## 4 Results and Discussion  
Considering that the larger dataset and more hidden layers have a greater impact on the neural network structure and iteration time of the neural network structure, this paper constructs a four-layer DNN structure which is illustrated in Figure 6. The number of input neuron nodes is equal to that of bin number, and the number of output neuron nodes is 1. The activation functions of the hidden layer  
Figure 7: Experimental setup for OSNR monitoring in coherent receiver. and the output layer are Logsig and linear functions, respectively. We use the grid search method to optimize the number of hidden layer neuron nodes and get the optimal value of hidden layer neuron nodes when the fitness value reaches the minimum value. In order to find the relationship between bin number and OSNR estimation accuracy, we treat the total amplitude sample data according to AHs bin number of 10-100 (with step size of 10) to obtain different AHs bin counts. After the two signals are processed by DSP, each signal is transformed into a \(n_{i}\times 1\) dimensional vector \(x=\left(x_{1},x_{2},\cdots,x_{n_{i}}\right)^{T}\), where \(n_{i}=10,20,30,40,50,60,70,80,90,100\) is the AHs bin number and \(x=\left(x_{1},x_{2},\cdots,x_{n_{i}}\right)^{T}\) is \(n_{i}\) AHs bin counts. Therefore, this is the input data of PSO-DNN. Correspondingly, the input layer of PSO-DNN has \(n_{i}\) neurons. For comparison, we input the same training set into the traditional DNN for training and test the conventional DNN and PSO-DNN with the same test set, respectively. Among them, the structures of neurons for PSO-DNN with 100 input nodes was trained and tested with complete AHs signal sets, 100-76-47-1 (input layer has 100 nodes, the two hidden layers have 76 and 47 nodes, and output layer has 1 node) and 100-79-62-1 for QPSK and 16 QAM signals, respectively. The corresponding neuronal structures of conventional DNN are 100-77-52-1 and 100-62-53-1. In addition, the neuron structures of other bin numbers were obtained by grid search method, therefore, they are not listed one by one. Through the simulations of PSO-DNN and conventional DNN by convergence training, the average estimation error of these two signals in OSNR of corresponding AHs bin number are calculated and mapped. The following simulation results are obtained by random selection as 80% and 20% of the AHs data for the training set and the test set and a 10-fold cross-validation is used to obtain the average results to ensure the model fits the training data well. As shown in the Figure 8, the average estimation error in OSNR of the two signals trends to decreases as the AHs bin number increases. For PM-RZ-QPSK and PM-NRZ-16 QAM signals, the average error of PSO-DNN in OSNR is the same as that of conventional DNN when the bin number is about 53 and 62, that is, PSO-DNN can achieve the same OSNR estimation accuracy as conventional DNN with fewer neurons. It is worth noting that when the bin number is 100, PSO-DNN can achieve a smaller estimation error than conventional DNN, which indicates that PSO-DNN can achieve better estimation accuracy than conventional DNN when the number of neurons is the same. It can be seen that when the number of layers of the neural network structure is the same, the number of neurons in the input layer is the main factor of the complexity of the network structure and the modeling time. Therefore, compared with conventional DNN, PSO-DNN can achieve better estimation accuracy under the same complexity of neural network structure. In order to achieve high estimation accuracy with fewer neuron nodes in the input layer, an IBPSO algorithm is introduced into the system to obtain equivalent sparse input vectors. Through repeated  
Figure 8: Averaged error of estimated OSNR for (**a**) PM-RZ-QPSK and (**b**) PM-NRZ-16 QAM signals versus AHs bin number processed by the particle swarm optimization optimized deep neural network (PSO-DNN) and DNN.