# OTSU Multi-Threshold Image Segmentation Based on Improved Particle Swarm Algorithm
## 4 Multi-Threshold Segmentation Algorithm Based on Improved PSO
### Elite Particle Search Strategy  
In view of the low efficiency and slow speed of classical particle swarm optimization in multi-threshold segmentation, this paper improves classical particle swarm optimization by updating the speed and position of particles and proposes a search strategy for elite particles, which is divided into three steps. Firstly, the threshold segmentation contribution of each particle is calculated; secondly, 20% elite particles are selected according to the threshold segmentation contribution of each particle; and finally, the optimal solution of this iteration is found through chaos optimization. In this paper, 20% of the particles are selected as elite particles according to the contribution. The contribution of each particle is obtained by comparing the fitness value of each particle with the fitness value of the global extremum in the current iteration. Wecalculated the distance difference between the location of a single particle and the location of the global limit particle. The closer the distance was to the optimal threshold, the greater the contribution to the optimization. Assuming that the global extremum particle is \((e_{gbest},s_{gbest})\) in each iteration, the distance difference between the location of a single particle and the location of the global extreme particle and the threshold segmentation contribution value of each single particle are obtained according to the following formula:  
\[z=\sqrt{(e_{gbest}-e_{i})^{2}+(s_{gbest}-s_{i})^{2}} \tag{13}\]  
\[ACD=\frac{1}{z} \tag{14}\]  
where \(z\) represents the distance between the individual particle of the ith particle and the particle individual, corresponding to the global extremum, \(e_{gbest}\) is the x-axis of the particle individual, corresponding to the global extremum in the target search space, \(s_{gbest}\) is the y-axis coordinate of the particle individual, corresponding to the global extremum in the target search space, \(e_{i}\) is the x-axis of the \(i\)-th particle individual in the target search space, \(s_{i}\) is the y-axis coordinate of the ith particle individual in the target search space, \(ACD\) (actual contribution degree) is the threshold segmentation contribution of each particle, threshold segmentation contribution, and distance difference of \(z\), which is inversely proportional. The closer the \(i\)-th particle individual is to the particle individual, corresponding to the global extreme value, the greater the contribution of the \(i\)-th particle individual to the threshold segmentation of this optimization. The top 20% of elite particles are selected in order of contribution from largest to smallest by threshold segmentation, reducing optimization time. For details, see Figure 1. Where the arrows represent the change in the number of thresholds, and the three circles indicate the optimization when the threshold is a different value. Taking the gray value range of the segmented image as the coordinate range of \(x\) and \(y\) values, the black dot as all particles, and the central red dot as the global optimal solution _gbest_ of the current iteration, the search range can be reduced to a black circular region, that is, the region where the elite particles are located, and \(k\) is the number of threshold values. Each threshold requires a corresponding particle swarm to determine, while \(n\)  
Figure 1: Particle swarm narrows the search range according to the contribution of particles. threshold values require \(n\) particle swarms. In the same iteration, determine the global optimal particle of the \(n\)-particle swarm in turn. Put the selected elite particles into chaos optimization. During each iteration, the _gbest_ is scrambled and used as the update position of the particles, which makes them search locally for the global optimal solution. The purpose is to increase the diversity of the population, enhance the local optimization ability of the algorithm, and realize the local depth search of the particle swarm algorithm.