Abstract
The purpose of image segmentation is to select the target region from the existing image, which is the core technology for image understanding, description and analysis. When faced with some complicated problems, the image segmentation effect of the traditional method is often unsatisfactory. As a branch of the swarm intelligence optimization algorithm, Particle Swarm Optimization (PSO) provides a new power and direction for the development of image segmentation. However, the algorithm has a large probability of loss of particle diversity in the late stage, which makes the algorithm converge prematurely. Therefore, the purpose of this paper is to improve the problem existing in the PSO algorithm and apply the improved algorithm in image segmentation. In this paper, the whole population of PSO algorithm is divided into multiple sub-populations and co-evolution. The mutation operation from the genetic algorithm is introduced at the same time. The worst sub-population is mutated according to the mutation probability. The larger inertia factor is selected to speed the particles. Update, and then carry out simulation experiments on some classical test functions. Finally, combined with the improved PSO algorithm and fuzzy C-means clustering algorithm (FCM), the fuzzy clustering validity index is introduced, and the blood cell image is segmented by the algorithm. The experimental results show that the algorithm can find a reasonable number of cluster center segmentation categories and efficiently perform adaptive segmentation of images.
Introduction
Image segmentation is to decompose the image into different spatial regions, so that the pixels in different regions have different features, while the pixels in the same region have similar features, so as to extract the interesting parts from the complex background [1]. Image segmentation technology has been highly valued since the 1970 s. It is an important and difficult research work in the field of computer vision and artificial intelligence. Image segmentation has a wide range of applications in many fields. Generally speaking, in various image applications, as long as the extraction and measurement of image objects are required, image segmentation is indispensable.
Particle swarm optimization (PSO) is a swarm intelligence optimization algorithm [2]. especially suitable for dealing with complex and non-linear problems that cannot be solved by traditional search methods. Particle swarm optimization has the advantages of high search efficiency, few parameters, simple calculation and easy implementation. Therefore, as soon as the algorithm was proposed, it immediately attracted great attention from researchers, and a large number of research results emerged in a few years. It has been successfully applied in the fields of multi-objective optimization, optimal control of power system, artificial neural network training, control engineering and so on [3, 4].Image segmentation is a key part of image understanding. Only by adopting effective segmentation techniques and obtaining more perfect segmentation results can the subsequent processing of images be completed better. However, in practical applications, sometimes the images that need to be processed are often very complex, and the amount of data is also very large, and the processing of the data by the algorithm is quite time-consuming, which will have a certain impact on its application and promotion. The emergence of intelligent optimization algorithm provides an effective means to solve such problems. As an important branch of intelligent optimization algorithm, particle swarm optimization has been successfully applied to image segmentation and achieved certain results. Because the particle swarm optimization algorithm has not been developed yet, the theoretical research of the algorithm is not mature enough, and there are many areas that need to be improved. This paper chooses the image segmentation algorithm based on particle swarm optimization and its application as the research object to further explore the theory and application of the algorithm. The research in this paper has certain theoretical and practical value for improving the performance of particle swarm optimization algorithm and image segmentation quality.
This paper improves the particle swarm optimization algorithm and applies it to image segmentation. In order to further improve the performance of the algorithm, the whole population of the basic PSO algorithm is divided into multiple sub-population convolutions. At the same time, the mutation operation of genetic algorithm is introduced to carry out the mutation according to the probability of the worst sub population. The particle velocity is updated with larger inertia factor, and some classical test functions are simulated. Finally, the improved algorithm is applied to image segmentation. Experimental results show that the improved algorithm has higher convergence accuracy. In the process of image segmentation, how to better determine the number of categories of image segmentation has always been the focus and difficulty of research. In order to automatically determine the number of categories of image segmentation, this paper combines the improved PSO with the fuzzy c-means clustering algorithm (FCM), introduces the fuzzy clustering effectiveness index, and proposes a FCM image segmentation method based on the improved PSO. Finally, the segmentation system is used to segment the blood cell image. The experimental results show that the algorithm can search a reasonable number of segmentation categories and clustering center, so that the adaptive segmentation of images can be completed quickly and accurately.
In the first part, the paper introduces the background of the development of image segmentation algorithm, as well as the innovation of this paper and the rent structure of the article. The second part introduces the related work of the predecessors in this field, and the basic concepts of particle swarm algorithm and the principle of the algorithm. The third part introduces the improvement process of the algorithm and the specific implementation steps of the IPSO_FCM image segmentation algorithm. The fourth part discusses and analyzes the specific effects of the algorithm on image segmentation and the performance of the algorithm. The fifth part summarizes the work of the full text and summarizes the performance of the algorithm.
Proposed method
Related work
Particle swarm optimization is an intelligent optimization method just like genetic algorithm [5, 6]. PSO algorithm has been listed as one of the topics discussed by the international conference on evolutionary computing (CEC). In foreign countries, the United States has set up a special organization to study the simulation of swarm intelligence. IEEE association for computational intelligence has held a swarm intelligence conference every year. The European union-funded swarm intelligence-related research project was also launched at several European research institutions. In China, particle swarm optimization algorithm has received more and more attention from scholars, but relatively speaking, domestic research is still in the initial stage, the focus of research is algorithm synthesis and algorithm application in practical engineering and other aspects [7].
After decades of research on image segmentation, thousands of segmentation algorithms have been formed [8–10]. However, most existing segmentation algorithms are specific to specific problems, and there is no general segmentation algorithm suitable for all images, mainly because the image segmentation technology has the following special properties: first, the image segmentation has not established a unified theory; Second, there is no one segmentation method that can independently complete the ideal segmentation of all images. Due to the different types of images to be segmented (such as medical images, thermal imaging, and SAR images), the final purpose of segmentation is also different. Therefore, the methods of image segmentation are also different [11]. For example, the image segmentation algorithm can be studied from the following six parts: Threshold segmentation, pixel classification, depth image segmentation, color image segmentation, edge detection and fuzzy set based method. Image segmentation technology can be divided into three categories: threshold segmentation, region extraction and edge detection. In addition, the segmentation technology can be divided into context-related technology and context-independent technology according to whether the image information is global or local. Considering the number of threshold can be divided into single threshold method and multiple threshold method. Among them, the classical segmentation methods mainly include the following categories: Segmentation technology based on threshold, segmentation technology based on region extraction and segmentation technology based on edge detection [12, 13].
Fuzzy c-means Algorithm (FCM) has been widely applied due to its simplicity, good processing of multiple solutions and uncertainty of image information. However, FCM algorithm is easily affected by the initial clustering center, making its iterative optimization process easily fall into local optimization. In order to overcome the above shortcomings, many scholars have made great efforts in recent years. JIAO R proposed incremental kernel fuzzy clustering to improve the quality of clustering results for each data block by optimizing the initial clustering center of FCM, but the algorithm did not improve the stability of FCM algorithm [14]. Since membership function information and spatial context information are not considered, conventional standard FCM algorithm is sensitive to noise. In order to solve this problem, He Lianghua proposed an improved FCM image segmentation algorithm with spatial constraint algorithm, which improved the anti-noise ability by modifying the objective function and membership function of the standard fuzzy c-means algorithm [15]. Wu Shaochun put forward a kind of advanced fuzzy C - average (FCM) clustering algorithm, overcomes the drawback of traditional FCM algorithm, including the initial center the instability of random selection and data separation or cluster size limits, the algorithm will distance and density together, and improve the objective function, which can improve the performance of algorithm [16]. Wang S et al. proposed a multi-dimensional fuzzy clustering image segmentation algorithm based on kernel metric and local information to reduce noise and details in the image. In this algorithm, multi-dimensional grayscale vector is constructed to replace the original one-dimensional grayscale, and then the kernel method is adopted to enhance its robustness. In addition, the penalty term representing the diversity between local pixels and their neighboring pixels is used to modify the objective function, so as to further improve its anti-noise ability [17]. Zhao Q H proposed an algorithm for texture image segmentation based on VT and HMRF fuzzy c-mean (FCM). The algorithm by using VT will image domain is divided into sub regions (Voronoi polygons) and HMRF to describe the relationship between the adjacent sub regions, thus VTHMRF model is established, based on VTHMRF model, the objective function in FCM add Kullback Leibler - (KL) divergence information regularization to define VTHMRF - the objective function of FCM, the algorithm combines the steady HMRF area and based on the benefits of FCM clustering segmentation [9]. Liu G proposed an image segmentation method based on unsupervised FCM. In this method, local information at the region level is incorporated into the fuzzy clustering process to adaptively control the range and intensity of interactive pixels [18].
Common methods
Particle Swarm Optimization (PSO), also known as Particle Swarm Optimization (PSO), is a Particle Swarm Optimization (PSO) algorithm. PSO algorithm meets the five basic principles of swarm intelligence proposed by Millonas when studying artificial life system: Approximation principle, the population can perform simple time and space calculation. Distributed response principle: individuals in a population cannot operate in a very similar way. According to the quality principle, the population should be able to sense and respond to changes in the surrounding environment. Stability principle, the population will not change its behavior pattern because of every change of the environment. Adaptability principle: the population decides whether to change its behavior pattern according to the calculated cost.
For optimization problems, on the one hand, they can be solved by means of certainty or possibility; On the other hand, they can also be optimized by means of probability. Swarm intelligence is a probabilistic method. Swarms of birds, fish or plankton, bees, ants and others gather together to forage, nest and escape predators. The “intelligence” of these seemingly randomly distributed groups is swarm intelligence. Swarm intelligence is inspired by the swarm behavior of organisms in nature. Its main idea is to use the competition and cooperation among individuals in the swarm to find the optimal solution. The common advantages of swarm intelligence algorithm are simple calculation, easy to understand, no special restrictions on the objective function, and the ability to find satisfactory solutions within a certain range. These advantages are of great significance for solving problems in practical engineering. Ant colony algorithm and particle swarm optimization are two typical swarm intelligence algorithms. Therefore, ant colony algorithm provides a powerful tool for solving complex optimization problems in many fields. Reynolds used the following three codes of conduct in the simulation experiment: Fly away from the nearest individual, avoid touching. Fly to the object of your search. We fly to the center of the group.
Suppose the whole population has M particles, and the search space is d dimension. In the t iteration, the position of particle i is x i = (xi1, xi2, ⋯ , x id ) and the velocity is v i = (vi1, vi2, ⋯ , v id ). The particle updates itself by tracking two “extreme values”. The first is the optimal value that the particle has found so far(p best id (t + 1) = (pi1, pi2, ⋯ , p id )), the second is the optimal value found so far for the entire population(g best (t) = (g1, g2, ⋯ , g d )). In the t + 1 iteration, each particle i updates its speed and position according to the following formula:
The motion of particles is jointly acted on by the above equation, where t represents the current iteration number, ω is the inertia factor, γ1 and γ2 are the random number uniformly distributed on (0,1), c1 and c2 are the acceleration constant, respectively adjusting the maximum stride length of flight to the direction of the best global particle and the best individual particle. Formula (3) limits the maximum velocity of particles and determines the search accuracy of particles in the solution space. If vmax is too large, the particles may fly through the optimal solution; If vmin is too small, the particles may easily fall into the local search space and cannot get the global optimal solution.
From a sociological perspective, the first part of formula (1) represents the particle’s trust in its current motion state and carries out inertial motion according to its own speed. In the formula, the smaller ω can enhance the particle’s local search ability, while the larger ω can enhance the global search ability. The second part represents the thinking of the particle itself, which belongs to the “cognitive” behavior, that is, it evolves according to its own experience, so as to realize an enhanced learning process. The third part represents the information sharing and cooperation among particles, which belongs to the “social” behavior. This behavior can be understood as the movement of particles comes from the experience of other particles in the group and imitates the movement of better companions through cognition. In particle swarm optimization; particles accumulate continuously through each iteration and eventually converge to the optimal solution after one iteration.
Improved PSO algorithm the basic idea is to assume that the basic particle swarm population size is popsize, divide the particle as m sub groups, each group has n particles (popsize = m * n), the first j is the group expressed as subj, (1 ≤ j ≤ m), each particle in the subgroups of individual extreme value for p
jibest
, subgroups of extreme value for p
subj
, g
best
for the optimal value of the whole population. In coevolution iteration, all child groups, after each iteration will have an optimal by comparing subgroups (sub
best
) and one of the worst subgroups (sub
bad
), to update the worst subgroups, join the mutation operator, and USES the large inertia factor to update its group of the particle velocity, mainly in order to keep the diversity of particles as much as possible, make the search space more widely, the rest of the subgroups according to the basic PSO updating formula of speed and position update. When updating the worst subpopulation, a prerequisite must be satisfied, that is, the optimal value of the whole population must be global or local. According to the standard deviation of population fitness Std and the theoretical optimal value Fbest, the basis of convergence judgment is given. The calculation formula of Std is as follows:
Where, fit
i
is the fitness of the i-th particle, fit
ave
is the current average fitness of the particle swarm, and its calculation formula is shown below.
When the fitness of all particles is the same, the particles appear the phenomenon of “aggregation”, which indicates that the particle swarm optimization algorithm converges to the global or local optimal value. The standard deviation Std of population fitness defined in formula (5) reflects the degree of “convergence” of all particles. It can be seen that the smaller the Std value is, the more the particle swarm tends to converge. When the Std is equal to zero, the particle swarm optimization algorithm achieves global convergence or local convergence. Then, by comparing the optimal value fitbest found by the algorithm at this time with the theoretical optimal value Fbest, fitbest is determined to be a global extreme value or a local extreme value. When the optimal value fitbest into local extremum, the worst subgroups according to certain probability p m mutation, particular way is, change the worst subgroups velocity updating formula, with a large inertia weight constants ω cons instead of linear decreasing inertia weight value, such a large inertia weight can better play to the particle’s energy, rapidly expand the search space and strengthen the global search ability.
When the optimal value searched by the algorithm is the minimum value, the definition of pm is as follows:
Where, k is any number between (0, 1), and the value S t is related to the actual situation, generally 0.1 or 0.2.
FCM clustering algorithm is an iterative optimization algorithm, which can be described as minimizing the objective function.The basic idea is that if a data set Y = { y1, y2, ⋯ , y
m
} ⊂ R
p
of m points is assumed, R
p
to be a p-dimensional Euclidean space, the purpose of clustering is to differentiate {y1, y2, ⋯ , y
m
} into c subsets in Y and to group similar samples into the same subset (clustering) as far as possible. c is the number of clustering, taking the integer between 2 and m. U is the membership matrix composed of u
ik
. When the element u
ik
in the matrix is 1, it means that the k-th data point yk belongs to the i-th class. And if the u
ik
is equal to 0, it means that yk is not in the i-th class. Set the clustering center of each class V ={ v1, v2, ⋯ , v
i
}, v
i
∈ R
p
, 1 ≤ i ≤ c. Objective function Jc of FCM clustering algorithm is defined as follows:
In the formula, p represents the weighted index, and values between (2,). When p = 2, Jc becomes the following formula:
In general, the classification results obtained according to different classification criteria are not exactly the same. Therefore, in order to obtain reasonably satisfactory classification results, an appropriate clustering criterion must be determined. The clustering criterion of fuzzy C-means is defined as taking the minimum value of objective function Jc, namely:
Since each column in membership matrix U is independent of each other, the above equation can be written as follows:
In the above equation, the constraint condition is
According to Lagrange multiplier method, the iterative optimization formulas for membership matrix and clustering center can be obtained, as shown in Equations (15) and (16) respectively.
Based on FCM clustering algorithm can determine the type of clustering validity index number, the advantages of the improved PSO algorithm combined with FCM algorithm, and at the same time the introduction of clustering validity index, put forward the FCM image segmentation method based on improved PSO (remember IPSO_FCM algorithm), the method can achieve better determine the type of to be the best segmentation algorithm, and according to the optimal class number of search to the optimal clustering center, finally realizes the image segmentation.
Improved PSO algorithm combined with fuzzy clustering, the FCM algorithm based on histogram, the application of the improved PSO FCM algorithm for image segmentation, each particle’s position corresponding to the image grey value, the position of a particle with vector V = (v1, v2, ⋯ , v i , ⋯ v c ) said, the value of the vector is c possible clustering center, which v i represents the i-th clustering center, each type of clustering center n using real number coding, so the vector V is a column vector c × n, the optimal clustering center is the V vector obtained finally.
The specific implementation steps of IPSO_FCM image segmentation algorithm are described as follows: Parameter setting. Select the cluster number range [cmin, cmax], cmin = 2, cmax = 7, set the initial cluster number c = cmin, determine the fuzzy exponent p and relevant parameters of the improved particle swarm optimization algorithm. Set the dimension of particles in the particle swarm d = c. Run the improved particle swarm optimization algorithm. Take the optimal solution found by the improved particle swarm optimization algorithm as the optimal clustering center. Calculate Xie-Beni effectiveness index V
xie
(c). Set c = c+1. If c> cmax, perform the next step; Otherwise, return to step (2) to continue. By comparing all V
xie
(c), the parameter c corresponding to the minimum validity index is the required optimal number of image segmentation categories. Determine the final clustering center according to the optimal number of image segmentation categories, and achieve image segmentation.
The algorithm in this paper was firstly used to conduct segmentation experiments on a large number of artificial images and classical test images, and then compared with the experimental results of VGA algorithm. The algorithm was operated in MATLAB2018b, and each experiment was run 50 times.The operating environment of the algorithm is MATLAB2018b, and each experiment is run 50 times.
Secondly, the blood cell image segmentation experiment was carried out, two blood cell images were selected as test images, and the results of the algorithm in this paper were compared with the experimental results of the maximum entropy image segmentation algorithm based on PSO. The operating environment of the algorithm is MATLAB2018b, and each experiment is run 50 times.
Discussion
(1) In this paper, four classic Benchmark test functions were selected to verify and compare the performance of the improved algorithm. PSO algorithm with linear decline of inertia factor (referred to as LDWPSO), PSO algorithm with convergence factor (referred to as CLPSO) and the improved PSO algorithm (referred to as IMPSO) were respectively used for the simulation experiment of function optimization (referred to as the minimum function problem).The parameters of the four test functions are set as shown in Table 1 below. In the iterative process, when the global minimum value is less than the error range in the table, the algorithm convergence is considered successful.
The parameters of all test functions
The parameters of all test functions
It can be concluded from the results that the convergence accuracy of IMPSO algorithm in this paper is obviously better than LDWPSO algorithm and CLPSO algorithm. For the four test functions, IMPSO algorithm can converge to the global optimal solution within the error range, while LDWPSO algorithm and CLPSO algorithm cannot converge to the global optimal solution. It can also be seen from the simulation results that although the convergence accuracy of the IMPSO algorithm in this paper has been greatly improved, its convergence speed has been somewhat reduced. Just as the PSO algorithm has the contradiction between convergence speed and convergence accuracy, the improvement of the convergence accuracy of the algorithm is sometimes at the expense of convergence speed.
(2) The selected test images include three artificial images and three classic commonly used test images. The classic test images are respectively the 256×256 Cameraman image, Church image and Reno image. The parameters of the algorithm in this paper are set as follows: the particle swarm size is 20, the number of subgroups divided is 5, and each subgroup has 4 particles, the maximum inertia weight wmax = 0.9, the minimum value wmin = 0.4, the inertia weight constant w cons = 1.1, and the two acceleration constants are 1.5. The maximum number of iterations is set to 200. VGA parameters are set as follows: population size is 80 and crossover probability is 0.9. The segmentation results of three artificial images are shown in Figs. 1–3, and the segmentation results of classic commonly used test images are shown in Figs. 4–6.

Segmentation results of different algorithms on image 1.

Segmentation results of different algorithms on image 2.

Segmentation results of different algorithms on image 3.

Segmentation results of different algorithms on “Cameraman”.

Segmentation results of different algorithms on “Church”.

Segmentation results of different algorithms on “Reno”.
(3) When segmenting the classic test image, both algorithms can obtain the correct number of subdivision categories. For three artificial images, both algorithms obtained the correct segmentation class number and more accurate segmentation results. However, as shown in Table 2 and Fig. 7, the IPSO_FCM algorithm in this paper has better segmentation effect than the VGA algorithm. Through the IPSO_FCM algorithm and the VGA algorithm in this article, you can query the appropriate number of segmentation categories and cluster centers, but the convergence algebra of the VGA algorithm is much higher than the convergence algebra of the IPSO_FCM algorithm in this article, so the segmentation efficiency of the IPSO_FCM algorithm is higher.

A comparative study of two algorithms for image segmentation.
A comparative study of two algorithms for image segmentation
(4) In this paper, FCM image segmentation system with improved PSO was used to conduct segmentation experiments on blood cell images. Two blood cell images were selected as test images, and the results of the algorithm in this paper were compared with the experimental results of the maximum entropy image segmentation algorithm based on PSO. The algorithm parameters in this paper are set as follows: the particle swarm size is 20, the number of subgroups divided is 5, each subgroup has 4 particles, wmax = 0.9, wmin = 0.4, w cons = 1.1, the two acceleration constants are 1.5, and the maximum number of iterations is 200. The maximum entropy image segmentation algorithm parameters based on PSO are set as follows: the particle swarm size is 20, wmax = 0.9, wmin = 0.4, and the two acceleration constants are 2. The number of segmentation categories should be set by the user himself. In this paper, it is set as 2, and the maximum number of iterations is 100. The processing results of the two algorithms are compared. The running time and number of segmentation categories of the two algorithms are shown in Table 3 and Fig. 8. The running time of the proposed method is lower than one half of the PSO algorithm.
A comparative study of two algorithms for image segmentation

A comparative study of two algorithms for image segmentation.
It can be seen that the segmentation time of the algorithm in this paper is much lower than that of the maximum entropy segmentation algorithm based on PSO.
Image segmentation, which distinguishes the target image from the background field, is the basis of subsequent image processing and plays an important role in image engineering. In recent years, many scholars have devoted themselves to applying intelligent optimization algorithm to image segmentation, overcoming the shortcomings of traditional image segmentation methods to some extent, and improving the image segmentation technology. Therefore, this paper introduces the particle swarm optimization algorithm, improves the particle swarm optimization algorithm, and proposes a fuzzy c-means clustering image segmentation algorithm based on the improved particle swarm optimization algorithm by combining the fuzzy clustering algorithm and fuzzy validity index. According to the study of the basic PSO algorithm, at the end of the iteration of the basic PSO algorithm, particles tend to lose diversity and lose the ability to detect the newly searched cable space, which makes the PSO algorithm may converge prematurely and affect its convergence accuracy. Aiming at this defect of the algorithm, this paper improves the algorithm. In this paper, the improved algorithm, refer to the whole population based on the concept of organization will divide the coevolutionary multiple sub groups, and introduces the variation operation, when the algorithm falls into local optimum, the worst subgroups according to certain mutation probability with larger inertia factor to update the particle velocity, so it can better play to the particle’s energy, rapidly expand the search space and strengthen the global search ability. The simulation of Benchmark test function is carried out by using the improved algorithm. The experimental results show that the improved algorithm is easy to jump out of local optimization and has higher convergence accuracy. The improved algorithm is applied to image segmentation to improve the precision of image segmentation. In the process of image segmentation, how to better determine the number of categories of image segmentation has always been the focus and difficulty of research. To automatically determine the type of the image segmentation, this paper will improve the PSO with fuzzy C - average clustering algorithm (FCM), the combination of fuzzy clustering validity index, introduced at the same time, puts forward the FCM image segmentation method based on improved PSO, the hybrid algorithm was applied to image segmentation, can search to a more reasonable clustering center and the class number, so as to realize the adaptive segmentation of the image. In this paper, the particle swarm optimization algorithm was studied and applied to image segmentation, and certain results were achieved. However, due to the limited level and time, there is still a lot of work to be further discussed. On the basis of reading a large number of domestic and foreign references and the research work of this paper, the problems of further research mainly include the following aspects: this paper only makes a preliminary discussion on image segmentation, and the in-depth research on segmentation technology needs to be continued. In practice, a large number of color images need to be processed. Therefore, the research on color image segmentation needs to be strengthened. In addition, there are various evaluation methods for image segmentation algorithms, and the results obtained by different segmentation evaluation methods will be different to some extent. Therefore, it is worth discussing how to further evaluate the performance of the algorithm in this paper with more reasonable methods. Particle swarm optimization is a stochastic heuristic search algorithm. Therefore, further research is needed on the convergence rate, global convergence and stability of the optimal solution. When dealing with some complex problems, the combination of multiple algorithms will often achieve good results. The fusion technology of particle swarm optimization algorithm and other algorithms can be discussed in depth, so as to improve the performance of the algorithm and further expand its application field.
Footnotes
Acknowledgments
This work was supported by the Education Department of Liaoning Province, General project (No. L2014085), and the Major Technology Platforms of Liaoning, China.
