Method, device and equipment for detecting people based on WIFI signal and medium
Patent Information
- Application Number
- CN202611233946.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-20
AI Technical Summary
[0006]本发明的实施例提供了一种基于WIFI信号的人员检测方法、装置、设备及介质,旨在解决现有基于WIFI CSI的人数识别技术因受不同房间物理环境差异影响导致信号特征分布发生漂移,模型无法有效区分人数变化与环境干扰,从而缺乏跨房间泛化能力的技术问题
在本发明的技术方案中,基于WIFI信号的人员检测方法通过采集多物理环境WIFI信道状态信息,提取人体运动低维统计特征。构建含特征提取器、人员分类器与环境判别器的对抗域自适应网络,并在提取器与判别器间设置梯度反转层进行对抗训练。训练时,梯度反转层使特征提取器在优化人员分类的同时混淆环境特征,从而学习环境不变特征,最终将模型直接用于目标环境实时推理。该方案有效克服了跨房间物理差异导致的信号特征漂移问题,实现跨环境零样本泛化,无需重新采集数据或微调模型,大幅降低硬件部署与后期维护成本,同时显著提升检测精度与系统泛化能力。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy-saving control technology for air conditioning equipment, specifically to a method, device, equipment, and medium for personnel detection based on WIFI signals. Background Technology
[0002] With the development of intelligent building and home environment control systems, the operation strategies of equipment such as ducted air conditioners and fresh air systems increasingly rely on the number of people indoors for dynamic adjustment to achieve on-demand cooling / heating and energy conservation. Currently, mainstream personnel detection solutions mainly use dedicated hardware devices such as infrared sensors (PIR), millimeter-wave radar, or visual cameras. These solutions have significant drawbacks in actual engineering deployment: on the one hand, dedicated sensors require room-by-room wiring or fixed-point deployment, resulting in high hardware procurement and construction costs, and subsequent periodic calibration, battery replacement, or maintenance of optical / RF components, leading to high operation and maintenance costs; on the other hand, visual solutions pose a risk of privacy leakage, while traditional infrared / radar solutions are easily obstructed by furniture, interfered with by pets, or limited by installation location, making it difficult to achieve seamless coverage in complex apartment layouts.
[0003] To reduce hardware dependence and deployment costs, contactless sensing technology based on Channel State Information (CSI) of existing Wi-Fi infrastructure has gradually become a research hotspot. This technology utilizes the fine-grained changes in Wi-Fi signals caused by human motion modulation during propagation to infer the status of people, eliminating the need for additional sensors and theoretically significantly reducing hardware procurement and subsequent maintenance costs. However, existing CSI-based people identification methods face fundamental bottlenecks when deployed across multiple rooms: differences in physical structures such as room size, furniture layout, and wall materials significantly alter the multipath propagation characteristics of Wi-Fi signals, leading to severe drift in the CSI feature distribution under the same number of people scenario. Conventional models, such as statistical thresholding, traditional machine learning, or end-to-end deep learning, are prone to overfitting to the static environmental characteristics of a specific room and cannot effectively separate the coupling signal between "environmental interference" and "people changes."
[0004] Therefore, when the model is moved to an unknown room, the recognition accuracy drops sharply, requiring data to be collected again, samples to be labeled, and the model to be fine-tuned. This "one room, one training" deployment model not only offsets the initial cost advantage of "sensorless" WIFI sensing, but also brings higher engineering implementation and later maintenance costs due to repeated calibration, model retraining, and on-site debugging.
[0005] In summary, overcoming the CSI feature drift problem caused by differences in the physical environment of a room without relying on additional dedicated sensors, and achieving zero-sample generalization of personnel detection across rooms with a single training session, has become a key technical challenge to break through the bottlenecks of hardware cost and subsequent maintenance cost of environmental control systems such as ducted air conditioners, and to promote the large-scale implementation of contactless sensing technology. Summary of the Invention
[0006] The embodiments of the present invention provide a method, apparatus, device and medium for people detection based on WIFI signals, which aims to solve the technical problem that existing people recognition technology based on WIFI CSI is affected by the difference in physical environment of different rooms, resulting in the drift of signal feature distribution, the inability of the model to effectively distinguish between changes in the number of people and environmental interference, and thus lacking cross-room generalization ability.
[0007] In a first aspect, embodiments of the present invention provide a method for detecting people based on WIFI signals. The method includes: acquiring multiple WIFI channel state information samples under different physical environments, and extracting low-dimensional statistical features reflecting human motion states based on the WIFI channel state information samples; constructing an adversarial domain adaptive network, wherein the adversarial domain adaptive network includes a feature extractor, a people classifier, and an environment discriminator, and a gradient inversion layer is provided between the feature extractor and the environment discriminator; performing adversarial training on the adversarial domain adaptive network based on the low-dimensional statistical features and corresponding labels, and using the gradient inversion layer to make the feature extractor obfuscate environmental features while optimizing the people classification task, thereby obtaining a trained people number detection model; acquiring real-time WIFI channel state information under a target environment, extracting the corresponding low-dimensional statistical features, inputting them into the trained people number detection model, and outputting the people number detection result under the target environment.
[0008] Secondly, embodiments of the present invention also provide a personnel detection device based on WIFI signals, used to perform the personnel detection method based on WIFI signals as described above.
[0009] Thirdly, embodiments of the present invention also provide a computer device, the computer device including a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the steps of the above-described personnel detection method based on WIFI signals.
[0010] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, can implement the steps of the above-described personnel detection method based on WIFI signals.
[0011] Compared with the prior art, the beneficial effects of the present invention are: In the technical solution of this invention, the personnel detection method based on WIFI signals extracts low-dimensional statistical features of human movement by collecting WIFI channel state information from multiple physical environments. An adversarial domain adaptive network is constructed, comprising a feature extractor, a personnel classifier, and an environment discriminator. A gradient inversion layer is set between the extractor and the discriminator for adversarial training. During training, the gradient inversion layer causes the feature extractor to obfuscate environmental features while optimizing personnel classification, thereby learning environment-invariant features. Finally, the model is directly used for real-time inference in the target environment. This solution effectively overcomes the signal feature drift problem caused by physical differences across rooms, achieves zero-sample generalization across environments, eliminates the need for re-collecting data or fine-tuning the model, significantly reduces hardware deployment and subsequent maintenance costs, and significantly improves detection accuracy and system generalization capability. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart of the personnel detection method based on WIFI signals provided by the present invention; Figure 2 This is a first sub-flowchart of the personnel detection method based on WIFI signals provided by the present invention; Figure 3 This is a sub-flowchart of the second sub-flowchart of the personnel detection method based on WIFI signals provided by the present invention; Figure 4 The third sub-flowchart of the personnel detection method based on WIFI signals provided by the present invention; Figure 5 The fourth sub-flowchart of the personnel detection method based on WIFI signals provided by the present invention; Figure 6 The fifth sub-flowchart of the personnel detection method based on WIFI signals provided by the present invention; Figure 7 The sixth sub-flowchart of the personnel detection method based on WIFI signals provided by the present invention; Figure 8 A schematic block diagram of a unit of the personnel detection device based on WIFI signals provided by the present invention; Figure 9 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0016] It should also be understood that the terminology used in this specification is for the purpose of describing embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0017] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0018] This invention addresses the technical problem of existing WIFI CSI-based people detection technology, which suffers from signal feature distribution drift due to differences in the physical environment of different rooms, resulting in the model's inability to effectively distinguish between changes in the number of people and environmental interference, and thus lacking cross-room generalization ability. The invention discloses a WIFI signal-based people detection method. This WIFI signal-based people detection method is used in intelligent air conditioning control systems.
[0019] Reference Figures 1 to 7 The method includes the following steps: S110. Obtain multiple WIFI channel state information samples under different physical environments, and extract low-dimensional statistical features reflecting human motion state based on the WIFI channel state information samples. S120. Construct an adversarial domain adaptive network, wherein the adversarial domain adaptive network includes a feature extractor, a person classifier, and an environment discriminator, and a gradient inversion layer is provided between the feature extractor and the environment discriminator; S130. Based on the low-dimensional statistical features and corresponding labels, the adversarial domain adaptive network is trained adversarially. The gradient inversion layer enables the feature extractor to obfuscate environmental features while optimizing the personnel classification task, thereby obtaining a trained personnel quantity detection model. S140. Obtain real-time WIFI channel status information under the target environment, extract the corresponding low-dimensional statistical features, input them into the trained personnel number detection model, and output the personnel number detection result under the target environment.
[0020] First, multiple Wi-Fi channel state information samples under different physical environments are acquired, and low-dimensional statistical features reflecting human motion states are extracted based on these samples. In actual deployment, a transceiver link is formed using a commercial wireless network card and a wireless router to collect Wi-Fi channel state information samples in multiple physical environments with different spatial dimensions, furniture layouts, and wall materials. For the collected raw Wi-Fi channel state information samples, phase calibration and bandpass filtering are performed sequentially. Phase calibration involves calculating the original phase of each subcarrier and performing phase expansion. The least squares method is used to fit the linear relationship between the subcarrier index and the phase, thereby subtracting the linear phase error caused by hardware clock asynchrony to obtain a clean phase sequence and amplitude sequence.
[0021] Subsequently, a zero-phase bandpass filter was used to filter both the phase and amplitude sequences. The passband was set to the micro-Doppler frequency band generated by normal human movement to filter out static multipath reflections and high-frequency environmental noise. Based on the filtered signal, the mean, variance, maximum, and minimum values of the amplitude sequence were calculated, and the instantaneous Doppler frequency was calculated based on the phase difference. The mean, variance, energy, and entropy of the Doppler sequence were then extracted. The amplitude statistical features and Doppler statistical features were concatenated to construct a low-dimensional statistical feature vector with fixed dimensions. This low-dimensional statistical feature vector can effectively characterize the human motion state and compress redundant information.
[0022] An adversarial domain adaptive network (ADN) is constructed, comprising a feature extractor, a people classifier, and an environment discriminator. A gradient inversion layer is placed between the feature extractor and the environment discriminator. The network architecture is built based on a deep learning framework. The feature extractor employs a multi-layer fully connected network structure, with each layer followed by a batch normalization layer and a non-linear activation function to map the low-dimensional statistical features of the input to a high-dimensional hidden feature space. The people classifier is connected to the output of the feature extractor, outputting the predicted probability distribution of the number of people by category through a fully connected layer and a Softmax activation function. The environment discriminator is also connected to the output of the feature extractor, outputting the predicted probability of the physical environment category to which the sample belongs. A gradient inversion layer is inserted between the feature extractor and the environment discriminator. This gradient inversion layer acts as a special computational node in the network, responsible for controlling the gradient flow during the model training phase.
[0023] Adversarial training is performed on an adversarial network based on low-dimensional statistical features and corresponding labels. A gradient reversal layer is used to obfuscate environmental features while optimizing the personnel classification task, resulting in a well-trained personnel quantity detection model. The low-dimensional statistical feature vectors carrying personnel quantity and environment labels are input into the adversarial network for iterative training. In the forward propagation phase, the low-dimensional statistical features pass sequentially through the feature extractor, personnel classifier, and environment discriminator, calculating the personnel classification loss and environment discrimination loss respectively. These two losses are then weighted and summed to form the total loss function. In the backpropagation phase, the personnel classifier and environment discriminator update their parameters according to the original gradient direction to minimize their respective losses.
[0024] When the gradient is backpropagated to the gradient reversal layer, the gradient reversal layer multiplies the gradient passed from the environment discriminator by a negative adversarial strength parameter and then passes it back to the feature extractor. The adversarial strength parameter adopts a dynamic scheduling strategy, and its calculation formula is as follows: Where p represents the proportion of the current training round to the total training rounds. This formula shows that in the early stages of training, the adversarial strength parameter approaches zero, and the network prioritizes optimizing the personnel classification task to establish basic feature representations; as training progresses, the adversarial strength parameter monotonically increases to one, and the gradient reversal layer gradually enhances the confusion of environmental features.
[0025] Through this adversarial training mechanism, the feature extractor is forced to maximize the environment discrimination loss while minimizing the loss of personnel classification. This actively removes static multipath features that are strongly correlated with the physical environment and ultimately learns environment-invariant features that are only sensitive to the number of personnel, thus completing the training convergence of the personnel number detection model.
[0026] The system acquires real-time Wi-Fi channel state information in the target environment, extracts corresponding low-dimensional statistical features, and inputs these features into a trained personnel detection model. The model then outputs the personnel count detection results for the target environment. The trained feature extractor and personnel classifier undergo weight consolidation and model stripping, removing the environment discriminator and gradient inversion layer, resulting in a lightweight inference model. In the target physical environment to be deployed, the system collects real-time Wi-Fi channel state information and rigorously reuses the aforementioned phase calibration, bandpass filtering, and statistical feature extraction processes to generate low-dimensional statistical features corresponding to the target environment. These low-dimensional statistical features are then input into the trained personnel detection model for forward inference, and the model directly outputs the personnel count detection results for the target environment.
[0027] This invention presents a Wi-Fi signal-based personnel detection method that extracts low-dimensional statistical features to compress signal dimensions and constructs an adversarial domain adaptive network including a gradient inversion layer for joint optimization. During training, the gradient inversion layer, combined with dynamic adversarial strength scheduling, forces the feature extractor to learn cross-environment invariant personnel discrimination features, effectively decoupling the coupling effect of physical environment differences and changes in personnel numbers on channel state information. This scheme achieves zero-sample cross-environment transfer without requiring data re-collection or model fine-tuning in the target environment during the inference phase, completely eliminating the hardware dependence on dedicated sensors found in traditional methods. This significantly reduces system deployment and maintenance costs while substantially improving the generalization ability and recognition accuracy of personnel detection in complex and variable physical environments.
[0028] In one embodiment, step S110 includes: S111. Perform phase calibration on the WIFI channel state information sample to eliminate linear phase error caused by hardware offset and obtain calibrated phase and amplitude. S112. Perform bandpass filtering on the calibrated phase and amplitude to filter out static environmental noise and high-frequency interference, while retaining the signal in the human motion frequency band. S113. Based on the filtered signal, extract amplitude statistical features and Doppler statistical features respectively; S114. Combine the amplitude statistical features and the Doppler statistical features to construct the low-dimensional statistical features.
[0029] Phase calibration is performed on the WIFI channel state information samples to eliminate linear phase errors caused by hardware offset. Specifically, the WIFI channel state information samples at each sampling time are parsed into complex vectors, and the original amplitude and original phase of each subcarrier are calculated. To address the periodic jumps caused by phase wrapping in the original phase sequence, a phase unrolling operation is performed to obtain a continuous phase sequence along the subcarrier index direction.
[0030] Using the subcarrier index as the independent variable and the expanded continuous phase sequence as the dependent variable, a first-order linear fit is performed using the least squares method to obtain the slope and intercept of the linear phase error characterizing hardware clock asynchrony and sampling frequency offset. Subtracting the fitted linear phase error from the continuous phase sequence yields the calibrated phase, calculated using the following formula: in This represents the phase of the k-th subcarrier after calibration. This represents the continuous phase after expansion, and k represents the subcarrier index. and These represent the fitting slope and intercept, respectively. The original amplitude remains unchanged during calibration, thus obtaining the calibrated phase and amplitude. This step effectively eliminates the cross-subcarrier linear phase drift introduced by inherent hardware defects in commercial wireless network cards, providing a clean signal substrate for subsequent human motion feature extraction.
[0031] The calibrated phase and amplitude sequences are bandpass filtered. A zero-phase digital filter is used to filter both the calibrated phase and amplitude sequences, with the passband frequency range set from 0.5 Hz to 10 Hz. This frequency band accurately covers the Doppler shift range caused by routine human activities such as slow walking, raising an arm, slight trunk movements, and breathing.
[0032] By using bandpass filtering, static environmental multipath reflection components and DC bias below 0.5 Hz are filtered out, while high-frequency electronic noise above 10 Hz and channel fast fading interference are suppressed. Ultimately, the signal in the human motion frequency band is preserved, significantly improving the signal-to-noise ratio and highlighting the dynamic modulation characteristics of the human body.
[0033] Amplitude and Doppler statistical features are extracted from the filtered signal. For the filtered amplitude sequence, its mean, variance, maximum, and minimum values are directly calculated to form amplitude statistical features, which characterize the range and dispersion of signal intensity fluctuations caused by human occlusion and reflection. For the filtered phase sequence, the instantaneous phase change is calculated by the phase difference between adjacent sampling points, and the instantaneous Doppler frequency is derived by combining the sampling time interval. The calculation formula is: in, This represents the phase difference between the nth sampling point and its adjacent sampling points. This indicates the time interval between adjacent sampling points.
[0034] Based on the instantaneous Doppler frequency sequence, the Doppler energy and Doppler entropy are further calculated. Doppler energy Calculated using the following formula: Where N represents the total number of sampling points within the time window, this indicator reflects the overall intensity and kinetic energy level of human movement; Doppler entropy Calculated using the following formula: in, This is a normalized probability distribution of the Doppler spectrum, used to characterize the complexity and spectral dispersion of human movement patterns. The mean, variance, energy, and entropy mentioned above together constitute the statistical characteristics of Doppler.
[0035] Amplitude statistical features and Doppler statistical features are vector-concatenated to construct low-dimensional statistical features. These low-dimensional statistical features compress the original high-dimensional complex channel response into a compact representation with fixed dimensions. This preserves the core information of dynamic amplitude attenuation and Doppler frequency shift caused by human motion, while significantly reducing the interference of static environmental factors such as room geometry and furniture materials through pre-filtering and statistical aggregation.
[0036] In one embodiment, step S111 includes: S1111. Calculate the original phase of each subcarrier, and perform phase expansion on the phases where the transition between adjacent subcarriers exceeds a preset threshold to obtain a continuous phase sequence. S1112. Using the subcarrier index as the independent variable and the continuous phase sequence as the dependent variable, perform linear fitting to obtain the linear phase error; S1113. Subtract the linear phase error from the continuous phase sequence to obtain the calibrated phase.
[0037] The original phase of each subcarrier is calculated, and phase unrolling is performed on phases where transitions between adjacent subcarriers exceed a preset threshold, resulting in a continuous phase sequence. For the complex channel response data in the collected WIFI channel state information samples, the real and imaginary parts of each subcarrier are extracted, and the original phase of each subcarrier is calculated using a two-parameter arctangent function. Due to carrier frequency and sampling frequency offsets during the sampling process in wireless communication hardware, periodic transitions exceeding a preset threshold often occur in the original phase between adjacent subcarriers. Therefore, a phase unrolling operation is performed on the original phase sequence. When the absolute value of the phase difference between adjacent subcarriers exceeds the preset threshold, the transition is eliminated by adding or subtracting an integer multiple of pi, thus mapping the rolled-up phase into a continuous phase sequence that changes continuously along the subcarrier index direction.
[0038] Linear fitting is performed using subcarrier index as the independent variable and continuous phase sequence as the dependent variable to obtain the linear phase error. The expanded continuous phase sequence and the corresponding subcarrier index are input into a least-squares fitting algorithm to construct a first-order linear regression model. This model can accurately capture the systematic phase drift trend caused by the combined effects of asynchronous hardware clocks at the transmitting and receiving ends and center frequency deviation, and the fitted outputs slope and intercept parameters. The slope and intercept parameters together constitute a mathematical expression characterizing the linear phase error caused by hardware offset. This linear phase error differs significantly from the random phase disturbance caused by human motion in its frequency domain distribution; the former exhibits a strict linear law, while the latter shows local nonlinear fluctuations.
[0039] The calibrated phase is obtained by subtracting the linear phase error from the continuous phase sequence. The fitted slope and intercept parameters are substituted into the linear equation to calculate the fitted phase value for each subcarrier index. The corresponding fitted phase value is then subtracted point-by-point from the continuous phase sequence to complete the phase calibration. The mathematical expression of the calibration process is as follows: in, This represents the phase of the k-th subcarrier after calibration. This represents the unfolded continuous phase sequence, where k represents the subcarrier index number. This represents the fitted slope parameter. This represents the fitting intercept parameter.
[0040] During the calibration process, the amplitude components of the WIFI channel state information samples remain unchanged from their original values. Through this subtraction operation, the hardware-introduced cross-subcarrier linear phase drift is completely eliminated, retaining only the pure phase changes modulated by physiological activities such as human breathing and limb micro-movements.
[0041] The solution in this embodiment effectively overcomes the pollution of channel phase information caused by the inherent carrier and sampling frequency offset of commercial WIFI network cards, ensuring that the subsequently extracted Doppler statistical features truly reflect the human motion state rather than hardware noise, and providing high-fidelity, low-distortion phase input for adversarial domain adaptive networks.
[0042] In one embodiment, step S113 includes: S1131. Calculate the amplitude sequence of the filtered signal and extract the statistical features of the amplitude sequence; S1132. Based on the phase sequence of the filtered signal, calculate the instantaneous Doppler frequency using the phase difference method, or obtain the Doppler spectrum using the short-time Fourier transform, and extract the Doppler feature sequence based on the instantaneous Doppler frequency or the Doppler spectrum. S1133. Calculate the statistical characteristics of the Doppler feature sequence, wherein the Doppler statistical characteristics include at least Doppler energy and Doppler entropy.
[0043] The amplitude sequence of the filtered signal is calculated, and its statistical features are extracted. For the complex channel response data after bandpass filtering, the amplitude components at each sampling time are directly extracted and arranged chronologically to form an amplitude sequence. One-dimensional statistical analysis is performed on this amplitude sequence to calculate the amplitude mean, amplitude variance, maximum amplitude, and minimum amplitude. These indicators together constitute the amplitude statistical features, used to quantify the macroscopic influence of the human body on the amplitude modulation of Wi-Fi signals.
[0044] Based on the phase sequence of the filtered signal, the instantaneous Doppler frequency is calculated using the phase difference method, or the Doppler spectrum is obtained through short-time Fourier transform. Doppler feature sequences are then extracted based on the instantaneous Doppler frequency or the Doppler spectrum. In the phase difference method implementation path, the filtered phase sequence undergoes differential operation between adjacent sampling points. Combined with the system sampling time interval, the phase change is converted into an instantaneous Doppler frequency, as described in the previous embodiment. This instantaneous Doppler frequency sequence directly reflects the trajectory of the Doppler frequency shift caused by human micro-movement over time. In the short-time Fourier transform implementation path, the filtered phase sequence is input into the short-time Fourier transform module. A preset window function is used to segment and window the phase sequence. Overlap rate and window length parameters are set to balance time resolution and frequency resolution. A fast Fourier transform is performed on the phase data within each time window to generate a time-frequency joint distribution Doppler spectrum. The main frequency band energy distribution or spectral centroid trajectory is extracted from this spectrum to construct the Doppler feature sequence. This approach is suitable for scenarios with complex human motion patterns and strong multipath interference. It further separates overlapping Doppler components through time-frequency analysis.
[0045] The statistical characteristics of the Doppler feature sequence are calculated, including at least Doppler energy and Doppler entropy. For an instantaneous Doppler frequency sequence or Doppler spectrum sequence, the Doppler energy is first calculated, and its discretization formula is as described in the previous example. This index characterizes the overall kinetic energy intensity and signal modulation depth of human motion. Then, the Doppler entropy is calculated. The Doppler frequency sequence or spectrum amplitude is normalized to obtain a probability distribution, which is then substituted into the information entropy formula for calculation, as described in the previous example. Doppler entropy is used to characterize the spectral complexity and disorder of human motion patterns. As the number of people increases, the overlapping of motion trajectories leads to a more dispersed spectral distribution, and the Doppler entropy value increases accordingly. Doppler energy and Doppler entropy, combined with indicators such as mean and variance, constitute the complete Doppler statistical characteristics.
[0046] The solution in this embodiment not only preserves sensitive information about the number of people, but also further suppresses static multipath interference from the environment, providing a highly discriminative and low-redundancy input representation for adversarial domain adaptive networks.
[0047] In one embodiment, step S120 includes: S121. Construct the feature extractor to receive the low-dimensional statistical features and extract the high-dimensional hidden layer features; S122. Construct the personnel classifier and connect it after the feature extractor to output the predicted probability of the number of personnel categories based on the high-dimensional hidden layer features. S123. Construct the environment discriminator to output the predicted probability of the physical environment category based on the high-dimensional hidden layer features; S124. Insert the gradient inversion layer between the feature extractor and the environment discriminator. The gradient inversion layer performs an identity mapping during forward propagation and passes the received gradient multiplied by a negative adversarial strength parameter to the feature extractor during backward propagation.
[0048] A feature extractor is constructed to receive low-dimensional statistical features and extract high-dimensional hidden layer features. The feature extractor employs a multi-layer fully connected neural network architecture, with the dimension of the network input layer strictly matching the dimension of the low-dimensional statistical features. Batch normalization layers, non-linear activation functions, and random deactivation layers are sequentially configured between the hidden layers of the feature extractor. The batch normalization layers stabilize the feature data distribution during network training, the non-linear activation functions introduce non-linear mapping capabilities to enhance the expressive power of the feature space, and the random deactivation layers randomly disable some neuron connections during the training phase at a predetermined ratio to prevent the network from overfitting to specific samples. Through multi-layer fully connected transformations and non-linear activations, the feature extractor progressively maps the input low-dimensional statistical features to a high-dimensional hidden layer feature space, which possesses stronger semantic abstraction capabilities and feature decoupling potential.
[0049] A people classifier is constructed and connected after the feature extractor. It is used to output the predicted probability of the number of people in each category based on the high-dimensional hidden layer features. The people classifier consists of a fully connected layer and a Softmax activation function. Its input directly receives the high-dimensional hidden layer features output from the feature extractor, and the number of nodes at the output is consistent with the preset total number of people categories. The Softmax activation function normalizes the original output values of the fully connected layer into a probability distribution, thereby obtaining the predicted probability of each people category in the target scene.
[0050] An environment discriminator is constructed to output predicted probabilities of physical environment categories based on high-dimensional hidden layer features. The environment discriminator also employs a fully connected network structure with a Softmax activation function. Its input is connected to the output of the feature extractor, and the number of nodes at the output corresponds to the total number of physical environment categories in the training dataset. The environment discriminator is independent of the personnel classifier and is specifically designed to learn the physical environment distribution patterns implicit in the high-dimensional hidden layer features.
[0051] A gradient inversion layer is inserted between the feature extractor and the environment discriminator. As a core control module in the adversarial domain adaptive network, the gradient inversion layer possesses dual forward and backward propagation mechanisms. During the forward propagation phase, the gradient inversion layer performs an identity mapping operation, losslessly transferring the high-dimensional hidden layer features output by the feature extractor to the environment discriminator, ensuring that the environment discriminator can correctly receive the input and calculate the environment category prediction probability. During the backward propagation phase, when the gradient generated by the environment discrimination loss is propagated back to the gradient inversion layer, the layer multiplies the received gradient by a negative adversarial strength parameter and continues to propagate the inverted gradient back to the feature extractor. The specific value and dynamic scheduling strategy of the adversarial strength parameter are as described in the previous embodiment. Through this gradient inversion mechanism, the environment discriminator attempts to minimize the environment discrimination loss during optimization to accurately identify the physical environment, while the feature extractor, after receiving the inverted gradient, has its parameter update direction forcibly adjusted to maximize the environment discrimination loss. This proactively obfuscates and removes environmentally sensitive information from the high-dimensional hidden layer features while optimizing the personnel classification task.
[0052] This embodiment ensures lossless feature transfer and parallel computation of dual tasks during forward propagation, while utilizing a gradient reversal mechanism during backpropagation to implement an adversarial game between the feature extractor and the environment discriminator. By forcing the feature extractor to learn environment-invariant features, this network architecture fundamentally cuts off the interference path of physical environment differences on the discrimination features of personnel numbers, providing a reliable model foundation for subsequent zero-shot transfer across physical environments.
[0053] In one embodiment, step S130 includes: S131. Input the low-dimensional statistical features and corresponding labels into the adversarial domain adaptive network for forward propagation, and calculate the personnel classification loss and environment discrimination loss respectively. S132. Perform backpropagation to update network parameters, wherein the personnel classifier and the environment discriminator update their parameters according to the original gradient to minimize their respective losses; S133. The feature extractor receives the gradient multiplied by the negative adversarial strength parameter through the gradient inversion layer, minimizing the personnel classification loss while maximizing the environment discrimination loss, thus forcing the feature extractor to learn the personnel discrimination features that are invariant to the environment.
[0054] Low-dimensional statistical features, along with corresponding personnel quantity labels and environment labels, are input into an adversarial domain adaptive network for forward propagation, calculating personnel classification loss and environment discrimination loss respectively. During training iterations, the preprocessed low-dimensional statistical feature vector is used as network input, along with the corresponding personnel quantity category labels and physical environment category labels. The low-dimensional statistical feature vector is sequentially mapped to high-dimensional hidden layer features by a feature extractor and then transmitted in parallel via two paths. The first path inputs to the personnel classifier, outputting the predicted probability distribution of personnel quantity categories. Based on this predicted probability distribution and the actual personnel quantity labels, the personnel classification loss is calculated. This loss function uses a multi-class cross-entropy form to quantify the deviation between the model's personnel quantity prediction results and the actual labels. The second path is passed to the environment discriminator via a gradient inversion layer, outputting the predicted probability distribution of physical environment categories. Based on this predicted probability distribution and the actual physical environment labels, the environment discrimination loss is calculated. This loss function also uses a multi-class cross-entropy form to evaluate the model's ability to distinguish different physical environment distribution patterns. The personnel classification loss and environment discrimination loss are weighted and combined to construct the total loss function for overall network optimization.
[0055] Backpropagation is performed to update network parameters, where the person classifier and environment discriminator update their parameters based on the original gradients to minimize their respective losses. Based on the constructed total loss function, an adaptive optimizer is used to initiate the backpropagation algorithm. During gradient backpropagation, the person classifier and environment discriminator, as standard classification modules, directly receive the original gradient signals from their respective loss functions. The person classifier adjusts its network weights and bias parameters according to the gradient direction of the person classification loss to continuously reduce the error in predicting the number of people; the environment discriminator adjusts its network parameters according to the gradient direction of the environment discrimination loss to continuously improve the accuracy of recognizing different physical environment features. Both follow the conventional gradient descent principle, achieving local parameter optimization by minimizing their respective loss functions.
[0056] The feature extractor receives gradients multiplied by a negative adversarial strength parameter through a gradient inversion layer. This minimizes the person classification loss while maximizing the environment discrimination loss, forcing the feature extractor to learn environment-invariant person discrimination features. When the gradient of the environment discrimination loss is backpropagated to the gradient inversion layer, the layer performs the core adversarial operation, multiplying the received environment discrimination gradient by a negative adversarial strength parameter. The dynamic scheduling strategy for the adversarial strength parameter is as described in the previous embodiment. The gradient after sign inversion and strength scaling continues to be propagated back to the feature extractor. At this point, the feature extractor simultaneously receives the positive optimization gradient from the person classifier and the negative adversarial gradient from the gradient inversion layer.
[0057] During parameter updates, the feature extractor optimizes along the gradient descent direction of the personnel classification loss to retain and enhance dynamic motion features strongly correlated with personnel numbers. Simultaneously, it optimizes along the gradient ascent direction of the environment discrimination loss to actively suppress and obfuscate static multipath patterns in high-dimensional hidden layer features that are bound to specific physical environments. Through this adversarial game mechanism, the feature extractor successfully removes environment-sensitive information after training convergence, retaining only personnel discrimination features stable across physical environments, ultimately yielding a well-trained personnel number detection model.
[0058] This embodiment utilizes a gradient inversion layer to construct an adversarial game mechanism, enabling the feature extractor to automatically decouple personnel motion features from environmental static features under the dual constraints of conventional classification optimization and domain confusion adversarial mechanisms. This effectively avoids overfitting of the model to multipath patterns in a single physical environment, ensuring that the trained personnel number detection model possesses strong environmental robustness.
[0059] Furthermore, during the iterative optimization phase of the adversarial domain adaptive network, the training control module records the ratio of the current training round to the preset total training rounds in real time. This ratio is used as a training progress variable and input into a monotonically increasing nonlinear function to dynamically calculate the adversarial strength parameter for the current iteration step. The specific mathematical expression of this nonlinear function is as described in the previous embodiment. In the early stages of training, the training progress variable has a small value, and the adversarial strength parameter output by the nonlinear function approaches zero. At this time, the gradient reversal layer has a very weak effect on reversing the gradient of environmental discrimination, and the network parameter update is mainly dominated by the personnel classification loss. This prompts the feature extractor to prioritize learning basic discrimination features related to human motion, establish a stable initial feature representation space, and effectively avoid feature space collapse or gradient oscillation caused by strong domain adversarial forces in the early stages of training. As the training rounds continue to advance, the training progress variable gradually increases, and the adversarial strength parameter monotonically increases along the nonlinear curve and gradually approaches one.
[0060] In the later stages of training, the gradient inversion layer propagates the environment discrimination gradient back to the feature extractor with a near-full-strength negative value, significantly enhancing the obfuscation power of the environment features. Given its basic ability to classify people, the feature extractor is forced to further strip away static multipath patterns coupled to specific physical environments from the high-dimensional hidden layer features, achieving deep decoupling of environment-invariant features. This dynamic scheduling mechanism, through smooth transitions in adversarial strength, maximizes cross-environment generalization performance while ensuring model convergence stability, ultimately resulting in a well-trained people count detection model.
[0061] In one embodiment, step S140 includes: S141. Continuously acquire real-time WIFI channel status information in the target environment through a sliding window; S142. Perform phase calibration, bandpass filtering and statistical feature extraction operations on the data in each sliding window to obtain the low-dimensional statistical features of the current window; S143. Input the low-dimensional statistical features of the current window into the trained personnel number detection model, and output the predicted probability of the number of personnel in the current window. S144. Using a time series smoothing strategy, smooth the predicted probability of the number of people in multiple consecutive sliding windows, and output the final result of the number of people detection.
[0062] The system continuously acquires real-time Wi-Fi channel status information in the target environment using a sliding window. During actual deployment, the data acquisition module continuously monitors the wireless communication links within the target environment at a fixed sampling rate, employing a sliding window mechanism to capture raw Wi-Fi channel status information data streams within continuous time segments. The sliding window's duration and step size are preset based on the human movement cycle and the system's real-time response requirements. The sliding window length covers the complete human movement cycle, while the step size is smaller than the sliding window length to achieve data overlap and continuous monitoring.
[0063] Phase calibration, bandpass filtering, and statistical feature extraction are performed on the data within each sliding window to obtain the low-dimensional statistical features of the current window. For each frame of data captured by the sliding window, the feature processing module strictly reuses the signal processing pipeline validated during the training phase, sequentially performing phase calibration to eliminate hardware linear phase errors, performing bandpass filtering in a specific frequency band to preserve human motion signals, and calculating amplitude and Doppler statistical features. The specific implementation methods and calculation logic of the phase calibration, bandpass filtering, and statistical feature extraction are as described in the previous embodiments. Through a standardized preprocessing flow, the original high-frequency complex signals within each sliding window are converted into low-dimensional statistical feature vectors with fixed dimensions in real time, ensuring that the distribution of input data during the inference phase remains highly consistent with that during the training phase.
[0064] The low-dimensional statistical features of the current window are input into the trained personnel count detection model, which outputs the predicted probability of the number of people in the current window. This lightweight personnel count detection model, stripped of the environment discriminator and gradient inversion layer, is deployed to an edge computing device or server. The inference module inputs the low-dimensional statistical feature vector generated in the current window into the feature extractor and personnel classifier of the trained personnel count detection model for forward propagation calculation. The trained personnel count detection model directly outputs the predicted probability of the number of people for each category in the current time window. Due to transient multipath fading and environmental noise interference in the wireless channel, the prediction results for a single window may experience brief fluctuations.
[0065] A time-series smoothing strategy is employed to smooth the predicted probability of the number of people across multiple consecutive sliding windows, outputting the final person count detection result. The time-series smoothing strategy can utilize an exponential moving average algorithm or a majority voting mechanism. The system maintains the smoothed state of historical predicted probabilities, weights and fuses the predicted probability of the number of people in the current window with historical smoothed values according to preset weights, generating an updated smoothed probability sequence. Subsequently, maximum value index extraction is performed on the smoothed probability sequence to determine the person count category with the highest confidence level as the final person count detection result for the current moment. This smoothing process effectively filters out prediction jumps caused by instantaneous channel jitter, ensuring the temporal continuity and stability of the output results.
[0066] Furthermore, during the real-time inference phase of the model, the system continuously receives the predicted probability of the number of people in the current window from the trained personnel quantity detection model in chronological order, and caches the predicted probability of the number of people in multiple consecutive sliding windows into a temporal buffer to construct a complete temporal probability sequence. This temporal probability sequence fully records the dynamic change trajectory of the confidence level of each personnel quantity category in the target environment, providing a data foundation for subsequent smoothing calculations.
[0067] For the time-series probability sequence of the cache, at least one of the following methods is used for calculation: majority voting, exponential moving average, or hidden Markov model.
[0068] In the majority voting method implementation path, a fixed-length historical window is set, and the frequency of occurrence of the number of people corresponding to the maximum predicted probability of each sliding window within the window is counted. The category with the highest frequency is determined as the smoothed result at the current moment. This method has extremely low computational overhead and can effectively filter out misjudgments caused by occasional channel interference.
[0069] In the implementation path of the exponential moving average method, an independent smoothed state value is maintained for each category of personnel quantity. The predicted probability of personnel quantity in the current window is weighted and fused with the historical smoothed state value according to a preset decay coefficient to generate an updated smoothed probability sequence. Then, the maximum value index in the smoothed probability sequence is extracted as the output category. This method gives higher weight to recent prediction results and achieves a balance between response speed and stability.
[0070] In the implementation path of the Hidden Markov Model, the category of personnel quantity is defined as the hidden state, and the predicted probability output by the model is defined as the observed state. The global optimal state sequence is solved by the Viterbi algorithm, and the physical continuity constraint of personnel quantity change is used to eliminate abrupt changes that do not conform to the actual motion law.
[0071] The above methods can be deployed independently or combined according to the computing power resources and real-time requirements of edge devices. After smoothing calculation processing, the system outputs the final personnel number detection result, which has completely eliminated the result jump of single-frame inference, presents the temporal continuity that conforms to the laws of human activity, and is pushed to the downstream control or alarm module in real time.
[0072] Furthermore, the trained personnel number detection model is lightweighted and deployed at the edge before real-time detection of the target environment.
[0073] The environment discriminator in the adversarial domain adaptive network is removed, retaining only the weights of the feature extractor and the person classifier. After the adversarial training converges, the environment discrimination task and gradient inversion mechanism are no longer needed in the inference phase. The model export module directly removes the environment discriminator network layer and gradient inversion layer nodes, only extracting the network topology of the feature extractor and the person classifier and their corresponding training weight parameters. The extracted sub-network structures are serialized and packaged, and exported as a standard open neural network exchange format file to ensure the compatibility and portability of the model architecture and weight data across different inference frameworks.
[0074] The retained model weights are exported and accelerated using integer quantization before deployment to edge computing devices. For the exported model files, post-training integer quantization is used for precision compression. Forward inference is performed on the model using a small, representative calibration dataset to statistically analyze the dynamic range of activation values and weight parameters at each layer, establishing a linear mapping between floating-point values and eight-bit integer values. All floating-point multiply-accumulate operations in the model are replaced with fixed-point integer operations, completing the integer quantization acceleration. This process significantly reduces model storage size and memory usage, while leveraging the integer arithmetic units of edge computing devices for hardware-level acceleration.
[0075] The quantized model file and its accompanying lightweight inference engine are deployed to an edge computing device, which can be a Raspberry Pi development board, an ARM architecture processor, or a dedicated AI acceleration chip. Once deployed, the edge computing device directly takes over the data acquisition interface of the wireless network card, locally executing the entire process of acquiring real-time Wi-Fi channel status information in the target environment, feature extraction, and model inference, and finally outputting the personnel count detection results for the target environment.
[0076] The personnel detection method based on WIFI signals of the present invention can be widely applied to air conditioning equipment control scenarios with high requirements for on-demand cooling / heating, dynamic zone control and system energy-saving optimization, especially in the field of air conditioning system technology with independent temperature control of multiple rooms and dynamic changes in the number of people. The following uses two typical application environments, multi-room office floors and hotel guest rooms, as examples for illustration.
[0077] In multi-room office floor scenarios, this method can be used to solve the supply-demand mismatch problem caused by the inability to adjust air conditioning strategies as needed due to frequent changes in the number of people in different rooms. Such office floors typically contain physical spaces with multiple functions, such as private offices, open workstations, and small to medium-sized meeting rooms. Each room varies significantly in size, layout, furniture, and partition materials, and the number of people in different rooms changes dynamically throughout the day due to meeting schedules, visits, and lunch breaks. Traditional air conditioning control relies on deploying infrared personnel sensors or cameras in each room to detect people. Infrared sensors can only determine whether someone is present or absent, but cannot distinguish the specific number of people to achieve precise airflow adjustment. While camera solutions can count people, they involve high hardware procurement costs, cross-room wiring costs, and subsequent maintenance costs. Furthermore, their accuracy decreases in low-light projection environments in meeting rooms, and privacy concerns among office workers limit their widespread deployment. If the number of people is indirectly inferred from the return air temperature alone, the response lag can be as long as several minutes or even tens of minutes, failing to meet the need for immediate airflow adjustment after people enter and exit.
[0078] By employing the method of this invention, the system only needs to deploy a pair of ordinary WIFI transceivers in each room of the office building. Existing or newly added commercial WIFI routers and receiver network cards can be used to collect WIFI channel status information in each room, eliminating the need for additional infrared sensors or cameras. This significantly reduces the overall cost of hardware procurement, installation, wiring, and subsequent maintenance. Furthermore, since WIFI signals do not involve visual information collection, it fundamentally avoids privacy concerns for office workers. The system extracts a low-dimensional statistical feature vector containing amplitude and Doppler statistical features from the real-time WIFI channel status information of each room. The amplitude statistical features reflect signal strength fluctuations caused by personnel movement, while the Doppler statistical features reflect the speed distribution and frequency complexity of personnel movement. Because this invention employs gradient inversion adversarial training between the feature extractor and environment discriminator of the adversarial domain adaptive network during the training phase, it forces the feature extractor to learn a high-dimensional hidden layer feature representation that is insensitive to the physical environment of the room but sensitive only to the number of people. Therefore, even if there are significant differences in area, layout, and wall materials among the office rooms, the trained personnel number detection model does not require re-collecting data or fine-tuning the model for any new office. It can be directly deployed and accurately identify the current actual number of people in each room. Based on the real-time detected personnel number, the system dynamically adjusts the opening of the corresponding room's duct branch valves and the air supply volume: when a meeting room is detected to change from being vacant to being used by multiple people, the air supply volume of that meeting room is increased in advance to meet the upcoming increase in cooling load demand; when the number of people in the open workstation area decreases due to lunch breaks, the air supply volume is reduced accordingly to avoid over-cooling. By segmenting the continuous WIFI signal through a sliding window mechanism and combining it with a time series smoothing strategy to smooth the multi-window prediction results, the system can effectively filter out single-window misjudgments caused by instantaneous personnel movement, outputting stable and reliable personnel number detection results. This method enables refined zoning control of office building air conditioning systems, providing cooling based on individual needs and dynamically matching cooling needs. While ensuring thermal comfort in each room, it significantly reduces the overall energy consumption of the air conditioning system.
[0079] In hotel building scenarios, this method can be used to solve the problem of inefficient cooling and energy waste caused by differences in occupancy status and temporary entry and exit of a large number of independent guest rooms. Hotel buildings typically contain hundreds of independent guest rooms, each with differences in area, orientation, and reflective properties of interior decoration materials. Furthermore, the occupancy status (vacant, single or double occupancy) and temporary behavior of guests (guests going out sightseeing, returning to rest, visitors making short stays) vary from room to room. Traditional hotel air conditioning control usually relies on the card-operated power signal in the guest room to determine occupancy, failing to detect the actual number of people in the room, let alone identify guests temporarily leaving but not checking out. This results in the air conditioning running at full load continuously during extended periods of absence, causing significant ineffective cooling and energy waste. Some hotels use infrared human body sensors to determine occupancy, but if the sensors malfunction due to dust or aging, engineers need to enter the guest rooms to inspect and replace them, disturbing already occupied rooms. Moreover, the workload and cost of maintaining sensors in hundreds of hotel rooms remain high.
[0080] By employing the method of this invention, the system utilizes existing or newly added WIFI access devices in hotel rooms to collect WIFI channel status information for each room. This eliminates the need to deploy additional sensor hardware inside the rooms, enabling occupancy detection in each room without disturbing guests. The system performs uniform phase calibration and bandpass filtering preprocessing on the WIFI channel status information of each room, filtering out multipath interference caused by static objects such as furniture and walls, retaining effective signals within the guest activity frequency band, extracting low-dimensional statistical features, and inputting them into a trained occupancy detection model to output real-time occupancy detection results for each room. The feature extractor used in this invention receives the environmental discrimination gradient signal multiplied by a negative adversarial strength parameter through a gradient inversion layer during the adversarial training phase. This minimizes the loss in occupancy classification while maximizing the loss in environmental discrimination, making the high-dimensional hidden layer features output by the feature extractor highly robust to physical differences between rooms (such as size, orientation, and interior furnishings). Therefore, the same trained occupancy detection model can be directly deployed in all hotel rooms without requiring separate data collection and model parameter adjustment for each room, significantly reducing the engineering threshold for cross-room deployment. The system automatically adjusts the air conditioning operation mode of each guest room based on real-time monitoring of the number and status of guests: when the number of guests in a room is zero for a sustained period, the system automatically switches the air conditioning to low-power standby or energy-saving cycle mode; when guests return to the room, normal cooling or heating operation is immediately restored; when the number of guests changes from one to two, the air supply volume is increased accordingly to accommodate the increased heat load. Through this human-sensing and demand-based control mechanism, the hotel's air conditioning system can minimize ineffective energy consumption during empty rooms and when guests are temporarily away, without affecting guest comfort, thereby reducing hotel operating electricity costs and the frequency of air conditioning equipment maintenance.
[0081] As demonstrated by the above applications, the method of this invention can achieve accurate perception and real-time dynamic control of the number of people in air conditioning control scenarios with different physical environments, utilizing existing or newly added WIFI signal infrastructure. It overcomes the interference of different room physical environments on the distribution of WIFI signal characteristics and achieves generalization capability for zero-sample deployment across rooms. This method combines the advantages of low hardware cost, non-intrusive privacy, low deployment threshold, and strong real-time detection, making it particularly suitable for multi-room office floors and hotel buildings with a large number of rooms, significant differences in physical environments, and frequent dynamic changes in the number of people. It has good engineering practical value and broad market prospects.
[0082] Figure 8 This is a schematic block diagram of a personnel detection device 600 based on a WIFI signal provided in an embodiment of the present invention. Figure 8As shown, corresponding to the above-described personnel detection method based on WIFI signals, the present invention also provides a personnel detection device 600 based on WIFI signals. This personnel detection device 600 includes a unit for executing the above-described personnel detection method based on WIFI signals, and the device can be configured in an air conditioning controller, a smart home central control unit, or a building ventilation system control terminal.
[0083] Specifically, please refer to Figure 8 The WIFI-based personnel detection device 600 includes: The sample acquisition and feature extraction unit 610 is used to acquire multiple WIFI channel state information samples under different physical environments, and extract low-dimensional statistical features reflecting human motion state based on the WIFI channel state information samples. The network construction unit 620 is used to construct an adversarial domain adaptive network, wherein the adversarial domain adaptive network includes a feature extractor, a person classifier, and an environment discriminator, and a gradient inversion layer is provided between the feature extractor and the environment discriminator; The adversarial training unit 630 is used to perform adversarial training on the adversarial domain adaptive network based on the low-dimensional statistical features and corresponding labels. The gradient inversion layer enables the feature extractor to obfuscate environmental features while optimizing the personnel classification task, thereby obtaining a trained personnel number detection model. The real-time inference unit 640 is used to acquire real-time WIFI channel status information in the target environment, extract corresponding low-dimensional statistical features, input them into the trained personnel number detection model, and output the personnel number detection results in the target environment.
[0084] In one embodiment, the sample acquisition and feature extraction unit 610 includes: A phase calibration unit is used to perform phase calibration on the WIFI channel state information sample to eliminate linear phase error caused by hardware offset and obtain calibrated phase and amplitude. The bandpass filter unit is used to perform bandpass filtering on the calibrated phase and amplitude, filtering out static environmental noise and high-frequency interference, and retaining the signal in the human motion frequency band; The feature extraction unit is used to extract amplitude statistical features and Doppler statistical features based on the filtered signal, respectively. The feature combination unit is used to combine the amplitude statistical features and the Doppler statistical features to construct the low-dimensional statistical features.
[0085] In one embodiment, the phase calibration unit includes: The phase unrolling unit is used to calculate the original phase of each subcarrier and to unroll the phases of adjacent subcarriers that exceed a preset threshold to obtain a continuous phase sequence. A linear fitting unit is used to perform linear fitting with the subcarrier index as the independent variable and the continuous phase sequence as the dependent variable to obtain the linear phase error; An error subtraction unit is used to subtract the linear phase error from the continuous phase sequence to obtain the calibrated phase.
[0086] In one embodiment, the feature extraction unit includes: An amplitude statistics unit is used to calculate the amplitude sequence of the filtered signal and extract the statistical features of the amplitude sequence. The Doppler calculation unit is used to calculate the instantaneous Doppler frequency based on the phase sequence of the filtered signal by means of the phase difference method, or to obtain the Doppler spectrum by means of short-time Fourier transform, and to extract the Doppler feature sequence based on the instantaneous Doppler frequency or the Doppler spectrum. A Doppler statistical unit is used to calculate the statistical features of the Doppler feature sequence, wherein the Doppler statistical features include at least Doppler energy and Doppler entropy.
[0087] In one embodiment, the network construction unit 620 includes: The feature extractor construction unit is used to construct the feature extractor and to receive the low-dimensional statistical features and extract high-dimensional hidden layer features. A personnel classifier construction unit is used to construct the personnel classifier and is connected after the feature extractor. It is used to output the predicted probability of the number of personnel categories based on the high-dimensional hidden layer features. An environment discriminator construction unit is used to construct the environment discriminator and output the predicted probability of the physical environment category based on the high-dimensional hidden layer features. A gradient inversion layer insertion unit is used to insert the gradient inversion layer between the feature extractor and the environment discriminator. The gradient inversion layer performs an identity mapping during forward propagation and passes the received gradient multiplied by a negative adversarial strength parameter to the feature extractor during backward propagation.
[0088] In one embodiment, the adversarial training unit 630 includes: The forward propagation and loss calculation unit is used to input the low-dimensional statistical features and corresponding labels into the adversarial domain adaptive network for forward propagation, and calculate the personnel classification loss and the environment discrimination loss respectively. A regular parameter update unit is used to perform backpropagation to update network parameters, wherein the person classifier and the environment discriminator update their parameters according to the original gradient to minimize their respective losses; An adversarial gradient update unit is used by the feature extractor to receive the gradient multiplied by the negative adversarial strength parameter through the gradient inversion layer, thereby minimizing the personnel classification loss while maximizing the environment discrimination loss, forcing the feature extractor to learn the personnel discrimination features that are invariant to the environment.
[0089] In one embodiment, the real-time inference unit 640 includes: A sliding window acquisition unit is used to continuously acquire real-time WIFI channel status information in the target environment through a sliding window; The window feature processing unit is used to perform phase calibration, bandpass filtering and statistical feature extraction operations on the data in each sliding window to obtain the low-dimensional statistical features of the current window. The window inference unit is used to input the low-dimensional statistical features of the current window into the trained personnel number detection model and output the predicted probability of the number of personnel in the current window. The temporal smoothing unit is used to smooth the predicted probability of the number of people in multiple consecutive sliding windows using a time series smoothing strategy, and outputs the final number of people detection results.
[0090] The aforementioned personnel detection device 600 based on WIFI signals can be implemented as a computer program, which can be used in, for example... Figure 9 It runs on the computer device shown.
[0091] Please see Figure 9 , Figure 9 This is a schematic block diagram of a computer device 500 provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as an air conditioner controller, a smart home central control unit, or a building ventilation system control terminal. The server can be a standalone server or a server cluster composed of multiple servers.
[0092] See Figure 9 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0093] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a personnel detection method based on WIFI signals.
[0094] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0095] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a personnel detection method based on WIFI signals.
[0096] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0097] The processor 502 is used to run a computer program 5032 stored in a memory to implement the steps of the above method.
[0098] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0099] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0100] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the steps of the above-described method.
[0101] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0102] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0103] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0104] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0105] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0106] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting people based on WIFI signals, characterized in that, The method includes: Multiple WIFI channel state information samples under different physical environments are obtained, and low-dimensional statistical features reflecting human motion state are extracted based on the WIFI channel state information samples. Construct an adversarial domain adaptive network, wherein the adversarial domain adaptive network includes a feature extractor, a person classifier, and an environment discriminator, and a gradient inversion layer is provided between the feature extractor and the environment discriminator; Based on the low-dimensional statistical features and corresponding labels, the adversarial domain adaptive network is trained adversarially. The gradient inversion layer enables the feature extractor to obfuscate environmental features while optimizing the personnel classification task, resulting in a well-trained personnel quantity detection model. Obtain real-time WIFI channel status information in the target environment, extract the corresponding low-dimensional statistical features, input them into the trained personnel number detection model, and output the personnel number detection results in the target environment.
2. The personnel detection method based on WIFI signals according to claim 1, characterized in that, The steps of acquiring multiple WIFI channel state information samples under different physical environments and extracting low-dimensional statistical features reflecting human motion states based on the WIFI channel state information samples include: Phase calibration is performed on the WIFI channel state information sample to eliminate linear phase error caused by hardware offset, and the calibrated phase and amplitude are obtained. Bandpass filtering is applied to the calibrated phase and amplitude to remove static environmental noise and high-frequency interference, while retaining the signal in the human motion frequency band. Based on the filtered signal, amplitude statistical features and Doppler statistical features are extracted respectively. The amplitude statistical features and the Doppler statistical features are combined to construct the low-dimensional statistical features.
3. The personnel detection method based on WIFI signals according to claim 2, characterized in that, The step of performing phase calibration on the WIFI channel state information sample to eliminate linear phase error caused by hardware offset and obtain the calibrated phase and amplitude includes: Calculate the original phase of each subcarrier, and perform phase expansion on the phases where the transition between adjacent subcarriers exceeds a preset threshold to obtain a continuous phase sequence; Using the subcarrier index as the independent variable and the continuous phase sequence as the dependent variable, a linear fit is performed to obtain the linear phase error; The calibrated phase is obtained by subtracting the linear phase error from the continuous phase sequence.
4. The personnel detection method based on WIFI signals according to claim 2, characterized in that, The steps of extracting amplitude statistical features and Doppler statistical features based on the filtered signal include: Calculate the amplitude sequence of the filtered signal and extract the statistical features of the amplitude sequence; Based on the phase sequence of the filtered signal, the instantaneous Doppler frequency is calculated by the phase difference method, or the Doppler spectrum is obtained by the short-time Fourier transform, and the Doppler feature sequence is extracted based on the instantaneous Doppler frequency or the Doppler spectrum. Calculate the statistical characteristics of the Doppler feature sequence, wherein the Doppler statistical characteristics include at least Doppler energy and Doppler entropy.
5. The personnel detection method based on WIFI signals according to claim 1, characterized in that, The step of constructing an adversarial domain adaptive network, wherein the adversarial domain adaptive network includes a feature extractor, a person classifier, and an environment discriminator, and a gradient inversion layer is provided between the feature extractor and the environment discriminator, includes: Construct the feature extractor to receive the low-dimensional statistical features and extract the high-dimensional hidden layer features; The personnel classifier is constructed and connected after the feature extractor to output the predicted probability of the number of personnel categories based on the high-dimensional hidden layer features. Construct the environment discriminator to output the predicted probability of the physical environment category based on the high-dimensional hidden layer features; The gradient inversion layer is inserted between the feature extractor and the environment discriminator. The gradient inversion layer performs an identity mapping during forward propagation and passes the received gradients multiplied by a negative adversarial strength parameter to the feature extractor during backward propagation.
6. The personnel detection method based on WIFI signals according to claim 1, characterized in that, The steps of training the adversarial domain adaptive network based on the low-dimensional statistical features and corresponding labels, and using the gradient inversion layer to make the feature extractor obfuscate environmental features while optimizing the personnel classification task, to obtain a trained personnel quantity detection model, include: The low-dimensional statistical features and corresponding labels are input into the adversarial domain adaptive network for forward propagation, and the personnel classification loss and environment discrimination loss are calculated respectively. Backpropagation is performed to update network parameters, wherein the person classifier and the environment discriminator update their parameters based on the original gradient to minimize their respective losses; The feature extractor receives the gradient multiplied by the negative adversarial strength parameter through the gradient inversion layer, minimizing the personnel classification loss while maximizing the environment discrimination loss, thus forcing the feature extractor to learn the personnel discrimination features that are invariant to the environment.
7. The personnel detection method based on WIFI signals according to claim 1, characterized in that, The steps of obtaining real-time WIFI channel status information in the target environment, extracting corresponding low-dimensional statistical features, inputting them into the trained personnel number detection model, and outputting the personnel number detection results in the target environment include: Real-time WIFI channel status information in the target environment is continuously acquired through a sliding window; Phase calibration, bandpass filtering, and statistical feature extraction are performed on the data within each sliding window to obtain the low-dimensional statistical features of the current window; Input the low-dimensional statistical features of the current window into the trained personnel number detection model, and output the predicted probability of the number of personnel in the current window; By employing a time-series smoothing strategy, the predicted probability of the number of people in multiple consecutive sliding windows is smoothed, and the final result of the number of people is output.
8. A personnel detection device based on WIFI signals, characterized in that, Used to perform the personnel detection method based on WIFI signals as described in any one of claims 1 to 7.
9. A computer device, characterized in that, The computer device includes a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the steps of the method as described in any one of claims 1 to 7.