## 3 The Proposed Approach
### Improved Particle Swarm Optimization Algorithm  
In the PSO, each group of parameters of the FNN can be regarded as a \"particle\" in the search space. The swarm including \(M\) particles forms a \(D\) (\(D=2 kn+n\)) dimensional search space and the parameter values can be represented by the position of a particle. The position of the \(i\)th particle is marked as \(X_{i}=(X_{i1},X_{i2},\cdots,X_{iD})\) to express Equation (4), and the corresponding velocity is marked as \(V_{i}=(V_{i1},V_{i2},\cdots,V_{iD})\), which includes a direction and distance, determining the search capability of each particle in the space. The fitness of particles can be evaluated through the following error function:  
\[F=\frac{1}{q}\sum\limits_{i=1}^{q}{(yd_{i}-y_{i})^{2}} \tag{5}\]  
where \(q\) is the number of training samples, \(y_{i}\) denotes the network output of the \(i\)th sample; and \(yd_{i}\) denotes the desired output of the \(i\)th sample.  
The individual extremum is \(P_{i}=(p_{i1},p_{i2},\cdots,p_{iD})^{T}\) and the global extremum of the particle swarm is \(P_{g}=(P_{g1},P_{g2},\cdots,P_{gD})^{T}\). The updated equations for the velocity and position are as follows:  
\[V_{ij}^{t+1}=\alpha v_{ij}^{t}+c_{1}r_{1}(p_{ij}-X_{ij}^{t})+c_{2}r_{2}(p_{gj }-X_{ij}^{t}) \tag{6}\]  
\[X_{ij}^{t+1}=X_{ij}^{t}+V_{ij}^{t+1} \tag{7}\]  
where \(i=1:M,j=1:D\), \(\alpha\) denotes inertia weight. \(t\) denotes the current number of iterations, \(c_{1}\) and \(c_{2}\), called the learning factors, can be set to 1.5 and 2.5, respectively, and \(r_{1}\) and \(r_{2}\) are the random numbers in the range [0,1]. In this paper, the inertia weight is updated nonlinearly through the following equation, which is neither constant nor linear gradient, but diminishes non-linearly with the increase of the number of iterations:  
\[\alpha=(\alpha_{\max}-\alpha_{\min})\times\left(\frac{t_{\max}-t}{t_{\max}} \right)+\alpha_{\min} \tag{8}\]where \(\alpha_{\max}\) and \(\alpha_{\min}\) represent the maximum and minimum inertial weight, respectively, and can be set to 0.9 and 0.4; \(t_{\max}\) is the maximum number of iterations.  
However, PSO often suffers from the problems of slow convergence speed and premature convergence because of the quick loss of diversity in the later period [24; 25]. In this paper, a premature judgment and mutation mechanism is proposed to improve the PSO, abbreviated as IPSO.  
The position of particles is composed of the parameters of the FNN and can determine the fitness of the particle, so we can evaluate the performance of the particle swarm by the overall changing of all particles fitness. The group fitness variance \(\delta^{2}\) is employed to judge the premature level of particles, which can be defined as follows:  
\[\delta^{2}=\frac{1}{M}\sum_{i=1}^{M}\left(\frac{F_{i}-F_{avg}}{F}\right)^{2} \tag{9}\]  
where \(F_{i}\) denotes the fitness of the \(i\)th particle, \(F_{avg}\) is the average fitness of all particles, \(F\) denotes the normalization factor, which can be determined as follows:  
\[F=\max\left\{1,\max\left\{|F_{i}-F_{avg}|\right\}_{i=1}^{M}\right\} \tag{10}\]  
When \(\delta^{2}\) is smaller than a specified value \(H\) (\(H\) is a predetermined constant beforehand), the algorithm is considered as falling into premature. Hence, to avoid this drawback of PSO, a mutation mechanism based on resetting the velocity is proposed to enable particles to possess a new momentum according to the following equation:  
\[V_{ij}^{t}=V_{\min}+(V_{\max}-V_{\min})V_{ij}^{t} \tag{11}\]  
where [\(V_{\min}\), \(V_{\max}\)] is the velocity range of the particles. Proper velocity range can ensure that the performance of the algorithm.