People counting method, apparatus, device, medium, and product
By identifying indoor personnel behavior patterns using channel state information data and selecting an adaptive statistical model, the problem of insufficient accuracy in people counting under multi-behavioral environments is solved, and high-precision people estimation is achieved in complex scenarios.
Patent Information
- Application Number
- CN202611278137.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies struggle to accurately separate and count people in indoor environments with multiple behaviors, resulting in insufficient accuracy in headcount statistics.
By acquiring channel state information data, the behavior patterns of people indoors are identified, and an adaptive candidate number statistical model is selected based on the behavior patterns to estimate the number of people, including a first model for staying scenarios and a second model for entering and exiting scenarios. Convolutional neural networks and support vector machines are used for feature extraction and classification, and a model fusion mechanism is combined to improve statistical accuracy.
It significantly improves the overall accuracy of people counting in real indoor scenarios with mixed behaviors, adapts to different behavioral scenarios, and avoids the problem of mutual exclusion of accuracy when a single model is used to deal with loitering and entering/exiting behaviors.
Smart Images

Figure CN123142153A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and more specifically, to a method, apparatus, device, medium, and product for counting people. Background Technology
[0002] In real-world scenarios such as smart campuses and smart homes, indoor occupancy information is of significant value to systems for security monitoring, energy consumption control, and resource allocation. With the continuous development of wireless sensing technology, human body sensing technology based on Channel State Information (CSI) is gradually becoming a key path for achieving indoor occupancy identification. This technology, due to its non-contact and high-precision advantages, can effectively overcome the limitations of traditional sensors in areas such as privacy protection, equipment maintenance, and environmental adaptability.
[0003] In related technologies, various activities of indoor personnel are usually treated as homogeneous and processed uniformly. However, in real-world scenarios where multiple behaviors coexist, it is impossible to take into account the accuracy requirements of each behavior, making it difficult to accurately separate and count people in a multi-person environment, resulting in insufficient accuracy in headcount statistics. Summary of the Invention
[0004] This disclosure is made in view of the above-mentioned problems. This disclosure provides a method, apparatus, device, medium, and product for counting people.
[0005] In a first aspect, embodiments of this disclosure provide a method for counting people, comprising: acquiring channel state information data; determining the behavior patterns of indoor personnel based on the channel state information data, and outputting the determination results of the behavior patterns; wherein the behavior patterns include loitering behavior and entering / exiting behavior; selecting a corresponding target model from multiple different candidate number counting models according to the determination results; wherein the candidate number counting models include a first model for loitering scenarios and a second model for entering / exiting scenarios; inputting the channel state information data into the target model for people estimation, and outputting a people counting result that matches the behavior patterns.
[0006] In one embodiment of the first aspect, a target model is selected from multiple different candidate number statistics models based on the discrimination result, including: if the discrimination result is a loitering behavior, a first model of the loitering scenario is selected as the target model; if the discrimination result is an entry / exit behavior, a second model of the entry / exit scenario is selected as the target model; wherein, the first model is used to construct spatial structure data from channel state information data and to estimate the number of people based on the spatial structure data; the second model is used to extract temporal change features from the channel state information data and to estimate the number of people based on the temporal change features.
[0007] In one embodiment of the first aspect, the target model includes a first model of the loitering scenario. Channel state information data is input into the target model to estimate the number of people, and the output is a number of people statistics result that matches the behavior pattern. The method includes: converting the amplitude data of the channel state information data into a two-dimensional data structure with a predetermined number of frames and subcarriers; extracting spatial distribution features from the two-dimensional data structure based on a convolutional neural network; determining the number of people category based on the spatial distribution features based on a support vector machine classifier, and outputting the estimated number of loitering people result.
[0008] In one embodiment of the first aspect, the target model includes a second model for entering and exiting a scene. Channel state information data is input into the target model for people estimation, and the output is a people statistics result matching the behavior pattern. This includes: selecting a predetermined number of feature subsets with the highest discriminative power from candidate features; classifying the direction of entering and exiting behavior based on the feature subset using a first-level support vector machine classifier, and outputting behavior labels; wherein the behavior labels include entry behavior labels and exit behavior labels; and predicting the number of people entering and exiting corresponding to the direction using a second-level support vector regression model based on the feature subset, and outputting an estimated number of people entering and exiting that includes behavior labels and the number of people entering and exiting.
[0009] In one embodiment of the first aspect, after outputting the number of people statistics that match the behavior pattern, the method further includes: obtaining the current number of people estimated by the first model refresh output, the previous number of people staying, and the change in number of people caused by entry and exit behavior; wherein, if the second model detects an entry and exit event, the first model is refreshed; a correction value is calculated based on the previous number of people staying and the change in number of people; and the correction value is fused with the current number of people estimate to obtain the updated number of people statistics.
[0010] In one embodiment of the first aspect, the method further includes: if the difference between the updated population statistics result and the current population estimate exceeds a predetermined threshold, determining the current population estimate as the updated population statistics result.
[0011] In one embodiment of the first aspect, determining the behavior pattern of indoor personnel based on channel state information data includes: extracting feature vectors from the channel state information data; wherein the feature vectors are used to characterize the variation characteristics of the channel state information data in the time domain and frequency domain; inputting the feature vectors into a classifier, and obtaining the determination result of the behavior pattern of indoor personnel output by the classifier.
[0012] In one embodiment of the first aspect, the feature vector includes at least one of the following: the variance of the first principal component of principal component analysis, the standard deviation of subcarrier amplitude, the variance of amplitude distance between subcarriers, the rate of change of amplitude, the variance of received signal strength indication, and the autocorrelation feature of channel state information data; the classifier includes a random forest classifier.
[0013] In one embodiment of the first aspect, before determining the behavior pattern of indoor personnel based on channel state information data, the method further includes: calculating the Euclidean distance between the subcarrier amplitudes of the channel state information data; determining whether there are personnel indoors based on the Euclidean distance, and if there are personnel indoors, determining the behavior pattern of indoor personnel based on the channel state information data.
[0014] In a second aspect, embodiments of this disclosure provide a people counting device, comprising: a data acquisition unit for acquiring channel state information data; a pattern discrimination unit for discriminating the behavior patterns of indoor personnel based on the channel state information data and outputting the discrimination results of the behavior patterns; wherein the behavior patterns include loitering behavior and entering / exiting behavior; a model selection unit for selecting a corresponding target model from multiple different candidate number counting models according to the discrimination results; wherein the candidate number counting models include a first model for loitering scenarios and a second model for entering / exiting scenarios; and a people counting unit for inputting the channel state information data into the target model for people estimation and outputting people counting results that match the behavior patterns.
[0015] In a third aspect, embodiments of this disclosure provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps in the above-described people counting method are performed.
[0016] In a fourth aspect, embodiments of this disclosure provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps in the aforementioned people counting method.
[0017] In a fifth aspect, embodiments of this disclosure provide a computer program product stored in a storage medium, the program product being executed by at least one processor to implement the steps in the above-described people counting method.
[0018] As will be described in detail below, this disclosure describes a method, apparatus, device, medium, and product for counting people according to embodiments of the present disclosure. In this disclosure, channel state information data is first acquired. Then, based on the channel state information data, the behavioral patterns of people indoors are determined, and the determination result of the behavioral patterns is output. These behavioral patterns include loitering behavior and entry / exit behavior. Next, based on the determination result, a corresponding target model is selected from multiple different candidate counting models. These candidate counting models include a first model for loitering scenarios and a second model for entry / exit scenarios. Finally, the channel state information data is input into the target model for people estimation, and a people counting result matching the behavioral patterns is output. Through the above processing method, this disclosure pre-determines the behavioral patterns of people indoors using channel state information data and selects a corresponding target model for people estimation based on the behavioral patterns. This allows the people counting process to adapt to different behavioral scenarios, avoiding the accuracy conflict caused by significant differences in the characteristics of the two types of signals when a single model simultaneously processes loitering and entry / exit behaviors. This significantly improves the overall accuracy of people counting in real indoor scenarios with mixed behaviors.
[0019] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description
[0020] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0021] Figure 1 This is a flowchart of a people counting method according to an embodiment of the present disclosure.
[0022] Figure 2 This is a schematic diagram of a waveform before Hampel filtering according to an embodiment of this disclosure.
[0023] Figure 3 This is a schematic diagram of a Hampel-filtered waveform according to an embodiment of the present disclosure.
[0024] Figure 4 This is a schematic diagram of a waveform after wavelet threshold denoising according to an embodiment of the present disclosure.
[0025] Figure 5 This is a waveform diagram illustrating a dwell behavior according to an embodiment of the present disclosure.
[0026] Figure 6This is a waveform diagram illustrating an entry / exit behavior according to an embodiment of this disclosure.
[0027] Figure 7 This is a schematic diagram illustrating behavior determination using a random forest algorithm according to an embodiment of this disclosure.
[0028] Figure 8 This is an overall flowchart of a people counting process according to an embodiment of the present disclosure.
[0029] Figure 9 This is a schematic diagram of a people counting device according to an embodiment of the present disclosure.
[0030] Figure 10 This is a schematic diagram of an electronic device according to an embodiment of the present disclosure.
[0031] Figure 11 This is a schematic diagram of a computer program product according to an embodiment of the present disclosure. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this disclosure more apparent, exemplary embodiments according to this disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments of this disclosure. It should be understood that this disclosure is not limited to the exemplary embodiments described herein.
[0033] To facilitate understanding of this embodiment, a people counting method disclosed in this disclosure will first be described in detail. This people counting method can be applied to multiple fields such as smart campuses, smart homes, retail customer flow analysis, medical monitoring, and office spaces. The executing entity may include, but is not limited to, wireless devices. See [link to relevant documentation]. Figure 1 The diagram shows a flowchart of a people counting method provided in an embodiment of this disclosure. The method includes steps S101 to S104, wherein: Step S101: Obtain channel state information data.
[0034] Here, CSI can be understood as fine-grained physical layer information used in Wi-Fi communication to describe the channel characteristics that a signal experiences from the transmitter to the receiver.
[0035] The CSI data in this disclosure can be obtained through the network card driver interface of a deployed Wi-Fi device, specifically by extracting it from the channel estimation matrix generated during communication at the receiving end. Each CSI data sample contains amplitude and phase information of multiple subcarriers. This CSI data can reflect the multipath effect changes of wireless signals caused by human activity in indoor propagation environments, providing a fine-grained signal feature basis for subsequent behavior pattern discrimination and people estimation.
[0036] This disclosure employs Hampel filters and wavelet thresholding algorithms to preprocess CSI data, removing sharp abrupt changes and local outliers caused by environmental disturbances and hardware errors during the acquisition process, thereby improving feature quality and model robustness.
[0037] Specifically, to suppress the interference of abrupt noise, this disclosure introduces a Hampel filter to smooth the CSI amplitude sequence. The Hampel filter constructs a discrimination rule based on the local median and the median absolute deviation (MAD), which can effectively identify and replace local outliers and avoid the loss of feature information caused by excessive smoothing.
[0038] For example, suppose in a CSI sample the first... The amplitude sequence of each subcarrier is In a sliding window with a length of Under the conditions, the first The median of the window containing the data points is denoted as . MAD is denoted as The calculation formula is as follows: , .
[0039] If a certain point satisfies: If the value is 0, it is considered an outlier and is replaced with the median of the window. This is a preset threshold coefficient. This disclosure applies this method to the amplitude sequence of subcarriers in CSI samples, and adjusts the sliding window size and... Parameters are used to achieve the optimal balance between smoothing effects and feature preservation. For example... Figure 2 and Figure 3 As shown, Figure 2 This is a schematic diagram of the waveform before Hampel filtering, showing obvious abrupt changes and outliers. Figure 3 This is a schematic diagram of the waveform after Hampel filtering. Noise interference is effectively suppressed, while the main motion-related structures are preserved. This filtering strategy improves data quality and lays a solid foundation for subsequent motion segment extraction and model training.
[0040] Although Hampel filtering effectively removes abrupt changes and outliers from the CSI amplitude sequence, some high-frequency noise remains. These high-frequency disturbances typically lack significant anomalous characteristics and are difficult to identify by median filters, yet they are sufficient to affect the model's judgment of action boundaries and local dynamic changes. To further improve signal quality, this disclosure introduces a wavelet thresholding denoising algorithm based on Hampel filtering to perform refined secondary denoising processing on the CSI amplitude sequence.
[0041] Wavelet thresholding denoising is an effective denoising method based on Discrete Wavelet Transform (DWT). Its core idea is to decompose the signal at different frequency scales using wavelet transform, then apply a threshold to the high-frequency noise components, and finally perform an inverse transform to reconstruct a smooth signal.
[0042] Compared to traditional filtering methods, this approach not only removes high-frequency noise but also preserves local abrupt changes and edge features of the signal, making it suitable for processing motion signals in CSI data. Two-dimensional signal Can be decomposed into approximate coefficients and detail coefficient The specific calculation formula is as follows:
[0043]
[0044] In the formula, Describe the wavelet basis functions. Represents the scaling function. It is in the horizontal direction. It is in the vertical direction. It is the diagonal direction. The approximation coefficients contain low-frequency information of the signal, representing its overall characteristics. The detail coefficients contain high-frequency information, representing the signal's details and local features.
[0045] A key step in wavelet denoising is applying a threshold to the detail coefficients. This disclosure employs the soft thresholding method, mathematically expressed as follows: ,in, These are wavelet coefficients. A threshold is used; coefficients greater than the threshold are scaled and preserved, while those less than the threshold are set to zero, thus suppressing high-frequency noise. After wavelet transform, thresholding, and inverse transform reconstruction, noise in the CSI amplitude sequence is significantly reduced, the signal curve is smoother, and key detail features are preserved. Figure 4 The diagram shows the waveform after wavelet threshold denoising. The denoised waveform is clearer, which helps in the subsequent extraction and classification modeling of action features.
[0046] Step S102: Determine the behavior patterns of indoor personnel based on channel state information data, and output the determination results of the behavior patterns; wherein, the behavior patterns include loitering behavior and entry and exit behavior.
[0047] The behavioral patterns described in this disclosure include loitering behavior and entry / exit behavior. Loitering behavior typically occurs in scenarios such as working, reading, and resting. It is characterized by small behavioral amplitude and long duration, resulting in relatively weak CSI signal disturbances that are usually difficult to detect in background noise.
[0048] Entry and exit behaviors typically involve people passing through room doors or other entrances, accompanied by short-term and dramatic signal changes. Because these two types of behaviors differ significantly in their signal response characteristics, it is often difficult to balance statistical accuracy and system stability using a uniform model. In particular, low-amplitude disturbances are easily overlooked when identifying loitering behavior, while environmental noise may interfere with the identification of entry and exit behaviors.
[0049] Figure 5 This is a waveform diagram illustrating the loitering behavior. Figure 6 A waveform diagram illustrating the entry and exit behavior, such as... Figure 5 and Figure 6 As shown, there are significant differences in the CSI amplitude variation patterns between loitering behavior and entry / exit behavior. Loitering behavior exhibits relatively stable CSI amplitude fluctuations. Although fluctuations occur within short periods, the overall amplitude is small, and the frequency of large fluctuations is significantly lower. This is mainly due to the smaller signal disturbances caused by people remaining stationary or moving slowly. In contrast, entry / exit behavior is typically accompanied by more drastic signal changes, especially when traversing multiple Fresnel zones, where the multipath propagation path of the signal changes frequently, leading to a significant increase in both the amplitude and frequency of CSI amplitude fluctuations.
[0050] In this embodiment of the disclosure, feature information that can characterize the changes of the signal in the time domain and frequency domain can be extracted from CSI data, and a classifier can be used to determine the overall behavior state of the people in the room based on these feature information, that is, whether the people in the room are in a state of being basically still or moving slowly in a small range, or in a state of people quickly crossing the door or area boundary.
[0051] This preliminary discrimination step breaks down the complex problem of counting people in mixed scenarios into sub-problems under different behavioral patterns, providing a basis for selecting an appropriate statistical model in the future.
[0052] Step S103: Based on the discrimination results, select the corresponding target model from multiple different candidate number statistics models; wherein, the candidate number statistics models include the first model of the stay scenario and the second model of the entry and exit scenario.
[0053] To achieve more refined environmental perception, this disclosure further proposes an indoor people counting strategy. Different behavioral patterns have a significant impact on the choice of people counting methods, which can be mainly divided into two categories: loitering behavior and entry / exit behavior. These two types exhibit distinctly different variation characteristics in CSI channel state information, thus requiring the design of targeted modeling methods to improve statistical accuracy and system robustness.
[0054] Loitering behavior typically manifests as people remaining still or moving slowly within an indoor space (e.g., sitting, standing, or walking around in small areas), and these behavioral patterns exhibit spatial stability over a certain time period. In such scenarios, the CSI amplitude matrix exhibits characteristics similar to image data, making it suitable for using Convolutional Neural Networks (CNNs) to extract spatial distribution features. However, CNN models have high requirements for sample quantity and classification generalization ability during training, and using a CNN model alone is susceptible to insufficient training samples or environmental changes. Therefore, this disclosure introduces a CNN-SVM hybrid structure, utilizing CNN to extract spatially perceptual features and then using Support Vector Machines (SVMs) for stable people classification, thereby achieving collaborative modeling of structured and unstructured information.
[0055] In contrast, entry and exit behavior exhibits significant dynamic changes, manifested as substantial disturbances in the CSI channel over short periods. In this scenario, sequence features are more statistically valuable. To address this characteristic, this system employs a FisherScore-based feature optimization method to extract temporal features reflecting entry and exit behavior, such as amplitude difference, standard deviation, and rate of change. Joint modeling using SVM and Support Vector Regression (SVR) is then used to map the number of people entering and exiting. This structure demonstrates a high response to short-term disturbances and is suitable for identifying sudden changes in the number of people.
[0056] Based on the above analysis, this disclosure constructs a people counting strategy based on behavioral patterns: when lingering behavior is detected, it automatically switches to a CNN-SVM model for stable people counting; when entering or exiting behavior is detected, it switches to a feature-engineered SVM-SVR model to improve the responsiveness to dynamic changes. This strategy effectively improves the system's adaptability and robustness across multiple behavioral scenarios while ensuring accuracy.
[0057] In this embodiment, different types of behavior cause different perturbation patterns to the CSI signal, thus requiring different data processing strategies for adaptation. If the determination result is a loitering behavior, a first model designed for low-dynamic scenarios is selected; if the determination result is an entry / exit behavior, a second model designed for dynamic scenarios is selected. This adaptive selection mechanism ensures that each behavior pattern can be processed by the statistical model most suitable for its signal characteristics.
[0058] Step S104: Input the channel state information data into the target model to estimate the number of people, and output the number of people statistics that match the behavior pattern.
[0059] Here, the target model is a dedicated model selected from multiple candidate models based on the behavior pattern discrimination results, which corresponds to the current behavior pattern.
[0060] In this embodiment, channel state information data is input to the target model, and the target model extracts features and maps the number of people to the channel state information data, outputting an estimated number of people. If the behavior pattern is determined to be loitering behavior, the first model is selected for processing, and its output is the number of people in the loitering scenario; if the behavior pattern is determined to be entering or exiting behavior, the second model is selected for processing, and its output is the number of people in the entering or exiting scenario. Finally, the number of people is used as the final output of the system.
[0061] In the above embodiments, this disclosure pre-determines the behavior patterns of indoor personnel through channel state information data, and selects the corresponding target model for personnel estimation based on the behavior patterns. This enables the personnel counting process to adapt to different behavior scenarios, avoiding the accuracy conflict caused by the significant differences in the characteristics of the two types of signals when a single model simultaneously processes loitering behavior and entry / exit behavior. As a result, the overall accuracy of personnel counting is significantly improved in real indoor scenarios with mixed behaviors.
[0062] In an optional implementation, the above steps select a corresponding target model from multiple different candidate number statistics models based on the discrimination result, including: if the discrimination result is a loitering behavior, selecting a first model of the loitering scenario as the target model; if the discrimination result is an entry / exit behavior, selecting a second model of the entry / exit scenario as the target model; wherein, the first model is used to construct spatial structure data from the channel state information data and to estimate the number of people based on the spatial structure data; the second model is used to extract temporal change features from the channel state information data and to estimate the number of people based on the temporal change features.
[0063] In this embodiment of the disclosure, when the behavior pattern is determined to be loitering behavior, it indicates that the person indoors is in a static or slow-moving state, such as in scenarios like working, reading, or resting. In such scenarios, because the range of human movement is small, the time-domain variation of the CSI signal is relatively stable, making it difficult to detect the presence of a person by measuring the amplitude of signal changes.
[0064] However, the human body, as a scatterer of wireless signals, alters the multipath propagation structure of the signal itself. Even when stationary, the body attenuates, reflects, and scatters the signal, causing changes in the amplitude distribution across different subcarriers. This change manifests as a shift in the spatial distribution structure of amplitude between subcarriers, rather than a dramatic fluctuation in the time domain.
[0065] Therefore, the first model constructs the amplitude information of CSI data into a data form with spatial structure characteristics, so that the spatial distribution of signal amplitude becomes a spatial feature that can be recognized and learned by the model. This allows the model to perceive the spatial structure changes caused by the presence of people even when they are stationary, and to estimate the number of people indoors based on this.
[0066] In this embodiment of the disclosure, when the behavior pattern is identified as entry / exit behavior, it indicates that a person is crossing a room doorway or area boundary, such as entering or leaving a room. In such scenarios, the rapid crossing of multiple Fresnel zone boundaries causes drastic changes in the multipath propagation path of the signal, resulting in significant fluctuations in the CSI signal within a short period of time.
[0067] The second model extracts multiple features from CSI data that reflect the degree of signal change over time, and estimates the number of people based on these temporal variation features, thereby effectively capturing short-term signal disturbances caused by entry and exit behavior. Among them, temporal variation features refer to statistical quantities extracted from the time-domain sequence of CSI data to characterize the pattern and degree of signal change over time, such as the rate of change of amplitude, fluctuation amplitude, and statistical dispersion.
[0068] Overall, the first model converts CSI data into spatially structured data for processing. This spatially structured data refers to the data format with spatial structural characteristics formed by arranging and combining one-dimensional CSI time series according to frame and subcarrier dimensions. Through this construction method, the spatial distribution differences originally implicit between subcarriers can be explicitly presented, allowing the model to extract and analyze features. The second model analyzes the temporal variation characteristics of the CSI data. By analyzing the patterns of these features changing along the time axis, the model can perceive signal disturbances caused by incoming and outgoing behaviors.
[0069] In an optional implementation, the target model of the above steps includes a first model of the loitering scenario. Channel state information data is input into the target model for number estimation, including: converting the amplitude data of the channel state information data into a two-dimensional data structure with a predetermined number of frames and subcarriers; extracting spatial distribution features from the two-dimensional data structure based on a convolutional neural network; determining the number of people based on the spatial distribution features using a support vector machine classifier, and outputting the estimated number of loitering people.
[0070] Here, spatial distribution features refer to the feature vectors extracted from a two-dimensional data structure by a convolutional neural network, used to characterize the relative amplitude distribution pattern among different subcarriers.
[0071] In this embodiment, within a time window, the amplitude distribution of different subcarriers is influenced by the number, location, and posture of people indoors, forming a specific spatial distribution pattern. The convolutional neural network (CNN) extracts spatial correlations from local to global levels layer by layer on a two-dimensional data structure through the sliding window operation of its convolutional layers: lower convolutional layers capture local amplitude differences between adjacent subcarriers, while higher convolutional layers accumulate receptive fields to form a perception of the global subcarrier distribution pattern. Ultimately, the feature vector output by the CNN is a compact representation of the aforementioned spatial distribution pattern.
[0072] The spatial distribution feature has a smaller dimension than the input data, representing a lossy compression encoding of the original spatial distribution information while preserving the discriminative information most relevant to the people classification task. This spatial distribution feature is then fed into a support vector machine classifier to determine the people category.
[0073] For the first model, in the counting of people based on loitering behavior, this disclosure adopts a method framework based on the fusion of deep feature extraction and traditional classifier to construct the first model: using CNN to extract high-dimensional spatiotemporal features, and then combining it with SVM to complete the classification of people.
[0074] As shown in Table 1, the input data is a preprocessed CSI amplitude sequence with dimensions of 100×64×1, corresponding to 100 CSI samples and 64 subcarrier amplitudes (i.e., a two-dimensional data structure with a predetermined number of frames and subcarriers). The CNN network structure includes two convolutional layers, two max-pooling layers, a flattening layer, and two fully connected layers. To reduce the risk of overfitting, a dropout layer is placed between the two fully connected layers. Finally, the model outputs a 64-dimensional feature representation at the fully connected layer, which is used as input for determining the number of lingering residents.
[0075] Table 1 Layer name type Parameter settings Output size Input layer / / 100×64×1 Convolutional layer 1 Conv2D kernel=3×3, filters=32, same padding 100×64×32 Pooling layer 1 MaxPooling pool_size=2×2, stride=2 50×32×32 Convolutional layer 2 Conv2D kernel=3×3, filters=64, same padding 50×32×64 Pooling layer 2 MaxPooling pool_size=2×2, stride=2 25×16×64 Flattening layer Flatten / 25600 Fully connected layer 1 Dense units=128 128 Dropout layer Dropout rate=0.5 128 Fully connected layer 2 Dense units=64 64 Classifier Multiclass SVM There are a total of 50 binary classifiers (1-to-1, 10 classes). 10 categories To further improve classification accuracy and enhance the model's ability to distinguish between different population distributions, this disclosure replaces the Softmax layer at the end of the CNN with an SVM to construct a multi-class population recognition model. Considering that the actual number of people staying is between 1 and 10, the SVM employs a one-to-one strategy to build multiple binary classifiers to distinguish the feature boundaries between any two population classes. This strategy requires the construction of 50 SVM sub-classifiers. Each sub-classifier independently receives a 64-dimensional feature vector extracted from the CNN as input during the training phase and performs discriminative learning using the corresponding two population class data.
[0076] The SVM classifier employs a radial basis function (RBF) kernel and automatically determines key parameters such as kernel width and penalty factor through five-fold cross-validation. During training, the CNN parameters are frozen and used only as a feature extractor to avoid gradient interference between networks, thus enabling separate training of the CNN and SVM. This design ensures the full extraction of deep semantic information while enhancing the model's boundary discrimination ability in the feature space.
[0077] In the prediction phase, the input CSI data is first converted into a 64-dimensional feature vector (i.e., spatial distribution features) through a CNN network, and then fed into all 50 SVM sub-classifiers. Each classifier independently outputs its voting result. Finally, the system determines the classification result of the number of people staying based on the majority voting mechanism. That is, it uses the support vector machine classifier to determine the category of people based on the spatial distribution features and outputs the estimated number of people staying. This model has strong anti-interference ability and classification robustness in complex environments, and is particularly suitable for scenarios where different population distributions are relatively dense.
[0078] In an optional implementation, the target model of the above steps includes a second model for entering and exiting the scene. Channel state information data is input into the target model for people estimation, including: selecting a predetermined number of feature subsets with the highest discriminative power from candidate features; classifying the direction of entering and exiting behavior based on the feature subset using a first-level support vector machine classifier, and outputting behavior labels; wherein, the behavior labels include entry behavior labels and exit behavior labels; predicting the number of people entering and exiting corresponding to the direction using a second-level support vector regression model based on the feature subset, and outputting the estimated number of people entering and exiting including behavior labels and the number of people entering and exiting.
[0079] In this embodiment, the entry and exit behaviors exhibit significant dynamic changes, manifested as substantial disturbances in the CSI channel over short periods. To effectively characterize these disturbances, it is necessary to extract time-series statistical features from the CSI data that reflect the dynamic changes in the signal as candidate features.
[0080] The candidate features include, but are not limited to, the following types: CSI amplitude difference, which is the change in CSI amplitude between adjacent time frames, used to measure the instantaneous intensity of signal disturbance; amplitude standard deviation, which is the dispersion of CSI amplitude within a time window, used to reflect the overall amplitude of signal fluctuation; amplitude change rate, which is the average rate of change of CSI amplitude per unit time, used to characterize the drasticness of signal change; Received Signal Strength Indication (RSSI) variance, which is the fluctuation of RSSI within a time window, used to assist in judging the dynamic changes of the signal from the overall energy level; and CSI autocorrelation feature, which is the autocorrelation coefficient of the CSI sequence over time delay, used to reflect the short-term regularity and periodicity of signal changes. These features characterize the time-domain variation of the CSI signal from different perspectives.
[0081] In the task of people recognition based on entry and exit behavior, the complex perturbations of CSI signals caused by people's activities not only increase the computational complexity of the model by directly using all features for classification, but may also introduce redundant information and noise, thereby affecting recognition performance. Therefore, this disclosure introduces the Fisher Score algorithm to screen and rank candidate features, retaining the most discriminative subset of features to improve the training efficiency and generalization ability of the model.
[0082] The Fisher Score algorithm is a commonly used supervised feature selection method that evaluates the discriminative power of each feature against different classes based on the principle of maximizing inter-class separability and minimizing intra-class dispersion. Its basic idea is that if a feature has a large mean difference between different classes but a small variance within the same class, then that feature has strong discriminative power.
[0083] Suppose a set of features is given Any sample ,feature Inter-class divergence With the Class samples in Intra-class divergence The formula is as follows:
[0084]
[0085] in, It is the number of sample categories. It is the first The number of samples in each class It is the first Each category of samples has features The mean of the above, Are all samples in the feature The mean of the above, It is the first The first class of samples One sample in The value to be taken below.
[0086] Secondly, define features Fisher Score is According to characteristics The inter-class divergence and intra-class divergence can be used to... Represented as:
[0087] By calculating the Fisher Score for each feature and sorting them from highest to lowest, the subset of features with the highest discriminative power can be obtained. To reduce the computational complexity of the model while maintaining action discriminability, this disclosure selects the top 5 features based on the Fisher Score ranking as the final input feature subset. These features demonstrate good discriminative power in both entry and exit behaviors, effectively supporting subsequent people counting tasks.
[0088] In real-world environments, identifying the number of people entering and leaving faces two main challenges: firstly, there are significant differences in nonlinear perturbation characteristics between entering and leaving behaviors in terms of CSI features; secondly, different numbers of people exhibit similar perturbation patterns on the channel under the same behavior, leading to blurred identification boundaries and making accurate differentiation difficult using a single model. To address this, this disclosure proposes a second model based on SVM and SVR: the first stage uses SVM to perform binary classification of behavior direction (entering / leaving), and the second stage uses an SVR regression model to predict the specific number of people. Since it is difficult to simultaneously detect more than three people entering and leaving in real-world scenarios, the second model selects a recognition range of 1 to 3 people. This achieves a coarse-to-fine hierarchical identification. This strategy not only fully leverages the advantages of SVM in small-sample nonlinear classification but also improves the continuity and accuracy of the number estimation.
[0089] In the first-level support vector machine (SVM) classifier, a nonlinear SVM is used to perform binary classification of behavioral directions. SVM constructs an optimal hyperplane in a high-dimensional space to partition samples according to the maximum class margin; essentially, it solves a convex constrained quadratic programming (CCQP) problem. Under the ideal condition of linear separability, the hyperplane of the SVM is expressed as:
[0090] in, and Let represent two adjustable parameters. To maximize the classification margin, the optimization objective is:
[0091] in, This refers to behavioral labels, including entry and exit behavioral labels. Represents a sample vector. The total number of samples, Let these be slack variables. By introducing Lagrange multipliers, we can construct its dual problem:
[0092] By solving this optimization problem, the optimal parameters of the classifier can be obtained, thereby achieving accurate differentiation between entry and exit behaviors.
[0093] In the second-level support vector machine (SVR) classifier recognition, SVR is used to further predict the specific number of people involved in the behavior. Compared to direct multi-class classification, SVR is more suitable for fine-grained estimation tasks of the number of people, an approximately continuous variable, and can improve recognition accuracy and model generalization ability. To better fit the difference in feature distribution between the "entering" and "leaving" behaviors, this disclosure trains independent SVR models in two directions. The optimization objective is:
[0094] The constraints are as follows:
[0095] The constraints require the predicted value Compared with the actual number of people The deviation does not exceed the set threshold. The excess portion will be penalized. and Compensation is performed. The two-level models share the preferred feature subset selected by the Fisher Score method, but each trains its parameters independently and optimizes its model structure. Through a hierarchical recognition strategy, this disclosure achieves high-precision recognition of six types of entry and exit behaviors (1 to 3 people entering or leaving), effectively improving the stability and robustness of the model in complex scenarios.
[0096] In the above implementation, considering the characteristic of drastic short-term disturbances in CSI signals during entry and exit behavior, the model filters out redundant information and noise interference by selecting the most discriminative subset of features from candidate features, thereby reducing the feature dimensionality and focusing the model on the core features most relevant to entry and exit behavior. This improves the accuracy of entry and exit direction discrimination and people estimation. At the same time, a two-level recognition model composed of support vector machine and support vector regression is adopted to decouple direction discrimination and people regression, and model and train them separately. This reduces the learning complexity of a single model when recognizing both direction and people simultaneously, effectively improving the accuracy and stability of people estimation in entry and exit behavior scenarios.
[0097] In an optional implementation, after outputting the headcount statistics that match the behavior pattern, the method further includes: obtaining the current headcount estimate, the previous number of people staying, and the change in headcount caused by entry and exit behavior, as output by the first model refresh; wherein, if the second model detects an entry or exit event, the first model is refreshed; a correction value is calculated based on the previous number of people staying and the change in headcount; and the correction value is fused with the current headcount estimate to obtain the updated headcount statistics.
[0098] In order to integrate the indoor number estimation results of the two models, give full play to the complementary advantages of static stable perception and dynamic behavior response, and consider that the first model has the ability to periodically output stable number estimation, while the second model can capture local change information in the range of 1 to 3 people in real time, this disclosure designs a fusion mechanism based on trigger refresh and result alignment.
[0099] When the second model detects an entry or exit event, the system immediately triggers a refresh of the first model's results (i.e., if the second model detects an entry or exit event, the first model is refreshed), obtaining an estimated number of people staying at the current time. Subsequently, the system calculates the previous number of people staying by combining it with the change in the number of people identified by the second model, generating a correction value. This correction value is then fused with the refresh output of the first model to obtain the final updated number of people statistics. To balance the response to sudden events with overall stability, this disclosure employs a linear averaging method to fuse the results from both approaches. The specific calculation formula is as follows:
[0100] in, Refresh the current number estimate output by the first model. This refers to the number of people who stayed last time. The second model identifies the number of people changing, i.e., the change in the number of people caused by entry and exit behavior.
[0101] In the above embodiments, by establishing an event-triggered dual-model result fusion mechanism, the first model is refreshed when an entry or exit event triggers it. The calculated value (corrected value) based on event changes is fused with the stable observation value (current headcount estimate) of the static model. This allows the headcount statistics to quickly respond to dynamic changes caused by entry and exit behavior while maintaining the stable observation advantage of the first model in static scenarios, achieving a balance between dynamic response and static accuracy. The fusion mechanism of this disclosure effectively resolves the contradiction between dynamic change response speed and static scene statistical accuracy, improving the continuity and reliability of the headcount statistics results in mixed behavior scenarios.
[0102] In an optional implementation, if the difference between the updated headcount statistics and the current headcount estimate exceeds a predetermined threshold after a predetermined number of consecutive updates, the current headcount estimate is determined to be the updated headcount statistics.
[0103] If entry and exit detection is triggered multiple times within a continuous time window, the system will use the last change superimposed value for calculation and introduce an error accumulation suppression mechanism: when the difference between the fused number of people and the refresh value of the first model (i.e. the difference between the updated number of people statistics and the current number of people estimate) exceeds the set threshold (e.g., 2 people) twice in a row, the system will prioritize using the result of the first model for correction in order to avoid the continuous accumulation of misjudgments.
[0104] For the final output, if the estimated number of people after fusion is a decimal, the system will use a rounding method to convert it into the nearest integer to ensure that the number of people is a discrete integer.
[0105] In this embodiment, by further incorporating error accumulation suppression logic into the fusion mechanism, when the difference between the updated headcount statistics and the current headcount estimate output by the first model exceeds a predetermined threshold for a predetermined number of consecutive cycles, it is determined that the fusion result may have continuously deviated, and the current headcount estimate output by the first model is directly adopted as the updated headcount statistics. This mechanism effectively avoids the continuous accumulation of headcount errors caused by continuous misjudgments in entry and exit behavior detection, prevents the fusion result from gradually drifting during long-term operation, and ensures the long-term stability and reliability of the system output.
[0106] In an optional implementation, the above steps for determining the behavior patterns of indoor personnel based on channel state information data include: extracting feature vectors from the channel state information data; wherein the feature vectors are used to characterize the variation characteristics of the channel state information data in the time domain and frequency domain; inputting the feature vectors into a classifier, and obtaining the discrimination result output by the classifier for determining the behavior patterns of indoor personnel.
[0107] In complex indoor environments, human behavior can be mainly categorized into two states: loitering and entering / exiting. Loitering refers to individuals moving slowly or even remaining stationary within a fixed area; while entering / exiting refers to individuals rapidly traversing multiple locations, such as rooms or doorways. Because crossing multiple Fresnel zone boundaries causes frequent changes in multipath propagation paths in the channel, the amplitude and frequency of CSI signal fluctuations also vary significantly. To effectively capture these differences in behavioral patterns, this disclosure proposes a multi-feature discrimination strategy combining Principal Component Analysis (PCA) and a random forest classifier.
[0108] Specifically, in order to achieve accurate identification of indoor behavior patterns, this disclosure designs a combined feature extraction scheme based on CSI data, which includes dominant and supplementary features, to comprehensively reflect the channel change characteristics under different behavior patterns.
[0109] First, to reduce data dimensionality and extract global dynamic information, this disclosure employs principal component analysis to reduce the dimensionality of CSI data within each sliding time window, retaining the first principal component and calculating its variance as a macroscopic dynamic indicator. This indicator can effectively distinguish between stable dwell behavior and abrupt entry / exit behavior.
[0110] However, the first principal component extracted by PCA only represents the change of the CSI signal in the principal direction, which may ignore the detailed changes caused by local disturbances or multipath reflections.
[0111] In an optional implementation, to enhance the expressive power of the features, this disclosure further introduces five supplementary features: the standard deviation of CSI subcarrier amplitude, used to reflect the consistency of fluctuations in different subcarrier signals and capture the degree of frequency domain disturbances; the variance of amplitude distance between subcarriers, characterizing the differences in spatial path disturbances between subcarriers; the rate of change of amplitude, measuring the severity of CSI signals in the time dimension; the variance of RSS, representing the overall channel energy fluctuation, assisting in identifying entry and exit behaviors; and the CSI autocorrelation feature, used to reflect potential periodic changes or short-term regularities in the time series. That is, the feature vector includes at least one of the following: the variance of the first principal component of principal component analysis, the standard deviation of subcarrier amplitude, the variance of amplitude distance between subcarriers, the rate of change of amplitude, the variance of received signal strength indication, and the autocorrelation feature of the channel state information data.
[0112] This disclosure extracts six-dimensional input features from channel state information data: the variance of the first principal component of PCA and five supplementary statistical features, constructing a feature vector with a simple structure and low computational cost, providing strong support for subsequent models.
[0113] In one optional implementation, the classifier includes a random forest classifier. After extracting the six-dimensional features, this disclosure further constructs a multi-feature fusion random forest recognition model for classifying and judging different human behavior patterns. Compared with traditional single-feature or linear models, random forests have stronger nonlinear modeling capabilities and noise resistance, making them suitable for non-Gaussian perturbations and complex patterns present in CSI signals.
[0114] Random forest is an ensemble learning algorithm composed of multiple decision trees. During training, each tree randomly draws data from the training samples and feature subsets, thus combining randomness with ensemble learning and exhibiting strong generalization ability. Figure 7 The diagram illustrates the behavior determination using the Random Forest algorithm. In this system, the 6-dimensional feature vector extracted in the previous section is used as the model input, and the following strategies are employed to construct the Random Forest classifier: the number of trees is set to 30 to balance model complexity and efficiency; the maximum depth is set to 8 layers to limit the risk of overfitting; the Shannon entropy corresponding to information gain is used as the splitting criterion to improve the discriminativeness of node splitting; the feature selection strategy is to randomly select 3 candidate features from all features for each split; in terms of sample processing, considering the imbalance between the number of samples for loitering behavior and entry / exit behavior, a combination of undersampling and oversampling is used for class balancing.
[0115] In the above embodiments, the feature combination of this disclosure can effectively capture the characteristics of channel changes during different personnel behaviors, enabling the random forest model to maintain good recognition accuracy and stability when faced with changes in the number of people staying and the frequency of entry and exit. Meanwhile, because the random forest model does not rely on a complex gradient training process and has flexible parameter settings and fast inference speed, it is particularly suitable for deployment in edge devices with limited computing resources. Combined with the design of the aforementioned feature extraction method, the system as a whole possesses good engineering feasibility and deployment and promotion value.
[0116] In an optional implementation, before determining the behavior pattern of people indoors based on channel state information data, the method further includes: calculating the Euclidean distance between the subcarrier amplitudes of the channel state information data; determining whether there are people indoors based on the Euclidean distance; and, if there are people indoors, determining the behavior pattern of people indoors based on the channel state information data.
[0117] This disclosure explores the feasibility of using CSI amplitude difference, subcarrier correlation, and subcarrier amplitude distance in indoor personnel presence detection. Through comparative analysis, subcarrier amplitude distance, which exhibits strong anti-interference capabilities and is sensitive to environmental changes, was selected as the primary determining feature.
[0118] Specifically, the CSI amplitude difference is a simple way to measure the degree of change in channel state between adjacent time points. When a person moves, the CSI amplitude fluctuates, causing the amplitude difference between adjacent time points to increase; while when the environment is stationary, the amplitude difference tends to stabilize. Therefore, this feature can detect significant human activity to some extent. Its calculation formula is as follows:
[0119] Indicates a point in time The difference in amplitude, Indicates the first Subcarriers in time amplitude, Indicates that it is in Amplitude at time, The total number of subcarriers, Indicates a time interval.
[0120] During periods of human activity, the fluctuation of the CSI signal significantly increases, and the amplitude difference also rises, reflecting a certain correlation with the presence of a human. However, the CSI amplitude difference as a detection indicator has significant limitations. First, this feature is primarily sensitive to vigorous dynamic behaviors (such as walking and jumping), and its response to stationary or slowly moving individuals is not obvious. Second, the amplitude difference is quite sensitive to environmental noise, and occasional false positives may occur even in unoccupied environments, affecting detection reliability. More importantly, when a person is stationary in the environment, the overall variation in CSI amplitude is small, making it difficult to effectively characterize the static presence of a person, thus limiting its applicability in low-dynamic scenarios.
[0121] Subcarrier correlation measures the degree of correlation between different subcarriers in a CSI sample, reflecting the spatial consistency and multipath characteristics of the channel. The correlation between subcarriers is affected by environmental changes. Therefore, compared to amplitude difference, subcarrier correlation is more sensitive to small channel disturbances and can theoretically be used to detect minor human activity.
[0122] In actual calculations, CSI samples at a certain time point are selected, and the Pearson correlation coefficient between any two subcarriers is calculated pairwise. The calculation formula is as follows:
[0123] in, Indicates subcarrier and The correlation coefficient between them and These are the amplitude vectors of the corresponding subcarriers. This represents the covariance operation. and Subcarriers and The standard deviation.
[0124] The correlation coefficients of all subcarriers are combined into a vector, and the average variance of this vector is calculated as the detection index. During human activity, the correlation between subcarriers is disturbed, and the variance of the correlation coefficient fluctuates, thus reflecting changes in behavior.
[0125] Although subcarrier correlation is highly sensitive to channel changes and theoretically can provide higher detection sensitivity, it still has some limitations in practical personnel presence detection. On the one hand, this method relies on channel disturbances caused by activity, making it less effective at identifying stationary or slowly moving individuals. On the other hand, noise and subcarrier instability in the raw CSI data can introduce spurious correlations, increasing the risk of misjudgment. Especially in environments with long-term stability and stationary personnel, the correlation fluctuations between subcarriers are weak, making it difficult to produce clear detection results.
[0126] In personnel presence detection tasks, relying solely on drastic changes in CSI amplitude or disturbances in subcarrier correlation is insufficient to accurately determine whether "there are people indoors." This is because when people are stationary, the channel does not exhibit significant changes, resulting in amplitude fluctuations and correlations remaining at low levels, which can easily be misjudged as "no one is present." To address this issue, this disclosure introduces distance characteristics between CSI subcarrier amplitudes to capture changes in signal propagation structure caused by the presence of people.
[0127] The human body, as a scatterer of electromagnetic waves, attenuates, blocks, or reflects wireless signals, thereby altering the multipath structure of the channel. This change causes a reconstruction of the CSI amplitude distribution of different subcarriers at a given time point, resulting in significant differences in the amplitude distance between subcarriers. Therefore, for any CSI sample at any given time, the Euclidean distance between all subcarriers is calculated as a detection metric. The calculation formula is as follows:
[0128] In the formula, Indicates the first The subcarrier and the first The Euclidean distance between each subcarrier. Combine all distances into a vector. and calculate The average variance of the signal can be used as the detection value for the presence of people at that point in time. During the first 10 seconds, the person is stationary indoors, the amplitude distribution between subcarriers is relatively stable, and the distance variance is small. When the person leaves the room around the 10th second, the signal propagation path changes abruptly, causing a violent disturbance in the amplitude structure between subcarriers, resulting in a significant increase in distance. This characteristic can effectively distinguish between static and dynamic states, and the fluctuation trend is highly consistent with the actual event.
[0129] Therefore, CSI amplitude distance, as a structural feature, can effectively characterize the degree of interference from personnel on the channel and has a good ability to detect the presence of personnel. Based on this feature, this system ultimately selected it as the input basis for subsequent personnel state modeling.
[0130] In the above embodiments, this disclosure sets up a personnel presence detection step before behavior pattern discrimination and uses the Euclidean distance between CSI subcarrier amplitudes as a detection index to determine whether there are personnel indoors. This can effectively detect the spatial presence of stationary personnel, reduce the invalid computing overhead in the unattended state, reduce the overall computing power consumption of the system, and improve the operating efficiency of the system.
[0131] See Figure 8 The diagram shown is a flowchart of a people counting process provided in an embodiment of this disclosure.
[0132] S801: Acquire channel state information data.
[0133] S802: Determine the behavior patterns of people indoors based on channel state information data, and output the determination results of the behavior patterns.
[0134] Among them, behavioral patterns include loitering behavior and entry / exit behavior.
[0135] S803: If the judgment result is a loitering behavior, select the first model of the loitering scenario as the target model.
[0136] S804: If the judgment result is an entry / exit behavior, select the second model of the entry / exit scene as the target model.
[0137] The first model is used to construct spatial structure data from channel state information data and to estimate the number of people based on the spatial structure data; the second model is used to extract temporal variation features from channel state information data and to estimate the number of people based on the temporal variation features.
[0138] S805: Converts the amplitude data of channel state information data into a two-dimensional data structure with a predetermined number of frames and subcarriers; S806: Extracting spatial distribution features from two-dimensional data structures based on convolutional neural networks.
[0139] S807: Based on the support vector machine classifier, the spatial distribution features are used to determine the category of people and output the estimated number of people staying.
[0140] S808: Select a predetermined number of feature subsets with the highest discriminative power from candidate features.
[0141] S809: The first-level support vector machine classifier classifies the direction of entry and exit behavior based on a subset of features and outputs behavior labels.
[0142] Among them, the behavior tags include entry behavior tags and exit behavior tags; S810: The second-level support vector regression model predicts the number of people entering and exiting based on the feature subset and the direction, and outputs the estimated number of people entering and exiting.
[0143] The estimated number of people entering and exiting includes behavioral tags and the number of people entering and exiting.
[0144] Overall, the first stage is data preprocessing. This disclosure employs a Hampel filter and wavelet thresholding denoising algorithm to preprocess the raw CSI data, removing sharp abrupt changes and local outliers caused by environmental disturbances and hardware errors during acquisition, thereby improving feature quality and model robustness.
[0145] The second stage is the presence detection phase. The system periodically receives a segment of CSI data and quickly determines whether there is personnel activity by observing changes in the subcarrier amplitude distance. If it is initially determined that no one is present, no further processing is required; otherwise, the system proceeds to the next stage.
[0146] The next stage is behavior pattern discrimination. To distinguish between loitering behavior and entry / exit behavior, the system combines Fresnel zone traversal theory with principal component analysis and a random forest classifier to perform feature compression and behavior classification on the CSI signal. Since entry / exit behavior is usually accompanied by traversing multiple interference zones, causing significant perturbations in the CSI signal, the system can effectively identify entry / exit behavior based on this characteristic.
[0147] Finally, the system enters the model invocation and result fusion stage. If the behavior is determined to be loitering, the system invokes a CNN-SVM hybrid model, using CNN to extract spatial features and SVM to estimate the number of people. If the behavior is determined to be entering or exiting, the system uses the Fisher Score method for feature selection, and then uses SVM and SVR models to identify the number of people entering and exiting and their directions. Ultimately, the system integrates the recognition results of each sub-model through a phased fusion strategy to achieve dynamic updates of the indoor number of people.
[0148] As can be seen from the above description, the technical solution disclosed herein has the following advantages: Significantly improved overall counting accuracy and environmental adaptability in complex mixed behavior scenarios: The core of this disclosure is an architecture for behavior pattern discrimination-driven differentiated modeling. Specifically, the system first uses a random forest classifier based on multi-feature fusion (PCA variance, amplitude distance variance, etc.) to accurately distinguish between loitering and entering / exiting behaviors according to Fresnel zone theory. Subsequently, it adaptively calls fully optimized dedicated sub-models (CNN-SVM for loitering, SVM / SVR for entering / exiting) for different behaviors, so that each behavior can be processed by its most suitable algorithm, fundamentally overcoming the deficiency that a single model cannot take into account the characteristics of different behaviors.
[0149] It greatly enhances the perceptual sensitivity and counting ability for static or low-amplitude lingering behaviors: First, in the personnel presence detection phase, the subcarrier amplitude distance variance feature, which is more sensitive to changes in channel structure, is used instead of the traditional amplitude difference, thus enabling more reliable detection of the presence of stationary personnel. Second, for the determination of loitering behavior, a CNN-SVM model that treats CSI data as a spatial image is employed. The superior spatial feature extraction capability of CNN can capture subtle patterns hidden in the CSI amplitude matrix caused by stationary personnel, thereby achieving accurate classification of the number of loitering personnel.
[0150] It effectively improves the anti-interference ability and counting stability against short-term, drastic entry and exit behaviors: This disclosure presents a two-stage SVM-SVR model specifically designed for entry and exit behavior, based on Fisher Score feature selection. The Fisher Score algorithm automatically selects the top 5 features most discriminative for entry and exit behavior, effectively filtering redundant noise and highlighting core signal changes. Furthermore, the hierarchical processing structure of SVM (responsible for direction classification) and SVR (responsible for number regression) decomposes the complex problem of joint identification of behavior direction and specific number of people into two simpler sub-problems, reducing the learning difficulty of the model and enhancing its ability to model nonlinear perturbation patterns and its generalization ability in entry and exit events.
[0151] It provides more continuous, reliable, and self-correcting dynamic population estimates: This disclosure proposes a dynamic triggering and fusion mechanism. This mechanism uses entry / exit events as trigger signals to synchronously refresh the first model, ensuring data timeliness. Subsequently, a linear weighted fusion formula combines the inferred values based on event changes with the stable observations of the first model. More importantly, error accumulation suppression logic is introduced, enabling the system to have self-correcting capabilities, thereby ensuring the continuity and reliability of the final output number of people.
[0152] Based on the same inventive concept, this disclosure also provides a people counting device corresponding to the people counting method. Since the principle of the device in this disclosure is similar to the people counting method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0153] Reference Figure 9 The diagram shown is a schematic representation of a people counting device provided in an embodiment of this disclosure. The device includes: a data acquisition unit 90, a pattern discrimination unit 91, a model selection unit 92, and a people counting unit 93; wherein: The data acquisition unit is used to acquire channel state information data.
[0154] The pattern discrimination unit is used to discriminate the behavior patterns of people indoors based on channel state information data and output the discrimination results of the behavior patterns; wherein, the behavior patterns include loitering behavior and entering and exiting behavior.
[0155] The model selection unit is used to select the corresponding target model from multiple different candidate number statistics models based on the discrimination results; among them, the candidate number statistics models include a first model of the stay scenario and a second model of the enter and exit scenario.
[0156] The people counting unit is used to input channel state information data into the target model to estimate the number of people and output the people counting results that match the behavior patterns.
[0157] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0158] Corresponding to Figure 1 In addition to the method for counting people, this disclosure also provides an electronic device 60, such as... Figure 10 The diagram shown is a structural schematic of an electronic device 60 provided in an embodiment of this disclosure, including: The system includes a processor 61, a memory 62, and a bus 63. The memory 62 stores execution instructions and includes main memory 621 and external memory 622. The main memory 621, also called internal memory, temporarily stores the computational data in the processor 61, as well as data exchanged with external memory such as a hard disk. The processor 61 exchanges data with the external memory 622 through the main memory 621. When the electronic device 60 is running, the processor 61 communicates with the memory 62 through the bus 63, causing the processor 61 to execute the following instructions: Obtain channel state information data.
[0159] The behavior patterns of people indoors are determined based on channel state information data, and the determination results of the behavior patterns are output; the behavior patterns include loitering behavior and entering and exiting behavior.
[0160] Based on the discrimination results, the corresponding target model is selected from multiple different candidate number statistics models; among them, the candidate number statistics models include the first model of the stay scenario and the second model of the entry and exit scenario.
[0161] Channel state information data is input into the target model to estimate the number of people, and the output is a statistical result of the number of people that matches the behavior pattern.
[0162] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the people counting method described in the above-described method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0163] This disclosure also provides a computer program product 70, such as... Figure 11 The diagram shown is a schematic diagram of the structure of a computer program product 70 provided in an embodiment of this disclosure. The computer program product 70 carries a computer program 71. The program included in the computer program 71 can be used to execute the steps of the people counting method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0164] The above description, with reference to the accompanying drawings, outlines a method, apparatus, device, medium, and product for counting people according to embodiments of this disclosure. In these embodiments, channel state information data is first acquired. Then, based on the channel state information data, the behavioral patterns of people indoors are determined, and the determination result of the behavioral patterns is output. These behavioral patterns include loitering behavior and entry / exit behavior. Next, based on the determination result, a corresponding target model is selected from multiple different candidate counting models. These candidate counting models include a first model for loitering scenarios and a second model for entry / exit scenarios. Finally, the channel state information data is input into the target model for people estimation, and a people counting result matching the behavioral patterns is output. Through this processing method, this disclosure pre-determines the behavioral patterns of people indoors using channel state information data and selects a corresponding target model for people estimation based on the behavioral patterns. This allows the people counting process to adapt to different behavioral scenarios, avoiding the accuracy conflict caused by significant differences in the signal characteristics of the two types of signals when a single model simultaneously processes loitering and entry / exit behaviors. This significantly improves the overall accuracy of people counting in real indoor scenarios with mixed behaviors.
[0165] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0166] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0167] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.
[0168] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.
[0169] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.
[0170] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0171] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method for counting people, characterized in that, include: Acquire channel state information data; The behavior patterns of people indoors are determined based on the channel state information data, and the determination results of the behavior patterns are output; wherein, the behavior patterns include loitering behavior and entering and exiting behavior; Based on the discrimination results, a corresponding target model is selected from multiple different candidate number statistics models; wherein, the candidate number statistics model includes a first model of the stay scenario and a second model of the entry and exit scenario; The channel state information data is input into the target model to estimate the number of people, and the output is a statistical result of the number of people that matches the behavior pattern.
2. The method according to claim 1, characterized in that, The step of selecting the corresponding target model from multiple different candidate number statistical models based on the discrimination result includes: If the determination result is a loitering behavior, the first model of the loitering scenario is selected as the target model; If the determination result is an entry / exit behavior, the second model of the entry / exit scenario is selected as the target model; The first model is used to construct the channel state information data into spatial structure data and to estimate the number of people based on the spatial structure data; the second model is used to extract temporal variation features from the channel state information data and to estimate the number of people based on the temporal variation features.
3. The method according to claim 1, characterized in that, The target model includes a first model of the loitering scenario. The step of inputting the channel state information data into the target model for people estimation and outputting a people count result matching the behavioral pattern includes: The amplitude data of the channel state information data is converted into a two-dimensional data structure with a predetermined number of frames and subcarriers; Spatial distribution features are extracted from the two-dimensional data structure based on a convolutional neural network. The spatial distribution features are used to determine the number of people and output an estimated number of people staying.
4. The method according to claim 1, characterized in that, The target model includes a second model for entering and exiting the scene. The step of inputting the channel state information data into the target model for people estimation and outputting a people statistics result matching the behavior pattern includes: Select a predetermined subset of features with the highest discriminative power from the candidate features; The first-level support vector machine classifier classifies the direction of entry and exit behaviors based on the feature subset and outputs behavior labels; wherein, the behavior labels include entry behavior labels and exit behavior labels; The second-level support vector regression model predicts the number of people entering and exiting corresponding to the direction based on the feature subset, and outputs the estimated number of people entering and exiting, including the behavior label and the number of people entering and exiting.
5. The method according to claim 1, characterized in that, After outputting the statistical results of the number of people matching the said behavioral pattern, the method further includes: Obtain the current number of people estimated by the first model refresh output, the number of people staying at the last time, and the change in the number of people caused by entry and exit behavior; wherein, if the second model detects an entry or exit event, the first model is refreshed. The correction value is calculated based on the previous number of stayers and the change in the number of stayers; The corrected value and the current estimated number of people are combined to obtain the updated population statistics.
6. The method according to claim 5, characterized in that, The method further includes: If the difference between the updated headcount statistics after a predetermined number of consecutive cycles and the current headcount estimate exceeds a predetermined threshold, the current headcount estimate is determined to be the updated headcount statistics.
7. The method according to claim 1, characterized in that, The method of determining the behavior pattern of indoor personnel based on the channel state information data includes: Feature vectors are extracted from the channel state information data; wherein the feature vectors are used to characterize the variation characteristics of the channel state information data in the time domain and frequency domain. The feature vector is input into the classifier, and the classification result output by the classifier is obtained to determine the behavior pattern of people indoors.
8. The method according to claim 7, characterized in that, The feature vector includes at least one of the following: the variance of the first principal component of the principal component analysis, the standard deviation of the subcarrier amplitude, the variance of the amplitude distance between subcarriers, the amplitude change rate, the variance of the received signal strength indication, and the autocorrelation feature of the channel state information data. The classifier includes a random forest classifier.
9. The method according to claim 1, characterized in that, Before determining the behavior patterns of indoor personnel based on the channel state information data, the method further includes: Calculate the Euclidean distance between the subcarrier amplitudes of the channel state information data; The presence of people indoors is determined based on the Euclidean distance, and if people are present indoors, their behavior patterns are determined based on the channel state information data.
10. A people counting device, characterized in that, include: The data acquisition unit is used to acquire channel state information data; The pattern discrimination unit is used to discriminate the behavior patterns of indoor personnel based on the channel state information data, and output the discrimination results of the behavior patterns; wherein, the behavior patterns include loitering behavior and entering / exiting behavior; The model selection unit is used to select the corresponding target model from multiple different candidate number statistics models based on the discrimination result; wherein, the candidate number statistics model includes a first model of the stay scenario and a second model of the enter and exit scenario; The people counting unit is used to input the channel state information data into the target model to estimate the number of people and output the people counting results that match the behavior pattern.
11. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the people counting method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the population counting method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the people counting method as described in any one of claims 1 to 9.
