A large-scale crowd counting method based on passive WiFi sensing

Through the sliding window mechanism and deep learning model, the accuracy and coverage problems of the crowd counting method in the prior art are solved, and high-precision large-scale crowd counting is achieved.

CN115442744BActive Publication Date: 2024-11-01INNER MONGOLIA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210991488.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-18
Publication Date
2024-11-01
Estimated Expiration
2042-08-18

AI Technical Summary

Technical Problem

The existing population counting method based on computer vision and radio frequency signal analysis has high deployment cost, high computational complexity, blind spots and occlusion problems, and it is difficult to cover large-scale monitoring areas; the existing population counting method based on passive WiFi perception has relatively high estimation accuracy. Low, limited by irregular perceived boundaries and simple linear mapping capabilities.

Method used

The sliding window mechanism is used to sample WiFi sniffing data and fingerprint positioning, build a WiFi spatio-temporal information matrix, and predict the number of people through the RNN deep learning model, combining KNN classifier and preprocessing technology to improve counting accuracy.

Benefits of technology

The accuracy of large-scale population counting is significantly improved, the absolute error is reduced by about 40%, the relative error is below 15%, and the estimated accuracy is above 85%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115442744B_ABST
    Figure CN115442744B_ABST
Patent Text Reader

Abstract

The invention discloses a large-scale crowd counting method based on passive WiFi perception, comprising the following steps: setting a monitoring area and performing WiFi sniffing to obtain sniffing perception data; performing sliding window sampling through a sliding window mechanism, performing WiFi fingerprint positioning on the sniffing perception data in each sliding window, and obtaining fingerprint positioning information in the monitoring area; constructing the positioning information under multiple windows into corresponding multiple WiFi spatiotemporal information matrices, and stacking all the WiFi spatiotemporal information matrices into a WiFi spatiotemporal information matrix sequence; performing supervised learning on the WiFi spatiotemporal information matrix sequence and performing population prediction to obtain the number of people in the monitoring area; the invention establishes a mapping between the WiFi spatiotemporal information matrix sequence and the number of people in the monitoring area through supervised learning, can realize more fine-grained parameter estimation, fully capture spatiotemporal correlation, and improve the accuracy of the mapping relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent monitoring technology, and more particularly to a large-scale crowd counting method based on passive WiFi perception. Background Art

[0002] At present, the existing crowd counting methods based on computer vision have the disadvantages of high deployment cost, high computational complexity, blind spots and occlusions, and limited lighting conditions. In addition, it is difficult to cover large-scale monitoring areas due to the difficulty of cross-camera collaborative processing.

[0003] Secondly, existing crowd counting methods based on RF signal analysis rely on high-quality collected signals, so a large amount of infrastructure needs to be deployed in the monitoring scene to achieve acceptable counting accuracy, which makes the deployment cost high. At the same time, since fine-grained RF signals fluctuate greatly due to environmental influences, existing methods are only applied to fixed indoor scenes for small-scale population estimation.

[0004] Thirdly, the existing crowd counting methods based on passive WiFi perception are based on low-cost, large-coverage, non-invasive WiFi sniffers (WiFi access points). Although they are easy to implement, they are limited by irregular perception boundaries and limited simple linear mapping capabilities, which makes the estimation accuracy of such methods generally low.

[0005] Therefore, how to provide a large-scale crowd counting method based on passive WiFi perception is a problem that those skilled in the art urgently need to solve. Summary of the invention

[0006] In view of this, the present invention provides a large-scale crowd counting method based on passive WiFi sensing, which can be applicable to crowd counting in large-scale scenes and significantly improves the crowd counting accuracy.

[0007] In order to achieve the above object, the present invention adopts the following technical solution:

[0008] A large-scale crowd counting method based on passive WiFi sensing includes the following steps:

[0009] Set the monitoring area and perform WiFi sniffing to obtain sniffing perception data;

[0010] Sliding window sampling is performed through a sliding window mechanism, and WiFi fingerprint positioning is performed on the sniffing perception data in each sliding window to obtain fingerprint positioning information in the monitoring area;

[0011] The positioning information under the multiple windows is constructed into a corresponding multiple WiFi space-time information matrices, and all the WiFi space-time information matrices are stacked into a WiFi space-time information matrix sequence;

[0012] The WiFi spatiotemporal information matrix sequence is supervisedly learned and the number of people is predicted to obtain the number of people in the monitoring area.

[0013] Furthermore, the monitoring area is set and WiFi sniffing is performed, the steps include:

[0014] At least three non-collinear WiFi sniffing sensing points are evenly arranged in the monitoring area;

[0015] Sniffing is performed based on each of the WiFi sniffing sensing points, wherein the sniffing range covers the monitoring area.

[0016] Furthermore, the WiFi fingerprint positioning step includes:

[0017] Preprocessing the sniffing perception data in a single sliding window into a fingerprint vector of the detection target;

[0018] Performing regional recognition on the fingerprint vector using a pre-trained KNN classifier and retaining the fingerprint vector within the monitoring area;

[0019] Standardization processing is performed on the fingerprint vectors, and each fingerprint vector is positioned using a KNN positioning algorithm to obtain positioning information corresponding to each detection target.

[0020] Furthermore, before performing WiFi fingerprint positioning, first model training data is generated through offline investigation, and the KNN classifier is trained:

[0021] The offline investigation steps include:

[0022] Establish a two-dimensional Cartesian coordinate system, and set a plurality of reference position points inside and outside the monitoring area based on the two-dimensional Cartesian coordinate system; set at least one reference device at each reference position point to continuously send WiFi detection request frames;

[0023] Perform WiFi sniffing on each reference position point inside and outside the monitoring area respectively, and obtain reference vectors of each reference position point inside and outside the monitoring area according to the sniffed WiFi detection request frame signal strength; splice the reference vector with its corresponding inside and outside area mark to generate first model training data;

[0024] The KNN classifier is trained using the first model training data.

[0025] Furthermore, the pre-processing step includes:

[0026] Filter out the sniffing perception data in the corresponding sliding window by the timestamp of the sniffing perception data;

[0027] Clean up WiFi frames with missing values ​​and non-detection request frames in the sniffing perception data, and filter out WiFi detection request frames of basic devices in the monitoring area by using MAC addresses;

[0028] Based on the cleaned sniffing perception data, the average value of the signal strength of the WiFi detection request frame sniffed by the detection target at each sniffing perception point is obtained to construct the fingerprint vector corresponding to the detection target.

[0029] Further, the fingerprint vector is standardized and the fingerprint vector in each area is located by the KNN positioning algorithm to obtain the positioning information corresponding to each detection target. The steps include:

[0030] Through the offline survey, the fingerprint database data is obtained: the reference vectors of each reference position point in the monitoring area are spliced ​​with the coordinates of the corresponding reference position point to obtain the fingerprint database data;

[0031] Standardizing the fingerprint vector and the fingerprint library data to obtain a standardized fingerprint set and a standardized fingerprint library;

[0032] The Euclidean distance between each detection target fingerprint in the standardized fingerprint set and each reference target fingerprint in the standardized fingerprint library is calculated, at least one reference point fingerprint is selected from small to large according to the Euclidean distance, and the physical coordinate mean of the selected reference point fingerprint is calculated to obtain the fingerprint positioning information of each detection target.

[0033] Furthermore, the positioning information under the multiple windows is constructed into a corresponding multiple WiFi space-time information matrices, and all the WiFi space-time information matrices are stacked into a WiFi space-time information matrix sequence, the steps comprising:

[0034] Initialize the WiFi spatiotemporal information matrix within a time window with a dimension of M×N;

[0035] Divide the sniffing range area of ​​size H×W into M×N grids of equal size;

[0036] Traverse the fingerprint positioning information under a single time window and all grids According to the fingerprint positioning information of each detected target, update the WiFi spatiotemporal information matrix element corresponding to its positioning grid;

[0037] like and but

[0038] The location set L of consecutive l time windows ΔtTraverse and obtain l continuous WiFi spatiotemporal information matrices;

[0039] The WiFi space-time information matrices are stacked to obtain a WiFi space-time information matrix sequence.

[0040] Furthermore, supervised learning is performed on the WiFi spatiotemporal information matrix sequence and the number of people is predicted, the steps comprising:

[0041] Construct an RNN deep learning model, wherein the RNN deep learning model includes 4 hidden layers, each of the hidden layers from input to output is composed of 512, 256, 128, and 64 RNN units respectively, the RNN units of each layer are interconnected using fully connected weights, and each RNN unit uses ReLU as a nonlinear activation function;

[0042] Constructing a second model training data set;

[0043] Iteratively train the pre-built RNN deep learning model with a learning rate of lr=2e-5 using the second model training data set using the Adam optimization algorithm and the MSE loss function;

[0044] The WiFi spatiotemporal information matrix sequence is flattened row by row to form multiple vector sequences with a length of grid division fine-grainedness, which are input into the trained RNN deep learning model to obtain the number of people in the monitoring area at the corresponding time.

[0045] Further, constructing a second model training data set includes the following steps:

[0046] dividing the monitoring area into a plurality of sub-areas covered by separate image acquisition devices;

[0047] Capturing images of each of the sub-areas by using a pre-deployed image acquisition device;

[0048] While collecting images, the second model training data set is obtained through WiFi sniffing, preprocessing, WiFi fingerprint positioning, construction of WiFi spatiotemporal information matrix, and stacking of WiFi spatiotemporal information matrix sequences;

[0049] After a certain period of image acquisition, the number of people in each sub-area of ​​each frame of the acquired image is annotated according to the image acquisition result and at a specified frame rate, and the total number of people in the monitored area is obtained by summing up; the total number of people is associated with the corresponding generated WiFi spatiotemporal information sequence to form a second model training data set.

[0050] Furthermore, the propagation process of the RNN deep learning model is:

[0051]

[0052]

[0053] in, and are the hidden state vector and input vector of the i-th layer and the t-th time step, respectively, B (i) is the bias of the i-th layer, U, V, and W are the corresponding weight parameter vectors respectively;

[0054] The last value X of the regional population value sequence output by the RNN deep learning model l (4) As an estimate of the number of people in the monitoring area at the current moment.

[0055] Interesting effects of the present invention:

[0056] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a large-scale crowd counting method based on passive WiFi perception, which uniformly represents complex WiFi perception data through a WiFi spatiotemporal information matrix sequence. While effectively retaining the spatiotemporal correlation of the scene population distribution represented by the WiFi perception data, it is also convenient to use a deep learning model for further processing. Among them, the use of sensory data preprocessing, positioning only fingerprints classified within the area, and fingerprint standardization technology can filter out the influence of fixed devices and devices outside the area, achieve higher positioning accuracy, and ensure the effective retention of spatial correlation; the use of serialized information matrices with shorter time windows avoids the high amount of calculation caused by too long a time window data and the problem of destroying the temporal correlation of sensory data; the deep learning model RNN is used to establish a mapping from the WiFi spatiotemporal information matrix sequence to the number of people in the scene. Compared with the traditional method of only using a simple linear model to achieve the mapping of the number of sensory devices and the number of people in the scene, the method of the present invention uses the method of regional division to achieve finer-grained parameter estimation, and uses the RNN model to fully capture the spatiotemporal correlation in the WiFi spatiotemporal information matrix sequence, thereby obtaining a more complex and accurate mapping relationship; the present invention has been tested in practice in a real campus road network environment. Compared with the traditional simple linear mapping method, the absolute error of large-scale crowd counting can be significantly reduced by about 40%, and the relative error can be effectively reduced to less than 15%, that is, the estimation accuracy is more than 85%. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0058] Figure 1 The accompanying drawing is a schematic diagram of a large-scale crowd counting method based on passive WiFi sensing provided by the present invention;

[0059] Figure 2 The accompanying figure is a schematic diagram of the network structure of the RNN deep learning model in the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] like Figure 1 The embodiment of the present invention discloses a large-scale crowd counting method based on passive WiFi perception, comprising the following steps:

[0062] S1: Set the monitoring area and perform WiFi sniffing to obtain sniffing perception data;

[0063] In one embodiment,

[0064] S11: evenly set at least 3 non-co-linear WiFi sniffing sensing points in the monitoring area;

[0065] S12: Based on each WiFi sniffing sensing point, sniffing is performed to obtain sensing data within the monitoring area, wherein the sniffing range covers the monitoring area.

[0066] The specific steps are: deploy several WiFi sniffers evenly in the monitoring area to meet the needs of WiFi positioning. For irregular monitoring areas, an approximately uniform deployment can be used. The deployment distance is usually about 500m 2 Area / WiFi sniffer. In extreme cases, at least three WiFi sniffers are deployed in the entire area and the three WiFi sniffers are not on the same horizontal line. The WiFi sniffer can obtain the perception data of WiFi-enabled smart devices carried by pedestrians in the monitoring area and nearby areas.

[0067] S2: Sliding window sampling is performed through the sliding window mechanism, and WiFi fingerprint positioning is performed on the sniffing perception data in each sliding window to obtain the fingerprint positioning information in the monitoring area;

[0068] In one embodiment, the WiFi fingerprint positioning step includes:

[0069] S21: preprocessing the sniffing perception data in a single sliding window into a fingerprint vector of the detection target;

[0070] S22: Use the pre-trained KNN (K-NearestNeighbor) classifier to perform regional identification on the fingerprint vector and retain the fingerprint vector in the monitoring area;

[0071] S23: Perform standardization processing on the fingerprint vectors, and locate each fingerprint vector using a KNN positioning algorithm to obtain positioning information corresponding to each detection target.

[0072] In one embodiment, the pre-processing step includes:

[0073] S211: filtering out the sniffing sensed data in the corresponding sliding window according to the timestamp of the sniffing sensed data;

[0074] S212: Clean up the WiFi frames with missing values ​​and inconsistent types in the sensed data within the time window. Inconsistent types refer to WiFi frames other than WiFi detection request frames. Combined with the scene prior knowledge, the WiFi detection request frames of the scene basic equipment are filtered out using the MAC address. Due to the widespread use of WiFi technology today, the WiFi sniffer can capture almost all types of WiFi frames in the scene, such as (1) Beacon frames, various response management frames and control frames, downlink data frames, etc., issued by the wireless routers (AP, hotspots) in the scene; (2) various management frames, control frames, and uplink data frames issued when the fixed pedestrians in the scene connect to the nearby wireless routers (AP, hotspots). The main purpose of the present invention is to monitor the existence of fixed pedestrians and passers-by in the scene (estimated number of people). Regardless of whether the mobile devices carried by these pedestrians are connected to the AP or not, as long as the WiFi switch is turned on, they will send out detection request frames (even some devices will send out without turning on the WiFi switch). Therefore, it is necessary to filter out WiFi frames that are not detection request frames according to the frame type attributes of the sensed data.

[0075] S213: Based on the cleaned sniffing sensing data, the average signal strength of the WiFi detection request frame sniffed by the detection target at each sniffing sensing point is obtained to construct a fingerprint vector corresponding to the detection target, wherein the detection target is each unique MAC address device in the monitoring area.

[0076] In this embodiment, before performing WiFi fingerprint positioning, first model training data is generated through offline investigation, and the KNN classifier is trained, the steps include:

[0077] S221: Establish a two-dimensional Cartesian coordinate system, and set multiple reference position points inside and outside the monitoring area based on the two-dimensional Cartesian coordinate system; set at least one reference device at each reference position point to continuously send WiFi detection request frames; if n d Reference equipment selection n in reference points within the monitoring area and n out For each reference point, use at least one reference device to continuously collect data for 1 minute.

[0078] S222: Perform WiFi sniffing on each reference location point inside and outside the monitoring area respectively, and obtain reference vectors of each reference location point inside and outside the monitoring area according to the signal strength of the WiFi detection request frame sniffed; splice the reference vector with its corresponding inside and outside area mark to generate the first model training data; the specific steps are: use the MAC address to filter out the WiFi detection request frames of all reference devices located at each reference point in the area; extract all RSS values ​​in the WiFi detection request frames of the reference devices, and average all RSS values ​​corresponding to each reference point to obtain an m-dimensional fingerprint vector F, and splice the area mark, which is 1 inside the area and 0 outside the area, to obtain a number of (m+1)-dimensional vectors, and form a set of these vectors as the training data of the inside and outside area classifier, that is, the first model training data D c .

[0079] S223: Train the KNN classifier using the first model training data.

[0080] In another embodiment, the fingerprint vector is standardized and the fingerprint vector in each area is located by a KNN (K-NearestNeighbor) positioning algorithm to obtain the positioning information corresponding to each detection target. The steps include:

[0081] S231: Obtaining fingerprint database data through offline investigation: splicing the reference vector of each reference position point in the monitoring area with the coordinates of the corresponding reference position point to obtain the fingerprint database data;

[0082] S232: Standardize the fingerprint vector and the fingerprint library data to obtain a standardized fingerprint set and a standardized fingerprint library;

[0083]

[0084] in, and are the mean and variance of the fingerprint itself, and the standardized fingerprint set is obtained after processing and standardized fingerprint library

[0085] S233: Calculate the Euclidean distance between each detection target fingerprint in the standardized fingerprint set and each reference target fingerprint in the standardized fingerprint library, select at least one reference point fingerprint from small to large according to the Euclidean distance, and calculate the mean of the physical coordinates of the selected reference point fingerprint to obtain the fingerprint positioning information of each detection target. For example, the KNN positioning algorithm is used to calculate the Euclidean distance between each fingerprint in the standardized fingerprint set and each reference point fingerprint in the standardized fingerprint library, and then select k reference point fingerprints with the smallest Euclidean distance, and calculate the mean of the physical coordinates of the k reference point fingerprints to obtain the fingerprint positioning information.

[0086] In another embodiment, a WKNN (Weighted KNN) positioning algorithm is used to locate each fingerprint vector. The WKNN positioning algorithm is used to calculate the likelihood probability of each fingerprint in the standardized fingerprint set and each reference point fingerprint in the standardized fingerprint library, and then k reference point fingerprints with the largest likelihood probabilities are selected, and the weighted mean of the physical coordinates of the k reference point fingerprints is calculated to obtain fingerprint positioning information.

[0087] The specific steps are:

[0088] Through offline investigation, the RSS mean and standard deviation fingerprint library data are obtained: the fingerprint library data is obtained by splicing the mean and standard deviation fingerprints of each reference position point in the monitoring area with the coordinates of the corresponding reference position point;

[0089] Standardize the mean and standard deviation fingerprint and fingerprint library data to obtain a standardized fingerprint set and a standardized fingerprint library;

[0090] Calculate the likelihood probability of the mean and standard deviation fingerprint of each detection target in the standardized fingerprint set and the mean and standard deviation fingerprint of each reference target in the standardized fingerprint library, select at least one reference point fingerprint from large to small according to the likelihood probability, and calculate the weighted mean of the physical coordinates of the selected reference point fingerprint with the corresponding likelihood probability as the weight to obtain the fingerprint positioning information of each detection target.

[0091] S3: constructing the positioning information under the multiple windows into corresponding multiple WiFi spatiotemporal information matrices, and stacking all the WiFi spatiotemporal information matrices into a WiFi spatiotemporal information matrix sequence;

[0092] In one embodiment, the steps include:

[0093] S31: Initialize the WiFi spatiotemporal information matrix within a time window with a dimension of M×N;

[0094]

[0095] S32: Divide the minimum rectangle of the coverage monitoring area with a size of H×W into M×N grids of equal size, where each grid corresponds to an element in the WiFi spatiotemporal information matrix;

[0096] S33: Traverse the fingerprint positioning information result set under a single time window and all grids According to the fingerprint positioning information of each detected target, update the WiFi spatiotemporal information matrix element corresponding to its positioning grid; the logical condition for counting is: if and but

[0097] S34: Positioning set L of consecutive l time windows Δt Repeat S31-S33 to obtain l consecutive WiFi spatiotemporal information matrices, and stack these information matrices to obtain a WiFi spatiotemporal information matrix sequence.

[0098] Among them, the known parameters are: monitoring area size H×W, monitoring area division granularity M×N, number of deployed WiFi sniffers m, number of fingerprint library reference points n in and n out and the corresponding physical coordinates, the sliding time window length Δt and the sliding step length δ, the k value of the KNN positioning algorithm, and the length l of the WiFi spatiotemporal information matrix sequence;

[0099] S4: Perform supervised learning on the WiFi spatiotemporal information matrix sequence and predict the number of people to obtain the number of people in the monitoring area;

[0100] like Figure 2 In one embodiment, the steps include:

[0101] S41: Build an RNN (recurrent neural network) deep learning model, which includes 4 hidden layers, each layer consists of 512, 256, 128, and 64 RNN units respectively. The RNN units between each layer are connected to each other using fully connected weights, and each RNN unit uses ReLU as a nonlinear activation function;

[0102] The entire operation process of the model is as follows: after inputting the entire WiFi spatiotemporal information matrix sequence, it enters the first hidden layer, where the hidden state vector of the first time step of the sequence is calculated, and the obtained hidden state vector will enter the second time step calculation; h0 is the initial hidden state (usually initialized to a vector of all zeros), and h1 is the hidden state vector after the first time step update (the result of the previous hidden state and the current input); similarly, until the lth time step is calculated, this is a horizontal (time direction) calculation; then the data updated at each time step is output through the second formula on the left to output the l attribute sequences (i.e., 512·l-dimensional attributes) after the first layer calculation, and sent to the second layer for processing; the 2nd to 4th layers perform similar horizontal (time direction) calculations; in summary, the output value of the lth time step output by the last layer is It is the comprehensive result obtained by the entire model after calculating the entire input WiFi spatiotemporal information matrix sequence in the vertical (layer direction) and horizontal (time direction); among them, the horizontal (time direction) propagation calculation of each layer reflects the significance of other windows participating in the model calculation, and the vertical propagation will continue to pass this significance downward (each layer also has its own horizontal propagation) until the last layer outputs the value In addition, the full connection between each layer in the vertical direction reflects the utilization of spatial correlation, and the propagation of time steps in the horizontal direction reflects the utilization of temporal correlation.

[0103] S42: construct a second model training data set;

[0104] S43: Based on the second model training data set, the RNN deep learning model is trained for 1000 iterations at a learning rate of lr=2e-5 using the Adam optimization algorithm and the MSE loss function;

[0105] S44: Flatten each WiFi information matrix in the WiFi information matrix sequence by row to form a vector sequence of l lengths M·N, and input all l flattened vectors into the trained RNN deep learning model to obtain the number of people in the monitoring area at the corresponding time.

[0106] In this embodiment, the second model training data set is constructed, and the steps include:

[0107] S421: Divide the monitoring area into a small number of sub-areas that can be covered by separate image acquisition devices respectively;

[0108] S422: Capturing images of each sub-region by using a pre-deployed image acquisition device;

[0109] S423: After collecting data for a certain period of time, the number of people in each sub-area is marked at a specified frame rate, and the total number of people in the monitored area is obtained by summing up. The total number of people is associated with the corresponding generated second model WiFi spatiotemporal information sequence to form a second model training data set; wherein the second model WiFi spatiotemporal information sequence is obtained through S1-S3 performed synchronously with image collection.

[0110] Multiple image acquisition devices (i.e., videos taken by cameras or smartphones) are strictly time-synchronized before use, and the perception data used for WiFi fingerprint positioning is also time-synchronized and contains the timestamp of the sniffing moment. Therefore, a certain sampling rate, i.e., the frame rate of the video and the step size of the perception data time window, is used to obtain the total number of people labels at each sampling moment and the corresponding second model WiFi spatiotemporal information matrix sequence (a matrix constructed by the perception data of the time window length of 1 time window before the current moment, and a sequence of length l consisting of l matrices of the current moment time window and the previous sliding window step length l-1 time window). Association refers to the corresponding association of the total number of people labels at each sampling moment (scalar representation) with the second model WiFi spatiotemporal information matrix sequence (three-dimensional array representation, one dimension of which is the sequence time dimension and the other two dimensions are the grid local counts after the two-dimensional space is divided).

[0111] In this embodiment, the propagation process of the RNN deep learning model is:

[0112]

[0113]

[0114] in, and are the hidden states and features of the input at the i-th layer and the t-th time step, respectively, B (i) is the bias of the i-th layer, U, V, and W are the corresponding weight parameter vectors respectively; when i = 0, is the WiFi spatiotemporal information matrix of the tth time step of the input original WiFi spatiotemporal information matrix sequence;

[0115] The last value of the regional population sequence output by the 4th hidden layer As the estimated value of the number of people in the monitoring area at the current moment. The loss between the estimated value and the corresponding true value (total number of people label) is calculated through the MSE loss function, and the Adam optimization algorithm is used to calculate the gradient and update the model parameters according to the loss. The training is iterated until the maximum number of training times is reached and the model training is completed.

[0116] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0117] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A large-scale crowd counting method based on passive WiFi sensing, characterized in that: The following steps are involved: Set the monitoring area and perform WiFi sniffing to obtain sniffing perception data; Sliding window sampling is performed through a sliding window mechanism, and WiFi fingerprint positioning is performed on the sniffing perception data in each sliding window to obtain fingerprint positioning information in the monitoring area; The positioning information under the multiple windows is constructed into a corresponding multiple WiFi space-time information matrices, and all the WiFi space-time information matrices are stacked into a WiFi space-time information matrix sequence, the steps comprising: Initialize the WiFi spatiotemporal information matrix in a time window with a dimension of M×N; divide the sniffing range area with a size of H×W into M×N grids of equal size; traverse the fingerprint positioning information in a single time window and all grids According to the fingerprint positioning information of each detected target, update the WiFi spatiotemporal information matrix element corresponding to its positioning grid; like and but The location set L of consecutive l time windows Δt Traverse and obtain l continuous WiFi spatiotemporal information matrices; The WiFi space-time information matrices are stacked to obtain a WiFi space-time information matrix sequence. The WiFi spatiotemporal information matrix sequence is supervisedly learned and the number of people is predicted to obtain the number of people in the monitoring area, the steps comprising: Construct an RNN deep learning model, wherein the RNN deep learning model includes 4 hidden layers, each of the hidden layers from input to output is composed of 512, 256, 128, and 64 RNN units respectively, the RNN units of each layer are interconnected using fully connected weights, and each RNN unit uses ReLU as a nonlinear activation function; Construct a second model training data set; use the Adam optimization algorithm and the MSE loss function to iteratively train the pre-constructed RNN deep learning model at a learning rate of lr=2e-5 through the second model training data set; flatten the WiFi spatiotemporal information matrix sequence by row to form a plurality of vector sequences with a length of grid division fine-grained, and input them into the trained RNN deep learning model to obtain the number of people in the monitoring area at the corresponding time.

2. According to claim 1, a large-scale crowd counting method based on passive WiFi perception is characterized in that: To set up a monitoring area and perform WiFi sniffing, the steps include: At least three non-collinear WiFi sniffing sensing points are evenly arranged in the monitoring area; Sniffing is performed based on each of the WiFi sniffing sensing points, wherein the sniffing range covers the monitoring area.

3. A large-scale crowd counting method based on passive WiFi perception according to claim 1, characterized in that: The WiFi fingerprint positioning steps include: Preprocessing the sniffing perception data in a single sliding window to obtain a fingerprint vector of the detection target; Performing regional recognition on the fingerprint vector using a pre-trained KNN classifier and retaining the fingerprint vector within the monitoring area; Standardization processing is performed on the fingerprint vectors, and each fingerprint vector is positioned using a KNN positioning algorithm to obtain positioning information corresponding to each detection target.

4. A large-scale crowd counting method based on passive WiFi perception according to claim 3, characterized in that: Before performing WiFi fingerprint positioning, the first model training data is generated through offline investigation, and the KNN classifier is trained: The offline investigation steps include: Establish a two-dimensional Cartesian coordinate system, and set a plurality of reference position points inside and outside the monitoring area based on the two-dimensional Cartesian coordinate system; set at least one reference device at each reference position point to continuously send WiFi detection request frames; Perform WiFi sniffing on each reference position point inside and outside the monitoring area respectively, and obtain reference vectors of each reference position point inside and outside the monitoring area according to the sniffed WiFi detection request frame signal strength; splice the reference vector with its corresponding inside and outside area mark to generate first model training data; The KNN classifier is trained using the first model training data.

5. The large-scale crowd counting method based on passive WiFi perception according to claim 3 is characterized in that: The pre-processing step comprises: Filter out the sniffing perception data in the corresponding sliding window by the timestamp of the sniffing perception data; Clean up WiFi frames with missing values ​​and non-detection request frames in the sniffing perception data, and filter out WiFi detection request frames of basic devices in the monitoring area by using MAC addresses; Based on the cleaned sniffing perception data, the average value of the signal strength of the WiFi detection request frame sniffed by the detection target at each sniffing perception point is obtained to construct the fingerprint vector corresponding to the detection target.

6. A large-scale crowd counting method based on passive WiFi perception according to claim 4, characterized in that: The fingerprint vector is standardized and the fingerprint vector in each area is located by the KNN positioning algorithm to obtain the positioning information corresponding to each detection target. The steps include: Through the offline survey, the fingerprint database data is obtained: the reference vectors of each reference position point in the monitoring area are spliced ​​with the coordinates of the corresponding reference position point to obtain the fingerprint database data; Standardizing the fingerprint vector and the fingerprint library data to obtain a standardized fingerprint set and a standardized fingerprint library; The Euclidean distance between each detection target fingerprint in the standardized fingerprint set and each reference target fingerprint in the standardized fingerprint library is calculated, at least one reference point fingerprint is selected from small to large according to the Euclidean distance, and the physical coordinate mean of the selected reference point fingerprint is calculated to obtain the fingerprint positioning information of each detection target.

7. A large-scale crowd counting method based on passive WiFi perception according to claim 1, characterized in that: Constructing a second model training data set, the steps include: dividing the monitoring area into a plurality of sub-areas covered by separate image acquisition devices; Capturing images of each of the sub-areas by using a pre-deployed image acquisition device; According to the image acquisition results, at a specified frame rate, the number of people in each sub-area in each frame of the acquired image is annotated, and the total number of people in the monitoring area is obtained by summing up; the total number of people label is associated with the corresponding generated second model WiFi spatiotemporal information sequence to form a second model training data set.

8. The large-scale crowd counting method based on passive WiFi perception according to claim 1 is characterized in that: The propagation process of the RNN deep learning model is: in, and are the hidden state vector and input vector of the i-th layer and the t-th time step, respectively, B (i) is the bias of the i-th layer, U, V, and W are the corresponding weight parameter vectors respectively; The last value of the regional population value sequence output by the RNN deep learning model As an estimate of the number of people in the monitoring area at the current moment.