## 3 Algorithm and Methods
### CNN Location Classification Model  
The structure of CNN we use is developed from AlexNet, which has produced remarkable performance in image classification. As shown in the Figure 3, the CNN location classification model consists of four convolution layers, one fully connected layer and one softmax layer in turn. CNN is robust to noise by using convolution kernel and constructs a higher-level representation of the input image in the latter layer. A two-dimensional image \(\mathbf{I}\) is used as input and the two-dimensional convolution kernel is defined as \(\mathbf{K}_{c}\), the convolution operation is expressed as:  
\[\mathbf{S}(i,j)=(\mathbf{K}_{c}*\mathbf{I})(i,j)=\sum_{m}\sum_{n}\mathbf{I}(i-m,j-n)\mathbf{K}_{c}( m,n) \tag{3}\]  
Figure 2: Observation matrix and sliding window. where the size of the convolution kernel \(\mathbf{K}_{\mathbf{c}}\) is \(m\times n\), the size of the image is \(i\times j\). The larger the convolution kernel, the larger the receptive field and the more information is obtained. A large convolution kernel may lead to a surge in computational complexity, which is not conducive to increasing the depth of the model and reducing the computational performance. The convolution kernel size is usually odd. For each input image, we employed 10 convolutional filters with \(1\times 1\) kernel size in the first convolutional layer. The \(1\times 1\) convolution layer increases the nonlinear characteristics while keeping the image size unchanged, which is conducive to feature extraction. We employed 10, 5, 5 convolutional filters with \(3\times 3\) kernel size in the following three convolutional layers. Due to the dimension of the observation image itself is not big enough, we pad the observation image to ensure that the size of the feature image remains \(16\times 4\) during forward propagation. We set the stride step of the convolution kernel to one to obtain the information in the time domain accurately, so that the dimension of the input observation image will not be reduced. We hope that the fully connected layer can get enough input features. We believe that each pixel on the observation image is a description of the location features, so we do not use the pooling layer for down sampling to avoid losing the information. The dropout layer is added and set to 0.2 after the first fully connected layer to reduce the influence of over fitting. The activation function in convolution layer introduces nonlinearity into the neural network, which is an important factor affecting the performance of the neural network. The function of activation function is to compress the result of convolution into a fixed range, so that the numerical range is controlled after multiple convolution layers. We choose the Rectified Linear Units (ReLUs) as the activation function, which achieves high computing speed because the resulting neural network has good sparsity. ReLUs are expressed as:  
\[f(x)=\max(0,x) \tag{4}\]  
The number of neurons in the output layer is equal to the number of reference points, so each output neuron corresponds to a reference point. Since the UE may appear near any reference point, we use softmax as the activation function of the output layer, which means the sum of all outputs is equal to one. Therefore, the output of neurons is interpreted as the probability that the UE belongs to the corresponding reference point. The softmax function is defined as follows:  
Figure 3: CNN location classification model. \[p_{j}=\frac{e^{w_{j}^{T}q_{i}}}{\sum_{j=1}^{I}e^{w_{j}^{T}q_{i}}} \tag{5}\]  
where \(p_{j}\) represents the output of the \(j\)th neuron in softmax layer. There are a total of \(I\) output neurons whose number is equal to the number of reference points in the positioning area. \(q_{i}\) is the output of the neuron of the second last layer, \(w_{j}\) is the weight connecting the second last layer and softmax layer, and \(T\) represents the transpose of the weight vector.