# Online Learning-Based Adaptive Device-Free Localization in Time-Varying Indoor Environment
## 4 The Proposed Method
### Deep Representations for the Fingerprints  
ML-OSELM is stacked by Online Sequential Extreme Learning Machine-Autoencoder (OS-ELM-AE) [32]. In OS-ELM-AE, the parameters of the input layer and the hidden layer bias are randomly generated and orthogonal. OS-ELM-AE is an unsupervised learning algorithm, and its inputs are also its outputs [33]. Therefore, the output weights of its initialization phase can be expressed as  
\[\beta^{(0)}=\mathbf{P}_{0}\mathbf{H}_{0}{}^{T}\mathbf{X}_{0}. \tag{7}\]  
In the online learning phase, when the \((k+1)\)th set of training data arrives, the weights \(\beta^{(k+1)}\) can be expressed as  
\[ \begin{split}\mathbf{P}_{k+1}=\mathbf{P}_{k}-\mathbf{P}_{k} \mathbf{H}_{k+1}^{T}\Big{(}\mathbf{I}+\mathbf{H}_{k+1}\mathbf{P}_{k}\mathbf{ H}_{k+1}^{T}\Big{)}^{-1}\mathbf{H}_{k+1}\mathbf{P}_{k}\\ \beta^{(k+1)}=\beta^{(k)}+\mathbf{P}_{k+1}\mathbf{H}_{k+1}^{T} \Big{(}\mathbf{X}_{k+1}-\mathbf{H}_{k+1}\beta^{(k)}\Big{)}.\end{split}  \tag{8}\]  
In ML-OSELM, the parameters of all hidden layers can be initialized by Equation (7), and Equation (8) can be used to train online for subsequent arrivals of data. The output of the hidden layer \(l\) for the \((k+1)\)th set of data can be expressed as  
\[\mathbf{H}_{k}^{l}=g\bigg{(}\Big{(}\beta_{l}^{(k)}\Big{)}^{T}\mathbf{H}_{k}^{ l-1}\bigg{)}, \tag{9}\]  
where \(g(\cdot)\) denotes the activation function, and \(\beta_{l}^{(k)}\) denotes the output weights of OS-ELM-AE in the hidden layer \(l\) of the \(k\)th data set. The input layer can be considered as the zeroth hidden layer. ML-OSELM is divided into two phases as follows. 1. Initialization phase In this phase, for ML-OSELM with \(p\) hidden layers, the output of hidden layer \(l\) is computed as \[\mathbf{H}_{0}^{l}=g\bigg{(}\Big{(}\beta_{l}^{(0)}\Big{)}^{T}\mathbf{H}_{0}^{ l-1}\bigg{)},l=1,2,\ldots,p,\] (10) where \(\beta_{l}^{(0)}\) can be obtained by Equation (7). The parameters of the hidden layer \(p\) to the output layer is calculated as \[\beta_{p}^{0}=\mathbf{P}_{0}(\mathbf{H}_{0}^{p})^{T}\mathbf{Y}_{0}.\] (11)
2. Online learning phase In this phase, when the \((k+1)\)th set of training data arrives, the output of the hidden layer \(l\) is obtained by \[\mathbf{H}_{k+1}^{l}=g\bigg{(}\Big{(}\beta_{l}^{(k+1)}\Big{)}^{T}\mathbf{H}_{k+1}^ {l-1}\bigg{)},l=1,2,\ldots,p, \tag{12}\]  
where \(\beta_{l}^{(k+1)}\) can be obtained by Equation (8). The weights of the output layer are calculated as  
\[\beta^{(k+1)}=\beta^{(k)}+\mathbf{P}_{k+1}\mathbf{H}_{k+1}^{T}\Big{(}\mathbf{ Y}_{k+1}-\mathbf{H}_{k+1}\beta^{(k)}\Big{)}, \tag{13}\]  
where \(\mathbf{H}_{k+1}=\mathbf{H}_{k+1}^{p}\) can be obtained by Equation (12). As mentioned above, to alleviate the fingerprint similarity problem, we use ML-OSELM to transform the original signal into a discriminable fingerprint. Specifically, we use the weights of ML-OSELM as the new fingerprint (see Algorithm 1). This method can help tackle the similarity problem because we use CSI as input during the training process, and this method can learn data with multilayer autoencoders. Therefore, the weights of ML-OSELM contain information about the target position, and we use the weights to replace the raw signal as the new fingerprint. This deep representation method can help improve the localization performance.