# Parameter Optimization Based BPNN of Atmosphere Continuous-Variable Quantum Key Distribution
## 3 BPNN-Based CVQKD Scheme  
Different from optical fiber channel, the transmittance of the atmospheric channel is nonlinear. Factors affecting transmittance include not only distance but also climatic conditions. In order to achieve the maximum secret key rate transmission, it is very important to choose an appropriate modulation variance at Alice end. BPNN can be applied to the system to predict the most suitable modulation variance \(V_{A}\) quickly and accurately. For simplicity, we convert the above relationship into the mathematical formula as follows:  
\[\begin{array}{c}\overrightarrow{u}=(L,\sigma_{R^{\prime}}^{2},\left\langle T \right\rangle).\\ \overrightarrow{v}=(V_{A}).\end{array} \tag{11}\]  
The secret key rate \(K\) is the function of \(V_{A}\), which is \(K=f(\overrightarrow{v})\). Modulation variance optimization could be regarded as searching for \(\overrightarrow{v_{opt}}\) to maximize \(K\), as indicated  
\[\overrightarrow{v_{opt}}=argmax_{\overrightarrow{v}\in V}[K=f(\overrightarrow {v})]. \tag{12}\]  
At the beginning, we invent an input layer that contains three neurons. They receive distance \(L\), Rytov parameter \(\sigma_{R}^{2}\) and transmittance \(\left\langle T\right\rangle\) as the input, respectively. For input parameters, \(L\) is the distance between [PERSON] and [PERSON], and Rytov parameter \(\sigma_{R}^{2}\) is mainly dependent on refraction index structure parameter \(C_{n}^{2}\). Transmittance \(\left\langle T\right\rangle\) is relevant to atmosphere turbulence. Then, a hidden layer comprised of eight neurons is enhanced to connect the input layer. In the end, an output layer of only one neuron is installed, which will output the modulation variance \(V_{A}\).  
Figure 4: (**a**) key rate as a function of modulation variance \(V_{A}\) and transmittance; (**b**) key rate as a function of modulation variance \(V_{A}\) for various distances. From top to bottom, the distance increases by 1 km. The excess noise \(\varepsilon\) is set as 0.01, detector efficiency \(\eta=0.6\), electrical noise \(v_{el}=0.01\).  
Here, we prepare the training data for BPNN. First, a program was written to randomly sample the input data space, randomly select the combination of \(\overrightarrow{u}\) (for which we generate 1000 sets of data from \(L=0-11 km\), \(\sigma_{R}^{2}=0-20\), \(\langle T\rangle=0-1\)), and calculate the corresponding optimal parameters \(\overrightarrow{v}\) and the secret key rate by using the local search algorithm (LSA).  
The next step is to train BPNN. We record all the above-mentioned \(\overrightarrow{u}\) and \(\overrightarrow{v}\) as the training dataset \(U\) and \(V\). Then, we introduce the BPNN that is applied to predict \(V_{A}\). First, we extract \(V_{A}\) from \(\overrightarrow{v_{opt}}\) and make a label dataset \(V_{1}\). Then, we put the dataset \(U\) into BPNN and adjust the network connection weights with the back propagation algorithm (BPA) according to the difference between the output of the BPNN and label dataset \(V_{1}\). The working principle of BPNN is described in detail in Appendix C. Once trained, the neural network can find the optimal parameters and key rate directly according to any input, which greatly speeds up the parameter optimization process.  
After the training is achieved, three groups of data are randomly selected using the training network, and the outcomes are recorded in Table 2. The table indicates that the predicted parameters and the matching key rate are very familiar with the optimal values acquired by LSA, for the parameters predicted by BPNN reaching 99.99% of the optimal key rate. As depicted in Figure 5, we compared the BPNN-predicted and optimized parameters by scanning the distance from 0 to 11 km. Compared with the traditional LSA, the BPNN performs very well in predicting optimal values for modulation variance and attains a very similar key rate level.