## 3 Robust Algorithm Based on CNN
### Configuration of CNN  
In this study, the mean values and standard deviations of residuals are the inputs of CNN, and the probabilities of the corresponding expansion factors are the outputs. The input data are normalized at first, and then divided into data segments with size of \(2\times 10\). Each data segment that acts like a picture is the processing object of CNN. Two rows of elements in the data segment correspond to the mean values and standard deviations of residuals, respectively. The data length is set to 10 to allow for both short data processing time and sufficient data quantity. The residual of each receiving channel contains two components: pseudo-range residual and pseudo-range rate residual, which correspond to different coefficients of \(\widetilde{\mathbf{R}}\). Thus, two CNNs are required for each receiving channel. One CNN is for pseudo-range residuals, and the other is for pseudo-range rate residuals. CNN needs to be trained before being put into use. During the training stage of CNN, the system structure is shown as follows:  
In Figure 3, the pseudo-range residual of the \(i\)th receiving channel is shown as an example. \(\overline{L}_{i}\) and \(\delta_{i}\) denote the mean and standard deviation of residuals, respectively. Abnormal values are artificially added in the pseudo-range error of the \(i\)th receiving channel, and then the value of \(R_{i}\) is adjusted by different expansion factor. When the positioning error \(\delta p\) is minimized, the optimal expansion factor \(\hat{\alpha}_{i}\) is obtained. Next, CNN starts to be trained. \(\hat{\alpha}_{i}\) is compared with the expansion factor \(\alpha_{i}\), which is predicted by CNN. The smaller the difference between the two factors, the more accurate the prediction of CNN is. The training goal of CNN is to minimize the difference. Actually, the outputs of CNN are expressed in probability. Different expansion factors correspond to different probabilistic values. At last, the alternative value corresponding to the maximum probability is determined as the expansion factor of CNN. The loss function is constructed as:  
\[e(W,b)=\frac{1}{N_{e}}\sum_{j=1}^{N_{e}}\left(o_{j}-\delta_{j}\right)^{2}, \tag{25}\]  
where \(o_{j}\) represents the \(j\)th output of CNN, and \(\delta_{j}\) represents the expected output. Both \(o_{j}\) and \(\delta_{j}\) are probabilistic values ranging from 0 to 1. \(N_{e}\) represents the number of CNN output. The expected probability corresponding to \(\delta_{i}\) should be equal to 1, and the others should be equal to 0. In the training process, back-propagation is applied to update the trainable parameters in the neural network by minimizing the loss function [37]. The parameters include the weights of convolution kernel and the connection coefficients of fully connected layer. Back-propagation is implemented based on the stochastic gradient algorithm, so the method of updating the parameters is as follows:  
\[W_{k+1}=W_{k}-\eta\frac{\partial e(W_{k},b_{k})}{\partial W_{k}}, \tag{26}\]  
\[b_{k+1}=b_{k}-\eta\frac{\partial e(W_{k},b_{k})}{\partial b_{k}}, \tag{27}\]  
where \(\eta\) denotes the learning rate. \(W_{0}\) and \(b_{0}\) are initialed with small random values. In order to prevent over-fitting in the training process, some measures are taken to increase the sparsity and randomness of neural network. Firstly, the input and output data of CNN are normalized. In addition, a weight decay is adopted to limit the growth of the weights and suppress the effects of static noise [38]. It adds a term in the updating procedure of weights, as shown in Equations (28) and (29):  
\[W_{k+1}=W_{k}-\eta(\frac{\partial e(W_{k},b_{k})}{\partial W_{k}}+\beta W_{k}), \tag{28}\]  
\[b_{k+1}=b_{k}-\eta(\frac{\partial e(W_{k},b_{k})}{\partial b_{k}}+\beta b_{k}). \tag{29}\]  
In addition, dropout is applied in full-connected layer. It drops neurons and their connections from the neural network randomly. For the input data, the network is different owing to the randomness of dropout.