ANLoC: An Anomaly-Aware Node Localization Algorithm for WSNs in Complex Environments

Accurate and sufficient node location information is crucial for Wireless Sensor Networks (WSNs) applications. However, the existing range-based localization methods often suffer from incomplete and detorted range measurements. To address this issue, some methods based on low-rank matrix recovery have been proposed, which usually assume noises follow single Gaussian distribution or/and single Laplacian distribution, and thus cannot handle the case with wider noise distributions beyond Gaussian and Laplacian ones. In this paper, a novel Anomaly-aware Node Localization (ANLoC) method is proposed to simultaneously impute missing range measurements and detect node anomaly in complex environments. Specifically, by utilizing inherent low-rank property of Euclidean Distance Matrix (EDM), we formulate range measurements imputation problem as a Robust ℓ2,1-norm Regularized Matrix Decomposition (RRMD) model, where complex noise is fitted by Mixture of Gaussian (MoG) distribution, and node anomaly is sifted by ℓ2,1-norm regularization. Meanwhile, an efficient optimization algorithm is designed to solve proposed RRMD model based on Expectation Maximization (EM) method. Furthermore, with the imputed EDM, all unknown nodes can be easily positioned by using Multi-Dimensional Scaling (MDS) method. Finally, some experiments are designed to evaluate performance of the proposed method, and experimental results demonstrate that our method outperforms three state-of-the-art node localization methods.


Introduction
Wireless Sensor Networks (WSNs) have made great progress and have been widely used in various fields, such as environmental monitoring, intelligent transportation, target tracking, etc. [1][2][3]. The premise that these applications work well is accurate location information acquisition [4,5]. Up to now, many localization methods have been proposed, which could be divided into two categories [6]. One is called range-based localization method that could achieve more accurate positioning, but the computation and communication overhead is large while some hardware support is also required. The other is named range-free localization method that is generally suitable for low power and cost applications, yet their positioning accuracy is low.
In this paper, we mainly focus on the range-based localization methods, which could be described as follows: in WSNs applications, some sensor nodes are randomly disposed, and a few of them called anchors could get actual location information by GPS device or other equipment. Then, with 1.
A Robust 2,1 -norm Regularized Matrix Decomposition (RRMD) model is proposed to jointly estimate the missing range measurements and detect the node anomaly, which takes advantage of the potential relationship between two tasks which could help each other to achieve more accurate performance.

2.
The MoG distribution is employed to fit the unknown complex noise, which allows the proposed RRMD model to adaptively handle a wider range of noise beyond the existing methods. Meanwhile, an efficient optimization algorithm is designed to solve the proposed RRMD model by adopting the popular EM method.

3.
A novel Anomaly-aware Node Localization (ANLoC) method is proposed based on the RRMD model, and extensive experiments verify the superior positioning performance of the ANLoC method in the coexistence of node anomaly and complex noise.
The rest of this paper is organized as follows. In Section 2, we introduce the current research advances about the range-based node localization methods and low-rank matrix decomposition methods, respectively. Section 3 describes the notations used in this paper and some related mathematical foundations. In Section 4, the RRMD model is constructed and an optimization algorithm based on the EM method is designed to solve this model. This section also presents the Anomaly-aware Node Localization (ANLoC) method based on the proposed RRMD and the classic MDS. In Section 5, a series of simulation experiments are conducted to evaluate the performance of our proposed method. Finally, the conclusions are drawn in Section 6.

Range-Based Node Localization
At present, the typical range-based localization methods include two steps: (1) using certain ranging methods to measure the distance between nodes, such as Time of Arrival (ToA), Time Difference of Arrival (TDoA) and Received Signal Strength Indicator (RSSI); (2) using the range measurements combined with the location of anchor nodes to calculate the position information of unknown nodes. The popular localization method called Maximum Likelihood (ML) is asymptotically efficient [14] with enough data records. Tomic et al. [15] built a new convex estimator that approximated the ML by applying efficient convex relaxations, which reduced the estimation errors. In references [16,17], WSNs localization problem is treated as a variant of EDM recovery problem or graph implementation problem. By using the range measurements between nodes and introducing the slack variable to convert non-convex quadratic distance constraints into linear constraints, the authors formulated the WSNs localization problem as a Semi-Definite Programming (SDP) problem, and designed an efficient optimization method to solve the proposed problem. References [18,19] employed the classical MDS method to map the distance relationship between wireless sensor nodes to low-dimensional space, and generated a relative coordinate map which fitted well the distance relationship between nodes. Then, a few anchor nodes were used to convert the relative position to the global position. However, the above methods did not work well in real application scenarios. In general, these methods required complete and accurate EDM. Unfortunately, due to the requirement of energy-saving and the effects of potential node anomaly and complex noise, the existing range-based node localization methods often suffer from incomplete and detorted range measurements. In addition, the ML method and SDP method could be only used to solve a small-scale problem because of its high computational complexity.
To address the above issues, some matrix completion based node localization methods have been proposed in recent years. Specifically, by taking advantage of the low-rank characteristics of EDM, Feng et al. [20] firstly formulated the range measurement imputation problem as a low-rank EDM Matrix Completion (MC) model, and designed an efficient optimization method to solve the proposed MC model. However, their work is limited to assume the errors contained in the range measurements are Gaussian noise, ignoring the existence of some complex errors caused by node hardware failure, multipath transmission, etc. In reference [6], another kind of errors called outliers was assumed to obey Laplacian distribution. Then, 1 -norm regularization was introduced to deal with it, which effectively improved the positioning accuracy. However, it was also too simple to preset the complex noise to these two known types, and the actual noises should be more complicated in practical applications. Recently, Liu et al. [21] proposed a Linear Bregman Iteration based matrix completion method to localize node position for WSNs. However, this method did not consider the actual scenario under the co-existence of complex noise and anomaly. More importantly, all these matrix completion based node localization methods inevitably involved Singular Value Decomposition (SVD) operation with heavy computation cost. To address these issues, an ANLoC method is proposed in this paper, which Sensors 2019, 19, 1912 4 of 20 formulate the range measurements imputation problem as low-rank matrix decomposition instead of low-rank matrix completion model. Therefore, in the next section, we will introduce the related work on low-rank matrix decomposition.

Low-Rank Matrix Decomposition
Low-Rank Matrix Decomposition (LRMD) is an important technique in data science, which can uncover the latent manifold structures of data, and thus obtain a low dimensional compression representation. Recently, by decomposing the target matrix into the product of two low-rank matrices, LRMD has been widely used in various fields such as dimensionality reduction, clustering, and matrix recovery.
The original LRMD [22] model can be formulated as where M ∈ R m×n is the target matrix to be approximated, U ∈ R m×r and V ∈ R n×r are two low-dimensional matrix variables (r < min(m, n)), ||·|| p denotes the p -norm, and 1 -norm and 2 -norm are commonly used to make this model robust to Gaussian noise and outlier noise, respectively. When some elements of M are missing, the original LRMD could be changed into a matrix recovery model by adding an orthogonal projection operator [23], which could be formulated as: where P Ω (·) is an orthogonal projection operator defined as where This model could be applied to various matrix recovery problems such as recommender system [24] and image representation [25], and has lower computational complexity than low-rank matrix completion model with nuclear norm minimization. However, 1 -norm and 2 -norm regularizations are only optimal when the noise follows a Gaussian or Laplacian distribution, which is not in line with the actual situation. To address this limitation, Meng et al. [10] proposed a noise-tolerant LRMD model based on Mixture of Gaussian distribution, which could be described as: where ||·|| MoG represents that each element of this matrix is modeled by Mixture of Gaussian distribution.
Reference [10] has demonstrated the robustness of the MoG model to unknown noise. However, since this model does not explicitly consider the row/column-wise structural anomaly that the sampled matrix may suffer from, it cannot be directly applied to the node localization of WSNs in this paper.

Notations
We first introduce the important notations used in this paper. All italic letters denote variables and non-italic letters denote constants. Bold uppercase letters denote matrices and bold lowercase letters denote vectors. Specifically, X ij denotes the scalar in the i-th row and j-th column of X. x i and x j represent the i-th row and j-th column of the matrix X respectively. Additionally, we denote the p -norm, Sensors 2019, 19, 1912 5 of 20 Frobenius-norm, and 2,1 -norm of matrix X ∈ R m×n as , and , respectively. X T denotes the transpose of matrix X. N 0, σ 2 denotes a Gaussian distribution with mean 0 and variance σ 2 . Finally, represents the Hadamard product of two matrices.

Mathematical Foundation
Definition 1 [26]: (Proximal Operator) Let F(X) be a real convex function defined on X ∈ R m×n , for any τ, µ > 0 and constant matrix M ∈ R m×n , the proximal operator could be defined as: Definition 2 [27]: (Structural Thresholding Operator) For any τ > 0, M ∈ R m×n , the proximal operator of 2,1 -norm, i.e., structural thresholding operator, is defined as: where Definition 3 [28]: (Lipschitz Continuous Gradient) A differentiable convex function F(X) defined on R m×n is said to have a Lipschitz continuous gradient ξ, i.e., for ∀X 1 , X 2 ∈ R m×n , there exists a constant ξ > 0, such that Theorem 1 [29]: Let F 1 and F 2 be two lower semi-continuous convex functions on X ∈ R m×n , and F 2 is also a differentiable function with Lipschitz continuous gradient ξ. Then, for a convex optimization problem defined as min X F 1 (X) + F 2 (X) (9) if F 1 + F 2 is mandatory and strictly convex, then for any initial value X 0 and 0 < δ < 1/ξ, the iterative sequence X k+1 generated by the following Equation (10) is the unique solution of problem (9)

Anomaly-Aware Node Localization for WSNs
In this section, we first establish a RRMD model and employ EM method to optimize it, and then a novel ANLoC method is proposed based on the RRMD model.

Problem Description and RRMD Model Construction
In a typical application scenario, n sensor nodes are randomly deployed in a specific area, whose coordinates can be formulated as X = [x 1 , x 2 , . . . , x n ] ∈ R d×n (d usually be 2 or 3, indicating Sensors 2019, 19,1912 6 of 20 the dimension of the coordinate space). Then, the corresponding EDM matrix D ∈ R n×n could be calculated by where D ij represents the squared Euclidean distance between the i-th sensor node and the j-th sensor node. Reference [8] has proofed that the rank of matrix D is at most d + 2, which indicates the EDM matrix has an inherently strict low-rank property. Usually, in practical applications, only a few sensor nodes could obtain their accurate coordinates by loading GPS, and the position information of other unknown nodes need be indirectly calculated by employing some localization methods. Due to irregular node distribution and energy consumption limitation, only the partial range measurements could be collected. Based on the collected incomplete distance measurements, we can only establish a sampled EDM matrix with missing elements. Our goal is to estimate the coordinates of unknown nodes based on the sampled range measurements and the known coordinates of anchor nodes. Figure 1 illustrates the pipeline of node localization for WSNs in complex environments. As shown in Figure 1, the node localization process involves two main steps: EDM recovery and node positioning. At the first step of EDM recovery, by using our proposed RRMD algorithm, we can impute the missing range measurements and obtain the estimated complete EDM matrix, which is also called the true underlying EDM matrix, and then at the second step of node positioning, based on the estimated true underlying EDM matrix, we can further employ MDS method to position each unknown node. Compared to the second step of node positioning, the first step of EDM recovery is more critical and challenging. Specifically, in practical applications, limited by the complex environmental interference, malicious attacks, hardware malfunction, etc., the existence of errors in range measurements is unavoidable, which leads to the destruction of sampled EDM and reduction in localization accuracy. In this paper, we assume that the sampled EDM matrix M ∈ R n×n consists of the true underlying EDM component D ∈ R n×n , the row structural anomaly matrix component R ∈ R n×n , the column structural anomaly matrix component C ∈ R n×n , and the noise matrix component N ∈ R n×n , which is illustrated in Figure 2.
The noise is considered to be caused by environmental interference, malicious attacks, etc., which usually follows continuous complex distributions. Moreover, the existence of the anomaly is caused by abnormal transmission module or other unpredictable hardware defects. Specifically, when the receiving module of the nodes fails, it will cause row structural anomaly in the corresponding row in EDM, and when the sending module of nodes fails, the corresponding column in the EDM will have the column structural anomaly [8]. To address the above problems, we need to design an efficient method to obtain a true underlying EDM. Finally, based on this EDM, the actual coordinates of unknown nodes could be easily estimated by employing the classic MDS method. Therefore, our primary goal is to design an effective EDM reconstruction method to impute the missing range measurements and de-noise the inaccurate ones. Intuitively, based on the low-rank characteristics of EDM, we can classify the EDM reconstruction problem into a standard matrix decomposition model, which is formulated as However, this model can only be applied to the case of single Gaussian noise, and its reconstruction performance will decline dramatically when the sampled EDM is under co-existence of complex noise and anomaly. To this end, we employ MoG distribution and 2,1 -norm to improve the model, and then establish a Robust 2,1 -norm Regularized Matrix Decomposition (RRMD) model as follows: where M ∈ R n×n denotes the sampled matrix, R ∈ R n×n and C ∈ R n×n represent row structural anomaly and column structural anomaly, respectively, U, V ∈ R n×(d+2) are two low-rank components of the true underlying EDM matrixD, logL(P Ω (N)|Π, Σ) is the log-likelihood function, Π = π 1 , π 2,..., π n c ,Σ = σ 2 1 , σ 2 2 , . . . , σ 2 n c and n c are the parameters of MoG, and λ 1 and λ 2 are the tunable parameters. The key of this model is that we use MoG distribution to smooth any unknown noises and 2,1 -norm to detect node anomaly, respectively. The main motivations for this model are as follows. (1) First of all, in response to the complex noise, we introduce a Mixture of Gaussians distribution, which is treated as a universal approximator to any continuous density function. Therefore, the RRMD model is robust against a wider range of complex noise distributions beyond Gaussian and Laplacian noises. (2) Then, as the optimal measure of row sparsity matrix, 2,1 -norm could be used to smooth row-wise anomaly and the transpose of column-wise anomaly, thus the abnormal nodes can be detected. (3) Finally, in order to deal with the challenge of data missing, we choose the classic low-rank MD method, which can impute the missing elements with lower computational costs than the low-rank MC method. In this paragraph, we introduce how to apply MoG distribution to the RRMD model. Without loss of generality, each element ( , = 1,2, … , ) in the noise matrix is considered to be from a Mixture of Gaussians distribution, which is defined as where |0, denotes the Gaussian distribution with mean 0 and variance . is the number of Gaussian components and ≥ 0 represents the mixing proportion where ∑ = 1 .
Then, the likelihood function can be written as where = , ,…, ， = , , … , . Usually, we use the log-likelihood function instead of this likelihood function for convenient calculation. Then, our aim is to maximize the log-likelihood function to obtain the MoG parameters. Obviously, we can construct the final objective function expressed as Equation (13) by combining the negative log-likelihood function with the ℓ , -norm, and then minimize it to get all unknown variables in RRMD model.   In this paragraph, we introduce how to apply MoG distribution to the RRMD model. Without loss of generality, each element ( , = 1,2, … , ) in the noise matrix is considered to be from a Mixture of Gaussians distribution, which is defined as

Optimizing RRMD via Expectation Maximization Method
where |0, denotes the Gaussian distribution with mean 0 and variance . is the number of Gaussian components and ≥ 0 represents the mixing proportion where ∑ = 1 .
Then, the likelihood function can be written as where = , ,…, ， = , , … , . Usually, we use the log-likelihood function instead of this likelihood function for convenient calculation. Then, our aim is to maximize the log-likelihood function to obtain the MoG parameters. Obviously, we can construct the final objective function expressed as Equation (13) by combining the negative log-likelihood function with the ℓ , -norm, and then minimize it to get all unknown variables in RRMD model.   In this paragraph, we introduce how to apply MoG distribution to the RRMD model. Without loss of generality, each element N ij (i, j = 1, 2, . . . , n) in the noise matrix N is considered to be from a Mixture of Gaussians distribution, which is defined as 14) where N N ij |0, σ 2 k denotes the Gaussian distribution with mean 0 and variance σ 2 . n c is the number of Gaussian components and π k ≥ 0 represents the mixing proportion where n c k=1 π k = 1. Then, the likelihood function can be written as

Optimizing RRMD via Expectation Maximization Method
where Π = π 1 , π 2,..., π n c , Σ = σ 2 1 , σ 2 2 , . . . , σ 2 n c . Usually, we use the log-likelihood function instead of this likelihood function for convenient calculation. Then, our aim is to maximize the log-likelihood function to obtain the MoG parameters. Obviously, we can construct the final objective function expressed as Equation (13) by combining the negative log-likelihood function with the 2,1 -norm, and then minimize it to get all unknown variables in RRMD model.

Optimizing RRMD via Expectation Maximization Method
In this section, we employ the popular EM method to solve the proposed RRMD model. Firstly, we explain the motivation for using this method. Obviously, in order to gain the estimated values of parameters Π, Σ, the log-likelihood function logL(P Ω (N)|Π, Σ) should be maximized. However, for many specific problems, parameters Π, Σ cannot be directly calculated due to complex expressions of log-likelihood functions. Fortunately, the EM method can be employed to solve such problems, which has been proven to be effective by many researches. Specifically, let Z ijk ∈ {0, 1} be a set of hidden variables with n c k=1 Z ijk = 1(i, j = 1, 2, . . . , n), and Z ijk = 1 implies the noise N ij comes from the k-th Gaussian component. Therefore, the log-likelihood function can be re-written in a form that is easy to optimize as Next, we will introduce the specific optimization process of estimating the parameters (D, R, C, N, U, V, Π, Σ) in Equation (13) by alternately conducting the E and M steps.
In the E step, we calculate the conditional expectation Υ ijk of Z ijk . The specific calculation formula can be given as follows.
In the M step, we need to optimize the following optimization model as min U,V,R,C,Π,Σ A natural idea is to use alternate iteration methods to solve MoG parameters Π, Σ and matrix variables U, V, R, C, i.e., Update Π, Σ: Update U, V, R, C: In order to update U, V, R, C, we need to solve the following sub-problem: If we let Then Equation (21) can be reformulated as follows: Furthermore, we can optimize Equation (23) by solving the following three sub-problems.
1) Update U, V by solve the following sub-problem: Obviously, as a typical weighted matrix decomposition problem, it could be solved by various methods, such as ALS [30], WLRA [31] and DN [32].
2) Update R by conducting the following iteration: where t represents the t-th iteration and τ R is the step size of the proximal gradient.
3) Update C by conducting the following iteration: where t represents the t-th iteration and τ C is the step size of the proximal gradient.
Based on the aforementioned analysis, we summarize the whole procedure in Algorithm 1.

Algorithm 1. Proposed Robust 2,1 -norm Regularized Matrix Decomposition (RRMD) Algorithm
Input: The sampled EDM matrix M, the index set Ω, the parameters λ 1 , λ 2 and threshold θ, the initial number of Gaussian components n c . Output: The true underlying EDM matrixD, the row structural anomaly R, and the column structural anomaly C.

Anomaly-Aware Node Localization
Based on the proposed RRMD model, all pair-wise range measurements between nodes can be easily obtained. However, it is only the first step of this range-based localization method. The second step of this method is to calculate the location information of the unknown nodes based on the complete distance information and the actual coordinates of anchor nodes, and which can be implemented by using the classical MDS method [6,8,21].
MDS is a typical low-dimensional embedding method, which is originally proposed to solve the curse of dimensionality in the field of machine learning. The MDS method ensures that the distance between samples in the original high-dimensional space can be preserved in low-dimensional space. The input of this method can be high-dimensional features of samples (the pair-wise distance information can be easily obtained from high-dimensional features) or the distance information between samples, while the output is the low-dimensional features of samples in the specified d-dimensional space. Therefore, in the sensor networks localization application, we can employ the MDS method to calculate the relative coordinates of each node in the d-dimensional space. Then, based on the actual/absolute coordinates of at least d + 1 anchor nodes and the relative coordinates obtained, the coordinate transformation matrix between the actual coordinates and the relative coordinates can be calculated (with the details provided in Theorem 2). Finally, the relative coordinates can be mapped to the actual ones by using the coordinate transformation matrix.
Next, we introduce the specific steps to implement the above MDS method. Firstly, we let the relative coordinates and actual coordinates of n nodes be represented as T = [t 1 , t 2 , . . . , t n ] ∈ R d×n , A = [a 1 , a 2 , . . . , a n ] ∈ R d×n , respectively, and assume that nodes 1, 2, . . . n a (n a ≥ d + 1) are anchor nodes. Secondly, the classic MDS method is employed to calculate the relative coordinates of all nodes. Thirdly, with the actual coordinates of anchor nodes, we have coordinate transformation matrix: Finally, the coordinate of all unknown nodes can be obtained by (a i = Q·(t i − t 1 ) + a 1 , i = n a + 1, n a + 2, . . . n Based on the aforementioned analysis, the proposed Anomaly-aware Node Localization (ANLoC) algorithm can be summarized as in Algorithm 2.

Theorem 2:
For sensor nodes localization in d-dimensional space, given the absolute positions a 1 , a 2 , · · · , a n a of the n a anchor nodes and the relative coordinates {t 1 , t 2 , · · · , t n } of all the n (n n a ) sensor nodes, if n a ≥ d + 1, then the relative coordinates t n a +1 , t n a +2 , · · · , t n can be transformed to the corresponding absolute positions a n a +1 , a n a +2 , · · · , a n .
Proof: According to reference [13], the absolute positions a i (i ≥ n a + 1) can be computed according to a i = Q·(t i − t 1 ) + a 1 , i = n a + 1, n a + 2, · · · , n where Q ∈ R d×d is the unknown coordinate-transform matrix, which should be determined by the following matrix equation: Q·[t 2 − t 1 , t 3 − t 1 , · · · , t n a − t 1 ] = [a 2 − a 1 , a 3 − a 1 , · · · , a n a − a 1 ] Without loss of generality, letT = [t 2 − t 1 , t 3 − t 1 , · · · , t n a − t 1 ] andÂ = [a 2 − a 1 , a 3 − a 1 , · · · , a n a − a 1 ], then we can see thatT ∈ R d×(n a −1) andÂ ∈ R d×(n a −1) . Therefore, the above matrix Equation can be regarded as the following equivalent equations: d l=1 Q il ·T lj =Â ij , i = 1, 2, · · · , d, and j = 1, 2, · · · , n a − 1 Obviously, if n a ≤ d, then the number of unknown entries (i.e., d 2 ) is greater than the number of Equations (i.e., d × (n a − 1)), so we cannot obtain the determined coordinate-transform matrix Q. On the contrary, if n a ≥ d + 1, we only need to arbitrarily select d + 1 anchor nodes, then we can obtain the unique solution of Q.

Performance Evaluation
In this section, we first describe the experimental setting and evaluation metrics, and then report some extensive experimental results under the different scenarios.

Experimental Setting
In order to investigate the performance of our proposed ANLoC, some simulation experiments were conducted. All these experiments were designed based on MATLAB 2017a and run on PC with Intel i5-8400 CPU and 16G RAM. Firstly, we randomly disposed 100 sensor nodes in a square area with 100 × 100 unit (where the unit can be determined according to actual communication condition, such as meter, decimeter, foot, and inch, etc.), and 6 of them were anchor nodes while others were unknown nodes. Let X ∈ R 2×100 be the actual coordinate matrix of all nodes and D ∈ R 100×100 denote the ground truth EDM matrix between nodes. Secondly, we artificially added some error matrices into matrix D to simulate the complex noises and the structural anomaly, and thus obtained a corrupted matrix D error . Specifically, the complex noise was set to the mixture of the following components: (1) Gaussian noise with mean 0 and variance 100; (2) Gaussian noise with mean 0 and variance 50; and (3) sparse noise with a pollution ratio 1% randomly generated within the range of [0, 10000]. Moreover, the structural anomalies were set to be randomly generated within the range of [0, 500] and with a row-wise pollution ratio 3% and a column-wise pollution ratio 3%. Thirdly, sampled matrix M could be obtained by randomly sampling some elements from D error . Finally, the true underlying EDM matrix can be reconstructed from M via Algorithm 1, and then the actual coordinates of all nodes could be calculated using Algorithm 2. Moreover, we summarized all the simulation parameters in Table 1. The proposed ANLoC method involves three hyper-parameters λ 1 , λ 2 and n c . It is important to adjust these parameters to proper values. In order to determine the optimal value of these parameters, we employed a 10-fold cross validation procedure and conduct the grid search method. In particular, firstly, let n c = 5, we searched for the optimal solution of λ 1 and λ 2 within the range of {0.001, 0.01, 0.1, 1, 10, 100, 1000} by minimizing the matrix recovery error of EDM. Then, based on the selected optimal parameter λ 1 and λ 2 , n c was determined within the range of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Last but not least, we compared our method with three different competing methods, including NLIRM method [6], SVT-based method [20], and OptSpace-based method [33]. All the involved parameters in these competing methods were optimized by using the same nested 10-fold cross-validation procedure as in our ANLoC method.

Evaluation Metrics
We selected the following four evaluation metrics to evaluate the node localization performance: • EDM recovery error: whereD denotes the reconstructed matrix and D is the ground truth matrix. • Localization error: e l = ||X − X|| F /n (33) whereX denotes the coordinates calculated by Algorithm 2.

•
Anomaly recognition accuracy: p ave = (p row + p col )/2 where p row and p col represent the row anomaly recognition accuracy and column anomaly recognition accuracy, respectively. Specifically, the p row is calculated by p row = 2 × r pre ·r rec r pre + r rec , r pre = r tru r all , r rec = r tru r act (35) where r all represents the number of abnormal rows identified by the method proposed in this paper, r tru indicates the number of correctly recognized rows in r all and r act represents the number of actual abnormal rows; the p row is calculated by where c all represents the number of abnormal columns identified by the method proposed in this paper, c tru indicates the number of correctly recognized columns in c all , and c act represents the number of actual abnormal columns.

•
Cumulative distribution of localization errors [21]: where ∆l i = (x i − x i ) 2 + (ŷ i − y i ) 2 defines the localization error of i-th node, (x i , y i ) and (x i ,ŷ i ) denote the actual coordinates and the estimated coordinates, respectively.

Experimental Results
In order to investigate the performance of proposed method in complex environments, we conducted the following four experiments under the different application scenarios.

• Scenario 1: Localization without the noise and anomaly
This experiment assumed that all observed range measurements were accurate. Figure 3 shows that the variation of the EDM recovery error and average localization error of WSNs nodes when the EDM is sampled at different proportions. The horizontal axis of the two subgraphs represents the sampling ratio, while the vertical axis in Figure 3a represents the EDM recovery error, and the vertical axis in Figure 3b represents the localization error of WSNs nodes. Comparing Figure 3a with Figure 3b, it is obvious to find that the EDM recovery error and localization error are consistent with the trend of the sampling rate. Under this scenario, when sampling rate reaches 0.3, the EDM recovery error and the localization error of these four methods reach a very low level. This shows that the existing methods and the method proposed in this paper can achieve good positioning accuracy under the ideal condition. This experiment aims to examine the performance of four methods with only complex noise. Therefore, we only add complex noise into EDM. After sampling the EDM in different proportions, the experimental results are shown in Figure 4. Under this scenario, the SVT-based method and the OptSpace-based method have large EDM recovery error and localization error even if the sampling rate is high, which indicates that the two methods do not handle the complex noise well. When the sampling ratio reaches 0.3, the EDM recovery error of NLIRM could be stabilized at around 0.01, and the localization error of nodes could be less than 0.03. However, the EDM recovery error and localization error of ANLoC could reach 0.001 and 0.01, respectively. Comparing with Figure 3, we find that both the SVT-based method and the OptSpace-based method could not deal with complex noise at all. The NLIRM has a certain ability to resist noise, but it is slightly worse than our ANLoC. Therefore, our ANLoC could perform best under complex noise than others.

• Scenario 3: Localization with only anomaly
The purpose of this experiment is to examine the performance of detecting anomalous nodes in the environment without any noise. In this case, only anomaly is added into EDM. As shown in Figure 5, compared with Figure 3, the EDM recovery error and the localization error of the four methods are all increased when the EDM is destroyed by the anomaly. However, compared with other three methods, ANLoC could have better performance at a lower sampling rate (0.2). In addition, the ANLoC could also detect abnormal nodes. Specifically, Figure 5c shows that when the sampling rate reaches 0.2, the recognition accuracy of abnormal nodes can reach 100%. In comparison with Figure 3, we find that the performance of all methods has been degraded in varying degrees, but our ANLoC still has the best performance. Therefore, when some sensor nodes have abnormities, the ANLoC has good performance for precisely locating unknown nodes and detecting abnormal nodes. This experiment aims to examine the performance of four methods with only complex noise. Therefore, we only add complex noise into EDM. After sampling the EDM in different proportions, the experimental results are shown in Figure 4. Under this scenario, the SVT-based method and the OptSpace-based method have large EDM recovery error and localization error even if the sampling rate is high, which indicates that the two methods do not handle the complex noise well. When the sampling ratio reaches 0.3, the EDM recovery error of NLIRM could be stabilized at around 0.01, and the localization error of nodes could be less than 0.03. However, the EDM recovery error and localization error of ANLoC could reach 0.001 and 0.01, respectively. Comparing with Figure 3, we find that both the SVT-based method and the OptSpace-based method could not deal with complex noise at all. The NLIRM has a certain ability to resist noise, but it is slightly worse than our ANLoC. Therefore, our ANLoC could perform best under complex noise than others.   • Scenario 3: Localization with only anomaly The purpose of this experiment is to examine the performance of detecting anomalous nodes in the environment without any noise. In this case, only anomaly is added into EDM. As shown in Figure 5, compared with Figure 3, the EDM recovery error and the localization error of the four methods are all increased when the EDM is destroyed by the anomaly. However, compared with other three methods, ANLoC could have better performance at a lower sampling rate (0.2). In addition, the ANLoC could also detect abnormal nodes. Specifically, Figure 5c shows that when the sampling rate reaches 0.2, the recognition accuracy of abnormal nodes can reach 100%. In comparison with Figure 3, we find that the performance of all methods has been degraded in varying degrees, but our ANLoC still has the best performance. Therefore, when some sensor nodes have abnormities, the ANLoC has good performance for precisely locating unknown nodes and detecting abnormal nodes.

• Scenario 4: Localization with both complex noise and anomaly
This experiment is designed to evaluate the performance of the ANLoC in a complex environment where complex noise and anomaly coexist. The complex noise and the anomaly are both added to the EDM to simulate the impact of the complex real application scenarios. Experimental results are shown in Figure 6. Obviously, compared with the other three methods, our ANLoC method proposed in this paper not only has the lowest EDM recovery error and localization error, but also has high recognition accuracy of abnormal nodes when the sampling rate reaches 0.3. Comparing with Figure 3, we can find that the performance of the SVT-based method and the OptSpace-based method are much worser in complex environment. The NLIRM has less performance degradation, but its EDM recovery accuracy and localization accuracy are still not as high as our ANLoC. In short, our proposed ANLoC has good robustness to complex application scenarios and could detect faulty nodes well. In addition, Figure 7a shows the cumulative distribution of the localization error for the four methods when the sampling rate is 0.5 under this scenario. The probability of the localization error of the ANLoC being less than 0.5 is 98% and the probability of being less than 1 is 100% while the other three methods are all below 30%. In addition, Figure 7b shows the intuitionistic localization results of all nodes in this case when the sampling rate is 0.5.

• Scenario 4: Localization with both complex noise and anomaly
This experiment is designed to evaluate the performance of the ANLoC in a complex environment where complex noise and anomaly coexist. The complex noise and the anomaly are both added to the EDM to simulate the impact of the complex real application scenarios. Experimental results are shown in Figure 6. Obviously, compared with the other three methods, our ANLoC method proposed in this paper not only has the lowest EDM recovery error and localization error, but also has high recognition accuracy of abnormal nodes when the sampling rate reaches 0.3. Comparing with Figure 3, we can find that the performance of the SVT-based method and the OptSpace-based method are much worser in complex environment. The NLIRM has less performance degradation, but its EDM recovery accuracy and localization accuracy are still not as high as our ANLoC. In short, our proposed ANLoC has good robustness to complex application scenarios and could detect faulty nodes well. In addition, Figure 7a shows the cumulative distribution of the localization error for the four methods when the sampling rate is 0.5 under this scenario. The probability of the localization error of the ANLoC being less than 0.5 is 98% and the probability of being less than 1 is 100% while the other three methods are all below 30%. In addition, Figure 7b shows the intuitionistic localization results of all nodes in this case when the sampling rate is 0.5.

Effects of the Proposed Strategies
To analyze the effects of our proposed strategies, experiments are designed to compare the proposed method with three partial deleted methods. Actually, our RRMD can be treated as LRMD + MoG + ℓ , -norm. Then, the remaining three types of partial deleted methods are as follows. (1) Pure LRMD: do not consider any noise or anomaly; (2) LRMD + MoG: only consider complex noise; (3) LRMD + ℓ , -norm: only consider the anomaly. What's more, these experiments are set under the scenario with both complex noise and anomaly. Finally, all experimental results are shown in Figure  8a-c. Obviously, our ANLoC considers both complex noise and anomaly, which leads to its low EDM recovery error and localization error. Moreover, when the sampling rate reaches 0.3, it could accurately detect abnormal nodes. Due to too ideal assumptions, pure LRMD is the worst performer, which means that it cannot be applied in actual situation. Although LRMD + MoG could handle the error of EDM well, it does not have the ability to detect abnormal nodes. Specially, LRMD + ℓ ,norm could hardly detect abnormal nodes in this case. Naturally, we speculate the noise that is not unprocessed may have a negative effect on the performance for detecting abnormal nodes in this method. Therefore, another experiment is designed with LRMD + ℓ , -norm when the EDM is only destroyed by anomaly, and the result of anomaly recognition is drawn in Figure 8d. The pleasure is that this supplementary experiment validates our conjecture. In conclusion, these experiments demonstrate the effectiveness of the MoG and ℓ , -norm strategies.

Effects of the Proposed Strategies
To analyze the effects of our proposed strategies, experiments are designed to compare the proposed method with three partial deleted methods. Actually, our RRMD can be treated as LRMD + MoG + 2,1 -norm. Then, the remaining three types of partial deleted methods are as follows. (1) Pure LRMD: do not consider any noise or anomaly; (2) LRMD + MoG: only consider complex noise; (3) LRMD + 2,1 -norm: only consider the anomaly. What's more, these experiments are set under the scenario with both complex noise and anomaly. Finally, all experimental results are shown in Figure 8a-c. Obviously, our ANLoC considers both complex noise and anomaly, which leads to its low EDM recovery error and localization error. Moreover, when the sampling rate reaches 0.3, it could accurately detect abnormal nodes. Due to too ideal assumptions, pure LRMD is the worst performer, which means that it cannot be applied in actual situation. Although LRMD + MoG could handle the error of EDM well, it does not have the ability to detect abnormal nodes. Specially, LRMD + 2,1 -norm could hardly detect abnormal nodes in this case. Naturally, we speculate the noise that is not unprocessed may have a negative effect on the performance for detecting abnormal nodes in this method. Therefore, another experiment is designed with LRMD + 2,1 -norm when the EDM is only destroyed by anomaly, and the result of anomaly recognition is drawn in Figure 8d. The pleasure is that this supplementary experiment validates our conjecture. In conclusion, these experiments demonstrate the effectiveness of the MoG and 2,1 -norm strategies.

Localization for Large-Scale Scenario
In a practical application scenario, there is a case that when the size of the localization scenario is much larger than ranging length of the sensor nodes and only a few range measurements between inter-nodes could be obtained. As a result of that, the sampled EDM based on range measurements will be very sparse, which leads to poor performance of our method. To solve this problem, a largescale localization method is proposed in this paper. For the convenience of discussion, we simplify the application scenario as shown in Figure 9. Suppose there is a 180 × 100 unit area divided into three parts I, II, and III from left to right, and among them, there are 80, 20, 80 nodes, respectively. Of the 180 nodes, there are 6 anchor nodes and 6 relay nodes. Then, regions I and II are combined into a localization sub-region ℳ while regions II and III are combined into a localization sub-region . The large-scale process is as follows. (1) Calculate the actual coordinates of all nodes within subregion ℳ by ANLoC. (2) Based on step one, the actual coordinates of relay nodes are gained. Taking them as anchor nodes, we employ ANLoC again to get the coordinates of the remaining unknown nodes in region . Further, in order to verify the feasibility of the above-mentioned large-scale scenario localization method, we designed an experiment with complex noise and anomaly. Moreover, the EDM sampling rates of region ℳ and are both set 0.5. As Figure 10 shows, the experimental results confirm that our large-scale localization method can be well applied to large-scale scenarios.

Localization for Large-Scale Scenario
In a practical application scenario, there is a case that when the size of the localization scenario is much larger than ranging length of the sensor nodes and only a few range measurements between inter-nodes could be obtained. As a result of that, the sampled EDM based on range measurements will be very sparse, which leads to poor performance of our method. To solve this problem, a large-scale localization method is proposed in this paper. For the convenience of discussion, we simplify the application scenario as shown in Figure 9. Suppose there is a 180 × 100 unit area divided into three parts I, II, and III from left to right, and among them, there are 80, 20, 80 nodes, respectively. Of the 180 nodes, there are 6 anchor nodes and 6 relay nodes. Then, regions I and II are combined into a localization sub-region M while regions II and III are combined into a localization sub-region N. The large-scale process is as follows. (1) Calculate the actual coordinates of all nodes within sub-region M by ANLoC. (2) Based on step one, the actual coordinates of relay nodes are gained. Taking them as anchor nodes, we employ ANLoC again to get the coordinates of the remaining unknown nodes in region N.  Further, in order to verify the feasibility of the above-mentioned large-scale scenario localization method, we designed an experiment with complex noise and anomaly. Moreover, the EDM sampling rates of region M and N are both set 0.5. As Figure 10 shows, the experimental results confirm that our large-scale localization method can be well applied to large-scale scenarios.

Conclusions
In this paper, we aim to estimate node position of WSNs in complex environments. Considering that the coexistence of potential node anomaly and complex noise in practical applications, we propose a novel Anomaly-aware Node Localization (ANLoC) method to address this task. Specifically, the proposed ANLoC method is divided into two steps. First, a Robust ℓ , -norm Regularized Matrix Decomposition (RRMD) model is designed to simultaneously detect node anomaly and impute the missing range measurements. Second, based on the imputed EDM matrix, all unknown nodes can be easily estimated by using the classic MDS method. The extensive experiments demonstrated our proposed ANLoC method consistently outperforms three state-ofthe-art localization methods in terms of EDM recovery error, localization error, and anomaly recognition accuracy. Additionally, our proposed ANLoC method also can extend to a large-scale localization scenario. Future work will focus on extending our ANLoC approach to an incremental version, making it suitable for handling dynamic positioning of mobile sensor nodes.

Conclusions
In this paper, we aim to estimate node position of WSNs in complex environments. Considering that the coexistence of potential node anomaly and complex noise in practical applications, we propose a novel Anomaly-aware Node Localization (ANLoC) method to address this task. Specifically, the proposed ANLoC method is divided into two steps. First, a Robust 2,1 -norm Regularized Matrix Decomposition (RRMD) model is designed to simultaneously detect node anomaly and impute the missing range measurements. Second, based on the imputed EDM matrix, all unknown nodes can be easily estimated by using the classic MDS method. The extensive experiments demonstrated our proposed ANLoC method consistently outperforms three state-of-the-art localization methods in terms of EDM recovery error, localization error, and anomaly recognition accuracy. Additionally, our proposed ANLoC method also can extend to a large-scale localization scenario. Future work will focus on extending our ANLoC approach to an incremental version, making it suitable for handling dynamic positioning of mobile sensor nodes.