Figures
Abstract
Multilevel thresholding image segmentation is one of the widely used image segmentation methods, and it is also an important means of medical image preprocessing. Replacing the original costly exhaustive search approach, swarm intelligent optimization algorithms are recently used to determine the optimal thresholds for medical image, and medical images tend to have higher bit depth. Aiming at the drawbacks of premature convergence of existing optimization algorithms for high-bit depth image segmentation, this paper presents a pyramid particle swarm optimization based on complementary inertia weights (CIWP-PSO), and the Kapur entropy is employed as the optimization objective. Firstly, according to the fitness value, the particle swarm is divided into three-layer structure. To accommodate the larger search range caused by higher bit depth, the particles in the layer with the worst fitness value are employed random opposition learning strategy. Secondly, a pair of complementary inertia weights are introduced to balance the capability of exploitation and exploration. In the part of experiments, this paper used nine high-bit depth benchmark images to test the CIWP-PSO effectiveness. Then, a group of Brain Magnetic Resonance Imaging (MRI) images with 12-bit depth are utilized to validate the advantages of CIWP-PSO compared with other segmentation algorithms based on other optimization algorithms. According to the segmentation experimental results, thresholds optimized by CIWP-PSO could achieve higher Kapur entropy, and the multi-level thresholding segmentation algorithm based on CIWP-PSO outperforms the similar algorithms in high-bit depth image segmentation. Besides, we used image segmentation quality metrics to evaluate the impact of different segmentation algorithms on images, and the experimental results show that the MRI images segmented by the CIWP-PSO has achieved the best fitness value more times than images segmented by other comparison algorithm in terms of Structured Similarity Index and Feature Similarity Index, which explains that the images segmented by CIWP-PSO has higher image quality.
Citation: Ma J, Hu J (2024) An improved particle swarm optimization for multilevel thresholding medical image segmentation. PLoS ONE 19(12): e0306283. https://doi.org/10.1371/journal.pone.0306283
Editor: Sunil Pathak, Amity University Rajasthan: Amity University - Jaipur Campus, INDIA
Received: March 24, 2024; Accepted: June 13, 2024; Published: December 31, 2024
Copyright: © 2024 Ma, Hu. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: The manuscript already contains most of the data, and the remaining data is stored in the public repository: https://github.com/JiaQiMark/CIWP-PSO/tree/main/result.
Funding: The author(s) received no specific funding for this work.
Competing interests: The authors have declared that no competing interests exist.
1 Introduction
As an important technology in the field of image and vision, medical image segmentation has brought many significant contributions to modern society [1,2]. In the past decades, image segmentation has been widely used in cell detection [3], medical diagnose [4], autonomous driving [5], remote sensing [6,7], etc. Segmentation of image is a foundational process with numerous medical applications, including functional image and medical analysis, and segmentation of image can be regarded as an upstream task of medical image processing, which prepares for downstream image analysis. The principle of the image segmentation is to merge pixels with uniform attribute into several regions and extract the areas of interest [8]. Generally speaking, image segmentation technology can be roughly divided into two categories. One is traditional image segmentation technology based on thresholds, regions, and edges, and the other is convolutional neural networks (CNN) based on deep learning.
With the development of deep learning technology and computing power in recent years, CNN can handle a variety of image segmentation problems very well [9,10]. To obtain higher solution accuracy, CNN relies too much on a large amount of labeled data. However, manual calibration of datasets for image segmentation is time-consuming and labor-intensive, and what’s even more terrible is that for a considerable number of rare diseases, the medical community does not have enough data for neural network training. Therefore, traditional image segmentation methods are particularly important in the field of medical image segmentation.
The traditional medical image segmentation methods mainly include thresholding method, region growing method and edge-based method. Among them, thresholding image segmentation has the advantages of fast processing speed, stable performance and simple operation, so it is widely used in the field of medical image segmentation [11]. The principle of thresholding image segmentation method is to classify pixel points based on the preset thresholds and set pixels in the same category to the same gray value. Thresholding image segmentation method can be divided into two categories, binary level thresholding and multi-level thresholding. Bi-level thresholding segmentation simply uses a threshold to separate the image into background and foreground, and multilevel thresholding segmentation segment the image into n+1 groups of pixels based on n thresholds [12]. In comparison, multilevel threshold image segmentation technology can adapt to a variety of tasks and handle more complex images.
In the process of multilevel threshold image segmentation, the determination of threshold is the most critical step. The exhaustive search method once is used to search the optimal thresholds, but it has a large computational burden in determining the optimal thresholds, and its computational burden increases exponentially as the number of thresholds increases [13]. To improve the search efficiency of the optimal thresholds, swarm intelligent optimization algorithms (SIOA) are introduced by many scholars to search for the optimal threshold [14–16]. The SIOA greatly reduce the computational burden of searching for optimal thresholds, which promotes the application of multilevel threshold image segmentation in medical image processing.
Different from the 8-bit depth images seen in daily life, the images presented by medical imaging machines often have a higher bit (12-bit) depth to obtain more texture features and physiological information. However, the current mainstream SIOA used for image threshold segmentation mostly search for optimal thresholds on 8-bit depth images. Compared with 8-bit deep images, the search range of 12-bit deep images is 16 times larger for the optimization algorithm, so the current SIOA perform poorly on thresholds searching for high-bit depth images, exposing the disadvantage of premature convergence. Therefore, this paper proposed an improved particle swarm optimization (CIWP-PSO) for the multilevel thresholds search of high-bit depth images.
Particle swarm optimization (PSO) takes into account both the present and history, local and global aspects, and has great potential to search for optimal values in a large range. The key to converging to the optimal threshold in a large range is to avoid falling into the local optimum for a long time. Therefore, this paper adjusts the particle swarm to a pyramid structure based on the fitness value, and the worst particle group adopts a random opposition learning strategy to jump out of the local range. In addition, a pair of complementary inertia weights related to fitness value are introduced, which can balance the local and global capability with a greater extend to adapt to a larger search range.
In the part of experiments, 9 12-bit depth benchmark images and 12-bit depth brain tumor MRI images are selected by this paper, and many SIOA and improved PSO are compared with CIWP-PSO to validate the superiority of the CIWP-PSO. The experiments results show that CIWP-PSO can achieve more excellent Kapur entropy, and the images segmented by CIWP-PSO’s thresholds have high image quality in terms of Peak Signal-to-Noise ratio (PSNR) and Structured Similarity Index Measure (SSIM).
The main contributions of this paper are presented as follows:
- This paper proposes a new pairwise complementary inertia weight strategy to balance exploration and development to a greater extent.
- The random learning strategy are introduced into the PSO to adapt to the optimal threshold search for high-bit depth medical images.
- This paper carried out lots of experiments to evaluate the segmentation of the CIWP-PSO and its peers using benchmark and MRI medical images with various metrics.
The rest of this paper is organized as follows. Section 2 discusses the relevant literature and research in the field of medical image segmentation. Section 3 briefly introduces the principle of initial PSO. The proposed CIWP-PSO and its improved strategies are explained in detail in Section 4. Section 5 employed many image segmentation experiments to evaluate the segmentation quality of CIWP-PSO and other SIOA. Finally, the conclusions and the future directions of medical image thresholding segmentation are given in Section 6.
2 Related works
This section will discuss related work from the perspectives of swarm intelligent algorithm and thresholding image segmentation.
2.1 Swarm intelligent optimization algorithm
The SIOA has strong practicality and is simple to operate and easy to deploy. With the development of information technology and computing power, SIOA intelligent algorithm has become increasingly popular in solving optimization problems [17,18]. Sati et al [19] combined the swarm intelligent optimization algorithm and PID algorithm to automatically control the power system. Mustaqeem [20] et al used the swarm intelligent optimization algorithm and multilayer perception to optimize software defect prediction.
Thanks to SIOA’s strong scalability, SIOA can be improved to adapt to different optimization problems. Therefore, in recent decades, various improvement strategies have been introduced into different SIOA, solving many optimization problems very well [21]. Zhang et al [22] applied strengthening swarm hierarchy strategy to gray wolf optimization (GWO) to optimize the parameters of multilayer perceptron for the cancer identification. Their improved GWO algorithm focuses on solving high-dimensional optimization problems but is not suitable for optimization problems with larger search ranges. Gong et al [23] used diversity migration strategy to improve the particle swarm optimization algorithm to improve the diversity of population, which greatly improved the exploration of the algorithm. Shasha Yang et al [24] utilized sparrow search algorithm (SSA) improved by hybrid strategy to optimize the hyperparameters of Long-short term memory network for geological disasters forecasting. The SSA has the advantages of fast convergence speed and high convergence accuracy and can obtain high-precision solutions within a short number of iterations. However, the SSA pays too much attention on the local areas and ignores the ability of exploration. Ant colony algorithm and A* search algorithm are combined by Yanfei Zhang [25] to plan the ship route. Yanchun Gu [26] uses self-developed inverted S-shaped inertia weights to improve chicken swarm optimization for high-dimensional problems. The inverted S-shaped inertia weight takes into account the impact of the number of iterations on flock convergence and attempts to balance exploitation and exploration by the number of iterations. However, the inverted S-shaped inertia weight strategy relies on thousands of long-term iterations, which greatly increase the computational burden and is not suitable for processing image data.
2.2 Multilevel thresholding image segmentation
Multilevel thresholding image segmentation has the characteristics of simple operation and high execution efficiency and can segmentation an image into multiple regions by relying only on a set of thresholds. The adaptive thresholding image segmentation combined with SIOA greatly improves the search efficiency of optimal thresholds. Compared with deep neural networks, adaptive thresholding image segmentation does not rely on massive data, which makes it still receive widespread attention at a time when neural network algorithms are sweeping the field of image processing.
Chunzhi Wang et al [27] utilized a mixed-strategy-based improved whale optimization algorithm (WOA) for multilevel thresholding image segmentation. They proposed k-point search strategy to randomly generate an initialization population with a more uniform distribution, and adaptive weight coefficient was introduced to balance exploration and exploitation, which makes the improved WOA achieve more excellent Kapur entropy and Otsu value. Bald eagle search (BES) was improved by Sharma et al [28] to segmentation brain MRI images. They introduced the dynamic opposite learning strategy to overcome the shortcomings of slow convergence and local optima stagnation of original BES. Lin Lan, and Shengsheng Wang [29] used the improved African vulture optimization algorithm (AVOA) based on predation memory strategy to segment chest X-ray images and brain MRI images. The predation memory strategy speeds up convergence and improved the solution accuracy, and their experiment results indicate that the medical image segmented by the improved AVOA has higher image quality in many evaluation metrics, such as Jaccard Similarity Coefficient, SSIM and Feature Similarity Index (FSIM). However, all the above threshold optimization methods do not focus on high-bit depth medical image threshold search, and they are prone to falling into local optima when faced with a wide range of objective functions.
3 Method
3.1 Particle swarm optimization
Inspired by the flocking behaviors of birds, PSO was propose by James Kennedy and Russell Eberhart in 1995 [30]. As a method of evolutionary computation, PSO has been widely used in many fields for the advantages of simplicity and high effectiveness [31]. Thanks to its scalability, PSO has become increasingly popular in recent years [32,33].
The PSO algorithm simulates the process of bird foraging, in which the position of the particle is updated by its own best historical position and the best position of the swarm. In the evolution procedure, each particle iteratively learns from its own experience and exchanges information with the best one of swarm. Based on the above principles, the optimization procedure of PSO is as follows.
- (1) Swarm initialization: Randomly generate a swarm containing N particles each with position vector
, and then randomly generate a velocity vector
with dimension D for each particle.
- (2) Swarm evaluation: Calculate the fitness value of each particle, and then record the historical optimal position pbest of each particle and the optimal individual gbest of the population.
- (3) Position update: In each iteration, particle update its velocity vector and position vector according to Eqs (1) and (2) respectively.
where ω is the inertia weight, usually between 0.4 and 0.9; c1 and c2 represents the learning factors of oneself and group respectively; r1 and r2 takes the random numbers uniformly distributed between 0 and 1; t is the number of iterations [34].
- (4) After each position iteration, update the pbest and gbest.
- (5) If the conditions for the end of iteration is met, the optimal solution is returned, and the algorithm ends; otherwise, go back to Step (3).
3.2 System model and objective function
This subsection describes the system model and problem definition of adaptive threshold segmentation in detail. Thresholding image segmentation divides pixels into multiple regions based on thresholds. Assuming that there is a medical image I with L gray levels, and we need use n thresholds th1, th2, th3,…,thn to segment the image into n+1 regions, which can be described as Eq (3).
(3)
where i and j represent the coordinates of pixels on the image; Ci is the ith set of pixels. When n = 1, there is only one threshold, also known as bi-level thresholding segmentation; while when n≥2, these n thresholds divide the image into n+1 regions according to the grayscale value of the pixel. This paper mainly focusses on multilevel thresholding segmentation, whose n is greater than 1.
The purpose of the multilevel thresholding segmentation is to segment pixels with similar gray values into the same region as much as possible, which can ignore the secondary information and highlight the important contour information of the image. Therefore, we need an objective function as the criterion to evaluate the quality of the thresholds, and the objective function can not only judge whether the pixels between each threshold have reached the maximum degree of separation, but also guide the evolution of the optimization algorithm. Assuming that f(I, th1, th2,…,thn) is the objective function for thresholding image segmentation to evaluate the quality of segmented image. The goal of the adaptive thresholding segmentation algorithm is to search the optimal thresholds to get the most excellent solution of objective function.
In the field of threshold image segmentation, there are two evaluation criteria mostly commonly used as objective function, namely Otsu method and Kapur entropy [35–37]. Otsu’s maximum inter-class variance method is a commonly used threshold segmentation method. Its basic idea is to find an optimal threshold by iteratively calculating the inter-class variance under different thresholds so that the inter-class variance between foreground and background pixels is maximized. Otsu’s maximum inter-class variance method can automatically determine the optimal threshold to avoid the difficulty of manual selection and can achieve good segmentation results for images of different gray levels. Kapur entropy is also a threshold selection method based on information theory. Its basic idea is to select the optimal threshold by calculating the entropy of pixels with different gray levels in the image. In an image, the gray value of a pixel can be regarded as a random variable, and the distribution of pixel values can reflect the information content of the image. Kapur entropy finds an optimal threshold by calculating the entropy of pixels with different gray levels, so that the information difference between the foreground and background pixels after segmentation is maximized.
The Otsu method aims to the maximum inter-class variance of the grayscale values of different segmented regions, and the inter-class variance tends to be maximum when the areas of each region are similar. Therefore, the Otsu method is good at processing images with similar areas of different segmented regions, and it is easy to segment images with targets of different sizes into regions with similar sizes. However, Kapur entropy method aims to maximize the entropy, which is not sensitive to the size of the divided regions based on the gray-level intra-class probability and can better retain small targets in the image. Therefore, this paper selected the Kapur entropy as the optimization objective of CIWP-PSO. Kapur entropy [38] is known as the maximum entropy method, and the function of the Kapur entropy of the image can be formulated as Eq (4).
(4)
where the t1, t2, t3,…,tn segmented the image into n+1 regions; pi represents the probability of ith gray level and
L is the maximum value of gray level.
3.3 The improved CIWP-PSO
This subsection proposes improved CIWP-PSO based on two strategies and provides a detailed introduction to these two improvement strategies.
3.3.1 Random opposition learning strategy based on pyramid structure.
Random opposition learning strategy (ROL) is an optimization strategy that uses reverse thinking to increase flexibility, and it is applied in many optimization algorithms [39,40]. The original intension of ROL is to escape from local optimality and improve the population diversity. The core idea of this strategy is that if a solution performs poorly, its opposite solution may have better potential. While exploring opposite points in the search space, adding a little random element will increase the diversity of the population, which greatly increases the ability of global exploration and increases the probability of escaping the local optimum. By introducing random opposite solutions, the solution space can be explored more comprehensively, thereby accelerating convergence and improving global search capabilities. In SIOA, for the proportion of individuals with the worst fitness, the weak guidance of the excellent individuals is not enough to make them escape from the area with poor fitness value, while ROL can powerfully help these individuals jump out of local areas, which is great for the searching over large areas.
ROL needs to act on a proportion of poor individuals, but original PSO does not divide the population into obvious hierarchies. Therefore, this paper divides the particle swarm into a three-layer pyramid structure based on the fitness value, and it is shown as Fig 1.
The population is divided into three layers from top to bottom according to the fitness value from good to bad. As shown in Fig 1, most individuals are divided into the second layers, and the first layer contains only one global optimal individual, and the third layer only contains 5% ~ 20% of the worst individuals. The global best one serving as the first layer is used to guide the update of the second layer individuals. A certain proportion of individuals with the worst fitness values are set as the third layer of the pyramid, and the remaining individuals serve as the second layer.
Thanks to the three-layer hierarchical structure, ROL can act on the individuals in the third layer, who have the worst fitness value, so these poor individuals can explore other positions to obtain better fitness values and help the population escape from the local optima. The particles in the third layer use ROL as the position update strategy, The ROL can be formulated as Eq (5).
(5)
where t represents the number of iterations; LB and UB are the upper and lower boundaries of search range respectively; r is a uniformly distributed random number between 0 and 1.
3.3.2 Complementary inertia weights.
In the population evolution process of all swarm optimization algorithms, the mathematical model of individual position update can be uniformly expressed by the Eq (6):
(6)
where Pt and Pt+1 represent the position vector of the current iteration and the next iteration respectively, while Δp represents the distance that the individual should move at the current iteration. In the initial PSO, although the update process of each particle’s velocity vector has a weight parameter as shown Eq (1), the weight parameter ω cannot adapt to the changes in fitness value and iteration times, which greatly limits the performance of the algorithm.
Based on the above mathematical model of position update, many scholars have adopted various inertia weight mechanisms to adjust Pt or Δp to improve the convergence efficiency and convergence accuracy of the optimization algorithm [41,42]. However, the traditional inertia weights are only used to adjust the step size Δp, ignoring the impact of initial position vector Pt on the position update process, which greatly reduces the guidance of inertia weights and limits the convergence ability of optimization algorithms.
In order to address the limitation of traditional inertia weights, the pair of complementary inertia weights proposed by this paper uses the inverse relationship between the initial position vector and step size according to the fitness value to conveniently control both initial position vector Pt and the step length Δp. The more excellent fitness value makes the particle has greater motivation to stay in its original position and the poor fitness value makes the particle has more motivation to leave current position (The larger fitness is, the more excellent fitness is). Therefore, the inertia weight ω(f) increases as the fitness increases, and reversed inertia weight ωreverse(f) decreases as the fitness increases. The mechanism of the pair of inertia weights is based on the mathematical model of position update described as below.
(7)
where inertia weight ω(f) and reverse inertia weight make up this pair of complementary inertia weights. In this position update model, when the more excellent fitness value makes the particle has greater motivation to stay in its original position, so it should get a larger inertia weight and smaller reverse weight. When the particle has poor fitness value, the particle has more motivation to leave current position, so it should get a larger reverse weight and smaller inertia weight. Besides, to guide each particle to search in a large range more accurately, the factor that controls the step size Δp also needs to be designed, and reverse weight can also play the role of adjusting the step size. Inertia weight and reverse weight need to have opposite trends to form a complementary dynamic, and the changing trend of the pair of inertia weights in this paper needs to meet the following requirements:
- The slope of the function should be monotonic throughout the variation range, such that the inertia weight is positively related to fitness and reverse weight is negatively related to fitness.
- Keeping the slope larger at the beginning and end to ensure that more weights are distributed around the median which can amplify the influence of inertia weight to accommodate search over a wide range.
The inverse Sigmoid function satisfies these two requirements for the pair of inertia weights. The slope of the inverse Sigmoid function is monotonic throughout the variation range, such that the inertia weight ω(f) is positively related to fitness and reverse weight ωreverse(f) is negatively related to fitness. The inverse Sigmoid function has the larger slope at the beginning and end to ensure that more weights are distributed around the median, which can amplify the influence of inertia weight to accommodate search over a wide range.
Therefore, this paper selects inverse Sigmoid function as the basis function, and the inverse Sigmoid function is described as Eq (8).
(8)
where sx and sy represent the scaling factors in the x-axis and y-axis directions, which are chosen 0.96 and 7.8 respectively. mx is the movement factor in the x-axis direction, which is set to 0.5. Based on the above inverse Sigmoid function, the inertia weight and reverse weight proposed by this paper can be formulated as Eqs (9) and (10).
(9)
(10)
where ωmin and ωmax represent the minimum and maximum of inertia weight respectively; f is the fitness value of current particle, and fbest and fworst represent the best and worst fitness respectively. x can be described as Eq (11).
(11)
The position update equation of PSO modified by the pair of complementary inertia weight is shown in Eqs (12) and (13).
(12)
(13)
The curve of the inertia weight and reverse weight are shown in Fig 2.
From Fig 2, we can intuitively see that when the fitness value of a particle is greater than the median fitness, a larger inertia weight and a smaller reversed weight can be obtained to maintain its own initial advantage; when the particle’s fitness value is poor, the inertia weight takes a smaller value and the reversed weight takes a greater value to try to get rid of its own position.
3.3.3 The procedure of CIWP-PSO.
This paper first divides the particle swarm into a three-layer pyramid structure, and then uses the above two strategies to improve PSO. The framework of CIWP-PSO is shown in Algorithm 1.
Algorithm 1. The pseudo-code of CIWP-PSO.
a) Input: Set the population size N, dimension D, the maximum number of iterations T
b) Output: The best position and corresponding fitness
c) Initialize the position vector and velocity vector of each particle.
d) While (t≤T)
e) Calculate the fitness value of each particle.
f) Divide them into three layers based on fitness value.
g) For p in second layer
h) Update their position and velocity according to Eqs (12) and (13)
i) For p in third layer
j) Update their position according to Eq (5)
k) t = t+1
l) Return the best position and corresponding fitness.
The overall impact of improvement strategies proposed by this paper on the CIWP-PSO in optimizing thresholding image segmentation is mainly reflected in the following two aspects. Random opposite learning strategy helps the CIWP-PSO give up exploring the worst areas and instead explore more potential thresholds, increase population diversity, and escape from the local optimal thresholds. The pair of complementary inertia weights, using the reverse changes of step size and inertia, provide CIWP-PSO with efficient guidance and feedback on its journey to explore the optimal thresholds, which greatly improves the efficiency of searching for the optimal thresholds in high bit-depth images.
4 Experiments
In the section, this paper carries out two main sets of experiments to demonstrate the advantages of the CIWP-PSO in solving the thresholding segmentation problem for high-bit depth image. The first experiment used general benchmark images with high-bit depth to preliminary validate the effectiveness of the algorithm. In the second one, high-bit depth medical images segmented by CIWP-PSO are compared with other SIOAs.
All above experiments were conducted on a person computer with Intel(R) Core (TM) i7-9700 CPU, 16GB RAM and Windows 11 operating system, and the algorithms were implemented with python 3.10.9.
4.1 Comparative experiments on benchmark images
4.1.1 Dataset preprocessing.
In this work, we collected a dataset containing 16 color images with 8-bit depth, and these 16 grayscale images were used as benchmark images to prove the algorithm’s segmentation capability for high-bit-depth images. After converting the color images into grayscale images, we mapped the gray values of the gray images to 12-bit depth. The processed images and their grayscale histogram are listed in Fig 3.
Image (1) Histogram (1) Image (2) Histogram (2) Image (3) Histogram (3) Image (4) Histogram (4) Image (5) Histogram (5) Image (6) Histogram (6) Image (7) Histogram (7) Image (8) Histogram (8) Image (9) Histogram (9) Image (10) Histogram (10) Image (11) Histogram (11) Image (12) Histogram (12) Image (13) Histogram (13) Image (14) Histogram (14) Image (15) Histogram (15) Image (16) Histogram (16).
4.1.2 Experiments and result analysis.
To investigate the performance of the CIWP-PSO, six automatic thresholding segmentation algorithms based on widely used swarm intelligent algorithms (GWO, WOA, SSA, PSO, GA [43] and [FA] [44]) are compared to segment the above benchmark images to obtain higher Kapor entropy. In addition, two well-behaved PSO variants, including QPSO [23] with inertia weight strategy and PSOH [45] which combines the strengths of SSA and PSO, are selected to highlight the efficiency of the improved strategies proposed by this paper.
All the optimization algorithms have an initial population size of 30 and a maximum number of iterations of 100. Other hyperparameters for these algorithms are chosen from their initial paper and are presented in Table 1.
To comprehensively compare the multi-thresholding segmentation capability of each algorithm, these benchmark images are segmented by different number of thresholds nTh = [4,6,8] respectively. All algorithms were run independently 10 times, and the middle value were taken to eliminate chance. All the above algorithms regard Kapur entropy as the fitness function, and the Kapur entropies obtained by segmenting the nine benchmark images are listed in Table 2, in which the most excellent Kapur entropy are in bold and blue.
The experimental results form Table 2 shows that the PSO, QPSO, PSOH and CIWP-PSO usually converge to higher fitness value than other SIOAs, which means that the PSO-based algorithms have greater potential to handle the segmentation task of high-bit-depth images, and this is also one of the important reasons why this paper selects PSO as the basic algorithm. Among all algorithms, CIWP-PSO proposed by this paper is the most outstanding one. For almost all segmentation tasks of all images, CIWP-PSO can always search for the relative optimal thresholds to obtain the best Kapur entropy.
To intuitively demonstrate the convergence characteristics of CIWP-PSO, we show the convergence curves of the better-performing algorithms for image (2) and image (9) in Fig 4.
Image (2) nTh = 4 nTh = 6 nTh = 8 Image (9) nTh = 4 nTh = 6 nTh = 8.
It can be seen from the Fig 4 that CIWP-PSO have significantly smoother convergence curves than original PSO and WOA, indicating that CIWP-PSO has stronger stability. In summary, the multilevel thresholding algorithm based on CIWP-PSO can obtain the most excellent segmentation results for benchmark images with high-bit depth. Apart from this, during the iteration process, CIW converges stably and has good robustness.
4.2 Comparative experiments on medical images
In this work, the MRI brain tumor dataset, which are grayscale images with 12-bit depth, are used to test the segmentation capabilities of these algorithms for high-bit depth medical image. From this data set, we selected 9 images as experimental data to comprehensively compare the performance of algorithms, and these 9 images and their corresponding histograms are shown in Fig 5. The set of experiments first demonstrate the ability to segment images, and then evaluate the segmentation impact of CIWP-PSO on the brain tumor images.
Image (a) Histogram (a) Image (b) Histogram (b) Image (c) Histogram (c) Image (d) Histogram (d) Image (e) Histogram (e) Image (f) Histogram (f) Image (g) Histogram (g) Image (h) Histogram (h) Image (i) Histogram (i).
4.2.1 Analysis of experimental results.
In the experiment, GWO, WOA, SSA, PSO, GA, FA, QPSO and PSOH are applied in the images segmentation to compare performance with CIWP-PSO. All above algorithms pursue higher Kapur entropy as the optimization goal, and higher Kapur entropy means better segmentation results. To comprehensively evaluate the multi-thresholding segmentation ability of each algorithm, the MRI images are segmented by different number of thresholds nTh = [4,6,8] respectively. In order to rule out serendipity, all algorithms were run independently 10 times, and the medians of the 10 results of algorithms for each image are presented in Table 3.
From the Table 3, we can get that the Kapur Entropy of all tumor images will increase as the number of thresholds increases. Similar to processing benchmark images, the PSO-based algorithms show remarkable advantages in segmenting high-bit-depth medical images. Overall, the CIWP-PSO obtains the best result in 18 cases (27 in total) which shows the best performance in solution accuracy, whereas the other algorithms show weak advantages in any case when compared with the CIWP-PSO.
4.2.2 Friedman Rank-sum test.
To prove the validity of experimental data, it is often necessary to introduce non-parametric statistical inference testing methods, and common non-parametric testing methods include Friedman Rank Sum method and Wilcoxon Rank Sum method. In contrast to the Wilcoxon Rank Sum Test, which compares two groups, the Friedman test is designed for scenarios involving three or more related groups. The Friedman test is an extension of the Wilcoxon test, making it versatile for situations where multiple related groups are involved, providing a comprehensive analysis of differences in medians. It involves ranking observations within each group, calculating average ranks, and computing the Friedman statistic [46]. The Friedman test is particularly valuable when comparing the performance of multiple algorithms.
In order to ensure that the differences in experimental data are statistically significant, we calculate the Friedman statistic and p-value of PSO and its variants for the 9 medical images, which are listed in Table 4.
The p-value of these four sets of data is far less than the significance level (0.05), which means that the CIWP-PSO proposed by this paper does have a significant difference between CIWP-PSO and its counterparts. In addition, the average ranks of the above four PSO-based algorithms are presented in Table 5, which clearly shows that the CIWP-PSO is indeed superior to the other two PSO variants in segmenting high-bit depth medical images.
4.2.3 Image segmentation quality evaluation.
To fully validate the performance of these algorithms, in addition to verifying their ability to segment high-bit depth medical images, this paper also evaluates the impact of segmentation on images using the algorithms that performed well in the above results, including SSA, PSO, GA, QPSO, PSOH and CIWP-PSO. We use Peak Signal-to-Noise ratio (PSNR), Structured Similarity Index Measure (SSIM) and Feature Similarity Index Measure (FSIM) as a segmentation quality metrics to quantify the impact of segmentation with different algorithms.
PSNR is a metric used to measure the quality of reconstruction of a signal, especially in the context of image segmentation and compression. In this paper, it quantifies the amount of noise introduced during the segmentation process compared to the original images. The formula for calculating PSNR can be Mathematically defined as Eq (14):
(14)
where 2n represents the maximum possible pixel value of image, for the 12-bit deep medical image here, the n is 12. The MSE indicates mean squared error between the original and segmented images. The larger the PSNR value, the less noise rest of the image, indicating good image segmentation quality.
SSIM is a method used to evaluate the perceived quality of reconstructed images. Unlike traditional metrics that rely solely on pixel-wise differences, SSIM takes into account the structural information and captures changes in structural similarities between the original and processed signals. The SSIM metric compares local patterns of pixel intensities rather than individual pixel values across multiple spatial scales. It is defined as the product of three key components of perception: luminance (l), contrast (c), and structure (s). The SSIM is expressed as Eq (15):
(15)
in which the three modules l, c and s are defined respectively as follow:
(16)
(17)
(18)
where x, y represent the images before and after segmentation respectively. The parameters α, β, γ are constants that ensure the balance between luminance, contrast, and structure components, and in practical applications α = β = γ = 1. C1, C2, C3 is a constant and C3 = 0.5C2. μx, μy are all pixels of the image, δx, δy represents the standard deviation of the image pixel values, and δxy represents the covariance of the two images. The SSIM value ranges from 0 to 1, and a higher SSIM value closer to 1 indicates a better segmentation quality, suggesting that the processed image closely resembles the original in terms of structure and perception [47].
FSIM is a metric designed to evaluate the quality of images by assessing the similarity between the structural information of an original image and a segmentation image. During the calculation, FSIM considers both phase consistency feature (PC) and gradient feature (GM), in which PC can portray the local structure of an image and GM is used to extract the changes in an image [48].
The similarity of PC is calculated as Eq (19):
(20)
The similarity of GM is calculated as Eq (20):
(20)
The comprehensive similarity is calculated as Eq (21):
(21)
The formula for FSIM is as Eq (22):
(22)
where α, β is generally taken as 1,
.
The above 3 indicators are used to evaluate the quality of images segmented by different algorithms, and the numerical results of PSNR, SSIM and FSIM for image segmentation are shown in Tables 6–8, respectively.
Tables 6–8 show the qualify metrics of the tumor image segmented by different algorithms. Overall, the images segmented by the CIWP-PSO algorithm have obvious advantages in terms of PSNR, SSIM and FSIM. From Table 6 we can get that the CIWP-PSO obtains the highest FSNR values the most times (12), while other algorithms only obtained the optimal solution around 5 times.
Table 7 shows that for about half of the cases, CIWP-PSO achieved the best SSIM, which clearly far surpasses other algorithms. As for feature similarity, all algorithms achieved the best FSIM values between 3 to 5 times, except for PSO and CWIP-PSO, and it is easy to see that PSO and CWIP-PSO exerted the similar degree of influence on the image feature during the thresholding segmentation, but CIWP-PSO still has certain advantages.
In summary, it can be concluded that the image thresholding segmentation method based on CIWP-PSO provides competitive results compared to its famous and novel counterparts. The CIWP-PSO has more excellent multilevel thresholding segmentation ability for high-bit-depth images, which not only can obtain higher Kapur entropy in the image segmentation process, but also the images segmented by CIWP-PSO have higher quality in terms of FSNR, SSIM and FSIM.
5 Conclusions and future directions
In response to the insufficient performance of existing thresholding segmentation algorithms for high-bit-depth medical image, this paper proposes a multi-level threshold segmentation algorithm based on improved CIWP-PSO, which is a PSO variant improved by hybrid strategy. To adapt to the large search range brought by high-bit depth, some particles need to actively escape from the local optimum. Therefore, we constructed the particle swarm as a pyramid structure with three levels according to the fitness value, and the worst tier performs the adversarial learning strategy to explore as wide a search range as possible. In addition, to greatly improve convergence efficiency and accuracy, a pair of complementary inertia weight is introduced to guide individuals to search for optimal thresholds within a wider range. Then the Kapur entropy of images is used as the fitness function to search the optimal segmentation thresholds precisely. To validate the segmentation ability of high-bit depth images targeted by this proposed CIWP-PSO, the convergence performance is compared on 9 benchmark images and medical MRI image with 12-bit depth with its famous and excellent counterparts, such GWO, PSO, SSA and some PSO variants. The experimental results show that the multilevel thresholding segmentation algorithm based on CIWP-PSO outperforms the segmentation algorithms based on other SIOAs in the convergence accuracy. To evaluate the impact of segmentation on images, we calculated the FSNR, SSIM and FSIM of the two images before and after segmentation under different algorithms, and we conclude that CIWP-PSO not only has stronger image segmentation capabilities, but also has higher image segmentation quality in terms of PSNR and SSIM.
Segmentation of image is a foundational process with numerous medical applications, and it can be regarded as an upstream task of medical image processing, which prepares for downstream image analysis. Therefore, the quality of downstream tasks is another important criterion for evaluating performance of thresholding segmentation algorithms. In the future experiment, target extraction of brain tumor images will be used as the downstream task, and the target areas of the final images processed by the morphological operations will be compared to highlight the superiority of the CIWP-PSO.
As scope for further studies, the proposed CIWP-PSO can be applied to segment other kinds of images, such as underwater and remote sensing images, and we will make specific improvements to the segmentation algorithm according to the characteristics of different kinds of images. In addition, the other objective functions can be employed in the CIWP-PSO for searching the optimal thresholds.
References
- 1. Si TP, Patra DK, Mondal S, Mukherjee P. Breast DCE-MRI segmentation for lesion detection using Chimp Optimization Algorithm. Expert Systems with Applications. 2022;204.
- 2. Wang BJ, Lv YL, Bhola J, Mahor V, Yadav R, Kaliyaperumal K. Vibration compensation for railway track displacement monitoring system using biomedical image processing concept. Journal of Engineering-Joe. 2022;2022(11):1076–85.
- 3. Arous D, Schrunner S, Hanson I, Frederike Jeppesen Edin N, Malinen E. Principal component-based image segmentation: a new approach to outline in vitro cell colonies. Computer Methods in Biomechanics. 2023;11(1):18–30.
- 4. Qureshi I, Yan JH, Abbas Q, Shaheed K, Bin Riaz A, Wahid A, et al. Medical image segmentation using deep semantic-based methods: A review of techniques, applications and emerging trends. Information Fusion. 2023;90:316–52.
- 5. Chen C, Wang C, Liu B, He C, Cong L, Wan S. Edge intelligence empowered vehicle detection and image segmentation for autonomous vehicles. IEEE Transactions on Intelligent Transportation Systems. 2023.
- 6. Ma Z, Xia M, Weng L, Lin H. Local feature search network for building and water segmentation of remote sensing image. Sustainability. 2023;15(4):3034.
- 7. He Q, Sun X, Diao W, Yan Z, Yao F, Fu K. Multimodal remote sensing image segmentation with intuition-inspired hypergraph modeling. IEEE Transactions on Image Processing. 2023;32:1474–87. pmid:37027684
- 8. Zhang C, Pei Y-H, Wang X-X, Hou H-Y, Fu L-H. Symmetric cross-entropy multi-threshold color image segmentation based on improved pelican optimization algorithm. PloS one. 2023;18(6):e0287573. pmid:37384625
- 9. Xie L, Wisse LE, Wang J, Ravikumar S, Khandelwal P, Glenn T, et al. Deep label fusion: A generalizable hybrid multi-atlas and deep convolutional neural network for medical image segmentation. Medical image analysis. 2023;83:102683. pmid:36379194
- 10. Yeung M, Rundo L, Nan Y, Sala E, Schönlieb C-B, Yang G. Calibrating the dice loss to handle neural network overconfidence for biomedical image segmentation. Journal of Digital Imaging. 2023;36(2):739–52. pmid:36474089
- 11. Abualigah L, Almotairi KH, Elaziz MA. Multilevel thresholding image segmentation using meta-heuristic optimization algorithms: Comparative analysis, open challenges and new trends. Applied Intelligence. 2023;53(10):11654–704.
- 12. Hosny KM, Khalid AM, Hamza HM, Mirjalili S. Multilevel thresholding satellite image segmentation using chaotic coronavirus optimization algorithm with hybrid fitness function. Neural Computing & Applications. 2023;35(1):855–86. pmid:36187233
- 13. Sahoo SK, Houssein EH, Premkumar M, Saha AK, Emam MM. Self-adaptive moth flame optimizer combined with crossover operator and Fibonacci search strategy for COVID-19 CT image segmentation. Expert Systems with Applications. 2023;227:120367. pmid:37193000
- 14. Xia J, Cai Z, Heidari AA, Ye Y, Chen H, Pan Z. Enhanced moth-flame optimizer with quasi-reflection and refraction learning with application to image segmentation and medical diagnosis. Current Bioinformatics. 2023;18(2):109–42.
- 15. Ning G. Two-dimensional Otsu multi-threshold image segmentation based on hybrid whale optimization algorithm. Multimedia Tools Applications. 2023;82(10):15007–26.
- 16. Eisham ZK, Haque MM, Rahman MS, Nishat MM, Faisal F, Islam MR. Chimp optimization algorithm in multilevel image thresholding and image clustering. Evolving Systems. 2023;14(4):605–48.
- 17. Srinivas TAS, Yadav R, Gowri V, Chandraprabha K, Ponnusamy S, Mavaluru D. Development and implementation of unmanned vehicles through artificial intelligence involving communication system with sensors and control parameters. Measurement: Sensors. 2024;33:101136.
- 18.
Singh D, Nayani AK, Rajan MS, Yadav R, Alanya-Beltran J, Chakravarthi MK, editors. Implementation of virual instrumentation for signal acquisition and processing. 2022 International Conference on Innovative Computing, Intelligent Communication and Smart Electrical Systems (ICSES); 2022: IEEE.
- 19.
Sati MM, Kumar D, Singh A, Raparthi M, Alghayadh FY, Soni M, editors. Two-Area Power System with Automatic Generation Control Utilizing PID Control, FOPID, Particle Swarm Optimization, and Genetic Algorithms. 2024 Fourth International Conference on Advances in Electrical, Computing, Communication and Sustainable Technologies (ICAECT); 2024: IEEE.
- 20. Mustaqeem M, Mustajab S, Alam MJIJoIC, Cybernetics. A hybrid approach for optimizing software defect prediction using a gray wolf optimization and multilayer perceptron. 2024.
- 21.
Yadav R, Tripathi A. Machine learning theory and methods. Intelligent system algorithms and applications in science and technology: Apple Academic Press; 2022. p. 101–16.
- 22. Zhang XM, Wang X, Chen HY, Wang DD, Fu ZH. Improved GWO for large-scale function optimization and MLP optimization in cancer identification. Neural Computing & Applications. 2020;32(5):1305–25.
- 23. Gong C, Zhou N, Xia S, Huang S. Quantum particle swarm optimization algorithm based on diversity migration strategy. Future Generation Computer Systems. 2024;157:445–58.
- 24. Yang S, Jin A, Nie W, Liu C, Li Y. Research on SSA-LSTM-based slope monitoring and early warning model. Sustainability. 2022;14(16):10246.
- 25. Zhang Y, Wen Y, Tu H. A method for ship route planning fusing the ant colony algorithm and the A* search algorithm. IEEE Access. 2023;11:15109–18.
- 26. Gu Y, Lu H, Xiang L, Shen W. Adaptive Simplified Chicken Swarm Optimization Based on Inverted S‐Shaped Inertia Weight. Chinese Journal of Electronics. 2022;31(2):367–86.
- 27. Wang C, Tu C, Wei S, Yan L, Wei F. MSWOA: A mixed-strategy-based improved whale optimization algorithm for multilevel thresholding image segmentation. Electronics. 2023;12(12):2698.
- 28. Sharma SR, Alshathri S, Singh B, Kaur M, Mostafa RR, El-Shafai W. Hybrid multilevel thresholding image segmentation approach for brain MRI. Diagnostics. 2023;13(5):925. pmid:36900074
- 29. Lan L, Wang SS. Improved African vultures optimization algorithm for medical image segmentation. Multimedia Tools and Applications. 2023.
- 30.
Kennedy J, Eberhart R, editors. Particle swarm optimization. Proceedings of ICNN’95-international conference on neural networks; 1995: ieee.
- 31. Li T, Shi J, Deng W, Hu Z. Pyramid particle swarm optimization with novel strategies of competition and cooperation. Applied Soft Computing. 2022;121:108731.
- 32. Alzubi QM, Anbar M, Sanjalawe Y, Al-Betar MA, Abdullah R. Intrusion detection system based on hybridizing a modified binary grey wolf optimization and particle swarm optimization. Expert Systems with Applications. 2022;204:117597.
- 33. Thaher T, Chantar H, Too J, Mafarja M, Turabieh H, Houssein EH. Boolean Particle Swarm Optimization with various Evolutionary Population Dynamics approaches for feature selection problems. Expert Systems with Applications. 2022;195:116550.
- 34. Marini F, Walczak B. Particle swarm optimization (PSO). A tutorial. Chemometrics Intelligent Laboratory Systems. 2015;149:153–65.
- 35. Upadhyay P, Chhabra JK. Kapur’s entropy based optimal multilevel image segmentation using crow search algorithm. Applied soft computing. 2020;97:105522.
- 36. Sharma A, Chaturvedi R, Kumar S, Dwivedi UK. Multi-level image thresholding based on Kapur and Tsallis entropy using firefly algorithm. Journal of Interdisciplinary Mathematics. 2020;23(2):563–71.
- 37. Yan Z, Zhang J, Yang Z, Tang J. Kapur’s entropy for underwater multilevel thresholding image segmentation based on whale optimization algorithm. IEEE access. 2020;9:41294–319.
- 38. Kapur JN, Sahoo PK, Wong AKC. A new method for gray-level picture thresholding using the entropy of the histogram. Computer Vision Graphics and Image Processing. 1985;29(3):273–85.
- 39. Yang D, Wu M, Li D, Xu Y, Zhou X, Yang Z. Dynamic opposite learning enhanced dragonfly algorithm for solving large-scale flexible job shop scheduling problem. Knowledge-Based Systems. 2022;238:107815.
- 40. Xia X, Liu J, Li Y. Particle Swarm Optimization Algorithm with Reverse-Learning and Local-Learning Behavior. J Softw. 2014;9(2):350–7.
- 41.
Bansal JC, Singh P, Saraswat M, Verma A, Jadon SS, Abraham A, editors. Inertia weight strategies in particle swarm optimization. 2011 Third world congress on nature and biologically inspired computing; 2011: IEEE.
- 42.
Shi Z, Li Q, Zhang S, Huang X, editors. Improved crow search algorithm with inertia weight factor and roulette wheel selection scheme. 10th international symposium on computational intelligence and design (ISCID); 2017: IEEE.
- 43.
Lambora A, Gupta K, Chopra K, editors. Genetic algorithm-A literature review. 2019 international conference on machine learning, big data, cloud and parallel computing (COMITCon); 2019: IEEE.
- 44. Karthikeyan M, Manimegalai D, RajaGopal K. Firefly algorithm based WSN-IoT security enhancement with machine learning for intrusion detection. Scientific Reports. 2024;14(1):231. pmid:38168562
- 45. Gong C, Zhou N, Xia S, Huang S. Quantum particle swarm optimization algorithm based on diversity migration strategy. Future Generation Computer Systems. 2024;157:445–58.
- 46. Biju VG, Prashanth C. Friedman and Wilcoxon evaluations comparing SVM, bagging, boosting, K-NN and decision tree classifiers. Journal of Applied Computer Science Methods. 2017;9:23–47.
- 47. Müller MU, Ekhtiari N, Almeida RM, Rieke C. Super-resolution of multispectral satellite images using convolutional neural networks. arXiv preprint arXiv. 2020;00580.
- 48. Zhang L, Zhang L, Mou X, Zhang D. FSIM: A feature similarity index for image quality assessment. IEEE transactions on Image Processing. 2011;20(8):2378–86. pmid:21292594