WiFi-based non-contact human presence detection technology

In the swiftly evolving landscape of Internet of Things (IoT) technology, the demand for adaptive non-contact sensing has seen a considerable surge. Traditional human perception technologies, such as vision-based approaches, often grapple with problems including lack of sensor versatility and sub-optimal accuracy. To address these issues, this paper introduces a novel, non-contact method for human presence perception, relying on WiFi. This innovative approach involves a sequential process, beginning with the pre-processing of collected Channel State Information (CSI), followed by feature extraction, and finally, classification. By establishing signal models that correspond to varying states, this method enables the accurate perception and recognition of human presence. Remarkably, this technique exhibits a high level of precision, with sensing accuracy reaching up to 99\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\%$$\end{document}%. The potential applications of this approach are extensive, proving to be particularly beneficial in contexts such as smart homes and healthcare, amongst various other everyday scenarios. This underscores the significant role this novel method could play in enhancing the sophistication and effectiveness of human presence detection and recognition systems in the IoT era.


System block diagram
The block diagram of the WiFi-based non-contact human presence sensing system proposed in this paper is presented in Fig. 1.Initially, a network card with modified firmware is utilized to gather channel state information.Following this, noise is mitigated using a low-pass filter and wavelet transform.Subsequently, an algorithm founded on a neural network is employed to extract distinguishing features.Ultimately, machine learning techniques are used to classify and identify human states.

Relevant theories
According to the IEEE 802.11 standard, the process of WiFi signal transmission is segmented into various subcarriers, each operating at a distinct frequency.The propagation paths of these subcarriers through the environment differ, leading to the diversity observed in the CSI data 14 .The CSI encompasses a range of data, including the time delay, amplitude attenuation, and phase shift experienced during the signal's transmission and reception.Essentially, CSI represents the physical layer information of the subcarriers, characterizing the cumulative effect on wireless signals at the receiver after undergoing reflection, refraction, and scattering across different environmental paths 29 .
In the frequency domain, the communication model for a system employing multiple transmitting and receiving antennas, characterized by narrowband flat fading, is represented as follows: Here, y denotes the received signal, x symbolizes the transmitted signal, n represents noise, and H is the signal transformation matrix.This matrix H reflects the impact of the external physical environment on the transmitted signal x, as it propagates from the transmitter to the receiver, transforming into y.The matrix H can also be estimated using the following equation: CSI is essentially a representation of H.At the receiver, the CSI for each subcarrier can be quantified in terms of amplitude and phase, as per the equation: In this notation, H i signifies the value of the ith subcarrier in the Channel State Information, H i represents the amplitude of the ith subcarrier, and ∠H i denotes the phase of the ith subcarrier 30 .The Signal-to-Noise Ratio (SNR) plays a critical role in this context, as it quantifies the level of the desired signal relative to the background noise, which is crucial in analyzing the quality and reliability of the communication channel.Variations in the environmental conditions during the wireless signal transmission can lead to multipath propagation, encompassing a line-of-sight path and several paths involving reflection and refraction 15,22 .The crux of this paper is to analyze the alterations in channel propagation, induced by environmental changes during the propagation process, to facilitate the detection of human presence.

Methodology Pretreatment
The channel state information acquired directly is susceptible to low-pass noise and, therefore, cannot be directly employed for human presence detection.Accordingly, a low-pass filtering method is chosen 20 .This technique exploits the characteristics of inductors with high resistance at low frequencies and capacitors with low resistance at high frequencies to perform data denoising.The formula is as follows: (1) where R is the resistance, l is the load series inductor, C is the parallel capacitor at both ends of the load resistance, and f c is the cutoff frequency.
To augment the detection of indoor human activities, wavelet transforms 17 , recognized for their aptitude to differentiate high and low-frequency components, are employed for noise reduction.The core principle hinges on signal extraction through localized transformations in both spatial and frequency domains.By employing scaling and translation, the CSI is analyzed multi-scale.This approach distinctly segregates high and low-frequency components, enhancing the robustness and precision of the sensing technology.The mathematical representations of the hard(φ hard (̟ )) and soft ( φ soft (̟ ) ) thresholding functions are shown in Eqs. ( 6) and (7), respectively.
where ̟ is the wavelet coefficient, the threshold value, and sgn(.)denotes the signum function.In hard thresh- olding, the coefficient is nullified if its absolute value is below the threshold, while preserved otherwise.In contrast, the soft thresholding reduces the absolute value of each coefficient by and sets it to zero if the result is non-positive.

Feature extraction
While preprocessing significantly improves signal quality, the extensive volume of data complicates the direct classification and interpretation of human activities.A self-organizing neural network 18 , utilizing unsupervised learning with a competitive approach, skillfully extracts channel state information features following preprocessing.This network primarily consists of input and output layers, dedicated to classification and clustering tasks.The operation sequence is as follows: The data first undergoes normalization to facilitate uniformity in subsequent processes.This step is mathematically represented as: Post-normalization, a similarity metric identifies the most relevant neurons.This involves the normalization of the weight vectors, expressed as: where X and Ŵj denote the normalized input and weight vectors, respectively.
The core of the competitive learning algorithm is to minimize the distance between the input vector and the weight vector of the selected neuron.This is encapsulated by the following equation: where j * represents the index of the winning neuron.
Subsequently, the output values are updated as follows: where y j (t + 1) denotes the output of the jth neuron at time (t + 1).
For the winning neuron, the weight vector is refined using the equation: Here, Ŵj * (t) is the weight vector at time t, adjusted to reduce the disparity with the input vector X .The term α , representing the learning rate, falls within the range (0, 1].It regulates the adaptation pace and magnitude of the weight vectors.
As the iteration count t progresses, the learning rate α gradually reduces to zero.This decline ensures the con- vergence and stability of the learning algorithm, thus preventing any potential overshooting of the optimal weight configuration.This methodical reduction in α is pivotal for the efficacy and efficiency of the learning process 16 .

Classification
In the pursuit of classifying and discerning features indicative of human presence, this study employs a softmax classifier 19 .This classifier adeptly computes probabilities for various states corresponding to different feature vectors.The operational flow of the softmax classifier is outlined as follows: Initially, data is introduced into the input layer.It then traverses through two distinct feature layers, undergoing processing and transformation.Conclusively, the softmax function is applied, ensuring that each output is normalized to a probability range of 0 to 1.This normalization is formally represented as: www.nature.com/scientificreports/for an input vector x ∈ R K , where i is the index of a particular element, and K is the total number of classes.Through this process, the classifier effectively transforms raw data into a probability distribution, facilitating the interpretation of each output as a conditional probability under various scenarios.This probabilistic framework allows for a more nuanced and accurate classification, pivotal in the intricate task of human presence feature recognition.

Ethics approval
This article does not contain any studies with human participants performed by any of the authors.

Experimental setup
In response to the necessity for detailed experimental methodologies and architectural insights, this document meticulously delineates the experimental procedures, ensuring lucidity and reproducibility.
Experimental setup: The CSI dimension in our study is 1*3*30.This configuration comprises 1 transmitting antenna and 3 receiving antennas.The experimental hardware involves two Lenovo desktop computers, each powered by Intel Core i5800 CPUs.The transmitting computer is equipped with a single antenna, while the receiving computer features three antennas.The wireless transceiving system includes a Monitor Point (MP) for signal reception and an Access Point (AP) for signal transmission.The spatial arrangement of these antennas is illustrated in Fig. 2.

Software and model construction:
The model is developed on MATLAB, a platform well-regarded for its robust capabilities in algorithm development and simulation.To ensure a consistent operational environment, both computers utilize Ubuntu 14.04 LTS.Equipped with Intel 5300 network cards, these systems are subjected to precise kernel and driver configurations prior to the installation of the CSI toolbox, as referenced in 23 .This toolbox is instrumental in processing the CSI, offering a comprehensive suite of functionalities for analyzing and interpreting wireless signal characteristics.It facilitates the extraction and manipulation of CSI data, essential for our research.Moreover, the Self-Organizing Map neural network employed in our study is configured with a default output dimension of 100, optimizing the performance for our specific application.
Data collection environment and process: Data was gathered in two distinct environments to evaluate the model's versatility and efficacy under various conditions.The first environment was a laboratory measuring 6.5 m by 8 m, filled with test benches, chairs, and computers, presenting significant obstructions and strong multipath interference.The second was a spacious conference room, sized of successfully detecting the presence of a person in the test set when someone is actually present.Conversely, the False Positive Rate indicates the probability of incorrectly identifying the presence of a person when, in reality, no one is present.

Baseline
To benchmark our model, the dataset is also utilized in replicating the methodologies outlined in the references FreeSense, Wi-alarm, and HAR.
FreeSense 17 : FreeSense identifies human motion by detecting the phase difference of amplitude waveforms on multiple antennas.
Wi-alarm 18 : Wi-alarm uses raw channel state information for human motion monitoring and uses SVM for detection.
HAR 21 : In this study, the author used CNN to perform edge detection on CSI data, enhancing human activity recognition based on WiFi.

Performance evaluation
Overall performance evaluation: To effectively assess its overall performance, the method was compared with FreeSense 17 , Wi-alarm 18 , and HAR 21 .As shown in Figs. 3 and 4, the method achieved the lowest FPR value across different data types, averaging approximately 1.2% , with a high TPR of 99.5% .This indicates fewer false alarms triggered by the method when detecting human presence.
Performance analysis in different environments: The versatility of our approach was further substantiated through a series of experiments conducted in diverse environments and postures, as depicted in Fig. 5.These figures illustrate the influence of environmental conditions on performance metrics.In both conference room and laboratory settings, the average TPR for detecting human presence was recorded at 98.8% and 98.4% , respectively, while the average FPR was 1.3% and 1.5% .This indicates a minor variance in the accuracy of human perception technology across different testing environments.The more spacious conference room experienced a reduced multipath effect.Conversely, the laboratory, smaller in size and cluttered with numerous objects, exhibited  Performance analysis across different body types: It allowed for the perception of individuals with varying genders, weights, and heights.The experimental results showed no substantial changes due to the posture of the subjects, thereby emphasizing the strong versatility of the method.As shown in Fig. 5.
Performance at different movement speeds: This study also assessed human motion perception at different speeds, such as slow walking, normal walking, fast walking, and sprinting.The experimental results were compared side by side with two typical methods, as shown in Figs. 6 and 7.The findings indicated that the method maintained a stable TPR and FPR across different movement speeds.However, the FPR significantly increased   www.nature.com/scientificreports/while the TPR notably decreased for the other three methods when participants moved at slower speeds.This outcome can be attributed to the reduced interference characteristics of the wireless signal during the slower speed sampling period, causing less impact of the human body on the wireless signals.Nevertheless, the Self-Organizing Competitive Neural Network used in this method, with its rich feature set, maintained stable TPR and FPR, proving the robust reliability of the method.

Performance under environmental changes:
To investigate the robustness of our model in the face of environmental changes, especially the effect of furniture rearrangement in rooms, we conducted targeted experiments.We modified the placement of chairs and tables in both lab and conference room settings to evaluate the impact on model performance.The results revealed that furniture rearrangement indeed influenced the model's performance.In the lab setting, post-adjustment, the TPR decreased by about 1.8%, and in the conference room, it decreased by approximately 2.1%.These findings suggest that while the model demonstrates considerable robustness, it is still somewhat affected by changes in furniture layout.Importantly, these tests were conducted without retraining the model, underscoring its adaptability to environmental shifts.However, the impact of furniture layout on performance warrants attention.In future research, we aim to explore this issue more thoroughly, with the goal of developing a more stable and efficient model for human presence detection.Through optimization and adjustments, we aspire to improve its detection accuracy and robustness in diverse settings, enhancing its applicability in smart homes, healthcare monitoring, and other scenarios.

Conclusion
Addressing the stability issues and user inconveniences of traditional human perception recognition techniques, this study presents a non-contact human presence detection technology.By preprocessing, extracting features, and classifying the CSI signals, we can discern different states such as an empty room, a room with a present individual, and a room where someone has recently been, demonstrating robust accuracy and versatility.Nevertheless, the current study only detects human presence within a room and does not recognize specific movements or simultaneous actions of multiple people, which limits its applicability.Future research will pivot towards the perception of multiple individuals' actions, broadening the scope and functionality of this technology.

Figure 5 .
Figure 5. FPR under different environment and personnel posture.