Skip to main content

PCA-Kalman: device-free indoor human behavior detection with commodity Wi-Fi


Human behavior detection has become increasingly significant in various fields of application. In this paper, we propose a device-free indoor human behavior detection method with channel state information (CSI) and principal component analysis (PCA), respectively, in the line of sight environment, non-line-of-sight environment, and through the wall environment experiments. We divide this method into two parts. It begins with an online phase. A fingerprint database is established by collecting the original data packets of CSI in different time periods and using the characteristics of PCA algorithm to reduce the dimension of the original CSI data. Then, some outlier values are removed by Kalman filter algorithm, and we will get more stable data and fully prepared for the docking experiments. At the same time, the PCA algorithm’s estimation results are corrected according to the detected real-time motion speed to reduce the mismatch target. Then, in the offline phase, the classification of data is collected in the real-time environment by using support vector machine (SVM) algorithm. This method not only reduces the time complexity of the algorithm but also improves the detection rate of the human’s behavior and reduces the error. The processed data are matched with the data in the fingerprint database, and finally, the detection of different behaviors performed by humans in an indoor environment is finally achieved according to the matching results. We experimented repeatedly in three different scenarios, with an average 95% of human behavior detection rate in three different environments. In addition, we compare the method proposed in this paper with the existing methods in different aspects, such as the impact of the number of subcarriers, the impact of data packets, and the impact of the test area. The experimental results show that this method is superior to other algorithms in terms of average error and indoor activity recognition accuracy, which can more accurately identify indoor human motion behavior and improve the stability of the system.

1 Introduction

Detecting human behavior has aroused increasing attention in many potential applications, such as indoor intrusion detection, campus security, supermarket customer tracking, patient care, and elderly safety monitoring.

With the continuous progress and development of wireless sensor networks (WSNs), people’s research perspective has not only limited to the traditional location awareness and indoor location [1]. For example, the typical ultra-wideband (UWB)-based radar system [2] and the relatively new indoor positioning technology based on commercial [3] Wi-Fi infrastructure have better development advantages in all aspects [4].

A common solution to these problems is to pinpoint mobile devices in a Wi-Fi infrastructure [5]. Such a solution requires the active participation of mobile devices [6]. However, in many special occasions, most people do not carry equipment at any time. Such as at home or in sensitive areas, the objects may not carry any electronic devices or power them off [7]. Thus, device-free indoor human behavior detection is in need, which detects and tracks the objects that do not carry any electronic devices nor participate actively in the process [8].

In traditional indoor location technology, location service and environment perception are mainly based on received signal strength indication (RSSI) technology [9]. For example, researchers used RSSI to detect pre-positioning of indoor personnel in previous years [10]. However, in the experimental results of these technologies, it is found that the positioning accuracy is low. The main reason is that the stability of RSSI is low and the value is affected by time, and also, the time resolution is limited to the data packet standard [11]. In the IEEE 802.11n standard, the channel state information (CSI) describes the attenuation factor of each signal on each transmission path [12]. This is the value of each element in the channel gain matrix H, such as signal scattering, environmental weakness, and distance attenuation [13]. Compared with RSSI, CSI can adapt the communication system to the current channel conditions [14]. It has obvious advantages in terms of time resolution, frequency resolution, and stability [15]. Moreover, it is also guaranteed high-reliability and high-speed communication in the multi-antenna system [16].

Wang et al. used a method of deterministic CSI fingerprinting and threshold-based [17]. In order to detect a human in an omnidirectional way, Wu et al. proposed DeMan [8] for device-free detection of moving and stationary human. DeMan took advantage of amplitude and phase information of CSI to detect moving human and considered human breathing as an intrinsic indicator of stationary human [18]. Lv et al. proposed speed independent device-free entity detection (SIED) which is suitable for intrusion detection of a different entity moving speeds [19]. SIED captured the variance of variances of amplitudes of each CSI subcarrier and combined. Zhu et al [16] proposed R-TTWD for detection of moving human by taking advantage of the correlated changes over different subcarriers. Furthermore, they extract the first-order difference of eigenvector of CSI amplitudes across different subcarriers. Research [20] shows that the CSI can be used to achieve a detection rate of device-free human detection, and CSI is affected by human movements [21]. However, it is not optimal in timeliness of the algorithm. Research [13] shows that the CSI can be used to construct a low-cost and high-accuracy passive target localization method based on CSI model, which effectively combines the features of CSI with the target localization, which does not consider the detection area and detection rate relationship. Research [22] shows that the CSI is more temporally stable and provides the capability to benefit from the multipath effect, thus suitable for accurate human detection [23]. Research [24] seeks to monitor the position change of entities without actively carrying any physical devices. And research [25] shows that by creating a multiple hierarchical Dirichlet processes, NotiFi automatically learns the number of human body activity categories for abnormal detection.

Previous work on CSI-based human detection focused mainly on human behavior or used different methods to detect moving and stationary human separately [26]. The above papers all make good use of the characteristics of CSI, but some require special equipment to improve the positioning accuracy [27]. Furthermore, the overall performance and detection rate need to be improved to effectively achieve the accuracy of human behavior detection [28].

In view of the problems mentioned above, in this paper, we present a method for indoor human behavior detection based on principal component analysis (PCA)-Kalman feature extraction. The process goes through CSI data collection, feature extraction, model training to establish the human detection classifier, and the relationship between CSI fingerprints. We propose to apply Kalman on the CSI data to reduce noise and the computing complexity. We will apply PCA to extract the most contributing eigenvalues from the original CSI data.

At the same time, this method can reduce the dimension and reduce the time complexity of the algorithm. Meanwhile, we propose to apply support vector machine (SVM) on Wi-Fi CSI to achieve human detection. By doing this, the results of the classification will be converted into the physical location of the state information. In this paper, the Wi-Fi signal propagation model is used to detect the people’s different behavior in the physical space of human activity. Figure 1 shows the principle of the propagation of Wi-Fi signals in the physical space.

Fig. 1
figure 1

Wi-Fi signal propagation in indoor environments

Whenever human beings live indoors, the radio signals that are accepted will change significantly, and the amplitude information of the CSI will also change sensitively [29]. Based on this principle, we propose a method based on ubiquitous Wi-Fi signals to detect personnel behavior [30]. It is feasible to use CSI data to get from COTS wireless device [31]. And no testers are required to carry any additional Wi-Fi infrastructure or special sensor [32]. It can work under the condition of line-of-sight (LOS), non-line-of-sight (NLOS), and through one wall.

Particularly, this method provides a detection rate of around 92% for both moving and stationary people, while identifies human-free scenarios by 95%; all of which outperforms existing methods by about 20%. This method is greatly improved in the detection accuracy and overall efficiency compared with the traditional indoor personnel detection method.

In summary, the main contributions of the paper are as follows:

  1. a)

    We propose to use the fine-grained PHY layer information CSI for human behavior detection and, to the best of our knowledge, present a method for indoor human behavior detection based on principal component analysis (PCA)-Kalman feature extraction.

  2. b)

    We adopt Kalman algorithm to reduce noise in CSI data and apply PCA to extract the most contributing features from the CSI and reduce the dimensionality.

  3. c)

    Apply SVM classification to perform device-free human detection regardless of human moving or stationary.

  4. d)

    Regarding the performance of human detection, compare PCA-Kalman with other indoor human behavior detection methods. Investigate the parameters that affect the performance of human detection, such as the number of access points and the number of the packet and window size. Experiment results demonstrate that the PCA-Kalman can achieve high performance that outperforms traditional CSI-based system.

The rest of the paper is organized as follows. We review the related works in Section 2 briefly. In Section 3, we present the method design and the design details of with PCA-Kalman. We present the experimental setup with PCA-Kalman in Section 4. Evaluations, comparisons, results and discussion are reported in Section 5. Finally, we conclude the work in Section 6.

2 Related works

2.1 Human behavior detection with CSI

With the rise of cloud computing and the Internet of Things, as an enabling technology, network physical systems (CPS) are almost everywhere today [33, 34]. Yang et al. [35] proposed a complete data replica manager solution called “Auto Replica,” working in distributed caching and data processing systems using SSD-HDD tier storages. Auto Replica balances the trade-off between the performance and fault tolerance by storing caches in replica nodes’ SSDs. At the same time, we are in the era of data explosion and cloud computing [36], and large-scale data analysis is of great significance in various fields of research and industry [37]. With these technical supports, indoor positioning technology and indoor personnel status detection technology will be favored by all fields of research, and indoor positioning and indoor personnel status testing will become an essential part of life. Hu et al [38] proposed a method to detect human motion based on phase eigenvalue and then combined with covariance matrix and dynamic time window algorithm; finally, the experimental results of the HPMD system obtained a high-detection rate. Zhou et al [39] put forward a passive indoor location and detection method based on CSI. This method firstly collects effective CSI data, uses PCA algorithm for feature extraction and dimensionality reduction, then establishes fingerprint database, and finally, carries out on-line detection. The method is tested in two typical environments of visual distance and non-visual distance, and the detection rate is as high as 97% in the end. Compared with the traditional method of human behavior detection, this method improves the detection rate to a great extent. Wang et al [40] used CSI to detect the basic motion of human body, and CSI can be applied in real life. It can be seen that the use of CSI for indoor personnel status detection has developed very quickly, which will be the future development trend of wireless sensor network.

2.2 Novel applications based on CSI

Zhu et al [41] used CSI to analyze a series of effects of human motion on CSI, so a more robust passive human motion detection method was proposed, which uses PCA algorithm and spatial diversity provided by multiple antennas. Through the study of the quality of each antenna, the best antenna combination is selected to improve the accuracy of detection. Yan Wang et al [42] presented device-free location-oriented activity identification at home through the use of CSI. Domenico et al [43] presented a device-free crowd counting and occupancy estimation system by analyzing the shape of the Doppler spectrum of the received signal which was correlated to the number of people moving in the monitored environment. It can be seen that the detection of indoor human behavior detection using CSI signals has become a trend for the development of wireless sensor networks in the future.

2.3 CSI data collection

With the popularity of wireless networks and advances in orthogonal frequency division multiplexing (OFDM) technology, the traditional landscape has changed [31]. Channel responses can be extracted from commercial Wi-Fi devices under 802.11/g/n standards, which reveals that a set of channel measurements depict the amplitude and phase of each subcarrier [44]. Because RSSI cannot distinguish multiple signal propagation paths one by one [45], different multipath propagation conditions may lead to different sensitivities based on human movement, which further affects the results of human detection [46].

In multi-path indoor environment, wireless signals can change signal propagation in a more complicated way through reflection, diffraction and scattering, and human motion, which results in different amplitude signals under different sensitivities [47]. We were tested under three scenes line-of-sight distance, non-line-of-sight distance, and wall.

In order to evaluate PCA-Kalman’s ability to achieve LOS, NLOS, and through one wall behavior recognition. We extensively valuate PCA-Kalman’s performance in the following three scenarios, as shown in Fig. 2.

  1. a)

    LOS. The tester is in the LOS range between the transmitter and the receiver.

  2. b)

    NLOS. The tester is not on the LOS between the transmitter and the receiver, but within their range.

  3. c)

    Through the wall. The transmitter and the receiver are in adjacent rooms.

Fig. 2
figure 2

Experimental scenario layouts. a Line-of-sight, b non-line-of-sight, and c through one wall

As shown in Fig. 2, it can be seen that the distance between the signal sending end and the signal receiving terminal is different, and the different position of the personnel and the different actions of the body make an influence on the change of the signal. Therefore, the number of non-visual paths may interfere with human motion. More paths lead to more severe fluctuations in the received signals. In contrast, the LOS path, the person’s movement has no significant influence on the received signal. Therefore, from Fig. 3, we can see that in different environments, the distance between receiver and transmitter, location, and other factors have great influence on the sensitivity of received signals. It can be observed from Fig. 3a, b that there are great differences in amplitude signals in different environments. Figure 3a is more stable than Fig. 3b because Fig. 3a is collected in an open hall environment and has less interference. Figure 3b is a collection of data in a relatively complex laboratory environment, where there are a lot of electromagnetic interference, such as mobile phones and computers. And there are a lot of multipath interference, such as desks and chairs. This results in a large fluctuation of the signal in Fig. 3b. Therefore, through the comparison of two sets of amplitudes of CSI in different environments in Fig. 3, it can be concluded that the amplitude signals of CSI are different under different conditions. This phenomenon proves that it is feasible to use the amplitude signal of CSI as the characteristic value of indoor personnel state detection.

Fig. 3
figure 3

Fluctuations of CSI amplitudes under different sensitivities. a Amplitude changes in the open hall. b Amplitude changes in the laboratory

In order to better represent the multipath propagation, in the modeling stage, we use channel impulse response (CIR) to build the model. In the case of the linear time constant, CIR can be expressed as:

$$ h\left(\tau \right)=\sum \limits_{i=1}^N{a}_i{e}^{-j{\theta}_i\delta \left(\tau -{\tau}_i\right)} $$

Phase offset and time delay wherever aiθi, and τiare respectively the ith path attenuating. N represents the total number of propagation paths, and δ(τ) is a Dirac pulse function. Due to frequency selective fading during multipath propagation, in order to better characterize multipath propagation, we can select a channel frequency response (CFR) in order to better characterize multipath propagation. Since CFR is composed of amplitude-frequency response and phase-frequency response, CSI is fine-grained information from the physical layer that describes CFR from the transmitter to the receiver. Leveraging commodity network interface card (NIC) with modified firmware and driver, the amplitude and phase of each subcarrier within a channel can be revealed to the upper layers for each packet in the format of CSI.

Each CSI group represents the amplitude and phase of an OFDM subcarrier, which can be expressed as:

$$ H(k)=\left\Vert H(k)\right\Vert {e}^{j\angle H(k)} $$

In the formula above, H(k)and jH(k) are amplitude and phase of the kth subcarrier, respectively, since the amplitude information is more stable. Moreover, we use the amplitude to represent eigenvalue in the following process.

2.4 CSI feature extraction

In this paper, we collected CSI data in three different scenarios, and the data were obtained from common commercial Wi-Fi equipment, which is the real data. Because of the inherent noise of the environment and a series of electromagnetic interference, this will make the data unstable. In this paper, Kalman filter algorithm is used to reduce noise, and then PCA algorithm is used to extract the feature of the filtered eigenvalue. The combination of PCA algorithm and Kalman filter algorithm is the innovation of this paper. It not only make use of the better timeliness of Kalman filter algorithm, but also make use of the dimension reduction function of PCA algorithm.

Through repeated experiments, the experimental results show that the method proposed in this paper has good robustness and is tested in three different environments, so the method is more practical. We apply the Kalman algorithm to detect and remove the noise. In the first place, the goal of indoor exercise should be modeled. Figure 4a shows the raw CSI data collected from three receiving antennas at the receiving end, in which the isolated little black curve represents the noise and is marked with blue dashed lines. Figure 4b shows the CSI signal after removing redundant noise using the Kalman filter algorithm.

Fig. 4
figure 4

CSI denoising with Kalman filtering. a The CSI data Before Kalman filtering. b The CSI data after Kalman filtering

In our laboratory environment, we collected 360 dimensional CSI samples. But in the open hall environment, the CSI sample contains 270 dimensions. At the same time, high dimensionality causes time complexity. As each dimension may have a different contribution to human behavior detection, we apply PCA algorithm to extract the most contributing features and reduce the dimensionality of CSI data. PCA algorithm is based on the maximum variance of the high-dimensional feature space data, and then projected into the low-dimensional space through linear transformation, so that more indexes can be converted into several unique comprehensive indicators. The core of PCA is to diagonalize the covariance matrix so as to minimize the correlation between dimensions. Furthermore, it can raise and preserve the energy of the dimension. Specifically, as a high-dimensional data set, the raw data is maintained to the maximum extent while reducing the dimension and eliminating redundant data and noise as much as possible.

If the CSI signal is directly used as a fingerprint feature, the dimension of data is high, and the parameter estimation is difficult and computationally expensive. Furthermore, we use PCA to extract the features and remove the correlation between the location features and the components. This method reduces not only the dimension and the amount of data, but also the noise in the CSI signal and the positioning error. Consequently, we extract the eigenvalues directly from the subcarriers; thus, we extract more useful eigenvalues. We deployed N reference points in the selected positioning area. The position pi(xi, yi) of each reference point and the physical position of N reference points constitute a position space P = (p1, p2, …pN)T. The CSI signals of the position points are collected at each reference point, and each reference point is collected n times. And the collected signal is taken as the origin of the pi(xi, yi). Fingerprint information is recorded as an n-dimensional vector, Qi = (csi1, csi2, …, csin)T, i (1, N), where each CSI signal is again a complex matrix: m × n × 56.

We use the original position fingerprints of all reference points to make up an original position fingerprint space Q of n × N dimension, where Q is the Q = (Q1, Q2, …, QN)T, which Q is expressed as each row vector in the matrix. Q represents the original position fingerprints of the reference points.

3 PCA-Kalman design

This section presents the design of PCA-Kalman in a top-down manner, with emphasis on indoor human behavior detection. The architecture of PCA-Kalman mainly consists of two components: offline training phase and online testing phase. The working principle of using PCA-Kalman method to detect the behavior state of indoor personnel is shown in Fig. 5.

Fig. 5
figure 5

System architecture of PCA-Kalman

3.1 Offline training phase

In this section, we collect the position coordinates of each test area and process the received raw data of CSI. In this process, we leverage Kalman filter algorithm to reduce the noise of the original data and use the improved PCA algorithm to extract the most contributing features and reduce the dimensionality of CSI fingerprints. In other words, we extract the nonlinear feature of the original position fingerprint. Furthermore, we store the processed CSI signal in the fingerprint database and update the fingerprint database in real time according to the environment change.

In the first place, we derive a frequency-domain model of the state of a single channel. The formula can be expressed as:

$$ Y= HX+N $$

where Y is the received signal vector, X is a vector of the transmitted signal, H is the channel matrix, and N represents additional Gaussian white noise vectors. According to the previous step, CSI of all subcarriers can be expressed as:

$$ \mathrm{CSI}=\frac{Y}{X} $$

Then, the CSI of a single subcarrier can be expressed as:

$$ \mathrm{csi}=\left|\mathrm{csi}\right|{e}^{j\sin \angle \mathrm{csi}} $$

where |csi| and csi are the amplitude and phase corresponding to the subcarrier, respectively. Furthermore, we propose to apply Kalman filter algorithm to filter the amplitude information in the previous step. Suppose Xk to represent the state vector of the system at time k. If the change in the state quantity of the system can be expressed in the form of a linear equation. Then, the equation which becomes the state transition equation of the system can be expressed as:

$$ {X}_k={F}_k{X}_{k-1}+{B}_k{U}_k+{W}_k $$

where Fk is the state transition matrix, Bk is the control matrix, Uk is the control vector, and Wk is the noise of the transfer process. After Kalman filtering, these redundant noises are removed effectively.

We use the PCA algorithm to extract the main features of the original fingerprint space, and remove the redundant data to form the feature location fingerprint space, which can be expressed by the formula:

$$ {Q}^{\hbox{'}}={\left({Q_1}^{\prime },{Q_2}^{\prime },\dots, {Q_N}^{\prime}\right)}^T $$

The specific algorithm is as follows:

Step 1: Based on the above sample space formula, we can derive a new formula:

$$ Q={\left({Q}_1,{Q}_2,\dots, {Q}_N\right)}^T $$

Then, we calculate the center of the feature again. We use the data of each dimension minus the mean of the dimension data, in order to ensure that the average value of each dimension is zero. So, M represents the matrix.

Step 2: Construct the covariance matrix C:

$$ C=\frac{1}{N}{MM}^T $$

Step 3: Calculate the eigenvalue λi and eigenvector vi of the covariance matrix and then select the largest m eigenvectors:

Step 4: We project the original sample matrix:

Finally, we can get matrix Q' after dimension reduction.

3.2 Online behavior testing phase

At this stage, the transmitter is responsible for collecting real-time CSI data of each testing area. Similarly, the sender sends data on different behaviors made by the tester to the receiving end. Then, the SVM classifier is applied to the physical position coordinate state, and the classification result is obtained. Finally, the state of the estimated position is obtained. The main steps are as follows:

In the initialization phase, we divided the test area into 20 squares of the same size. Furthermore, we use these squares as reference points. The volunteers traverse the reference points one by one and perform different action states at each reference point, such as standing, jumping, squatting, sitting down, and other common actions.

The obtained CSI data is transferred to the server. As can be observed from Fig. 6, the changes in CSI signals vary significantly when testers perform different operations. What is more, real-time test data are collected in real experiment environment.

Fig. 6
figure 6

Amplitude changes under different motions. a Static. b Squat. c Jump. d Walk. e Waved. f Turn around

The next step is to apply the SVM classifier as follows:

Step 1: We assume that the sampling period for the CSI data at the receiving end is T, which is usually 1.0 s. Firstly, we let a volunteer traverse all reference points and perform daily actions such as standing, jumping, squatting, and sitting at the reference point. Assuming that the receiving end samples the sample training set is {(xi, yi)},  i = 1, 2, …, n. The SVM regression function is

$$ f(x)=w\cdot x+b $$

In the above formula, W is the weight vector, and b is the bias vector.

Step 2: By solving the convex quadratic programming problem to solve w and b in Eq. (17), the predictive function is obtained, and the objective function is minimized:

$$ Q(w)=\frac{1}{2}{\left\Vert w\right\Vert}^2+C\cdot {R}_{\mathrm{emp}}(f) $$

where C is the penalty factor, Remp(f) is the loss function.

Step 3: Using the relaxation factor to convert the optimization objective function of formula (11) into:

$$ \operatorname{Minimize}\frac{1}{2}{\left\Vert w\right\Vert}^2+C\sum \limits_{i-1}^l\left({\xi}_i+{\xi}_i^{\ast}\right) $$

where \( {\xi}_i,{\xi}_i^{\ast } \) are the relaxation factors.

Step 4: To speed up the solution, we choose to introduce the Lagrange function and solve the following dual form to obtain multipliers \( {\alpha}_i,{\alpha}_i^{\ast } \), expressed as:

$$ {\displaystyle \begin{array}{l}\operatorname{Maximize}=\sum \limits_{i=1}^l\left({\alpha}_i-{\alpha}_i^{\ast}\right){y}_i-\varepsilon \sum \limits_{i=1}^l\left({\alpha}_i+{\alpha}_i^{\ast}\right)-\\ {}\frac{1}{2}\sum \limits_{i,j=1}^l\left({\alpha}_i^{\ast }-{\alpha}_i\right)\left({\alpha}_j^{\ast }-{\alpha}_j\right)<{x}_i,{x}_j>\end{array}} $$

Step 5: For nonlinear predictive problems, SVM introduces the mapping function φ to map the original data into a new feature space. Then, we convert the nonlinear problem into a linear problem in the new feature space. At the same time, the SVM regression can be expressed as:

$$ f(x)=w\cdot \varphi (x)+b $$

Step 6: The optimization objective function of formula (13) is transformed into the following form:

$$ {\displaystyle \begin{array}{l}\operatorname{Maximize}=\sum \limits_{i-1}^l\left({\alpha}_i-{\alpha}_i^{\ast}\right){y}_i-\varepsilon \sum \limits_{i=1}^l\left({\alpha}_i+{\alpha}_i^{\ast}\right)-\\ {}\frac{1}{2}\sum \limits_{i,j=1}^l\left({\alpha}_i^{\ast }-{\alpha}_i\right)\left({\alpha}_j^{\ast }-{\alpha}_j\right)<\varphi \left({x}_i\right),\varphi \left({x}_j\right)>\end{array}} $$

Step 7: In this step, we introduce kernel function k(xi, xj) instead of (φ(xi), φ(xj)) formula. Additionally, (15) is transformed into the following form of optimization objective:

$$ {\displaystyle \begin{array}{l}\operatorname{Maximize}=\sum \limits_{i-1}^l\left({\alpha}_i-{\alpha}_i^{\ast}\right){y}_i-\varepsilon \sum \limits_{i=1}^l\left({\alpha}_i+{\alpha}_i^{\ast}\right)-\\ {}\frac{1}{2}\sum \limits_{i,j=1}^l\left({\alpha}_i^{\ast }-{\alpha}_i\right)\left({\alpha}_j^{\ast }-{\alpha}_j\right)k\left({x}_i,{x}_j\right)\end{array}} $$

Step 8: What is more, the final SVM prediction function is:

$$ f\left(x,{a}_i,{a}_i^{\ast}\right)=\sum \limits_{i=1}^l\left({a}_i-{a}_i^{\ast}\right)k\left({x}_i,{x}_j\right)+b $$

Step 9: We use real-time amplitude data collected and fingerprint data to match. When the testers conduct experiments on different actions in the test area, the amplitude characteristics change with the change of different conditions. It can be clearly seen from Fig. 6 that the amplitude changes corresponding to different actions are completely different.

4 Experimental setup

4.1 Hardware testbed

Both the transmitter and the receiver have installed the Atheros AR 9380 NIC supporting the IEEE802.11n protocol to facilitate the acquisition of CSI from the device. As shown in Fig. 9. We have installed an external antenna of about 1.5 m in length. And all transmitters are equipped with the Ubuntu 14.04 LTS 32-bit system and the 4.1.10 Linux kernel version. At the same time, we use open source drivers, Atheros-CSI-Tool, and Atheros NIC, developed by Hsieh and others.

The driver modules make it possible to obtain CSI from Linux kernel when it received signals and saved them for other process. One of the desktop computers equipped with Intel Core i3-4150 CPU works as a sender while another computer works as a receiver. In our system, the obtained data is processed using the PCA-Kalman algorithm in C program.

4.2 Experimental scenarios

We conducted our experiments in a research laboratory (8 m × 9 m) and a meeting room (6 m × 4 m) both piled with desks and computers as well as a hall (10 m × 9 m) in our campus, which is piled with desks and computers in the laboratory and meeting room, thus creating a rather complex multipath environment, as shown in Figs. 7 and 8. We evaluated the performance of PCA-Kalman in three rooms’ surroundings (Tables 1 and 2).

Fig. 7
figure 7

The testbeds: the laboratory and meeting room and hall. a Laboratory. b Meeting room. c Hall

Fig. 8
figure 8

Floor plan of the testing environment. a Laboratory. b Meeting room. c hall

Table 1 The accuracy of each methods under different situations
Table 2 The robustness evaluation of PCA-Kalman

In order to construct an offline histogram fingerprint, we gathered data first thing in the morning when no one was in the lab. In addition, for the purpose of behavior detection, we generated three test sets, including three different test areas. The infrastructure of indoor human behavior detection is composed of wireless access points (AP) for data transmission, monitoring points (MP) for data retrieval, and a server for data processing. Each AP continuously broadcasts information to facilitate the Wi-Fi device to find an access point. For complete coverage of the area of interest, each pair of AP-MP is placed at the corners or edges, forming diagonal lines [48]. Each pair of transmitting-receiving antennas is a link (Fig. 9).

Fig. 9
figure 9

The commercial hardware testbed. a Transmitter. b Receiver

5 Numerical results and discussion

In this section, we interpret the experimental setups and the analysis of system performance and parameters.

5.1 Feasibility of PCA-Kalman

First of all, we evaluated the rate of detection of human activities in three different scenarios. As shown in Table 3, we listed five common behaviors of people in the table. We have chosen a total of three scenarios, as shown in Fig. 2. Furthermore, we compare the PCA-Kalman method with the other two methods. Clearly, Fig. 10 shows that the accuracy of PCA-Kalman in LOS, NLOS, and through one wall is much higher than the accuracy of other two methods. And Table 1 lists the detailed data of Fig. 10a. In Fig. 10a, the accuracy of PCA-Kalman declines with the increasing distance; however, the accuracy of PCA-Kalman shown in Fig. 10b, c is not significantly reduced. So, the reason for that is when the tester is far from the receiving end, they are closer to the transmitting end. The signal transmitted increases, but the reflected signal decreases.

Table 3 Top five abnormal activities
Fig. 10
figure 10

ac The accuracy of abnormal activity detection in different scenarios. df The robustness evaluation of PCA-Kalman respectively. a LOS. b NLOS. c Through one wall. d LOS. e NLOS. f Through one wall

5.2 Robustness verification

Figure 10d–f shows the detection rate of human activity in three different scenarios. And Table 2 lists the detailed data of Fig. 10b. In each scene, the distance between the AP and the computer is the same. The results show that the average accuracy of the PCA-Kalman method is 89% in the LOS environment, 87% in the NLOS environment, and 74% in the wall penetration environment. In these three scenarios, the accuracy of the open hall test was high, reaching up to 92, 85, and 77%.

In three scenarios, the average detection rate of meeting rooms was 91, 88, and 75%, respectively. However, in all three scenarios, laboratories have lower detection rates of 84, 81, and 70%, respectively. Furthermore, the average detection rate in the open hall environment and in the meeting room environment is higher than that in the laboratory. The reason is that the laboratory environment has more interference than the other two environments, such as more work desks and office chairs.

On the other hand, we detect the activity of a tester at different distances between the transmitter and the receiver. We found that the closer the distance means the higher detection rate. In general, the closer the AP is to the computer, the higher the accuracy is of the results. This is because the reception effect of the Wi-Fi signal received is enhanced with the shortening of the communication distance, thus providing a more reliable CSI feature extraction to capture the different movements of the human body.

5.3 The effect of different test areas on the detection rate

In this section, we discuss the effect of different test areas on the detection rate. In order to detect the effect of the behavior state of different test areas on the detection rate, we divided the experimental area into 20 squares and numbered them in ascending order. Moreover, in this experiment, we have chosen a grid of 1 to 9 for testing. As shown in Fig. 11, obviously, we can see that the detection rate is the highest in the 4, 5, 6, and 7 grid regions. And Table 4 lists the detailed data corresponding to this figure.

Fig. 11
figure 11

Impacts of test area on detection accuracy

Table 4 The detection rate of different methods in different test areas

The main reason is that the distance between the transmitter and the receiver in these three areas is relatively close, and there is no excessive signal interference. However, the detection rates for the first three grids are lower because the three areas are far from the receiving end to the sending end with the interference of multipath effects such as tables and walls next to them. The results show that the detection rate of the PCA-Kalman method is higher than the other two systems.

5.4 Detection of different performance areas

We focused on the following main metrics to evaluate our detection rate: (a) TP (true positive) for the probability that the human behavior events are correctly detected and (b) FP (false positive) for the fraction of cases in which the system announced a “detected” event when there was no one moving.

In this section, we compared the detection performance of PCA-Kalman method with R-PMD and FIMD in different test areas. First, we split the test area into 10 small areas from 0 to 9, as shown in Fig. 12. And Table 5 lists the detailed data corresponding to Fig. 12a.

Fig. 12
figure 12

Detection performance of FIMD and PCA-Kalman with regard to different activity areas. a TP of different activity areas. b Corresponding FP rate

Table 5 The TP rate of different methods in different activity areas

Figure 12a shows the TP rates for different test areas. From the figure, we can observe and guess two points:

  1. (1)

    The FIMD method performs well in zones 2, 5, and 8, but shows significant degradation in other areas. This is because 2 and 5 are in the LOS environment, while others are in the NLOS environment. The test TP rate further confirms that FIMD is valid only in the LOS area and is not suitable for detecting random movement patterns of personnel. PCA’s TP rate is far greater than the FIMD over all regions. What is more, the PCA-Kalman method is the best performance. Which further determines the advantages of using PCA [49].

  2. (2)

    We also noticed that PCA achieved excellent results, with the exception of zone 3 testing in all regions, since zone 3 was far from the transmitter and receiver, resulting in less noticeable changes in the signal from people.

Because qualified motion detection systems need to have not only a high-TP rate, but also a low-FP rate. Therefore, the figure shows that the FP rate is also low, and we can clearly observe that the PCA-Kalman method is more stable than the simple PCA method.

At the same time, the detection rate is higher than that of FIMD method. The above experimental results confirm that PCA-Kalman is superior to the other two methods. And in the two aspects of TP and FP, comparison can show obvious advantages. Similarly, PCA-Kalman is a more stable method, which can have a higher detection rate in each experimental environment.

5.5 Impact of different sliding window sizes

Since the window size to a certain extent represents the size of the delay, it plays an important role in the overall performance of the detection rate. Additionally, the window size indicator is selected to evaluate the detection rate. Moreover, the window size and performance are proportional. The effect of time variance can be alleviated based on a large amount of data. As can be seen from Fig. 13, the detection rates of the three systems increase with the increase of the window size, but when the window size exceeds a certain set threshold, the time difference of the CSI will be caused by the different behavior states of the personnel. And Table 6 lists the detailed data of Fig. 13.

Fig. 13
figure 13

Impacts of window size on detection accuracy

Table 6 The effect of the window size of different methods on the detection accuracy

However, when the window is smaller, it is very difficult for the system to detect the human. Because the size of the variance reduces the sensitivity of the system and lowers in a static environment. The results show that the PCA-Kalman method can achieve the best detection performance when the sliding window size is set to 10, and the detection rate is relatively stable.

5.6 Impact of feature number

As shown in Fig. 14, when we use more features, it may produce a higher detection rate. Meanwhile, unlike the eigenvalues of the correlation matrix used in the FIMD, its principle is partially focused on the eigenvalues. However, the covariance matrix we used in the PCA-Kalman method is more dispersed. And Table 7 lists the detailed data corresponding to Fig. 14.

Fig. 14
figure 14

Impacts of feature number on detection accuracy

Table 7 The effect of the number of features of different methods on the detection accuracy

Nevertheless, it can be shown from the figure that when different features are used and the number of features increases, the detection rate of PCA-Kalman method proposed in this paper will also increase. Moreover, it is not difficult to see that when the eigenvalue reaches 5, it basically stays steady. In contrast, the turning point for method FIMD was 4 and beyond and the detection rate dropped significantly. The results show that the detection rate of our proposed PCA-Kalman method is more stable.

5.7 Impact of packet number

We observe that different data packets have a great influence on the detection accuracy of the experiment. Moreover, we choose different data packets for testing. As shown in Fig. 15, the true positive (TP) rate increases as the number of packets increases. The true negative (TN) rate is almost unaffected. The reason is that in the absence of a human being, most of the channel measurements remain stable enough for a short period of time to capture the feature.

Fig. 15
figure 15

Impacts of packet quantity on detection accuracy

On the contrary, inadequate samples cannot characterize human time changes because the effects of human movement are not evenly distributed. Overall, both TP and TN rates can reach 90%, so the method described in this article works well.

6 Conclusions

In this paper, we propose a method for detecting indoor activity using ubiquitous Wi-Fi, called PCA-Kalman, and extract CSI signals from commercial off-the-shelf (COTS) Wi-Fi devices. We propose to extract a robust feature from the CSI signal to detect the behavior change of indoor personnel. In order to achieve it, we analyzed the limitations of Kalman filtering technique and PCA to improve denoising performance and capture the representative signals of human behavior. Therefore, the use of CSI is triggered, and the method proposed in this paper can obtain higher detection rate and robustness without any equipment. Meanwhile, a method of detecting human behavior without equipment based on CSI is proposed, by applying SVM to solve the human behavior detection problem. And we applied on CSI data to reduce noise and PCA is applied to extract feature and reduce dimensionality.

Further, the experimental results show that the detection rate of this method is 95% in three different test areas. Therefore, the method has strong robustness and stability. Our repeated tests in different scenarios have been compared with other methods. Besides, PCA-Kalman method has a high stability and good detection rate of indoor personnel behavior detection method. However, there are some shortcomings in our approach. For example, when there are multiple people, this will affect our experimental results. Moreover, we will solve the problem in the future. In addition, in this paper, the experiment of this method is carried out in the 2.4 G band. In order to further improve the overall performance and efficiency, in the future, we will explore the performance and efficiency of indoor personnel status detection in the 5 G band.



Access points


Channel frequency response


Channel impulse response


Channel state information


False positive




Monitoring points


Network interface card




Principal component analysis


Received signal strength indication


Support vector machine


True negative


True positive




Wireless sensor networks


  1. L. Chen, X. Chen, L. Ni, Y. Peng, D. Fang, Human behavior recognition using Wi-Fi CSI: challenges and opportunities. IEEE Commun. Mag. 55(10), 112–117 (2017)

    Article  Google Scholar 

  2. X. Wu, Z. Tian, T.N. Davidson, G.B. Giannakis, Optimal waveform design for UWB radios. IEEE Trans. Signal Process. 54(6), 2009–2021 (2004)

    MATH  Google Scholar 

  3. L. Gong, W. Yang, Z. Zhou, D. Man, H. Cai, X. Zhou, et al., An adaptive wireless passive human detection via fine-grained physical layer information. Ad Hoc Netw. 38(C), 38–50 (2016)

    Article  Google Scholar 

  4. R. Zhou, X. Lu, P. Zhao, J. Chen, Device-free presence detection and localization with SVM and CSI fingerprinting. IEEE Sensors J. 17(23), 7990-7999 (2017)

  5. S. Li, Z. Qin, H. Song, X. Yang, R. Zhang, A lightweight and aggregated system for indoor/outdoor detection using smart devices. Futur. Gener. Comput. Syst. (2017).

  6. O. Ammae, J. Korpela, T. Maekawa, Unobtrusive detection of body movements during sleep using Wi-Fi received signal strength with model adaptation technique. Futur. Gener. Comput. Syst. 78, 616-625. (2018)

  7. A. Chriki, H. Touati, H. Snoussi, SVM-based indoor localization in wireless sensor networks. Wireless communications and mobile computing conference IEEE (pp. 1144-1149) (2017).

  8. C. Wu, Z. Yang, Z. Zhou, X. Liu, Y. Liu, J. Cao, Non-invasive detection of moving and stationary human with WiFi. IEEE Journal on Selected Areas in Communications 33(11), 2329–2342 (2015)

    Article  Google Scholar 

  9. H. Zhu, F. Xiao, L. Sun, X. Xie, P. Yang, R. Wang, Robust and passive motion detection with cots WiFi devices. Tsinghua Science Technology 22(4), 345–359 (2017)

    Article  Google Scholar 

  10. F. Xiao, X. Xie, H. Zhu, L. Sun, R. Wang, Invisible Cloak Fails: CSI-Based Passive Human Detection. In Proceedings of the 1st Workshop on Context Sensing and Activity Recognition (ACM, 2015), pp. 19–23

  11. K. Qian, C. Wu, Z. Yang, Y. Liu, K. Jamieson, Widar: Decimeter-Level Passive Tracking via Velocity Monitoring with Commodity Wi-Fi. In Proceedings of the 18th ACM International Symposium on Mobile Ad Hoc Networking and Computing. ACM (2017)

  12. L. Zhang, E. Ding, Z. Zhao, Y. Hu, X. Wang, K. Zhang, A novel fingerprinting using channel state information with MIMO–OFDM. Clust. Comput. 20(4), 1–14 (2017)

    Google Scholar 

  13. Wang, J., Jiang, H., Xiong, J., Jamieson, K., Chen, X., Fang, D., et al. LiFS: Low Human-Effort, Device-Free Localization with Fine-Grained Subcarrier Information). International Conference on Mobile Computing and NETWORKING ACM (Pp.243–256(2016)

  14. H. Wang, D. Zhang, Y. Wang, J. Ma, Y. Wang, S. Li, RT-fall: a real-time and contactless fall detection system with commodity wifi devices. IEEE Trans. Mob. Comput. 16(2), 511–526 (2017)

    Article  Google Scholar 

  15. J. Xiao, K. Wu, Y. Yi, et al., FIFS: Fine-Grained Indoor Fingerprinting System[C]//Computer Communications and Networks (ICCCN), 2012 21st International Conference on. IEEE, 2012: 1-7.

  16. H. Zhu, F. Xiao, L. Sun, R. Wang, P. Yang, R-TTWD: robust device-free through-the-wall detection of moving human with WiFi. IEEE Journal on Selected Areas in Communications (99), 1–1 (2017)

  17. J. Lv, W. Yang, L. Gong, D. Man, X. Du, Robust WLAN-Based Indoor Fine-Grained Intrusion Detection (IEEE Global Communications Conference, IEEE. pp. 1-6, 2017)

  18. H. Xie, L. Lin, Z. Jiang, W. Xi, K. Zhao, M. Ding, et al., Accelerating Crowdsourcing Based Indoor Localization Using CSI. IEEE, International Conference on Parallel and Distributed Systems IEEE (ICPADS). IEEE, (pp. 274-281)(2016)

  19. S.S. Nanivadekar, U.D. Kolekar, An approach involving dynamic group search optimization for allocating resources in OFDM-based cognitive radio system. Alex. Eng. J. 57(1), 193-202, (2018)

  20. D. Wu, D. Zhang, C. Xu, et al., Device-Free WiFi Human Sensing: From Pattern-Based to Model-Based Approaches[J]. IEEE. Commun. Mag. 55(10), 91-97 (2017)

  21. S. He, J. Chen, X. Li, X. Shen, Y. Sun, Mobility and intruder prior information improving the barrier coverage of sparse sensor networks. IEEE Trans. Mob. Comput. 13(6), 1–1 (2014)

    Google Scholar 

  22. X. Wang, L. Gao, S. Mao, S. Pandey, CSI-based fingerprinting for indoor localization: a deep learning approach. IEEE Trans. Veh. Technol. 66(1), 763–776 (2017)

    Google Scholar 

  23. Z. Zhou, Z. Yang, C. Wu, L. Shangguan, Y. Liu, Omnidirectional coverage for device-free passive human detection. IEEE Transactions on Parallel & Distributed Systems 25(7), 1819–1829 (2014)

    Article  Google Scholar 

  24. J. Xiao, K. Wu, Y. Yi, L. Wang, L.M. Ni, Fimd: fine-grained device-free motion detection. 90(1), 229–235 (2012)

  25. D. Zhu, N. Pang, G. Li, S. Liu, NotiFi: A ubiquitous WiFi-based abnormal activity detection system. Neural Networks (IJCNN), 2017 International Joint Conference on. IEEE. 1766-1773 (2017)

  26. S. Li, X. Li, K. Niu, H. Wang, Y. Zhang, D. Zhang, AR-Alarm: An Adaptive and Robust Intrusion Detection System Leveraging CSI from Commodity Wi-Fi. International Conference on Smart Homes and Health Telematics Springer. Cham. 10461, 211-223 (2017)

  27. N. Shrivastava, A. Trivedi, Combined beamforming with space-time-frequency coding for MIMO–OFDM systems. AEUE - International Journal of Electronics and Communications 69(6), 878–883 (2015)

    Article  Google Scholar 

  28. H.F. Mahdi, M. Ismail, R. Nordin, Comparison of channel state information estimation using slm and clipping-based papr reduction methods. Procedia Technology 11(1), 955–961 (2013)

    Article  Google Scholar 

  29. C. Xu, Z. Jia, P. Chen, B. Wang, CSI-Based Autoencoder Classification for Wi-Fi Indoor Localization (IEEE Control and Decision Conference, 2016). IEEE, pp. 6523–6528

  30. Y. Zheng, C. Wu, K. Qian, Z. Yang, Y. Liu, Detecting Radio Frequency Interference for CSI Measurements on COTS WiFi Devices. ICC 2017, 2017 IEEE International Conference on Communications (IEEE, pp. 1–6). (2017)

  31. Tzur, A., Amrani, O., Wool, A. Direction finding of rogue Wi-Fi access points using an off-the-shelf MIMO–OFDM receiver. Physical Communication, 17(C), 149–164 (2015)

  32. X. Li, D. Zhang, Q. Lv, J. Xiong, S. Li, Y. Zhang, et al., IndoTrack: device-free indoor human tracking with commodity Wi-Fi. Proceedings of the Acm on Interactive Mobile Wearable & Ubiquitous Technologies 1(3), 72 (2017)

    Google Scholar 

  33. R. Benlamri, M. Sparer, Leadership, Innovation and Entrepreneurship as Driving Forces of the Global Economy[M]. Springer. pp. 297-392 (2017)

  34. A.I. Alomari, A. Gawanmeh, Challenges in formal methods for testing and verificationof cloud computing systems. Scalable Computing Practice & Experience 16(3), 321–332 (2015)

    Google Scholar 

  35. Z. Yang, J. Bhimani, J. Wang, D. Evans, N. Mi, Z. Yang, et al., Automatic and scalable data replication manager in distributed computation and storage infrastructure of cyber-physical systems. Scalable Computing 18(4), 291–311 (2017)

    Google Scholar 

  36. Z. Yang, Y. Wang, J. Bhamini, C.C. Tan, N. Mi, EAD: elasticity aware deduplication manager for datacenters with multi-tier storage systems. Cluster Computing. (12), 1–19 (2018).

  37. Z. Yang, J. Bhimani, Y. Yao, C.H. Lin, J. Wang, N. Mi, et al., AutoAdmin: automatic and dynamic resource reservation admission control in Hadoop YARN clusters. Scalable Computing. 19(1), 53-68 (2018)

  38. H. Hu, L. Li, A New Method Using Covariance Eigenvalues and Time Window in Passive Human Motion Detection Based on CSI Phases (IEEE In Electromagnetic Compatibility (EMC-Beijing), 2017 IEEE 5th International Symposium, IEEE, 2017), pp 1–6.

  39. R. Zhou, X. Lu, P. Zhao, J. Chen, Device-Free Presence Detection and Localization with SVM and CSI Fingerprinting. IEEE sensors J. 17(23), 7990-7999 (2017)

  40. Wang, W., Liu, A. X., Shahzad, M., Ling, K., & Lu, S.. Understanding and Modeling of WiFi Signal Based Human Activity Recognition. International Conference on Mobile Computing and Networking ACM (Pp.65–76) (2015)

  41. Y. Wang, K. Wu, L.M. Ni, WiFall: Device-Free Fall Detection by Wireless Networks. IEEE Transactions on Mobile Computing. IEEE. 16(2), 581-594 (2017)

  42. Wang, Y., Liu, J., Chen, Y., Gruteser, M., Yang, J., & Liu, H.. E-eyes: device-free location-oriented activity identification using fine-grained WiFi signatures (2014)

    Book  Google Scholar 

  43. S. D. Domenico, G. Pecoraro, E. Cianea, M. D. Sanctis, Trained-Once Device-Free Crowd Counting and Occupancy Estimation Using WiFi: A Doppler Spectrum Based Approach. IEEE, International Conference on Wireless and Mobile Computing, NETWORKING and Communications IEEE, pp. 1-8 (2016).

  44. X. Zhou, T. Chen, D. Guo, X. Teng, B. Yuan, From one to crowd: a survey on crowdsourcing-based wireless indoor localization. Frontiers of Computer Science 1, 1–28 (2017)

    Google Scholar 

  45. A. Bansal, A.K. Kohli, Suppression of impulsive noise in ofdm system using imperfect channel state information. Optik - International Journal for Light and Electron Optics 127(4), 2111–2115 (2016)

    Article  Google Scholar 

  46. Y. Xie, Z. Li, M. Li, Precise Power Delay Profiling with Commodity WiFi. MobiCom '15 Proceedings of the 21st Annual International Conference on Mobile Computing and Networking, ACM. pp. 53-64 (2015)

  47. F. Deng, S. Guan, X. Yue, X. Gu, J. Chen, J. Lv, et al., Energy-based sound source localization with low power consumption in wireless sensor networks. IEEE Transactions on Industrial Electronics. 64(6), 4894-4902 (2017)

  48. Zhou, Q., Wu, C., Xing, J., Li, J., Yang, Z., & Yang, Q. Wi-Dog: Monitoring School Violence with Commodity WiFi Devices. Wireless Algorithms, Systems, and Applications (2017)

  49. P. Mathecken, T. Riihonen, S. Werner, R. Wichman, Constrained phase noise estimation in ofdm using scattered pilots without decision feedback. IEEE Trans. Signal Process. 65(9), 2348–2362 (2017)

    Article  MathSciNet  Google Scholar 

Download references


The authors would like to thank the reviewers for their thorough reviews and helpful suggestions.


This work was supported by the National Natural Science Foundation of China under grant nos. 61363059, 61762079, and 61662070; Key Science and Technology Support Program of Gansu Province under grant nos. 1604FKCA097 and 17YF1GA015; and Science and Technology Innovation Project of Gansu Province under grant nos. 17CX2JA037 and 17CX2JA039.

Author information

Authors and Affiliations



XCD has contributed towards the algorithms and the analysis. As the supervisor of YNH, he has proofread the paper several times and provided guidance throughout the whole preparation of the manuscript. YNH has contributed towards the algorithms, the analysis, and the simulations and wrote the paper. ZJH and XS have revised the equations, helped in writing the introduction and the related works, and critically revised the paper. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Zhanjun Hao.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Dang, X., Huang, Y., Hao, Z. et al. PCA-Kalman: device-free indoor human behavior detection with commodity Wi-Fi. J Wireless Com Network 2018, 214 (2018).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: