Wi-Fi channel state information-based human behavior detection system and method for smart building

Through a human behavior detection system based on Wi-Fi channel state information, a two-way long and short-term memory network is used for action recognition, which solves the problems of privacy infringement, high cost and low sensitivity in the existing technology, and realizes accurate and convenient monitoring of indoor human behavior, and is suitable for a variety of smart building applications.

CN119729362APending Publication Date: 2025-03-28BEIJING UNIV OF TECH

Patent Information

Application Number
CN202510229909.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The existing human behavior capture technology has problems such as privacy infringement, high cost, low sensitivity and application limitations, making it difficult to effectively monitor and identify indoor human behavior.

Method used

The human behavior detection system based on Wi-Fi channel state information is adopted, and through data acquisition, preprocessing and action recognition modules, a two-way long and short-term memory network is used to perform action recognition on the preprocessed CSI data to achieve non-invasive and convenient human behavior monitoring.

Benefits of technology

The system can effectively deal with noise and outliers, improve the accuracy and reliability of action recognition, and realize accurate identification of indoor human behavior. It is suitable for smart homes, healthy elderly care and smart medical fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729362A_ABST
    Figure CN119729362A_ABST
Patent Text Reader

Abstract

The invention discloses a human behavior detection system and method for a smart building based on Wi-Fi channel state information, and belongs to the technical field of smart buildings. The human behavior detection system comprises a data acquisition module, a data processing module and an action recognition module; the specific process is as follows: firstly, collecting CSI data; then, the collected CSI data is processed; performing action recognition on the processed CSI data based on a bidirectional long short-term memory network; and finally, performing performance evaluation on the model through the evaluation indexes. According to the human behavior detection system and method for the smart building based on the Wi-Fi channel state information, a solution which is more convenient, more private and lower in cost is provided for indoor human behavior recognition, and the system and method have wide application prospects in the smart building fields such as smart home, health care and smart medical treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of smart buildings, and in particular relates to a human behavior detection system and method for smart buildings based on Wi-Fi channel status information. Background Art

[0002] Smart buildings are a key trend in modern urban development. Their core function is to enable dynamic interaction and automatic adjustment between the built environment and people by learning and adapting to human behavior patterns and personal preferences, thereby meeting diverse human needs. Smart buildings not only enhance building intelligence, energy efficiency, safety, and sustainability, but also significantly reduce energy consumption and operation and maintenance costs through data-driven decision-making. In 2022, global energy consumption reached 442 exajoules, of which buildings accounted for 30.1%. By 2050, global energy demand is projected to increase by approximately 45% compared to 2022. Compared to conventional buildings, smart buildings can not only reduce building energy consumption by 50% but also reduce building control system maintenance costs by 15% and labor costs by 40-60% over their entire lifecycle within ten years. Haier's highly efficient computer rooms, built in smart buildings, have ultimately reduced energy consumption by 40%, increased office efficiency by 30%, and reduced the number of operation and maintenance personnel by 30%, achieving convenient management and high energy efficiency.

[0003] People spend approximately 90% of their time indoors, making indoor human behavior a crucial factor in human safety, healthy buildings, and building energy consumption. Children climbing or running indoors can cause falls or collisions. Curiously, they may also put their hands or conductive objects into electrical outlets, resulting in electric shock. Elderly people, due to declining physical function, are more susceptible to falls and injuries, with over 50% of these occurring at home. Prolonged sedentary behavior (especially >8 hours per day) can increase the risk of cardiovascular disease, type 2 diabetes, and other conditions by 6–21%. Early detection of these behaviors can significantly reduce the risk of death and illness. Human behavior also plays a crucial role in building energy efficiency. Building energy consumption is primarily driven by people maintaining comfort through systems such as heating, cooling, ventilation, and artificial lighting. The use of appliances like air conditioners, lighting habits, and window opening can all lead to varying levels of comfort and, consequently, energy consumption. Human behavior in a building can cause up to tenfold differences in building energy consumption. Smart buildings can manage energy use more effectively and reduce building energy consumption by judging and predicting people's behavior patterns in real time.

[0004] Smart buildings can monitor the above-mentioned indoor human behaviors in real time, but through investigation, it is found that Figure 1 As shown, 63.6% of homes or offices do not have smart homes installed ( Figure 1Even in places where smart homes are installed, 18.6% of people never use their smart functions ( Figure 1 b). Users have high demands for intuitiveness and ease of use of smart home systems. 82.2% of people said that controlling devices in a building environment through a gesture or simple body movement would be more convenient than contact button control ( Figure 1 Among the reasons that hinder the use of smart home technology, price factors play a dominant role, with 67.8% of people believing that high prices are the main reason for not using smart home technology. Privacy infringement and operational difficulties follow closely behind, with 61% and 50.9% respectively. Figure 1 People have the most urgent need for improvements to lighting technology in their homes or offices, with 73.7% believing further improvements are needed. This suggests users have higher expectations for intelligent lighting systems, energy-saving effects, and adjustable capabilities. Temperature control is the second most desired option at 69.5%, while windows and sunshades are third, with 59.3% indicating a need for improvement. Figure 1 Regarding intelligent health and safety technologies, the demand for Wi-Fi human behavior recognition and control is also significant: 78.8% of people believe that indoor medical assistance is very important. This high proportion reflects the importance people attach to health monitoring and management in an aging society and with an increasing number of chronic disease patients. Indoor security and comfort are also key areas of concern, with demand proportions of 73.7% and 77.1%, respectively. Figure 1 f).

[0005] In summary, all current human behavior capture technologies have drawbacks. While cameras can provide accurate information on the number of people, location, and movement, they infringe on privacy, rely on lighting conditions, and have blind spots. Passive infrared sensors (PIR), while low-cost and easy to deploy, are susceptible to interference from environmental factors such as temperature fluctuations, airflow, and direct sunlight, resulting in reduced sensitivity and a limited field of view. Ultrasonic sensors experience uneven signal reflection when the target surface is rough, resulting in relative measurement accuracy errors exceeding 20% ​​for varying surface roughness. Wearable sensors, including radio frequency identification (RFID), require a separate device for each monitored person, making them inconvenient and prohibitive for use in public places such as shopping malls. Sensor fusion technology can improve accuracy by combining data from multiple sensors, but it is costly, can have slow response times, and is sensitive to environmental changes. Therefore, there is an urgent need to develop privacy-preserving, non-invasive human behavior monitoring methods to support indoor occupant safety, health, comfort, convenience, and building energy efficiency. Summary of the Invention

[0006] The purpose of this invention is to provide a human behavior detection system and method for smart buildings based on Wi-Fi channel status information. Human motion recognition technology based on Wi-Fi signals, with its advantages of non-invasiveness, widespread equipment, ease of operation, and privacy protection, effectively compensates for the shortcomings of traditional methods. It can assist in the intelligent recognition of indoor human behavior and has broad application prospects in smart building fields such as smart homes, health care, and smart medical care, providing strong support for the sustainable development of cities.

[0007] To achieve the above objectives, the present invention provides a human behavior detection system for smart buildings based on Wi-Fi channel status information, including a data acquisition module, a data processing module and a motion recognition module; The data acquisition module includes a signal transmitter and a signal receiver, and the signal receiver is equipped with a CSITool (channel state information acquisition tool); The data processing module preprocesses and converts the raw CSI (channel state information) data. The raw CSI data contains noise and outliers. The noise and outliers in the raw CSI data are preprocessed through format conversion, amplitude information extraction, PCA dimensionality reduction, Hampel filtering, and Gaussian smoothing. The action recognition module further processes the preprocessed CSI data. First, the dataset is partitioned for model training and performance evaluation. Then, action recognition models are compared to determine the most accurate model for Wi-Fi sensor human behavior classification. Finally, the model's generalization capability is tested.

[0008] The present invention also provides a method for a human behavior detection system for a smart building based on Wi-Fi channel status information, comprising the following steps: Step 1: Collect CSI data; Step 2: Process the collected CSI data; Step 3: Perform action recognition on the CSI data processed in step 2 based on a bidirectional long short-term memory network; Step 4: Evaluate the performance of the model using evaluation indicators, including accuracy, precision, recall, and F1 score.

[0009] Preferably, the process of processing the collected CSI data in step 2 is as follows: S21. Format conversion and amplitude information extraction. The specific process is as follows: S211. Determine the channel information in the frequency domain. The expression is as follows: (1) Where, and denote the transmitted signal vector and the received signal vector respectively, The vector represents white noise, which simulates the noise data in the surrounding environment; S212. According to formula (1), determine the approximate representation H of the CSI of each subcarrier, which is expressed as follows: (2) S213. The CSI data of an action collected by the CSI Tool contains 30 subcarrier groups, and the expression is as follows: (3) S214, for each subcarrier Expressed as follows: (4) in, Indicates the Complex form of CSI on subcarriers; and Respectively represent CSI amplitude and CSI phase on subcarriers, is an imaginary unit, satisfying ; S22. Use principal component analysis (PCA) to reduce data dimensionality. The specific process is as follows: S221. Calculate the covariance matrix of the data , the expression is as follows: (5) Where, is the number of samples, that is, the data matrix the number of rows, is the mean of the data, Amplitude data representing an action; S222, performing eigenvalue decomposition on the covariance matrix to obtain eigenvector coeff and eigenvalue latent; S223. Calculate the cumulative contribution rate. The expression is as follows: (6) In the formula, cumsum means cumulative sum, sum means total; S224. Select the principal component and project the data into the principal component space. The expression is as follows: (7) Where, is the number of principal components selected, It is the data after dimensionality reduction; S23. Remove outliers from the amplitude data using Hampel. The specific process is as follows: S231, the data after dimensionality reduction For each data point in , calculate the median xmedian and standard deviation xsigma of its neighborhood (window size is 4); S232, determine whether the current data point is an outlier: If ,but is an outlier; yes The data points; S233, replace outliers with the median of the neighborhood; S234, storing the filtered data in Among them Represents the data after Hampel filtering; S24. Perform convolution operation through Gaussian smoothing to obtain smoothed data. The specific process is as follows: S241. Define a Gaussian kernel: G = fspecial('gaussian', [hsize sigma]); the fspecial function generates a Gaussian filter kernel, 'gaussian' specifies the generation of a Gaussian kernel; hsize is the kernel size, i.e., the window size, and sigma is the standard deviation, which controls the degree of smoothing; S242, data Convolution operation with Gaussian kernel , and obtain the smoothed data ,in is the convolution function, Indicates that the output data size is the same as the input data.

[0010] Preferably, the process of performing action recognition on the CSI data processed in step 2 based on the bidirectional long short-term memory network in step 3 is as follows: S31. Dataset division: randomly divide the sample data into training set and test set, with 80% used for training and 20% for testing; S32. Construct a bidirectional long short-term memory network model; S33, training a bidirectional long short-term memory network model; S34. Use the trained bidirectional long short-term memory network model to classify and identify CSI data. When a new action appears, the model compares the features of these actions with the previously trained features, finds the most similar category, and then outputs the category of this action.

[0011] Preferably, the bidirectional long short-term memory network model constructed in S32 includes an input layer, a bidirectional LSTM layer, a ReLU activation layer, a fully connected layer, a Softmax layer, and a classification layer. The specific contents of each layer are as follows: Input layer (sequenceInputLayer): This layer receives input data. The input size is 30, indicating that each data sample is a sequence of length 30, corresponding to the 30 subcarriers in S213. It is usually used to process time series data, text data, or other data with sequential properties. Bidirectional LSTM layer (BiLSTM): The bidirectional LSTM layer has 200 hidden units. The bidirectional LSTM layer simultaneously learns the forward and backward information of the sequence data to better capture the contextual characteristics of the sequence. The bidirectional LSTM layer only outputs the hidden state of the last time step of the sequence, rather than the hidden state of the entire sequence. ReLU activation layer (reluLayer): The ReLU (rectangular linear unit) activation function introduces nonlinearity, enabling the network to learn more complex patterns. The ReLU activation function speeds up training and prevents the gradient vanishing problem; Fully Connected Layer: The fully connected layer linearly combines the output of the ReLU activation layer with the score of each class. The number of outputs is set to 5, corresponding to the 5 action categories. Softmax layer (softmaxLayer): The Softmax layer converts the output of the fully connected layer into a probability distribution so that the output value is between 0 and 1 and the sum is 1, which is convenient for classification; Classification Layer: The classification layer determines the final classification result based on the probability distribution of the Softmax layer and calculates the classification loss to guide model training.

[0012] Preferably, in S33, training the bidirectional long short-term memory network model requires setting the hyperparameters of network training. The specific parameters are as follows: Optimizer: Use Adam optimizer, a commonly used gradient descent optimization algorithm that can adaptively adjust the learning rate based on the exponentially decaying average of the gradient; Execution environment: Set to use GPU for accelerated computing. If there is no GPU, it will automatically switch to CPU. Gradient threshold: set to 1. When the gradient exceeds 1, the gradient is clipped to prevent the gradient explosion problem. Batch size: The size of each batch is set to 450. The batch size affects the training speed and the generalization ability of the model; Maximum number of training epochs: set to 4000, which means the model will go through 4000 complete training cycles (each cycle processes the entire training dataset once); Sequence length: Set so that all sequences are padded or truncated to the length of the longest sequence in the training data to maintain consistency of the input data; Data shuffling: Set to not shuffle the data during the entire training process.

[0013] Preferably, the calculation expressions for Accuracy, Precision, Recall and F1 score are as follows: (8) (9) (10) (11) Where TP (True Positive) represents the number of samples that correctly predict the behavior, FN (False Negative) represents the number of samples that incorrectly predict other behaviors, FP (False Positive) represents the number of samples that incorrectly predict the behavior, and TN (True Negative) represents the number of samples that correctly predict other behaviors.

[0014] Therefore, the present invention adopts the above-mentioned human behavior detection system and method for smart buildings based on Wi-Fi channel status information, which has the following beneficial effects: (1) The data processing module can be used to pre-process the original CSI data comprehensively and effectively. Through operations such as format conversion, amplitude information extraction, PCA dimensionality reduction, Hampel filtering and Gaussian smoothing, it can effectively process the noise and outliers contained in the original CSI data, improve data quality, and thus enhance the accuracy of action recognition. (2) The action recognition module can further process the pre-processed CSI data, including data set division, action recognition model comparison and model generalization ability test, which helps to optimize the effect of action recognition and make the model more accurate and reliable. At the same time, action recognition is performed based on the bidirectional long short-term memory network. The bidirectional LSTM layer can simultaneously learn the forward and reverse information of the sequence data, improve the learning ability of action features, and help to more accurately identify different human behaviors. (3) When training the bidirectional long short-term memory network model, reasonable hyperparameters were set, such as using the Adam optimizer, setting an appropriate gradient threshold, batch size, maximum number of training rounds, sequence length, and data rearrangement method, which helped the model converge quickly and stably, improving training efficiency and model accuracy.

[0015] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a statistical chart of the survey results on background technology, where (a) indicates whether smart home devices are installed; (b) indicates whether the smart functions of smart home devices are used; (c) indicates whether gesture control is more convenient than touch button control; (d) indicates the limitations of current smart home technology; (e) indicates the willingness to use current smart buildings; and (f) indicates the improvement directions of smart home technology in medical services, convenient management, security, and energy saving. Figure 2 This is an architecture diagram of the human behavior detection system for smart buildings based on Wi-Fi channel status information of the present invention; Figure 3 Schematic diagram of the experimental environment and acquisition process of an embodiment of the present invention; Figure 4 Flowchart of original CSI data processing according to an embodiment of the present invention; Figure 5 Figure 1 is a diagram showing the CSI data processing results of an embodiment of the present invention, where (a) is the original CSI data; (b) is the CSI data after PCA processing; (c) is the CSI data after Hampel processing; (d) is the CSI data after Gaussian smoothing; and (e) is the Hampel filtering process. Figure 6 This is a graph showing the evaluation index results of various algorithms in an embodiment of the present invention; Figure 7 1 is a confusion matrix diagram of different classification algorithms according to an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort shall fall within the scope of protection of the present invention.

[0018] See also Figure 2-Figure 7 , a human behavior detection system for smart buildings based on Wi-Fi channel status information, including a data acquisition module, a data processing module and a motion recognition module; The data acquisition module includes a signal transmitter and a signal receiver, and the signal receiver is equipped with a CSITool (Channel State Information Acquisition Tool). A router (TP-LINK 450M, TL-WR886N) is used as the signal transmitter. Specific parameters are shown in Table 1. A laptop is used as the signal receiver. The signal receiver is a Lenovo laptop running Debian Desktop 4.8.4 and supporting the Linux 3.16.0 operating system. It is equipped with an Intel 5300 network card and can be connected to an expansion antenna. Table 1 ;

[0019] The data processing module preprocesses and converts the raw CSI (channel state information) data. The raw CSI data contains noise and outliers. The noise and outliers in the raw CSI data are preprocessed through format conversion, amplitude information extraction, PCA dimensionality reduction, Hampel filtering, and Gaussian smoothing. The action recognition module further processes the preprocessed CSI data. First, the dataset is partitioned for model training and performance evaluation. Then, action recognition models are compared to determine the most accurate model for Wi-Fi sensor human behavior classification. Finally, the model's generalization capability is tested.

[0020] A method for a human behavior detection system for a smart building based on Wi-Fi channel state information includes the following steps: Step 1: Collect CSI data; Step 2: Process the collected CSI data. The specific process is as follows: S21. Format conversion and amplitude information extraction. The specific process is as follows: S211. Determine the channel information in the frequency domain. The expression is as follows: (1) Where, and denote the transmitted signal vector and the received signal vector respectively, The vector represents white noise, which simulates the noise data in the surrounding environment; S212. According to formula (1), determine the approximate representation H of the CSI of each subcarrier, which is expressed as follows: (2) S213. The CSI data of an action collected by the CSI Tool contains 30 subcarrier groups, and the expression is as follows: (3) S214, for each subcarrier Expressed as follows: (4) in, Indicates the Complex form of CSI on subcarriers; and Respectively represent CSI amplitude and CSI phase on subcarriers, is an imaginary unit, satisfying ; S22. Use principal component analysis (PCA) to reduce data dimensionality. The specific process is as follows: S221. Calculate the covariance matrix of the data , the expression is as follows: (5) Where n is the number of samples, that is, the number of rows in the data matrix x, μ is the mean of the data, and x represents the amplitude data of a certain action; S222, performing eigenvalue decomposition on the covariance matrix to obtain eigenvector coeff and eigenvalue latent; S223. Calculate the cumulative contribution rate. The expression is as follows: (6) In the formula, cumsum means cumulative sum, sum means total; S224. Select the principal component and project the data into the principal component space. The expression is as follows: (7) Where, is the number of principal components selected, It is the data after dimensionality reduction; S23. Remove outliers from the amplitude data using Hampel. The specific process is as follows: S231, the data after dimensionality reduction For each data point in , calculate the median xmedian and standard deviation xsigma of its neighborhood (window size is 4); S232, determine whether the current data point is an outlier: If ,but is an outlier; yes The data points; S233, replace outliers with the median of the neighborhood; S234, storing the filtered data in Among them Represents the data after Hampel filtering; S24. Perform convolution operation through Gaussian smoothing to obtain smoothed data. The specific process is as follows: S241. Define a Gaussian kernel: G = fspecial('gaussian', [hsize sigma]); the fspecial function generates a Gaussian filter kernel, 'gaussian' specifies the generation of a Gaussian kernel; hsize is the kernel size, i.e., the window size, and sigma is the standard deviation, which controls the degree of smoothing; S242, data Convolution operation with Gaussian kernel , and obtain the smoothed data ,in is the convolution function, Indicates that the output data size is the same as the input data.

[0021] Step 3: Perform action recognition on the CSI data processed in step 2 based on a bidirectional long short-term memory network. The specific process is as follows: S31. Dataset division: randomly divide the sample data into training set and test set, with 80% used for training and 20% for testing; S32. Construct a bidirectional long short-term memory network model. The bidirectional long short-term memory network model includes an input layer, a bidirectional LSTM layer, a ReLU activation layer, a fully connected layer, a Softmax layer, and a classification layer. The specific contents of each layer are as follows: Input layer (sequenceInputLayer): This layer receives input data. The input size is 30, indicating that each data sample is a sequence of length 30, corresponding to the 30 subcarriers in S213. It is usually used to process time series data, text data, or other data with sequential properties. Bidirectional LSTM layer (BiLSTM): The bidirectional LSTM layer has 200 hidden units. The bidirectional LSTM layer simultaneously learns the forward and backward information of the sequence data to better capture the contextual characteristics of the sequence. The bidirectional LSTM layer only outputs the hidden state of the last time step of the sequence, rather than the hidden state of the entire sequence. ReLU activation layer (reluLayer): The ReLU (rectangular linear unit) activation function introduces nonlinearity, enabling the network to learn more complex patterns. The ReLU activation function speeds up training and prevents the gradient vanishing problem; Fully Connected Layer: The fully connected layer linearly combines the output of the ReLU activation layer with the score of each class. The number of outputs is set to 5, corresponding to the 5 action categories. Softmax layer (softmaxLayer): The Softmax layer converts the output of the fully connected layer into a probability distribution so that the output value is between 0 and 1 and the sum is 1, which is convenient for classification; Classification Layer: The classification layer determines the final classification result based on the probability distribution of the Softmax layer and calculates the classification loss to guide model training.

[0022] S33. Train a bidirectional long short-term memory network model. Training the bidirectional long short-term memory network model requires setting network training hyperparameters. The specific parameters are as follows: Optimizer: Use Adam optimizer, a commonly used gradient descent optimization algorithm that can adaptively adjust the learning rate based on the exponentially decaying average of the gradient; Execution environment: Set to use GPU for accelerated computing. If there is no GPU, it will automatically switch to CPU. Gradient threshold: set to 1. When the gradient exceeds 1, the gradient is clipped to prevent the gradient explosion problem. Batch size: The size of each batch is set to 450. The batch size affects the training speed and the generalization ability of the model; Maximum number of training epochs: set to 4000, which means the model will go through 4000 complete training cycles (each cycle processes the entire training dataset once); Sequence length: Set so that all sequences are padded or truncated to the length of the longest sequence in the training data to maintain consistency of the input data; Data Shuffle: Set to not shuffle data during the entire training process because the data itself has time series correlation or is arranged in a specific order.

[0023] S34. Use the trained bidirectional long short-term memory network model to classify and identify CSI data. When a new action appears, the model compares the features of these actions with the previously trained features, finds the most similar category, and then outputs the category of this action.

[0024] Step 4. Evaluate the performance of the model using evaluation indicators, including accuracy, precision, and recall. The calculation expressions for accuracy, precision, recall, and F1 score are as follows: (8) (9) (10) (11) Where TP (True Positive) represents the number of samples that correctly predict the behavior, FN (False Negative) represents the number of samples that incorrectly predict other behaviors, FP (False Positive) represents the number of samples that incorrectly predict the behavior, and TN (True Negative) represents the number of samples that correctly predict other behaviors.

[0025] Example The specific layout of the experimental collection environment and the relative positions of the collection equipment are as follows: Figure 3 As shown in the figure, the room is free of any obstructions such as furniture. The data collection platform is deployed in the room, with the transceiver located in the center of the room, at a distance of 2 meters.

[0026] During each Wi-Fi data collection process, an operator was responsible for issuing the start and end instructions on the collection platform, guiding the collection process and saving the data samples; an experimental participant completed the corresponding actions as required in the collection area. A total of 10 volunteers were recruited for this experiment. Before the collection, the staff trained the volunteers and required them to follow the standard process. Figure 3 The transmitter was set to transmit 30 data packets per second. The participant was positioned in the middle of the transceiver, facing the receiver. A staff member operated a computer at the receiver. At the start of the experiment, the staff member and participant remained stationary at designated locations for 2-3 seconds. The staff member began data collection and issued a start motion command. 2-3 seconds later, the participant began performing a motion. After completing the motion in 2-3 seconds, the participant remained stationary for 2-3 seconds. The staff member stopped data collection and saved the motion sample. At the end of the experiment, only one motion was recorded at a time. Five motions were recorded throughout the experiment: horizontal right hand swing, double hand wave, high right hand swing, right hand throwing a paper ball, and right leg forward kick. 50 samples were collected for each motion. The entire experiment took 33-50 minutes for one volunteer. During the data collection period, to ensure participant comfort and consistency of each motion, participants were allowed to rest at any time according to their physical condition and return to the experiment later. Each activity sample collected consisted of more than 6 seconds of data, including 2-3 seconds of active data (valid data) and 4-6 seconds of blank data (no motion data). Blank data can ensure the stability of the activity signal pattern and reduce the impact of outliers and noise on the true activity signal pattern.

[0027] This study compared the performance of seven machine learning algorithms—support vector machines (SVMs), K-nearest neighbors (KNNs), decision trees (DTs), random forests (RFs), gated recurrent units (GRUs), long short-term memory networks (LSTMs), and bidirectional long short-term memory networks (Bi-LSTMs)—for building classification models. While SVMs, KNNs, DTs, and RFs rely on traditional manual feature extraction, GRUs, LSTMs, and Bi-LSTMs automatically learn features. During training of the latter three models, MATLAB, by default, splits the training data into mini-batches and pads the sequences to make them of equal length. Excessive padding negatively impacts model performance. To prevent excessive padding during training, this study sorted the training data by sequence length and selected mini-batch sizes to ensure that sequences within the same mini-batch were of similar length. Through comparative analysis of evaluation metrics, the goal was to assess the classification performance of these algorithms and identify the most accurate recognition model for Wi-Fi sensor human behavior classification.

[0028] To verify the generalization ability of the model, the determined classification model was tested on the Widar 3.0 public dataset. The room layout, transceiver placement, action categories, and number of samples in this dataset are different from those of this research experiment. Among them, the action categories include pushing and pulling, sweeping, clapping, sliding, vertical Z drawing, and vertical N drawing, a total of 6 types. Three volunteers repeated the 6 action categories in a classroom, completing each action category 20 times, containing a total of 360 CSI data. Because this public dataset involves the classification of 6 actions, one more action category than the original model, there is a correlation between the classification tasks of the new model and the original model. By training a model in the source domain, it can provide useful information and features for the target domain, thereby accelerating the model's learning process in the target domain. Therefore, we used transfer learning to train the model.

[0029] Performance analysis was conducted using a Wi-Fi human behavior dataset, which includes horizontal right hand swings, double hand waves, high right hand swings, right hand paper throwing, and right leg forward kicks. In this study, general evaluation metrics for classification models were used to comprehensively analyze the performance of each classification algorithm, including accuracy, precision, recall, and F1 score. For a certain Wi-Fi human behavior, TP (true positive) is defined as the number of samples correctly predicted as the behavior, FN (false negative) is defined as the number of samples incorrectly predicted as other behaviors, FP (false positive) is defined as the number of samples incorrectly predicted as the behavior, and TN (true negative) is defined as the number of samples correctly predicted as other behaviors. Among them, accuracy, as an intuitive indicator, reflects the overall performance of the model on all samples, indicating that the model is accurate and effective in classifying Wi-Fi human behavior; the precision of the model can evaluate the accuracy of the positive samples predicted by the model, which is important for avoiding misclassification; the recall rate can identify the accuracy of the actual positive samples, which is important for avoiding missed classification; the F1 score is the harmonic mean of the precision and recall rate. The higher the F1 score, the more balanced the model's performance in precision and recall. We trained and tested seven machine learning models through a rigorous evaluation process. In order to ensure the stability of the results, the training set and test set were randomly divided 5 times, and then the average value of the model performance was calculated, as shown in the following figure: Figure 6 As shown in the figure, the results show that among all classification models, the Bi-LSTM model performs best in key metrics such as accuracy, precision, recall, and F1 score, with all four metrics exceeding 98%, followed by LSTM (both 97.6%) and RF (both over 93.0%). Therefore, the Bi-LSTM model has extremely high accuracy and balance in prediction tasks, and can accurately capture the effective features of the data. Through the confusion matrix, as shown in Figure 7 As shown, among shallow learning algorithms with manual feature extraction, the RF model performs slightly better than the DT, with both achieving prediction accuracy exceeding 85% for each action. SVM and KNN perform the worst, with only 52.2% and 66.7% respectively. Deep learning-based methods, LSTM and Bi-LSTM, demonstrate excellent performance, with accuracy exceeding 97%, demonstrating the effectiveness of automatic feature learning. However, the GRU performs worse than the DT and RF. This may be due to the GRU's relatively simple structure. While it improves training speed, it lacks an advantage in handling long-term dependencies in time series data. Compared to the LSTM, the Bi-LSTM model takes into account the temporal dependencies of bidirectional sequence data and therefore demonstrates better performance when processing time series data. The Bi-LSTM's recognition accuracy for individual actions exceeds 96%, with an average accuracy of 98.1% across five actions, meeting the requirements of practical applications.

[0030] Finally, the public dataset test results showed that the accuracy of all actions reached 87.5% and 85.4% in the training and test sets, respectively. As shown in Table 2, in the test set, the clapping action had the lowest accuracy, at 80%. Because clapping involves multiple body parts and lasts for a long time, it can be easily misidentified as other actions. However, due to the simplicity of the vertical Z-shaped action, the recognition accuracy reached 100%. This demonstrates that the Bi-LSTM has strong anti-interference and generalization capabilities. Further research can be conducted to supplement data and expand features as needed to enhance the classification model's recognition capabilities. Table 2 Test results of public datasets ;

[0031] Therefore, the present invention adopts the above-mentioned human behavior detection system and method for smart buildings based on Wi-Fi channel status information, providing a more convenient, more private, and lower-cost solution for indoor human behavior recognition, and has broad application prospects in smart building fields such as smart homes, health care, and smart medical care.

[0032] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A human behavior detection system for smart buildings based on Wi-Fi channel status information, characterized by: It includes a data acquisition module, a data processing module and a motion recognition module; The data acquisition module includes a signal transmitter and a signal receiver, and a CSI Tool is arranged inside the signal receiver; The data processing module preprocesses and converts the original CSI data. The original CSI data contains noise and outliers. The noise and outliers in the original CSI data are preprocessed through format conversion, amplitude information extraction, PCA dimension reduction, Hampel filtering and Gaussian smoothing. The action recognition module further processes the preprocessed CSI data; first, the data set is divided, then the action recognition models are compared, and finally the generalization ability of the models is tested.

2. A method for a human behavior detection system for a smart building based on Wi-Fi channel status information as claimed in claim 1, characterized in that: The following steps are involved: Step 1: Collect CSI data; Step 2: Process the collected CSI data; Step 3: Perform action recognition on the CSI data processed in step 2 based on a bidirectional long short-term memory network; Step 4: Evaluate the performance of the model using evaluation indicators, including accuracy, precision, recall, and F1 score.

3. The method for a human behavior detection system for smart buildings based on Wi-Fi channel status information according to claim 2, characterized in that: The process of processing the collected CSI data in step 2 is as follows: S21, format conversion and extraction of amplitude information, the specific process is as follows: S211, determine the channel information in the frequency domain, the expression is as follows: (1) In the formula, and denote the transmitted signal vector and the received signal vector respectively, The vector represents white noise, simulating the noise data existing in the surrounding environment; S212. According to formula (1), determine the approximate representation H of the CSI of each subcarrier, which is expressed as follows: (2) S213. There are 30 subcarrier groups in the CSI data of an action collected by the CSI Tool. The expression is as follows: (3) S214: for each subcarrier It is expressed as follows: (4) in, Indicates The complex form of CSI on subcarriers; and Respectively represent The CSI amplitude and CSI phase on the subcarriers, is an imaginary unit, satisfying ; S22. Use principal component analysis to reduce data dimension. The specific process is as follows: S221. Calculate the covariance matrix of the data , the expression is as follows: (5) In the formula, is the sample size, is the mean of the data, Amplitude data representing an action; S222, performing eigenvalue decomposition on the covariance matrix to obtain an eigenvector coeff and an eigenvalue latent; S223. Calculate the cumulative contribution rate. The expression is as follows: (6) In the formula, cumsum means cumulative sum, sum means total; S224. Select the principal component and project the data into the principal component space. The expression is as follows: (7) In the formula, is the number of principal components selected, It is the data after dimensionality reduction; S23. Remove outliers in the amplitude data by using Hampel. The specific process is as follows: S231. Data after dimensionality reduction For each data point in , calculate the median xmedian and standard deviation xsigma of its neighborhood; S232, determine whether the current data point is an outlier: If ,but is an outlier; yes The data points; S233, replace outliers with the median of the neighborhood; S234, storing the filtered data in Among them Represents the data after Hampel filtering; S24, performing convolution operation through Gaussian smoothing to obtain smoothed data, the specific process is as follows: S241. Define Gaussian kernel: G = fspecial('gaussian', [hsize sigma]); the fspecial function generates a Gaussian filter kernel, 'gaussian' indicates that a Gaussian kernel is generated; hsize is the kernel size, sigma is the standard deviation, and controls the degree of smoothing; S242, data Convolution operation with Gaussian kernel , and obtain the smoothed data ,in is the convolution function, Indicates that the output data size is the same as the input data.

4. The method for a human behavior detection system for smart buildings based on Wi-Fi channel status information according to claim 3, characterized in that: In step 3, the process of performing action recognition on the CSI data processed in step 2 based on the bidirectional long short-term memory network is as follows: S31. Dataset division: randomly divide the sample data into training set and test set, 80% for training and 20% for testing; S32, construct a bidirectional long short-term memory network model; S33, training a bidirectional long short-term memory network model; S34. Use the trained bidirectional long short-term memory network model to classify and identify CSI data; when a new action appears, the model compares the features of these actions with the previously trained features, finds the most similar category, and then outputs the category of this action.

5. The method for a human behavior detection system for a smart building based on Wi-Fi channel status information according to claim 4, characterized in that: The bidirectional long short-term memory network model constructed in S32 includes input layer, bidirectional LSTM layer, ReLU activation layer, fully connected layer, Softmax layer and classification layer. The specific content of each layer is as follows: Input layer: This layer receives input data. The input size is 30, which means that each data sample is a sequence of length 30, corresponding to the 30 subcarriers in S213. Bidirectional LSTM layer: The bidirectional LSTM layer is set with 200 hidden units. The bidirectional LSTM layer learns the forward and reverse information of the sequence data at the same time. The bidirectional LSTM layer only outputs the hidden state of the last time step of the sequence, not the hidden state of the entire sequence; ReLU activation layer: The ReLU activation function introduces nonlinearity, enabling the network to learn more complex patterns. The ReLU activation function speeds up training and prevents the gradient vanishing problem. Fully connected layer: The fully connected layer linearly combines the output of the ReLU activation layer with the score of each class. The number of outputs is set to 5, corresponding to 5 action categories; Softmax layer: The Softmax layer converts the output of the fully connected layer into a probability distribution so that the output value is between 0 and 1 and the sum is 1; Classification layer: The classification layer determines the final classification result according to the probability distribution of the Softmax layer and calculates the classification loss.

6. The method for a human behavior detection system for smart buildings based on Wi-Fi channel status information according to claim 5, characterized in that: Training the bidirectional long short-term memory network model in S33 requires setting the hyperparameters of network training. The specific parameters are as follows: Optimizer: Use Adam optimizer; Execution environment: Set to use GPU for accelerated computing. If there is no GPU, it will automatically switch to CPU. Gradient threshold: set to 1. When the gradient exceeds 1, the gradient is clipped. Batch size: The size of each batch is set to 450; Maximum number of training rounds: set to 4000, which means the model will perform 4000 complete training cycles; Sequence length: All sequences are padded or truncated to the length of the longest sequence in the training data to maintain the consistency of the input data; Data shuffling: Set to not shuffle the data during the entire training process.

7. The method for a human behavior detection system for smart buildings based on Wi-Fi channel status information according to claim 6, characterized in that: The calculation expressions for accuracy, precision, recall and F1 score are as follows: (8) (9) (10) (11) In the formula, TP represents the number of samples that correctly predict the behavior, FN represents the number of samples that incorrectly predict other behaviors, FP represents the number of samples that incorrectly predict the behavior, and TN represents the number of samples that correctly predict other behaviors.

Citation Information

Patent Citations

  • Non-contact single step-counting method and system based on commercial Wi-Fi

    CN108489509A

  • A sign language recognition method based on commercial Wi-Fi

    CN109902554A

  • Wi-Fi-based gait recognition method with independent paths

    CN110738130A

  • CSI-based human body activity data detection method and apparatus and electronic device

    CN110855382A

  • Multi-scene indoor action recognition method based on channel state information and BiLSTM

    CN111556453A

Cited By

  • Human body behavior recognition method and system based on channel state information

    CN120561662A