# Robust and Accurate Wi-Fi Fingerprint Location Recognition Method Based on Deep Neural Network
## 3 Theoretical Frameworks
### DNN-Based Wi-Fi Location Recognition
#### 3.2.2 Offline Stage  
The SDAE is used to capture nonlinear and implicit correlations between \(RSS\) and the spatial location through signal changes at different fingerprint points. The SDAE is able to represent input data in the form of hierarchically distributed data, using the observation information on fingerprint points and reducing the feature dimension of signal data [32].  
An SDAE is stacked by multiple denoising autoencoders (DAEs) as hidden layers. Each DAE layer is used to train the pair of encoder-decoders to make the output value \(u\) equal to the input value  
Figure 1: System framework.  
\(x\) as much as possible. If input data can be restored after encoding and decoding, then the feature representations trained in this way will contain relatively low noise levels. Figure 2 shows the process of a DAE. The encoder-decoder can be formulated as  
\[\left\{\begin{array}{l}y(x)=\frac{1}{1+e^{-(wx+b)}}\\ u(y)=\frac{1}{1+e^{-(w^{\prime}y+b^{\prime})}}\end{array}\right. \tag{3}\]  
where \(w\) and \(w^{\prime}\) are the connection weights between the encoder and decoder, respectively; they are the transposition of each other, and \(b\) denotes the hidden units biases, while \(b^{\prime}\) denotes the visible units biases.  
We employed two techniques to suppress overfitting in training the DNN. First, we added a noise reduction mechanism during training [33]. Before the \(RSS\) in the fingerprint database is input into each DAE for unsupervised training, it will be \"corrupted\" by random setting to 0 based on a certain probability. The trained features are of higher robustness since corrupted input data are closer to actual test data. Second, we adopted dropout regularization, which has been shown to be useful for large networks [34]. This method randomly removed some neurons in different parts of the training stage, which means these neurons cannot participate in propagation. This prevented the interdependence of neurons because the DNN relied too much on several local features in the training process, and also enhanced the generalization of the model.  
The softmax function is usually used for solving the finite discrete probability distribution in classification. After layer-by-layer unsupervised training of the DNN's three hidden layers, we treated the softmax function as the final output layer and prior probability of all fingerprint points as labeled information in consideration of classification. The feature weight obtained from the training was recorded to complete the offline training, but not before being fine-tuned from top to bottom.  
The method constructs a four-layer DNN used for location recognition, as is shown in Figure 3. Boxes 1, 2 and 3 represent the hidden layers of DAE respectively, and the last box 4 represents the softmax output layer. After the standardized input \(RSS\)\(X^{\prime}\) enters DNN, the training of each DAE hidden layer is completed according to the procedures shown in Figure 2 in turn, and the trained connection weight \(w\) and hidden units biases \(b\) are saved. The output \(y\) of the previous layer is taken as the input of the next layer to propagate layer by layer. When data reaches the last layer, the priority probability of all fingerprint points as labeled is used for global fine-tuning from top to bottom to realize offline training. N is the neuron dimension of input layer, and the number is equal to APs observed in offline training. Z is the output layer dimension and is equal to fingerprints when the model is used for positioning, and is equal to floors when the model is used for floor recognition. H\({}_{1}\), H\({}_{2}\) and H\({}_{3}\) represent the neuron dimension of each hidden layer. Their value is determined by the actual situation.  
Figure 2: Training process of a denoising autoencoder (DAE).