## 3 The Conventional and Proposed UWB Localization Approaches
### LSTM Based UWB Localization  
The UWB data is time dependent and LSTM model is the best deep learning model for UWB localization as compared to recurrent neural networks (RNN) [30], and extreme learning machine (ELM) [31] models. LSTM is the improved form of RNN and it is used to connect historical information to the current input. The long-term dependence problem of RNN makes them unsuitable for UWB-based localization systems and the unique long-time dependence characteristics of LSTM [32] gives accurate localization results when compared to other deep learning models. The LSTM result shows that it reduces the vanishing gradient problem [33] which exists when we use RNN networks for UWB localization. In this paper we followed the LSTM model presented in References [34; 35] for deep LSTM implementation. The LSTM model consists of a layered structure with a state \(c\) (cell state) in each hidden layer. The output of the LSTM model is a regression output and not a classification one [36]. In a particular UWB indoor localization scenario, the number of anchors is \(N\), the UWB localization could be estimated only with \(N\in\{3,4,5,6,...\}\). Assume that the localization system uses only one UWB tag, the distance received from anchor \(i\), \(i\in\{1,2,3,...N\}\), can be written as \(\big{[}D_{i-1},D_{i-2},...,D_{i-M_{i}}]\), where \(M_{i}\) is the distance from anchor \(i\). The distance measurements from TOA-distance model converts into a fingerprint map and the fingerprint map in a certain location \((x,y)\) is expressed as  
\[D_{x,y}=\left[ \begin{array}{c}D_{1-1},D_{1-2},...,D_{1-M_{1}},\\ D_{2-1},D_{2-2},...,D_{2-M_{2}},\\...,\\ D_{N-1},D_{N-2},...,D_{N-M_{N}}\end{array} \right]. \tag{18}\]  
Let \(t\) denote the time interval of the current fingerprint, UWB distance data and \(D_{(xt,yt)},h_{(t-1)}\) and \(c_{(t-1)}\) be the current network input values. The output of the LSTM network is expressed as [35]  
\[h_{t}=\left[\hat{x}_{t},\hat{y}_{t}\right], \tag{19}\]  
where \(\hat{x}_{t}\) and \(\hat{y}_{t}\) are the coordinates of the predicted user position at a time \(t\). The value of \(c_{t}\) is defined by the forget gate (FG) and input gate (IG) functions in the LSTM. The FG function saves the information of \(c_{(t-1)}\) to \(c_{t}\) and IG saves the information \(c_{t}\) to \(h_{t}\). The calculation process in FG is expressed as  
\[f_{t}=\sigma\left(w_{f}\times\left[h_{t-1},D_{xt,yt}\right]+b_{f}\right), \tag{20}\]where \(\sigma\) is the rectified linear unit (ReLU), \(w_{f}\) is the weight matrix and \(b_{f}\) is the offset item. The calculation process in IG function is expressed as  
\[g_{t}=\sigma\left(w_{g}\times\left[h_{t-1},D_{xt,yt}\right]+b_{g}\right), \tag{21}\]  
where \(w_{g}\) is the weight matrix of IG and \(b_{g}\) is the offset. The cell state in forward direction of LSTM is expressed as  
\[\tilde{c}_{t}=\tanh\left(w_{c}\times\left[h_{t-1},D_{xt,yt}\right]+b_{c} \right), \tag{22}\]  
\[c_{t}=f_{t}\times c_{t-1}+g_{t}\times\tilde{c}_{t}, \tag{23}\]  
where \(\tilde{c}_{t}\) and \(c_{t}\) are input and output of the cell state at time \(t\). The long term message in LSTM network is formed from an iterative process and the output function \(\left(o_{t}\right)\) is expressed as  
\[o_{t}=\sigma\left(w_{o}\times\left[h_{t-1},D_{xt,yt}\right]+b_{o}\right), \tag{24}\]  
where \(W_{o}\) and \(b_{o}\) are weight matrix and offset which are estimated from training process. The last stage of LSTM forward process is to estimate \(h_{t}\) from cell state and network and is defined as  
\[h_{t}=o_{t}\times\tanh\left(c_{t}\right). \tag{25}\]  
Figure 7 shows the overall forward propagation of the LSTM network. The output of this network is the user \(x\) and \(y\) position results \(\left[\tilde{x}_{t},\tilde{y}_{t}\right]\).