## 2 Principles of the Proposed Method
### OSNR Monitoring Based on the IBPSO-Based DNN Trained with AHs
#### 2.2.2 Principle of the IBPSO  
Considering that the large input dataset in the DNN usage scenario will affect the convergence rate and computational complexity of DNN, therefore, it is necessary to conduct dimensionality reduction preprocessing for the data [44]. The common dimension reduction methods are principal component analysis (PCA) and partial least square (PLS). The disadvantage of PCA is that it is opposite to the original input variable, and the derived dimension may have no intuitive explanation. In addition, the implementation process of PLS is based on nonlinear iteration, which usually requires hypothesis or transformation of the original sample data, which is difficult to satisfy in practical problems. Therefore, the IBPSO algorithm was introduced to get an equivalent sparse input vector set to represent the original data by referring to the principle of sparse sampling and the role of chromosomes in GA, which improved the effect of data execution and data dimension reduction, and it was less affected by the testing process. The particles of a traditional binary particle swarm optimization (BPSO) algorithm are composed of binary strings [45]. In the specific dimension, the probability distribution with particle velocity as the main function generates the particle position randomly. Each binary bit utilizes Equation (1)to generate speed, and its velocity value is converted into the probability of transformation, that is, the chance of the bit variable to take a value of 1. In order to indicate that the velocity value is the probability of binary bit picking 1, the value of velocity is mapped to [0,1]. The mapping function is generally adopted as sigmoid function:  
\[S(v_{id})=Sigmoid(v_{id})=\frac{1}{1+\exp(-v_{id})} \tag{4}\]  
where \(S\) denotes the probability that position \(x_{id}\) takes 1, and the particle changes its position by the following formula:  
\[x_{id}=\left\{ \begin{array}{ll}1&if\ rand()\leq S(v_{id})\\ 0&otherwise\end{array} \right. \tag{5}\]  
It should be noted that the value of sigmoid function does not represent the probability of a bit change, only the probability of one bit take a value of 1. When the velocity of the particle \(v_{id}\) approaches 0 it means that the position of the particle \(x_{id}\) is consistent, and the sigmoid function demonstrates an equal probability of 0 or 1 for \(x_{id}\). If it converges to the global optimal particle, its velocity is 0. At this point, according to the properties of sigmoid function, the most chance of bit change is 0.5. And the search is random and directionless. Therefore, the traditional BPSO algorithm is a global random search algorithm, which runs with iteration and has strong randomness. In order to make the particle tend, more and more, to the optimal particle, and the algorithm converges to the global optimal particle, we change the mapping function to the following formula:  
\[S^{\prime}(v_{id})=\left\{ \begin{array}{ll}1-\frac{2}{1+\exp(-v_{id})}&v_{id }\leq 0\\ \frac{2}{1+\exp(-v_{id})}-1&v_{id}>0\end{array} \right. \tag{6}\]  
Then, the updating formula of particle position is changed to the following form:  
\[x_{id}=\left\{ \begin{array}{ll}0&if\ rand()\leq S^{\prime}(v_{id})\\ x_{id}&otherwise\end{array} \right.\quad\text{ when }v_{id}<0 \tag{7}\]  
\[x_{id}=\left\{ \begin{array}{ll}1&if\ rand()\leq S^{\prime}(v_{id})\\ x_{id}&otherwise\end{array} \right.\quad\text{ when }v_{id}>0 \tag{8}\]  
The purpose of the new mapping function is that when the velocity tends to 0, the value of the probability mapping function is 0. Secondly, when the value of the probability function is set to 0 and 1 in the form of Equations (7) and (8), this form can ensure that the value of bit is unchanged when the velocity is 0. When the velocity is negative, the bit can only be changed to 0, and when the velocity is positive, the bit can be changed to 1.