## 2 Proposed Convolutional Neural Network Based Multipath Detection Method  
A new machine learning based multipath detection method is proposed and the details and complete algorithm are described in this section. The proposed method uses CNN with SAE for feature extraction and random forest/softmax for classification. CNN is used for feature extraction in the proposed method because CNN can tolerate pattern shift and deformation [28]. The proposed method doesn't rely on the sidereal repeatability of multipath errors. CNR and Pseudorange multipath (MP) for each frequency are used separately to extract multipath features via CNN. MP is linear combinations of the pseudorange and carrier phase observations [29], which is given by:  
\[\mathrm{MP_{i}}=\mathrm{P_{i}}-\left(1+\frac{2}{\alpha-1}\right)\mathrm{L_{i} }+\left(\frac{2}{\alpha-1}\right)\mathrm{L_{j}} \tag{6}\]  
Figure 2: A sparse auto-encoder network with a sparse representation on the hidden layer. where MP\({}_{\rm i}\) (in metres) represents MP for Frequency i, P\({}_{\rm i}\) is the code measurement for frequency i, L\({}_{\rm i}\) and L\({}_{\rm j}\) are the carrier phase measurements for frequencies i and j, respectively, and \(\alpha\) is the ratio between squared frequencies of L\({}_{\rm i}\) and L\({}_{\rm j}\). The extracted features are combined together with a doubled input dimension (the reason to combine the features of CNR and MP is explained in Section 5) to train a classifier. After the training, the classifier can detect whether the data is multipath contaminated or not. The input data structure of the proposed method is shown in Table 1. For each type of signal from satellite k, its input data CNR and MP in the same column have the same timestamp. We denote n as the length of input time window and the observation n is the latest observation. The proposed method needs current and n \(-\) 1 previous successive observations to detect the multipath in the latest observation. As a real-time detection system, there is a response time between the epoch at the observation starts to suffer from multipath error and the epoch of detection of multipath. As a result, shortening the time window of input data (i.e., decreasing n) can reduce the detection response time, and vice versa. However, decreasing n would increase difficulty in feature extraction because of less information in the input data (due to reduced feature dimension) and convolution cannot be performed when n is less than 3. The value of n is set to 16 in this work, and the determination of n is presented in Section 5. To extract a multipath/direct-signal only feature in CNR and MP from the input data, the following steps are taken:  
1. Pre-process each MP\({}_{\rm i}\) in the time window (i.e. Table 1) to MP\({}_{\rm i}^{0}\) by: \[\rm{MP}_{\rm i}^{0}=\rm{MP}_{\rm i}-\sum_{i=1}^{n}\rm{MP}_{\rm i}/n.\] (7)
2. Scale the MP\({}_{\rm i}^{0}\) and CNR\({}_{\rm i}\) to [0.1] using the following two equations: \[\rm{CNR}_{\rm i}^{s}=0.8\bigg{[}\frac{\rm{CNR}_{\rm i}-\rm{CNR}_{\rm{max}}}{ \rm{CNR}_{\rm{max}}-\rm{CNR}_{\rm{min}}}\bigg{]}+0.1\] (8) \[\rm{MP}_{\rm i}^{s}=\sigma([\frac{\rm{MP}_{\rm i}^{0}}{|\rm{MP}_{\rm i}^{0} |}]\rm{log}\ (|\rm{MP}_{\rm i}^{0}|+1))\] (9) where CNR\({}_{\rm i}^{s}\) and MP\({}_{\rm i}^{s}\) are scaled CNR\({}_{\rm i}\) and MP\({}_{\rm i}\) from Table 1, respectively; \(\sigma(\cdot)\) is the sigmoid function defined in Equation (4). CNR\({}_{\rm{max}}\) and CNR\({}_{\rm{min}}\) are the upper and lower bounds of CNR in all measurements (not just in the time window). This step as data pre-processing (scaling all the input data to [0, 1]) is compulsory because sigmoid function, i.e., Equation (4), is used when training SAE in Step 3. The sigmoid function has an output range of [0, 1]. As described in Section 1, an SAE neural network has identical input and output values, so the input values of SAE need to be restricted to [0, 1] as well.