## 3 The PSO Algorithm  
Particle swarm optimization is an evolutionary optimization technique created by inspiring behaviors such as fish schooling and bird flocking. The system is initialized with a population of random solutions and searches for optima by updating generations.  
Suppose that the search space is D-dimensional. At the beginning of the PSO process, the position \(Z_{i}=\left\{z_{i1},z_{i2},...,z_{id}\right\}\) and the velocity \(V_{i}=\left\{v_{i1},v_{i2},...,v_{id}\right\}\) of each particle are randomly created. Every particle in the swarm is a part of the solution set. \(y_{i}=\left\{y_{i1},y_{i2},...,y_{id}\right\}\) is the best position discovered by the \(ith\) individual. \(\hat{\gamma}=\left\{\hat{\gamma}_{1},\hat{\gamma}_{2},...,\hat{\gamma}_{d}\right\}\) stands for the global best position searched by the whole swarm. In each iteration, \(Z_{i}\) and \(V_{i}\) are updated using the following equation (3), (4).  
\[v_{ij}(t+1)=\omega*v_{ij}(t)+c_{1}r_{1}\left(y_{ij}(t)-x_{ij}(t)\right)+c_{2}r_ {2}\left(\hat{\gamma}_{j}(t)-x_{ij}(t)\right) \tag{3}\]  
\[z_{ij}(t+1)=z_{ij}(t)+v_{ij}(t+1) \tag{4}\]  
Where \(c_{1}\) and \(c_{2}\) are the acceleration coefficients which determine the extent of stochastic weighting for the cognitive and the social components individually. \(r_{1},r_{2}\) are two random numbers generated by uniform distribution in the range [0,1] separately. The inertia weight \(\omega\) is employed to control the impact of the previous history of velocities on the current velocity. The linear decreasing method is represented as equation (5).  
\[\omega=\omega_{max}-\frac{\omega_{max}-\omega_{min}}{Iter_{max}}\times iter \tag{5}\]  
\(Iter_{max}\) is maximum iteration time. \(iter\) is current iteration time. \(\omega_{max}\) and \(\omega_{min}\) are maximum and minimum inertia weight respectively (it is set for \(\omega_{max}\)= 0.9, \(\omega_{min}\)= 0.4). The inertia weight is decreased linearly with increasing iterations.  
The solution quality is measured by the fitness function. The fitness value of each particle is calculated by the objective function. The values of \(y_{i}\) and \(\hat{\gamma}\) are then evaluated and replaced if a better particle best position or a better global best position is obtained. The smaller objective function is, the better fitness value is, given that objective function is expressed as equation (6). The fitness value is represented as equation (7) (to avoid zero in the denominators, \(\sigma=0.001\)).  
Figure 2: The incorrect instance of LBP texture_Algorithms_**2015**, \(8\)  
\[J=\sum\limits_{k=i=1}^{C}\sum\limits_{i=1}^{N}\left\|x_{i}-z_{k}\right\| \tag{6}\]  
\[\text{\emph{fitness}}=1/(J+\sigma) \tag{7}\]  
The personal best position of each particle is defined as equation (8).  
\[y_{ij}(t+1)=\begin{cases}\quad y_{ij}(t),if\ fitness(z_{ij}(t+1))\leq fitness(y _{ij}(t))\\ z_{ij}(t+1),if\ fitness\left(z_{ij}(t+1)\right)> fitness(y_{ij}(t))\end{cases} \tag{8}\]  
The global best position is defined as equation (9).  
\[\begin{array}{c}\hat{y}=\{\hat{y}_{1},\hat{y}_{2},...,\hat{y}_{d}\}| fitness(\hat{y})=\\ max\{fitness\big{(}y_{1}(t)\big{)},fitness\big{(}y_{2}(t)\big{)},...,fitness \big{(}y_{S}(t)\big{)}\}\end{array} \tag{9}\]  
Then we can use the standard procedure to find the optimum. The searching is a repeated process, and the stop criteria are that the maximum iteration number is reached or the minimum error condition is satisfied.