1. Introduction {#sec1-sensors-19-02537}
===============

Recently, with the rapidly increasing location-based service (LBS) \[[@B1-sensors-19-02537]\], such as positioning, tracking, navigation, and location-based security, the indoor localization has attracted wide attention. In outdoor environments, Global Positioning Service (GPS) \[[@B2-sensors-19-02537]\] and other satellite positioning methods can provide people with an acceptable accuracy of positioning services, which can basically meet the various needs of people. However, for indoor scenes, the GPS method cannot work due to a signal's dispersion and blocking. Thus, various indoor localization technologies have been proposed by researchers like Time Of Arrival (TOA) \[[@B3-sensors-19-02537]\], Angle Of Arrival (AOA) \[[@B4-sensors-19-02537]\], Time Difference of Arrival (TDOA) \[[@B5-sensors-19-02537]\], and Received Signal Strength (RSS) \[[@B6-sensors-19-02537]\]. Concerning factors such as positioning accuracy, technical complexity, electromagnetic interference, and construction cost, the WLAN (Wireless Local Area Networks) indoor positioning technology based on RSS fingerprints has become the principal method with an acceptable positioning accuracy.

The fingerprint-based method is widely used in a RADAR system \[[@B7-sensors-19-02537]\], a Nibble system \[[@B8-sensors-19-02537]\], and a Weyes system \[[@B9-sensors-19-02537]\] currently. Generally, the fingerprint-based positioning method is implemented in two phases: the off-line training phase and the online positioning phase. In the off-line training phase, the RSSs from different access point (APs) are measured at the selected reference points (RPs). The RSS information and the corresponding locations are generally formulated as the fingerprint database, which infers the relationship between the RSS distribution and the spatial locations. In the online positioning phase, the RSS information collected in real time is matched to the fingerprint database and the location can be estimated by many proposed methods, such as k-nearest neighbor algorithm (KNN) \[[@B7-sensors-19-02537]\], the kernel-based algorithm \[[@B10-sensors-19-02537]\], a Support Vector Machine (SVM) \[[@B11-sensors-19-02537]\], and the Bayesian estimation method \[[@B12-sensors-19-02537]\].

The fingerprint database is vital for the RSS-based method. However, some studies show that the signal propagation suffers from several noisy characteristics such as interference, reflection, refraction, and even temperature or humidity \[[@B13-sensors-19-02537],[@B14-sensors-19-02537]\] which cause incorrect data in fingerprint database. Moreover, there are numerous causes of outliers \[[@B15-sensors-19-02537]\] in the fingerprint database, for instance, the severe environment factors like human walking, furniture movement, or wall blocking and hardware factors such as incorrect hardware configuration, hardware malfunction, or malicious attacks. The noise and outliers will affect the accuracy of the fingerprint database and result in incorrect positioning information in the online phase.

1.1. Related Work {#sec1dot1-sensors-19-02537}
-----------------

We briefly summarize the relevant studies in this section.

### 1.1.1. Outlier Suppression Preprocessing {#sec1dot1dot1-sensors-19-02537}

Statistically, outliers are the inconsistent points with respect to the normal data in the data set and will destroy the intrinsic structure of the data set. A typical statistical view of outliers in RSS measurements is shown in [Figure 1](#sensors-19-02537-f001){ref-type="fig"}, which was collected in a real indoor environment at a fixed reference point at different times. All these outliers existing in a fingerprint database will degrade the localization accuracy significantly.

Therefore, after constructing the fingerprint database in the off-line phase, a preprocessing step is needed to deal with the outliers and noise. Otherwise, outliers will lead to wrong feature extraction and affect the estimation in the online localization algorithm such as SVM or KNN technology. As we can see in [Figure 2](#sensors-19-02537-f002){ref-type="fig"}, when outliers exist, the main direction of projection after the Principal Component Analysis (PCA) process has deviated from the correct line seriously, so it is vital to detect and eliminate noise and outliers.

There are many outlier suppression methods in indoor localization; the median filter \[[@B16-sensors-19-02537]\] is the most popular and simplest way to deal with the RSS variation. Chen et al. \[[@B17-sensors-19-02537]\] presented a method which combines the hampel filter and the kernel density estimator (KDE) by assigning each data a confidence indicator and by judging whether it is credible. Fang et al. \[[@B18-sensors-19-02537]\] presented a new approach to improve the positioning accuracy based on the Singular Value Decomposition (SVD) noise reduction technique.

There are also many outlier detection methods in the data analysis field. Knorr et al. \[[@B19-sensors-19-02537]\] proposed an outlier detection algorithm, which effectively solved the problem of unknown dataset distribution, but it was time-consuming. Ramaswamy et al. \[[@B20-sensors-19-02537]\] presented a k-nearest neighbor outlier detection algorithm based on distance, which determined a point as an outlier if it was far from most of the points. Ester et al. \[[@B21-sensors-19-02537]\] proposed a new clustering algorithm DBSCAN (Density-Based Spatial Clustering of Applications with Noise) that relies on a density-based notion of clusters which was designed to discover clusters of arbitrary shape. Raymond et al. \[[@B22-sensors-19-02537]\] proposed an outlier detection algorithm based on clustering, which detected outliers by examining the relationship between objects and clusters. Markus et al. \[[@B23-sensors-19-02537]\] presented a new outlier detection approach based on the density of data by giving each object a degree called LOF (Local Outlier Factor) for being an outlier. Raymond et al. \[[@B22-sensors-19-02537]\] developed a new clustering method to detect outliers called CLARANS (Clustering Large Applications Based Upon Randomized Search) which was based on a randomized search. Papadimitrio et al. \[[@B24-sensors-19-02537]\] proposed an outlier detection algorithm by introducing MDEF (multi-granularity DEviation Factor), which degraded the computation complexity, but it was hard to select an appropriate parameter.

These traditional dectection methods can accurately find outliers. However, they cannot deal with outliers well by only simply eliminating outliers or by replacing outliers with sample mean values. Therefore, we introduce the RPCA approach, which will be explained in the following section.

### 1.1.2. Robust PCA {#sec1dot1dot2-sensors-19-02537}

Candès et al. proposed a problem called RPCA \[[@B25-sensors-19-02537]\] to separate a low-rank matrix and a sparse matrix from a sum matrix. The RPCA problem was transformed into a convex optimization problem under minimal assumptions, which was also called Principal Component Pursuit (PCP). For the PCP problem, Candès proposed an iterative thresholding (IT) \[[@B25-sensors-19-02537]\] algorithm which was simple and convergent, but its convergence rate was slow. Lin et al. \[[@B26-sensors-19-02537]\] proposed an accelerated proximal gradient (APG) algorithm, which was several orders of magnitude faster than the IT algorithm. Ma et al. \[[@B27-sensors-19-02537]\] applied the method of Augmented Lagrange Multipliers (ALM) to solve the PCP problem, which achieved a higher accuracy and required less memory space. For RPCA research, many researchers proposed their own improvements. Sun et al. \[[@B28-sensors-19-02537]\] presented a novel non-convex formulation using the capped trace norm and the capped $\ell_{1}$-norm and presented two algorithms to solve the non-convex optimization. Candès et al. \[[@B29-sensors-19-02537]\] proposed a weighted formulation of $\ell_{1}$-norm minimization, which was designed to penalize nonzero coefficients more equally. Rao et al. \[[@B30-sensors-19-02537]\] proposed a new model for robust sparse and low-rank decompositions by introducing the $\ell_{1/2}$-norm for matrices to induce their lower rank. Oreifej et al. \[[@B31-sensors-19-02537]\] proposed a three-term decomposition for video stabilization and moving-object detection, including the low-rank matrix corresponding to the background, the sparse matrix corresponding to the moving object, and the dense error matrix. Xu et al. \[[@B32-sensors-19-02537]\] proposed an RPCA via outlier pursuit to obtain a robust decomposition when the outliers corrupted entire columns and identified the corrupted columns. Kang et al. \[[@B33-sensors-19-02537]\] proposed a novel non-convex rank approximation function that was tighter than the nuclear norm in PCP. Chiang et al. \[[@B34-sensors-19-02537]\] studied RPCA with a consideration for side information and explored the prior structure and entry features for recovery. For the application of RPCA technology, Wright et al. \[[@B25-sensors-19-02537]\] applied RPCA to remove shadows from face images and to subtract video backgrounds. Additionally, RPCA has been successfully applied to image denosing, face modeling, image alignment, and so on.

Based on these researches, taking into account the mixed noise including outliers and structured noise and exploiting the prior knowledge of singular value, we propose an improved RPCA model by introducing $\ell_{2,1}$-norm and by weighting each singular value which will be presented in [Section 3](#sec3-sensors-19-02537){ref-type="sec"}.

1.2. Motivation and Contribution {#sec1dot2-sensors-19-02537}
--------------------------------

Through the above analysis, we can see that a user may get wrong positioning information when the fingerprint database contains noise and outliers. These problems motivated us to propose a method to remove outliers and to purify the database. We noticed that the RSS data of each adjacent measurement has a high spatial correlation and that RSSs collected at a fixed reference point from an access point at different times also show high temporal correlations. The high correlation performs as a low-rank property in a matrix. Therefore, we construct a merging matrix which merges and arranges all the RSS values collected at different locations and different times and combine it with a low-rank recovery theory to remove noise and outliers. The major contributions of this paper can be listed as follows:We propose a fingerprint database reconstruction framework based on RPCA and present an improved weighted nuclear norm and multi-norm RPCA model, which utilizes the prior knowledge of singular values to enhance the low-rank property and eliminates both the outliers and structured noise in the meantime.We employ the well-known Augmented Lagrangian Multiplier (ALM) method to design a useful algorithm for the proposed model. In the meantime, aimed at the problem of the inability of the fixed direction of the Alternating Direction Method of Multipliers (ADMM) to accomplish convergence, we introduce the Randomly Permuted ADMM method.We analyze various different ways to construct a merging matrix to find the optimal matrix to leverage the hidden structure and redundancy of the collected data. The experiments confirm that our approach achieves the best performance, outperforming the other methods.

1.3. Organization {#sec1dot3-sensors-19-02537}
-----------------

The remainder of this paper is organized as follows. The background knowledge and system model for fingerprint-based localization are introduced in [Section 2](#sec2-sensors-19-02537){ref-type="sec"}. The framework for reducing outliers and noise in fingerprint database and an improved RPCA model for fingerprint database reconstruction are illustrated in [Section 3](#sec3-sensors-19-02537){ref-type="sec"}. In [Section 4](#sec4-sensors-19-02537){ref-type="sec"}, the corresponding optimization algorithm for the improved RPCA model is proposed. Some comparison experiment results are evaluated and discussed in [Section 5](#sec5-sensors-19-02537){ref-type="sec"}. The conclusion is given in [Section 6](#sec6-sensors-19-02537){ref-type="sec"}.

2. Fingerprint-Based Localization System {#sec2-sensors-19-02537}
========================================

A typical Wi-Fi indoor positioning system involves an off-line phase and an online phase. In the off-line phase, the main purpose is to construct a fingerprint database which indicates the correspondence between RSSs and reference points' locations. After collecting real-time RSS in the online phase, the users' locations will be estimated by using some localization algorithms. The system model is shown in [Figure 3](#sensors-19-02537-f003){ref-type="fig"}.

2.1. Off-Line Phase: Fingerprint Database Construction {#sec2dot1-sensors-19-02537}
------------------------------------------------------

In the off-line phase, firstly, the reference points should be carefully selected and recorded with their location coordinates. Then, the collected RSSs at the reference points and the corresponding location coordinates constitute the fingerprint database. Consequently, in the fingerprint database, there are two spaces mapped to each other, which are the position location space and the RSS space. Assuming that there are *n* RPs and *m* APs and that $\mathbf{L} \in \mathbb{R}{}^{n \times 2}$ contains location coordinates of reference points,$$\mathbf{L} = \left\lbrack \left( x_{1},y_{1} \right),\left( x_{2},y_{2} \right),\cdots,\left( x_{n},y_{n} \right) \right\rbrack^{T}$$ where $\left\lbrack \cdot \right\rbrack^{T}$ represents the matrix transpose and $x,y$ represent the *x* coordinate and the *y* coordinate of the reference points, respectively.

Let $\mathsf{\Psi} \in \mathbb{R}{}^{m \times n}$ be the RSSs collected at the reference points:$$\mathsf{\Psi} = \begin{bmatrix}
\psi_{11} & \psi_{12} & \cdots & \psi_{1n} \\
\psi_{21} & \psi_{22} & \cdots & \psi_{2n} \\
 \vdots & \vdots & \vdots & \vdots \\
\psi_{m1} & \psi_{m2} & \cdots & \psi_{mn} \\
\end{bmatrix}$$ where $\psi_{ij}$ represents the RSS collected at the *i*th reference point from the *j*th AP. Then, the fingerprint database is expressed as follows:$${{Fingerprint}{Database}} = \left\lbrack \mathbf{L},\mathsf{\Psi} \right\rbrack$$

In fact, in the practical application scenario, it is inevitable to mix nonstationary noise with the RSS space during the period of fingerprint database constructing, due to human walking, terminal diversity, indoor channel environment change, and other factors. Thus, its vital to have a preprocessing part to keep the RSS space away from the noise and outliers after constructing the fingerprint database.

2.2. Online Phase: Localization Algorithm Design {#sec2dot2-sensors-19-02537}
------------------------------------------------

In the online phase, the user terminal receives RSS information $\hat{\psi} \in \mathbb{R}{}^{m \times 1}$ at a real-time location and matches it with the RSS space $\mathsf{\Psi}$ in the fingerprint database to estimate the user's location from the known reference points' locations $\mathbf{L}$. There are many proposed localization algorithms like Weighted KNN (WKNN), SVM, and Bayesian estimation. WKNN is a popular algorithm which is improved from KNN technology due to its computation simplicity and high estimation accuracy. The estimation of the WKNN algorithm is based on the Euclidean distance:$$d_{j} = {\parallel {\psi_{j} - \hat{\psi}} \parallel}_{2}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\forall j = 1,\cdots,m$$ where ${\parallel \cdot \parallel}_{2}$ is the $\ell_{2}$-norm operator, $d_{j}$ is the Euclidean distance, and $\psi_{j}$ is the column of $\mathsf{\Psi}$.

In the WKNN algorithm, the distance values are given weight:$$w_{j} = 1/\left( d_{j} + \delta \right)$$ where $\delta$ is a small positive number introduced in order to control the denominator as not being zero and $\delta = 0.001$ in this paper and where *j* is the index of the reference points obeying $1 \leq j \leq m$.

Then, choose $k\left( k > 1 \right)$ reference points which have the shortest Euclidean $d_{j}$ as the candidate positions, and the user's position is estimated by averaging all *k* candidate positions as follows:$$\left( \hat{x},\hat{y} \right) = \frac{\sum\limits_{j = 1}^{k}{w_{j}\left( x_{j},y_{j} \right)}}{\sum\limits_{j = 1}^{k}w_{j}}$$

In conclusion, we could see that the fingerprint database plays a crucial role in the fingerprint-based indoor localization system. If the RSS space $\mathsf{\Psi}$ is not accurate or faults are in the database, the estimated position results would definitely be poor. Therefore, we need a precise fingerprint database to provide a better position estimation.

3. Proposed Fingerprint Database Reconstruction Framework {#sec3-sensors-19-02537}
=========================================================

Based on the system model in [Section 2](#sec2-sensors-19-02537){ref-type="sec"}, the fingerprint database could be disturbed by outliers. In view of this problem, exploiting the low-rank property of the fingerprint database, we propose a fingerprint database reconstruction framework based on RPCA. Additionally, taking into account the physical meaning of a singular value and the mixed noise situation including outliers and structured noises, we propose an improve RPCA model by weighting nuclear norm and by joining the $\ell_{2,1}$-norm.

3.1. The Low-Rank Property Analysis of the Fingerprint Database {#sec3dot1-sensors-19-02537}
---------------------------------------------------------------

### 3.1.1. The Spatial Correlation of RSS Data {#sec3dot1dot1-sensors-19-02537}

Before solving these problems, we notice that the RSS data has high spatial and temporal correlations. Suppose a fingerprint database $\mathsf{\Psi}$ is made up of an RSS vector $\varphi_{i}$ received at an *i*th reference point, that is, $\mathsf{\Psi} = \left\lbrack \varphi_{1},\varphi_{2},\cdots,\varphi_{n} \right\rbrack$. As we know, signal strength measurement relies on the characteristic of the signal propagation. Due to path loss, the signal strength attenuates depending on the distance that the signal travelled. Therefore, the reference points $i,j$ in proximity to one another which have similar distances should have similar RSS feature vectors $\varphi_{i},\varphi_{j}$, which means that the degrees of freedom of the fingerprint database are much lower than the dimensions. The limited degrees of freedom in a matrix shows the spatial correlation of the fingerprint database and exhibits a low-rank property.

To prove the spatial correlation, we construct an example of the fingerprint database $\mathsf{\Psi}$ by a logarithmic path loss model. By setting 16 APs and 49 RPs, we can get a fingerprint database $\mathsf{\Psi} \in \mathbb{R}^{16 \times 49}$. Using SVD decomposition technology, the normalized singular value is shown in [Figure 4](#sensors-19-02537-f004){ref-type="fig"}. As we can see, the first singular $\sigma_{1}$ occupies the vast majority of energy and the rest of the singular values $\left( \sigma_{2},\cdots,\sigma_{16} \right)$ approach zero. As the rank of the matrix is equal to the number of the singular values, we can see the spatial correlation and low-rank property of the fingerprint database.

### 3.1.2. The Temporal Correlation of RSS Data {#sec3dot1dot2-sensors-19-02537}

Except the spatial correlation in the fingerprint database, RSS values collected from an AP at a fixed location at different times are similar, which reveals the temporal correlation of RSS. Existing work \[[@B35-sensors-19-02537]\] has proved the temporal correlation of RSS. It identified that the RSS values from an AP at a fixed position are highly autocorrelated and shows that the autocorrelation of consecutive samples is as high as 0.9. This high autocorrelation exhibits that, over a short period of time, the signal strength received from an access point at a particular location is relatively stable.

Suppose that $\mathsf{\Psi}_{w}$ is the fingerprint database constructed in the *w*th time measurement. Based on the temporal correlation of the RSS data, the fingerprint database $\mathsf{\Psi}_{1},\mathsf{\Psi}_{2},\cdots,\mathsf{\Psi}_{W}$ constructed at the first, second, and *W*th times are correlated. By merging the fingerprint database constructed at different times into a matrix, the temporal correlation will generate a redundancy in the matrix and the matrix will exhibit a low-rank property eventually.

Therefore, exploiting the spatial correlation and temporal correlation of the fingerprint database constructed at different time measurements, we can form a merging matrix $\mathbf{D}$ by merging and arranging all the RSS values collected from *M* APs at *N* different locations at *W* different times. The spatial and temporal correlations of fingerprints result in a low rank of the merging matrix. Let $\mathbf{D}$ be the merging matrix of fingerprints with dimensions $\mathsf{\Psi} \in \mathbb{R}^{W \cdot M \times N}$:$$\mathbf{D} = \left\lbrack \mathsf{\Psi}_{1};\mathsf{\Psi}_{2};\cdots;\mathsf{\Psi}_{W} \right\rbrack$$ where $\mathsf{\Psi}_{w}$ represents the fingerprint database constructed in the *w*th ($w = 1,2,\cdots,W$) time as the sub-matrix and $\mathsf{\Psi}_{w}\left( m,n \right)$ is the RSS collected from the *m* th ($m = 1,2,\cdots M$) AP at the *n*th ($n = 1,2,\cdots N$) location. The merging matrix will be the low-rank matrix in the subsequent RPCA processing.

3.2. Strategy on Organizing the Matrix {#sec3dot2-sensors-19-02537}
--------------------------------------

In the previous subsection, the size of the merging matrix is $W \cdot M \times N$, where $W,M,N$ refer to the collecting times, the amount of APs, and the number of RPs, repectively, and we set them to 9, 36, and 5, respectively. However, this is not the only way to construct the merging matrix. Different structures of a matrix make different contributions to its inner correlations, which will further influence the effectiveness of RPCA. Hence, it is necessary to find a suitable matrix that can be recovered most effectively.

We list all possible combinations of matrices in [Table 1](#sensors-19-02537-t001){ref-type="table"} and give a new meaning to each matrix. The value of *W* represents the number of block matrix, and the sign of *W* indicates the orientation of the block matrix, where "+" represents the block matrix arrayed in rows and "−" represents the block matrix arrayed in columns. $M,N$ represent the number of rows and columns of the matrix. For instance, if $W \cdot M \times N$ is $+ 5 \cdot 36 \times 9$, then $\mathbf{X} = \left\lbrack \mathsf{\Psi}_{1},\mathsf{\Psi}_{2},\cdots,\mathsf{\Psi}_{5} \right\rbrack$, where $\mathsf{\Psi}_{i}$ is a $36 \times 9$ block matrix.

[Figure 5](#sensors-19-02537-f005){ref-type="fig"} shows the performance with different sizes of merging matrix in a matrix reconstruction error, where the *x*-axis represents the percentage of outliers and the *y*-axis represents the matrix reconstruction error. As we can see, the matrix performance in different structures shows great differences; thus, it is vital to select the final size of the merging matrix. Through the analysis of [Figure 5](#sensors-19-02537-f005){ref-type="fig"}, we choose the matrix with size of $45 \times 36$ in the following simulation experiments.

3.3. Fingerprint Database Reconstruction Based on RPCA {#sec3dot3-sensors-19-02537}
------------------------------------------------------

In this section, we exploit the low-rank property of the merging matrix to fix the outlier problem hidden in the fingerprint database and establish corresponding mathematical models. Notice that Candès presented a framework called RPCA to solve the following decomposed problem: Suppose there is a data matrix $\mathbf{D}$, which is the sum of the low-rank matrix $\mathbf{A}$ and the sparse matrix $\mathbf{E}$; how can we decompose the low-rank and sparse components accurately and efficiently?

Wright et al. \[[@B36-sensors-19-02537]\] have proved that, when $\mathbf{D} \in \mathbb{R}^{n_{1} \times n_{2}}$, $n = \max\left( n_{1},n_{2} \right)$ and $m = \min\left( n_{1},n_{2} \right)$, the decomposition succeeds with a probability at least $1 - cn^{- 10}$, provided that $$rank\left( \mathbf{A} \right) \leq \rho_{r}m\mu^{- 1}\left( \log n \right)^{- 2}\mspace{180mu}\mspace{180mu}\mspace{180mu}{and}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu} x \leq \rho_{s}n_{1}n_{2}$$ where $\mu$, $\rho_{r}$, *c*, and $\rho_{s}$ are positive numerical constants; *x* is the number of corrupted entries; and $\lambda = 1/\sqrt{n}$.

The merging matrix constructed by RSS has a low-rank property which is demonstrated in the previous subsection. Therefore, based on the low-rank recover theory, we can remove the noise and outliers contained in the fingerprint database. Assuming that the merging matrix $\mathbf{D}$ contains noise and outliers, matrix $\mathbf{A}$ is the precise matrix after denosing that we need online positioning and matrix $\mathbf{E}$ is the sparse matrix which represents the noise and outliers. Thus, the mathematical optimization model for separating outliers from the fingerprint database can be built as follows:$$\begin{array}{ll}
\min & {\left. {{rank}(}\mathbf{A} \right) + \lambda{\parallel \mathbf{E} \parallel}_{o}} \\
{s.t.} & {\mathbf{D} = \mathbf{A} + \mathbf{E}} \\
\end{array}$$ where the constraint ${\parallel \cdot \parallel}_{o}$ represents the number that is the nonzero element in the matrix, forcing *E* to be sparse, and the parameter $\lambda > 0$ controls the trade-off between two terms.

However, the problem in Equation ([9](#FD9-sensors-19-02537){ref-type="disp-formula"}) is generally an NP-hard problem. Thus, Candès transformed it into a convex optimization problem by relaxing the non-convex rank function as a nuclear norm ${\parallel \cdot \parallel}_{*}$ and by relaxing ${\parallel \cdot \parallel}_{0}$ as ${\parallel \cdot \parallel}_{1}$. The transformed problem is formulated as follows:$$\begin{array}{l}
{\min\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}{\parallel \mathbf{A} \parallel}_{*} + \lambda{\parallel \mathbf{E} \parallel}_{1}} \\
{s.t.\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mathbf{D} = \mathbf{A} + \mathbf{E}} \\
\end{array}$$ where ${\parallel \mathbf{A} \parallel}_{*}$ denotes the nuclear norm of the matrix $\mathbf{A}$, that is, the sum of the singular value $\sigma_{i}\left( \mathbf{A} \right)$ and ${\parallel \mathbf{E} \parallel}_{1}$ denotes the $\ell_{1}$-norm of the matrix $\mathbf{E}$.

By solving this optimization problem, we can recover the accurate fingerprint database $\mathbf{A}$ with no noise and outliers from the original noisy fingerprint database $\mathbf{D}$.

3.4. An Improved RPCA Optimization Model {#sec3dot4-sensors-19-02537}
----------------------------------------

In this section, we propose an improved RPCA model by taking into account the mixed noise including outliers and structured noise and by exploiting the prior knowledge of a singular value to propose an improved RPCA model.

### 3.4.1. Join $\ell_{2,1}$-Norm as Structured Noise {#sec3dot4dot1-sensors-19-02537}

In practical applications, the fingerprint database may contain structured noise, which represents that a few columns or rows in the matrix are completely corrupted when some situations occur; for instance, APs blocked by obstacles or an AP hardware malfunction such as a low battery will result in an unstable transmitted power.

Noticing that structured noise is not taken into account in the standard RPCA model \[[@B25-sensors-19-02537]\], we introduce a new matrix $\mathbf{G}$ to represent the structure noise. By using $\ell_{2,1}$-norm to capture the corruption structure, the improved RPCA mathematical model is constructed as follows:$$\begin{array}{l}
{\min\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}{\parallel \mathbf{A} \parallel}_{*} + \lambda{\parallel \mathbf{E} \parallel}_{1} + \gamma{\parallel \mathbf{G} \parallel}_{2,1}} \\
{s.t.\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mathbf{D} = \mathbf{A} + \mathbf{E} + \mathbf{G}} \\
\end{array}$$ where the ${\parallel \mathbf{G} \parallel}_{2,1}$ denotes the $\ell_{2,1}$-norm, that is, ${\parallel \mathbf{G} \parallel}_{2,1} = \sum_{i}\left( \sum_{j}\mathbf{G}_{ij}^{2} \right)^{\frac{1}{2}}$, the $i,j$ denotes the index of the rows and columns, and the parameter $\gamma$ represents the trade-off between the matrix decomposed.

### 3.4.2. Weighted Nuclear Norm {#sec3dot4dot2-sensors-19-02537}

Furthermore, notice that the nuclear norm ${\parallel \cdot \parallel}_{*}$, which is the sum of the singular values $\sigma_{i}$, treats each singular value equally. As a result, the soft thresholding operator shrinks each singular value with the identical value. However, it ignores the prior knowledge that the large singular values occupy the principal components of the matrix, which should be shrunk less, while the small singular values may contain noise or redundant components, which should be shrunk larger.

Therefore, we take different weights for each singular values to improve the flexibility of the nuclear norm and construct a new optimization model as follows:$$\begin{array}{l}
{\min\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}{\parallel \mathbf{A} \parallel}_{\mathbf{w},*} + \lambda{\parallel \mathbf{E} \parallel}_{1} + \gamma{\parallel \mathbf{G} \parallel}_{2,1}} \\
{s.t.\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu} D = \mathbf{A} + \mathbf{E} + \mathbf{G}} \\
\end{array}$$ where ${\parallel \mathbf{A} \parallel}_{\mathbf{w},*}$ denotes the weighted nuclear norm, that is, ${\parallel \mathbf{X} \parallel}_{\mathbf{w},*} = \sum_{i}\left| {w_{i}\sigma_{i}\left( \mathbf{X} \right)} \right|$ and $\mathbf{w} = \left\lbrack w_{1},\cdots,w_{n} \right\rbrack$, where $w_{i} > 0$ is a nonnegative weight assigned to $\sigma_{i}\left( \mathbf{X} \right)$.

In this way, we construct the improved RPCA model as Equation ([12](#FD12-sensors-19-02537){ref-type="disp-formula"}). By solving this optimization problem, we can decompose the matrix $\mathbf{E}$ which represents outliers and matrix $\mathbf{G}$ which represents structured noise from the measurement matrix $\mathbf{D}$ and get the low-rank matrix $\mathbf{A}$ as the accurate fingerprint database. Additionally, we design an efficient algorithm for the improved RPCA model using the well-known ALM method and will illustrate it in detail in the next section.

4. Algorithm Derivation {#sec4-sensors-19-02537}
=======================

In this section, the ALM method is adopted to solve the proposed model, which solves the constrained optimization by transforming it into an unconstrained optimization problem. To solve the proposed optimization problem by using ALM, we have use the preliminary definitions and theorems as follows:

4.1. Preliminary Definition {#sec4dot1-sensors-19-02537}
---------------------------

### 4.1.1. Definition 1 {#sec4dot1dot1-sensors-19-02537}

Shrinkage Operator: For any $\tau > 0$ and $\mathbf{X} \in \mathbb{R}^{m \times n}$, the shrinkage operator $S_{\tau}\left( \mathbf{X} \right)$ is defined as $$S_{\tau}\left( \mathbf{X}_{ij} \right) = \left\{ \begin{array}{l}
{\mathbf{X}_{ij} - \tau\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu} x > \tau} \\
{\mathbf{X}_{ij} + \tau\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu} x < - \tau} \\
{0\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu} otherwise} \\
\end{array} \right.$$

### 4.1.2. Definition 2 {#sec4dot1dot2-sensors-19-02537}

Soft-thresholding Operator: For any $\tau > 0$ and $\mathbf{X} \in \mathbb{R}^{m \times n}$ with a Singular Value Decomposition $\mathbf{X} = U\sum V^{T}$, the soft-thresholding operator is $$D_{\tau}\left( \mathbf{X} \right) = US_{\tau}\left( \sum \right)V^{T}$$

### 4.1.3. Theorem 1 {#sec4dot1dot3-sensors-19-02537}

For any $\tau > 0$ and $\mathbf{X} \in \mathbb{R}^{m \times n}$, the Shrinkage Operator is the optimal solution of the function as $$S_{\tau}\left( \mathbf{X} \right) = \arg\min\limits_{\mathbf{X}}\left\{ \frac{1}{2}{\parallel {\mathbf{X} - \mathbf{Y}} \parallel}_{F}^{2} + \tau{\parallel \mathbf{X} \parallel}_{1} \right\}$$

### 4.1.4. Theorem 2 {#sec4dot1dot4-sensors-19-02537}

For any $\tau > 0$ and $\mathbf{X} \in \mathbb{R}^{m \times n}$, the Soft-thresholding Operator is the optimal solution of the function as $$D_{\tau}\left( \mathbf{X} \right) = \arg\min\limits_{\mathbf{X}}\left\{ \frac{1}{2}{\parallel {\mathbf{X} - \mathbf{Y}} \parallel}_{F}^{2} + \tau{\parallel \mathbf{X} \parallel}_{*} \right\}$$

### 4.1.5. Theorem 3 {#sec4dot1dot5-sensors-19-02537}

For any $\tau > 0$ and $\mathbf{X} \in \mathbb{R}^{m \times n}$, the $\hat{X}$ is the optimal solution of the function of$$\min\frac{1}{2}{\parallel {\mathbf{X} - \mathbf{Y}} \parallel}_{F}^{2} + \eta{\parallel \mathbf{X} \parallel}_{2,1}$$ and the *i*th row of $\hat{\mathbf{X}}$ is $$\hat{\mathbf{X}}\left( i,: \right) = J_{\eta}\left( \mathbf{X} \right) = \left\{ \begin{array}{l}
{\frac{{\parallel \mathbf{Y}_{i} \parallel}_{2} - \eta}{{\parallel \mathbf{Y}_{i} \parallel}_{2}}\mathbf{Y}_{i},\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu} if{\parallel \mathbf{Y}_{i} \parallel}_{2} > \eta\mspace{180mu}} \\
{0,\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu}\mspace{180mu} otherwise\mspace{180mu}} \\
\end{array} \right.$$

4.2. Transform to Unconstrained Problem by ALM {#sec4dot2-sensors-19-02537}
----------------------------------------------

To solve the optimization problem, we firstly convert the constrained optimization problem into an unconstrained optimization problem by introducing a Lagrangian multiplier $\mathbf{Y}$ and a quadratic penalty term and then formulate the augmented Lagrange function as follows:$$\begin{array}{r}
\begin{array}{l}
{L\left( \mathbf{A},\mathbf{E},\mathbf{Y},\mu \right) = {\parallel \mathbf{A} \parallel}_{*} + \lambda{\parallel \mathbf{E} \parallel}_{1} + \gamma{\parallel \mathbf{G} \parallel}_{2,1} + < \mathbf{Y},\mathbf{D} - \mathbf{A} - \mathbf{E} - \mathbf{G} > + \frac{\mu}{2}{\parallel {\mathbf{D} - \mathbf{A} - \mathbf{E} - \mathbf{G}} \parallel}_{F}^{2}} \\
\end{array} \\
\end{array}$$ where the operator $< \cdot >$ represents the inner product of two matrices, ${\parallel \cdot \parallel}_{F}$ is the Frobenius norm which represents tolerable errors, matrix $\mathbf{Y}$ is the Lagrange multiplier matrix, and $\mu > 0$ is the tunable parameter.

4.3. Iteration Steps {#sec4dot3-sensors-19-02537}
--------------------

After the transformation into an unconstrained problem, the Alternating Direction Method of Multipliers is adopted to solve the proposed Lagrangian function of Equation ([19](#FD19-sensors-19-02537){ref-type="disp-formula"}). However, the fixed-direction alternating iteration cannot achieve convergence efficiently; thus, we utilize the randomly permuted ADMM, which randomly selects the direction of iterations for each variable in each iteration step. By regarding the other variable as a constant term in each iteration, we have the following iterative steps:

Step 1: update $\mathbf{A}$ $$\begin{array}{cl}
\mathbf{A}_{k + 1} & {= \arg\min\limits_{\mathbf{A}}L\left( \mathbf{A},\mathbf{E}_{k},\mathbf{G}_{k},\mathbf{Y}_{k},\mu_{k} \right)} \\
 & {= \arg\min\limits_{\mathbf{A}}{\parallel \mathbf{A} \parallel}_{*} + \frac{\mu}{2}{\parallel {\mathbf{D} - \mathbf{A} - \mathbf{E} - \mathbf{G} + \mu^{- 1}\mathbf{Y}} \parallel}_{F}^{2}} \\
 & {= D_{w/\mu}\left( \mathbf{D} - \mathbf{E}_{k} - \mathbf{G}_{k} + \mu^{- 1}\mathbf{Y} \right)} \\
\end{array}$$

Step 2: update $\mathbf{E}$ $$\begin{array}{cl}
\mathbf{E}_{k + 1} & {= \arg\min\limits_{\mathbf{E}}L\left( \mathbf{A}_{k + 1},\mathbf{E},\mathbf{G}_{k},\mathbf{Y}_{k},\mu_{k} \right)} \\
 & {= \arg\min\limits_{\mathbf{E}}\lambda{\parallel \mathbf{E} \parallel}_{1} + \frac{\mu}{2}{\parallel {\mathbf{D} - \mathbf{A} - \mathbf{E} - \mathbf{G} + \mu^{- 1}\mathbf{Y}} \parallel}_{F}^{2}} \\
 & {= S_{\lambda/\mu}\left( \mathbf{D} - \mathbf{A}_{k + 1} - \mathbf{G}_{k} + \mu^{- 1}\mathbf{Y} \right)} \\
\end{array}$$

Step 3: update $\mathbf{G}$ $$\begin{array}{cl}
\mathbf{G}_{k + 1} & {= \arg\min\limits_{\mathbf{E}}L\left( \mathbf{A}_{k + 1},\mathbf{E}_{k + 1},\mathbf{G},\mathbf{Y}_{k},\mu_{k} \right)} \\
 & {= \arg\min\limits_{\mathbf{E}}\eta{\parallel \mathbf{G} \parallel}_{2,1} + \frac{\mu}{2}{\parallel {\mathbf{D} - \mathbf{A} - \mathbf{E} - \mathbf{G} + \mu^{- 1}\mathbf{Y}} \parallel}_{F}^{2}} \\
 & {= J_{\eta/\mu}\left( \mathbf{D} - \mathbf{A}_{k + 1} - \mathbf{E}_{k + 1} + \mu^{- 1}\mathbf{Y} \right)} \\
\end{array}$$

Step 4: update $\mathbf{Y}$ $$\mathbf{Y}_{k + 1} = \mathbf{Y}_{k} + \mu_{k}\left( \mathbf{D} - \mathbf{A}_{k + 1} - \mathbf{E}_{k + 1} - \mathbf{G}_{k + 1} \right)$$

Then, update the parameter $\mu_{k + 1} = \rho\mu_{k}$ in order to accelerate the iteration. The iteration stops until it satisfies the criterion ${\parallel {\mathbf{D} - \mathbf{A}_{k + 1} - \mathbf{E}_{k + 1} - \mathbf{G}_{k + 1}} \parallel}_{F}/{\parallel \mathbf{D} \parallel}_{F} < \varepsilon$, where the $\rho$ and $\varepsilon$ are nonnegative constants. Following the above steps, the whole optimization procedure for the improved RPCA model is summarized in Algorithm 1.

Algorithm 1

Proposed Weighted Nuclear Norm and Multi-Norm RPCA Algorithm

Input:

merging matrix

D

, tolerance

ε

, Maximum Convergence Number

Ω

, parameters

λ

,

η

Output:

low rank matrix

A

, sparse matrix

E

, structure matrix

G

, number of iterations

τ

.

1.  Initialize parameter $\rho$,$\mu$, $\mathbf{A} = 0$, $\mathbf{E} = 0$, $\mathbf{G} = 0$, $\mathbf{Y}$.

2.  **while** not converged **do**

3.   Randomly choose direction to iterate *A*, *E* and *G*;

4.   When solve $\mathbf{A}_{k + 1} = \arg\min\limits_{\mathbf{A}}L\left( \mathbf{A},\mathbf{E}_{k},\mathbf{Y}_{k},\mu_{k} \right)$:;

5.   $\left( \mathbf{U},\mathbf{S},\mathbf{V} \right) = svd\left( \mathbf{D} - \mathbf{E}_{k} + {\mu_{k}}^{- 1}\mathbf{Y}_{k} \right)$.;

6.   $\mathbf{A}_{k + 1} = US_{w/\mu}\left( \mathbf{S} \right)\mathbf{V}^{T}$;

7.   When solve $\mathbf{E}_{k + 1} = \arg\min\limits_{\mathbf{E}}L\left( \mathbf{A}_{k + 1},\mathbf{E},\mathbf{Y}_{k},\mu_{k} \right)$:

8.   $\mathbf{E}_{k + 1} = S_{\lambda/\mu}\left( \mathbf{D} - \mathbf{A} + {1/\mu}\mathbf{Y} \right)$;

9.   When solve $\mathbf{G}_{k + 1} = \arg\min\limits_{\mathbf{E}}L\left( \mathbf{A}_{k + 1},\mathbf{E}_{k + 1},\mathbf{G},\mathbf{Y}_{k},\mu_{k} \right)$:

10.  $\mathbf{G}_{k + 1} = {}_{\eta/\mu}\left( \mathbf{D} - \mathbf{A}_{k + 1} - \mathbf{E}_{k + 1} + \mu^{- 1}\mathbf{Y} \right)$;

11.  Update $\mathbf{Y}_{k + 1} = \mathbf{Y}_{k} + \mu_{k}\left( \mathbf{D} - \mathbf{A}_{k + 1} - \mathbf{E}_{k + 1} \right)$;

12.  Update $\mu_{k}$ to $\mu_{k + 1}$;

13.  $\left. k\rightarrow k + 1 \right.$.

14. **end while**

15. **return** $A_{k},E_{k},G_{k}$

5. Numerical Experiments {#sec5-sensors-19-02537}
========================

To evaluate the proposed method, we implement the fingerprint database reconstruction experiments on both simulated and real data. The performance can be evaluated by the following three indicators: the average positioning error, matrix reconstructed error, and structured noise recognition accuracy. The average positioning error is defined as $$localization\_ error = \sqrt{\left( \overset{\land}{p}\left( x \right) - p\left( x \right) \right)^{2} + \left( \overset{\land}{p}\left( y \right) - p\left( y \right) \right)^{2}}$$ where $\overset{\land}{p}\left( x \right)$ and $\overset{\land}{p}\left( y \right)$ represent the *x* and *y* coordinates of the estimated position and where $p\left( x \right)$ and $p\left( y \right)$ represent the *x* and *y* coordinates of real position.

The matrix reconstructed error is defined as $$matrix\_ error = \frac{{\parallel {\hat{\mathbf{X}} - \mathbf{X}} \parallel}_{F}}{{\parallel \mathbf{X} \parallel}_{F}}$$ where the ${\parallel \cdot \parallel}_{F}$ denotes the Frobenius norm, $\mathbf{X}$ is an ideal matrix without noise, and $\hat{\mathbf{X}}$ is the reconstructed matrix.

The structured noise rows recognition accuracy is defined as$$r = 2 \cdot \frac{r_{{}_{1}} \cdot r_{2}}{r_{1} + r_{2}},r_{1} = \frac{r_{true}}{r_{all}},r_{2} = \frac{r_{true}}{r_{act}}$$ where $r_{true}$ and $r_{all}$ denote the number of structured noise recognized by the proposed algorithm and the number of the true structured noise among them, respectively, and $r_{act}$ is the actual number of rows of structured noise.

5.1. Simulation Experiments {#sec5dot1-sensors-19-02537}
---------------------------

To simulate the RSS in indoor localization and to test the performance of each algorithm, we use the ray-tracing method to simulate the signal attenuation. The simulation field is $20 \times 20 \times 4$ m, which contains 9 APs and 36 RPs. They contain seven ray paths, including the direct path, the reflection paths of the four walls, the ground, and the ceiling in an indoor environment. The electric intensity of each path is generated as follows:$$E_{i} = R_{i} \cdot \frac{\lambda}{4\pi d_{i}},i = \left( 1,2,\cdots,7 \right)$$ where $\lambda$ is the wavelength of electromagnetic wave, $d_{i}$ is the travel distance of the *i*th path, and $R_{i}$ is the reflection coefficient. The dielectric constant are set to $5 + 0.1j$ for walls and $6 - 1.2j$ for the ground and the ceiling.

The received signal strength in each reference point could be calculated as follows:$$P_{r} = P_{t} + 2G_{l} + 20\log_{10}\left( \left| {\sum\limits_{i = 1}^{7}E_{i}} \right| \right)$$ where $P_{t}$ is the transmitted power which we set to 15 dbm and $G_{l}$ is the Antenna gain which we set to 2.15 dbm.

After preprocessing the fingerprint database in the off-line training phase, we apply the WKNN technology to the online positioning phase for a better presentation of performance. In the online positioning phase, we randomly select 1000 test points in the simulation field as users to test the localization performance.

Three categories of contrast experiments are designed to evaluate the performance under different noise conditions, i.e., the outlier, structured noise, and mixed noise including outliers and structured noise. The proposed algorithm is compared with four methods, i.e., IALM (Inexact Augmented Lagrange Multipliers) algorithm, which is the best algorithm for the traditional RPCA model so far; the $DB\left( pct,d \right)$ method, which is a classical distance-based outlier detection algorithm; and the KNN method, which detects outliers based on the neighbors' distances and the Hampel filter method. Taking into account the randomness of the size and location of the noise, all the results of the experiment are the average of 500 independent repetitive experiments. In the meantime, considering the randomness of noise, we have done simulation experiments in different percentages and values of noise. Three contrast experiments are listed as follows:WONS: with outlier noise, no structured noise.NOWS: no outlier noise, with structured noise.WOWS: with outlier noise, with structured noise.

### 5.1.1. Experiment Results under WONS {#sec5dot1dot1-sensors-19-02537}

Experiments in this set assume that the fingerprint database is contaminated by outliers, which is generated randomly in different ranges, added at random positions, and obeys uniform distribution and that gain or loss are also randomly generated. To test the five methods, we use the Kruskal--Wallis test by setting an $\alpha$ level equal to 0.05 with a sample size of $n_{i} = 20\mspace{600mu}\left( i = 1,2,3,4,5 \right)$. We establish a null hypothesis $H0$---the five methods do not have significant differences in the mean localization error---and the alternative hypothesis $H1$---the five methods have differences for the same percentage of outliers which is set to $5\%$. By calculating the revised statistics $H_{c} = 73.532$, which is greater than the critical value 9.488 when the degree of freedom $v = 4$ and the significance value $\alpha = 0.05$, so $H0$ is rejected and $H1$ is accepted. Therefore, we can conclude that the five processing methods are statistically different.

As we can see in [Figure 6](#sensors-19-02537-f006){ref-type="fig"}a, where the *x*-axis represents the percentage of outliers added in the merging matrix and the *y*-axis represents the average localization error, while outliers are generated randomly ranging from 50 to 100, the RPCA-based methods perform better than the outlier detection method when the percentage of outliers is more than $10\%$. Additionally, the KNN and Hampel methods have poor performances when the percentage of outliers is small, and the proposed algorithm has the best performance in localization error in all cases. [Figure 6](#sensors-19-02537-f006){ref-type="fig"}b shows the matrix reconstruction error in different percentage of outliers. $DB\left( pct,d \right)$ has the best performance when the percentage of outliers is zero, which shows that this method can distinguish outliers and normal points accurately, but the RPCA-based method has a better performance than $DB\left( pct,d \right)$ when the percentage of outliers is more than $10\%$. Additionally, the proposed algorithm has the best performance in matrix reconstruction error compared with others when the percentage of outliers is more than $5\%$.

[Figure 7](#sensors-19-02537-f007){ref-type="fig"} shows the mean localization error of the five methods when the value of outliers changes, which means that the outliers are generated randomly, ranging from the value to double the value; for instance, if the value of outliers is 10, the outliers are generated randomly, ranging from 10 to 20, and the percentage of outliers is set to $10\%$. We can see that the localization error changes slightly when the value of outliers changes for the RPCA-based method while the outlier detection method cannot handle the outliers well when the value of outliers is small and that the proposed algorithm has the lowest localization error compared with the other methods in all cases.

### 5.1.2. Experiment Results under NOWS {#sec5dot1dot2-sensors-19-02537}

Experiments in this section assume that the fingerprint database is affected by the structured noise which is added in random rows. Each element value of structured noise is generated randomly from $- 15$ to 15. We apply the Kruskal--Wallis test to the five methods by setting an $\alpha$ level equal to 0.05 with a sample size of $n_{i} = 20\mspace{600mu}\left( i = 1,2,3,4,5 \right)$ and establish a null hypothesis $H0$---the median of the localization error after the five methods' processing do not have significant differences---and the alternative hypothesis $H1$---the five methods are not exactly the same for the same percentage of structured noise, which is set to $10\%$---by calculating the revised statistics $H_{c} = 84.835$, which is greater than the critical value 9.488 when the degree of freedom $v = 4$ and the significance value $\alpha = 0.05$. Therefore, $H0$ is rejected and $H1$ is accepted, and we can conclude that there are differences between the five methods in a statistical sense.

[Figure 8](#sensors-19-02537-f008){ref-type="fig"}a illustrates the five methods' performances in localization error, where the *x*-axis represents the percentage of structured noise rows and the *y*-axis represents the mean localization error. We can see that the performance of the proposed algorithm and IALM preform better than the outlier detection method in all cases and that the proposed algorithm has the best performance and the lowest localization error compared with the other methods. The matrix reconstruction error in a different percentage of structured noise is shown in [Figure 8](#sensors-19-02537-f008){ref-type="fig"}b. As we can see, the RPCA-based method has the lowest matrix reconstruction error and $DB\left( pct,d \right)$ has a good performance when the percentage of structured noise is small, while the KNN and Hampel methods cannot handle the structured noise'well.

[Figure 9](#sensors-19-02537-f009){ref-type="fig"}a shows the localization error of the five methods for different values of structured noise when the percentage of structured noise is set to $10\%$. The value *p* of structured noise means that each element of structured noise is generated randomly form the $- p$ to *p*, for instance, the value of the structured noise generated randomly from $- 5$ to 5 when the value is 5. As we can see, the KNN and Hampel methods have poor performances under NOWS while the proposed algorithm has the best performance compared with the other methods in all cases.

Furthermore, we can find that our algorithm is competent in recognizing the structural noise positions, i.e., the out algorithm can estimate the node of AP which was broken down and unable to provide effective information. The recognition accuracy performance is showed in [Figure 9](#sensors-19-02537-f009){ref-type="fig"}b, where the *x*-axis represents the percentage of structured noise and the *y*-axis represents the accuracy of detecting structured noise. We can see that the accuracy to find the right position of the structured noise has a probability of $100\%$ when the percentage of structured noise is $10\%$ and also has more than a $94\%$ accuracy in the other cases. According to this characteristic, we can eliminate the failure AP which provides wrong information in an online localization.

### 5.1.3. Experiment Results under WOWS {#sec5dot1dot3-sensors-19-02537}

Experiments in this part assume that the fingerprint database is contaminated by the mixed noise including outlier noise and structured noise. Outliers generated randomly in different ranges obey uniform distribution, and structured noise is generated randomly from $- 15$ to 15. We apply the Kruskal--Wallis test to the five methods by setting an $\alpha$ level equal to 0.05 with a sample size of $n_{i} = 20\mspace{600mu}\left( i = 1,2,3,4,5 \right)$. We establish a null hypothesis $H0$---the mean localization error after three methods' processing do not have significant differences---and the alternative hypothesis $H1$---the three methods have differences in localization error for the same percentage of mixed noise including $5\%$ outliers and $10\%$ structured noise. We calculate the statistics $H_{c} = 80.538$, which is greater than the critical value 9.488 when the degree of freedom $v = 4$ and the significance value $\alpha = 0.05$, so $H0$ is rejected and $H1$ is accepted. Thus, we can conclude that there are differences between the five processing methods.

[Figure 10](#sensors-19-02537-f010){ref-type="fig"}a shows the localization performance under different percentages of outliers, while the value of the outliers is generated randomly, ranging from 50 to 100, and the number of structured noise rows is set to $10\%$. As we can see, the RPCA-based method performs better than the traditional outlier detection method and our algorithm has the best performance when the percentage of outliers is less than $30\%$.

The performance for different values of outliers is shown in [Figure 10](#sensors-19-02537-f010){ref-type="fig"}b, where the *x*-axis represents the value of outliers and *y*-axis represents the localization error, and the percentage of outliers is set to $10\%$. RPCA-based methods change slightly when the value of outliers changes, and our algorithm has a better performance than IALM in all cases, while the $DB\left( pct,d \right)$, KNN, and Hampel methods cannot handle the situation well when outliers are small.

[Figure 11](#sensors-19-02537-f011){ref-type="fig"} shows the performance of the five methods at different percentages of structured noise rows, while the values of the outliers are generated randomly, ranging from 50 to 100. The percentage of outliers is set to $15\%$, and the structured noise value is generated randomly, ranging from $- 15$ to 15. We can see that our algorithm has the best performance and that the minimum localization error as the number of structured noise increases.

5.2. Real-World Experiments {#sec5dot2-sensors-19-02537}
---------------------------

To test the performance of the proposed algorithms, we performed experiments in a school building. The floor plan is shown in [Figure 12](#sensors-19-02537-f012){ref-type="fig"}. The experiment area includes a long west-east-oriented aisle and four shorter north-south-oriented aisles. The long aisle is around 40 m while the shorter aisle is nearly 8.5 m. There are 16 APs arranged in the area with uniform specifications but unknown positions. The direction from east to west is marked as the *x*-axis. The direction from south to north is marked as the *y*-axis.

The reference points are set symmetrically with a 1.2 m spacing. There are 126 reference points in total, which are represented by dots in [Figure 12](#sensors-19-02537-f012){ref-type="fig"}. In the off-line stage, we use a TL-WN823N USB wireless network adapter which is compatible with the IEEE 802.11 n/g/b standard. The frequency of the system is operated on 2.4 GHz. We record eight times the RSS information at each reference point, and the sampling interval is 1 s.

In the online phase, we selected ten test points which are represented by triangles in [Figure 12](#sensors-19-02537-f012){ref-type="fig"}. In order to have enough data to test the localization performance, we scan the RSS information at every test point 100 times, i.e., 1000 users are considered for localization. The Cumulative Distribution Function (CDF) of the localization error for different methods is shown in [Figure 13](#sensors-19-02537-f013){ref-type="fig"}. There are five methods to process the fingerprint database in [Figure 13](#sensors-19-02537-f013){ref-type="fig"}, including the original RSS from a measurement, the proposed algorithm, the IALM algorithm, the KNN method, and the $DB\left( pct,d \right)$ method.

As we can see from [Figure 13](#sensors-19-02537-f013){ref-type="fig"}, the proposed algorithm has the best localization accuracy compared with the other methods and original RSS. Under 4 m, the accuracy of the proposed algorithm is $73\%$, while the IALM is $70\%$, and the original RSS is $69\%$. The $DB\left( pct,d \right)$ performs almost the same as the original RSS. Moreover, the KNN method performs even worse than the original RSS, which means that some normal entries are wrongly treated as outliers.

6. Conclusions {#sec6-sensors-19-02537}
==============

In this paper, an off-line fingerprint database reconstruction approach is proposed. By observing and proving that the signal has high spatial and temporal correlations, the RSS data can be transformed into a low-rank matrix. Then, the RPCA technique can be applied to recover the matrix without noise. Meanwhile, a novel optimization problem is proposed for simultaneously eliminating the outliers and structured noise. Additionally, a strategy on organizing the low-rank matrix is given. Furthermore, an algorithm is derived to solve the proposed optimization problem based on the ALM method. The superiority of the proposed approach has been demonstrated in several experiments.

Data curation, T.T. and Y.G.; Methodology, L.Z. and T.T.; Project administration, L.Z.; Software, Y.G.; Supervision, L.Z. and W.Y.; Validation, T.T. and W.Y.; Writing---original draft, T.T.; Writing---review & editing, L.Z.

This paper is supported by \[the Fundamental Research Funds for the Central Universities No. 2019JBM015\].

The authors declare no conflicts of interest.

![A typical statistical view for an outlier.](sensors-19-02537-g001){#sensors-19-02537-f001}

![The outlier influence on the principal direction in a standard Principal Component Analysis (PCA).](sensors-19-02537-g002){#sensors-19-02537-f002}

![System model.](sensors-19-02537-g003){#sensors-19-02537-f003}

![The normalized singular values of the fingerprint database.](sensors-19-02537-g004){#sensors-19-02537-f004}

![The matrix reconstruction error with different structures.](sensors-19-02537-g005){#sensors-19-02537-f005}

![The performance evaluation at different percentages of outliers under the WONS (with outlier noise, no structured noise) condition.](sensors-19-02537-g006){#sensors-19-02537-f006}

![The localization error for different values of outliers under WONS.](sensors-19-02537-g007){#sensors-19-02537-f007}

![The performance evaluation in different percentages of structured noise under the NOWS (no outlier noise, with structured noise) condition.](sensors-19-02537-g008){#sensors-19-02537-f008}

![The performance evaluation under NOWS.](sensors-19-02537-g009){#sensors-19-02537-f009}

![The performance evaluation under the WOWS (with outlier noise, with structured noise) condition.](sensors-19-02537-g010){#sensors-19-02537-f010}

![The performance at different percentages of structured noise under WOWS.](sensors-19-02537-g011){#sensors-19-02537-f011}

![A comparison of different algorithm results in term of Cumulative Distribution Function (CDF).](sensors-19-02537-g012){#sensors-19-02537-f012}

![A comparison of different algorithm results in term of CDF.](sensors-19-02537-g013){#sensors-19-02537-f013}

sensors-19-02537-t001_Table 1

###### 

Merging matrices of various sizes.

  Index   W    M    N    Final Size
  ------- ---- ---- ---- ----------------
  1       +1   6    6    $6 \times 6$
  2       +1   9    36   $9 \times 36$
  3       +1   36   9    $36 \times 9$
  4       −5   9    36   $45 \times 36$
  5       +5   9    36   $9 \times 180$
  6       +5   36   9    $36 \times 45$
  7       −5   36   9    $180 \times 9$
  8       −9   36   5    $324 \times 5$
  9       +9   5    36   $5 \times 324$
