# Fingerprinting Indoor Positioning Based on Improved Sequential Deep Learning
## 3 System Overview
### Position Determination
#### 3.2.1 Dnn  
In our improved DNN architecture, the input layer remains consistent with that of a traditional DNNR model. However, the number of output nodes is aligned with the number of RPs, as illustrated in Figure 2. The architecture utilizes all RSSI samples from the RPs during the optimization process to capture the statistical characteristics of the RSSI samples at each RP. Each RP is treated as a unique class, and the RSSI sample distributions at these RPs are modeled throughout optimization. Unlike traditional approaches that rely on averaged RSSI datasets, our method leverages the complete RSSI samples, asshown in (5). The softmax activation function is applied at the output layer, restricting the output values to a range between 0 and 1, while ensuring their sum equals 1. This enables the output values to be interpreted as probabilities corresponding to each RP. Effectively, the improved DNN acts as a multivariate probability density estimator, assigning higher weights to similar samples and extracting valuable information even from a single RSSI sample. The output for the \(r\)th node in the output layer is calculated as follows:  
\[\text{SoftMax}\to f_{L}^{r}=\frac{exp(v_{L}^{r})}{\sum_{q=1}^{R}exp(v_{L}^{q})} \tag{7}\]  
where \(\sum_{q=1}^{M_{j}}f_{L}^{r}=1\). Instead of using the coordinate of RPs as output labels, we use one-hot encoded labels for RPs as follows  
\[C=\{\underbrace{[1,0,\cdots,0]_{1}^{\top}}_{c^{1}},\underbrace{[0,1,\cdots,0]_ {2}^{\top}}_{c^{2}},\cdots,\underbrace{[0,0,\cdots,1]_{M_{j}}^{\top}}_{c^{M_{ j}}}\} \tag{8}\]  
where \(c^{r}\) is the label for samples of the \(r\)th RP. The objective function proposed during the optimization process is either the log-likelihood function or the cross-entropy function, defined as [35]:  
\[\mathcal{L}=-\sum_{i=1}^{M_{j}N}\sum_{r=1}^{M_{j}}[c^{r}]_{i}log([f_{L}^{r}]_{ i}) \tag{9}\]  
where \(M_{j}\) is the number of the RPs in region \(j\), \(N\) is the number of samples at each RP, \([c^{r}]_{i}\) is the desired output of the \(i\)th sample at the \(r\)th node, and \([f_{L}^{r}]\) is the predicted output for the \(i\)th sample at the \(r\)th node. The cross-entropy loss function does not penalize output nodes with true values of 0. However, it imposes a logarithmic penalty on the target output nodes when the predicted value is significantly less than 1. This means the log function favors a strong selection of a single class, which is crucial for optimizing the weights of the network layers. The goal is to maximize the probability assigned to the closest RP as much as possible. Figure 2: Proposed DNN architecture. The computational complexity of the improved DNN can be analyzed as follows: The number of input nodes equals \(R\), the number of layers equals \(L\), and the number of output nodes equals the number of the RPs in region \(j\) denoted as \(M_{j}\). Additionally, the number of nodes in each layer \(l\) is represented as \(h_{l}\), where \(h_{1}=R\) (input layer) and \(h_{L}=M_{j}\) (output layer). For the layers up to \(L-2\), the computational complexity is equivalent to that of a conventional DNN used for regression tasks, given by \(\mathcal{O}\Big{(}\sum_{i=1}^{L-2}h_{i}h_{i+1}\Big{)}\). At the \((L-1)\)th layer, two primary factors contribute to the computational complexity: the activation function and the matrix weight multiplication. The activation function has a complexity of \(a(h_{L-1})\), while the matrix weight multiplication is influenced by the number of RPs, resulting in a combined complexity at this layer of \(\mathcal{O}(a(h_{L-1})+h_{L-1}M_{j})\). In the final layer, the computation of the softmax activation function introduces additional dependencies among the outputs. Assuming the complexity of the exponential function \((\exp)\) is comparable to that of a multiplication--due to its approximation via a finite number of multiplications in its Taylor series expansion--the complexity of the softmax function becomes \(\mathcal{O}(M_{j}^{2})\).