Wi-Fi-based people number detection and multi-person positioning and tracking method and system
Through Wi-Fi-based people detection and multi-person positioning and tracking methods, the neural network model and self-attention mechanism are used to process Wi-Fi signals, and the problem of low accuracy of indoor people detection and multi-person positioning is solved, and high-precision indoor people detection and multi-person positioning is achieved.
Patent Information
- Application Number
- CN202411683366.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
The prior art has problems such as low accuracy and difficulty in dealing with complex noise and multipath effects in indoor number detection and multi-person positioning and tracking.
Using Wi-Fi-based user detection and multi-person positioning and tracking methods, the channel state information CSI of wireless signals is used to perform signal processing and target positioning through neural network models and multi-task self-attention mechanism.
It realizes accurate detection of indoor number of people and positioning of multiple people in complex noise and multi-path environments, and has the advantages of high accuracy and convenient installation.
Smart Images

Figure CN119629580A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of indoor number detection, tracking and positioning, and more specifically to a method and system for number detection and multi-person positioning and tracking based on Wi-Fi. Background Art
[0002] Indoor crowd detection estimates the number of people in a certain indoor space and has been widely used in stations, department stores, smart homes, security management and other aspects.
[0003] Indoor location sensing technology has been widely used in the fields of special population positioning, large venue management, Internet of Things, personal location services, etc., especially in emergency scenarios such as fire rescue, emergency evacuation, earthquake relief, etc., indoor location information is particularly important.
[0004] However, due to the complex indoor environment and the obvious multipath effect, the common positioning based on optical signals such as video and images has problems such as privacy exposure and occlusion, and the positioning based on radar, Bluetooth and other technologies requires complex equipment. Therefore, it is difficult to implement a universal, real-time, efficient and high-precision positioning algorithm, and it is difficult to identify the number of moving targets at the same time.
[0005] Therefore, in view of this, in order to address the existing drawbacks, a Wi-Fi-based number detection and multi-person positioning, tracking method and system are provided, in order to achieve a more practical purpose. Summary of the invention
[0006] 1. Technical issues to be solved
[0007] In view of the problems existing in the prior art, the purpose of the present invention is to provide a Wi-Fi-based number detection and multi-person positioning and tracking method and system, which can accurately separate various signals of moving targets from signals containing complex noise and multipath. At the same time, the initial positions of the number of people and targets indoors are predicted by a trained neural network model based on a multi-task self-attention mechanism, which has high accuracy in locating different targets.
[0008] 2. Technical solution
[0009] To solve the above problems, the present invention adopts the following technical solutions.
[0010] The specific implementation steps of the Wi-Fi-based method for detecting, locating and tracking people are as follows:
[0011] Step S1, the wireless Wi-Fi signal transmitting device and two receiving devices, the network card and the computer start working;
[0012] Step S2, obtaining the channel state information CSI to be detected of two groups of receiving antennas from the array antenna of the receiving device;
[0013] Step S3, phase correction and static elimination of the wireless signal obtained in step S2;
[0014] Step S4: The signal d of the dynamic path obtained in step S3 l , respectively extract the amplitude and phase S of the dynamic signal d Signal and its short-time Fourier transform (STFT) spectrogram, and then conduct training. During the training, multiple people are preset, and the area to be detected is divided into 6×6 areas, and relevant data is collected in the database;
[0015] Step S5: training the neural network model using a multi-task based cross-domain attention mechanism;
[0016] Step S6: using the neural network model of step S5, obtaining the number of people in the room and their initial positions;
[0017] Step S7: Based on the MNM algorithm, the AOA of the dynamic target is estimated;
[0018] Step S9: adjusting the DBsacn spatiotemporal angle clustering algorithm based on the adaptive parameters;
[0019] Step S10: differentiating different target angle information according to the initial position and the number of people;
[0020] Step S11: Target positioning based on angle information.
[0021] Furthermore, in step S1, the wireless signal includes but is not limited to 2.4 GHZ and 5.8 GHZ.
[0022] Furthermore, in step S2, the channel state information CSI of the wireless signal Wi-Fi signal usually received includes static object information, dynamic object information and noise interference signal in the environment, and its mathematical expression is:
[0023]
[0024] Where L represents the total number of dynamic and static paths in the environment;
[0025] S l (m,k) represents the CSI signal of the k-th subcarrier of the m-th antenna of the l-th path;
[0026] N(i,k) represents the noise in the environment;
[0027] d l (i, k) represents the signal of the lth dynamic path;
[0028] s l (i,k) represents the signal of the lth static path.
[0029] Furthermore, in step S3, the method of phase correction and static elimination is conjugate multiplication.
[0030] Furthermore, in step S4, in the training phase, multiple people are preset including but not limited to three people, and the test area is divided into but not limited to a 6×6 area, and the specific division is as follows:
[0031] a: When there is one person in the room, collect the walking time of three people in different areas, and obtain S from step S4 d Signal and its short-time Fourier transform (STFT) spectrogram, each data was collected with 1000 data packets, the duration was 1 second, and each position was collected 20 times, resulting in a total of 3 × 6 × 6 × 20 data;
[0032] b: When no one is indoors, collect data 20 times, each of which contains 1000 data packets and lasts for 1 second;
[0033] c: When there are two people in the room, choose two C3 from the three people 2 Each person can collect C3 at 36 different locations. 2 ×36×36×20 data;
[0034] d: When there are three people in the room, each person can collect a total of 36×36×36×20 data at 36 different locations.
[0035] Furthermore, the specific implementation steps of step S5 are as follows:
[0036] The labeled source domain training data obtained in step S4 is subjected to feature extraction through a network composed of some convolutional layers and pooling layers to obtain network extracted features;
[0037] Use the self-attention mechanism to extract the core parameters. After the features are extracted, they are input into the softmax function for classification after passing through the fully connected layer to obtain the number recognition and positioning loss.
[0038] The target domain unlabeled data only passes through the feature extraction network, self-attention mechanism and fully connected layer;
[0039] The source domain labeled data and the target domain unlabeled data share the parameters of the feature extraction network and the fully connected layer, and the data input is synchronous. The model uses the difference in feature distribution between domains as the inter-domain distribution loss L T , combining the number of people recognition and positioning loss L G The total loss of the inter-domain distribution loss model becomes:
[0040]
[0041] in, Is the balance L G and L T The coefficient of size between .
[0042] Further, in step S7, each antenna is provided with 30 subcarriers, and the antenna is extended by using the phase deviation caused by the flight time of different subcarriers on different paths;
[0043] The steering vector of the signal of the lth path caused by the subcarrier and the antenna is:
[0044]
[0045] The total steering vector is:
[0046]
[0047] Angle of arrival for dynamic paths:
[0048]
[0049] Then, the spectrum function is calculated and the estimated value of its direction of arrival is obtained by finding the peak value;
[0050] Since the CSI receiving device has only three antennas, it can only identify the arrival angles AOA of two paths at most, which is far from enough to identify the arrival angles of three or more targets.
[0051] Furthermore, in step S9, the angle information and the time information are clustered together, and a time variation scale parameter ρ is added. The new time parameter is defined as:
[0052] t'=ρt
[0053] The basic principles of clustering are as follows:
[0054] Neps(p)={q∈Ddist(p,q)≤Eps}
[0055]
[0056] If the number of elements in the p neighborhood is less than the specified parameter Minpts, it is considered a noise point;
[0057] If the number of elements in the neighborhood of p is greater than or equal to Minpts, a new cluster is created and the point is added to the cluster.
[0058] Furthermore, in step S11, if the measurable radio signal reaches the angles θ1 and θ2 of the antenna arrays 1 and 2 after being reflected by the target, the position of the target can be determined;
[0059] Among them, the angle estimation algorithm refers to the MUSIC algorithm and the MNM algorithm, and the expression of the target position is:
[0060]
[0061] The target position is (x, y), and the positions of antenna arrays 1 and 2 are (x1, y1) and (x2, y2) respectively.
[0062] 3. Beneficial effects
[0063] Compared with the prior art, the advantages of the present invention are:
[0064] This solution performs number detection, multi-person positioning and tracking based on WiFi. In this process, a related system is established, and the signal receiving and transmitting subsystem performs signal receiving and transmitting operations, the signal computing subsystem separates and analyzes the received signals, and the positioning subsystem locates different targets respectively. It can accurately separate various signals of moving targets from signals containing complex noise and multipath. At the same time, the initial positions of the number of people and targets indoors are predicted by a trained neural network model based on a multi-task self-attention mechanism, which has high accuracy in locating different targets. At the same time, the system is easy to set up and promote on a large scale. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a schematic diagram of equipment of the method and system for detecting and locating and tracking people based on WiFi of the present invention;
[0066] Figure 2 It is a flow chart of the method and system for detecting and locating and tracking people based on WiFi of the present invention;
[0067] Figure 3 Schematic diagram of a cross-domain people detection and positioning system based on a self-attention mechanism of the present invention;
[0068] Figure 4 A schematic diagram of cluster distribution of the clustering algorithm in the present invention;
[0069] Figure 5 It is a schematic diagram of the principle of target positioning based on angle information in the present invention. DETAILED DESCRIPTION
[0070] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments, and all other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making creative work are within the scope of protection of the present invention.
[0071] Embodiment 1:
[0072] See also Figure 1 - Figure 4 , based on Wi-Fi, the method for detecting, locating and tracking people, the specific implementation steps of the method for detecting, locating and tracking people are as follows:
[0073] Step S1, the wireless Wi-Fi signal transmitting device and two receiving devices, the network card and the computer start working;
[0074] Step S2, obtaining the channel state information CSI to be detected of two groups of receiving antennas from the array antenna of the receiving device;
[0075] Step S3, phase correction and static elimination of the wireless signal obtained in step S2;
[0076] Step S4: The signal d of the dynamic path obtained in step S3 l , respectively extract the amplitude and phase S of the dynamic signal d Signal and its short-time Fourier transform (STFT) spectrogram, and then conduct training. During the training, multiple people are preset, and the area to be detected is divided into 6×6 areas, and relevant data is collected in the database;
[0077] Step S5: training the neural network model using a multi-task based cross-domain attention mechanism;
[0078] Step S6: using the neural network model of step S5, obtaining the number of people in the room and their initial positions;
[0079] Step S7: Based on the MNM algorithm, the AOA of the dynamic target is estimated;
[0080] Step S9: adjusting the DBsacn spatiotemporal angle clustering algorithm based on the adaptive parameters;
[0081] Step S10: Differentiate different target angle information according to the initial position and the number of people.
[0082] Step S11: Target positioning based on angle information.
[0083] Embodiment 2:
[0084] Based on the above embodiment 1, further description is given.
[0085] See also Figure 1 Specifically, in step S1, the wireless signal includes but is not limited to 2.4 GHZ and 5.8 GHZ.
[0086] Specifically, in step S2, the channel state information CSI of the wireless signal Wi-Fi signal usually received includes static object information, dynamic object information and noise interference signal in the environment, and its mathematical expression is:
[0087]
[0088] Where L represents the total number of dynamic and static paths in the environment;
[0089] S l (m,k) represents the CSI signal of the k-th subcarrier of the m-th antenna of the l-th path;
[0090] N(i,k) represents the noise in the environment;
[0091] d l (i, k) represents the signal of the lth dynamic path;
[0092] s l (i,k) represents the signal of the lth static path.
[0093] See also Figure 2 , Figure 3 and Figure 4 Specifically, in step S3, the method of phase correction and static elimination is conjugate multiplication.
[0094] Since the CSI signal reception process does not have strict clock synchronization, there will be errors between the measured phase and the actual phase. The conjugate multiplication method can effectively reduce the impact of the error.
[0095] Specifically, in step S4, in the training phase, multiple people are preset including but not limited to three people, and the test area is divided into but not limited to a 6×6 area. The specific division is as follows:
[0096] a: When there is one person in the room, collect the walking time of three people in different areas, and obtain S from step S4 d Signal and its short-time Fourier transform (STFT) spectrogram, each data is collected with 1000 data packets, the duration is 1 second, and each position is collected 20 times. A total of 3×6×6×20 data are obtained.
[0097] b: When no one is indoors, data is collected 20 times, each of which contains 1000 data packets and lasts for 1 second.
[0098] c: When there are two people in the room, choose two C3 from the three people2 Each person can collect C3 at 36 different locations. 2 ×36×36×20 data.
[0099] d: When there are three people in the room, each person can collect a total of 36×36×36×20 data at 36 different locations.
[0100] Specifically, the specific implementation steps of step S5 are as follows:
[0101] The labeled source domain training data obtained in step S4 is subjected to feature extraction through a network composed of some convolutional layers and pooling layers to obtain network extracted features; wherein the network includes but is not limited to CNN.
[0102] Use the self-attention mechanism to extract the core parameters. After the features are extracted, they are input into the softmax function for classification after passing through the fully connected layer to obtain the number recognition and positioning loss.
[0103] The unlabeled data in the target domain only passes through the feature extraction network, the self-attention mechanism and the fully connected layer; because it is unlabeled, the in-domain loss cannot be calculated, so it does not need to be input into the softmax function.
[0104] The source domain labeled data and the target domain unlabeled data share the parameters of the feature extraction network and the fully connected layer, and the data input is synchronous. The model uses the difference in feature distribution between domains as the inter-domain distribution loss L T , combining the number of people recognition and positioning loss L G The total loss of the inter-domain distribution loss model becomes:
[0105]
[0106] in, Is the balance L G and L T The coefficient of size between .
[0107] Specifically, in step S7, each antenna is provided with 30 subcarriers, and the antenna is extended by using the phase deviation caused by the flight time of different subcarriers on different paths.
[0108] The steering vector of the signal of the lth path caused by the subcarrier and the antenna is:
[0109]
[0110] The total steering vector is:
[0111]
[0112] Angle of arrival for dynamic paths:
[0113]
[0114] Then, the spectrum function is calculated and the estimated value of its direction of arrival is obtained by finding the peak.
[0115] Since the CSI receiving device has only three antennas, it can only identify the AOA of two paths at most, which is far from enough to identify the AOA of three or more targets.
[0116] See also Figure 4 Specifically, in step S9, since DBscan is a density-based clustering algorithm, the algorithm does not need to specify the cluster center and the number of clusters. Because the angle information usually changes continuously in adjacent time, clustering the angle information and time information together can ensure the consistency of spatiotemporal information. Adding the time change scale parameter ρ, the new time parameter is defined as:
[0117] t'=ρt
[0118] The basic principles of clustering are as follows:
[0119] Neps(p)={q∈Ddist(p,q)≤Eps}
[0120]
[0121] If the number of elements in the p neighborhood is less than the specified parameter Minpts, it is considered a noise point;
[0122] If the number of elements in the p neighborhood is greater than or equal to Minpts, a new cluster group is created and the point is added to the cluster group. Here, Eps is the radius of the clustering circle. This parameter directly affects the clustering result. Generally speaking, it needs to be adjusted based on experience and needs to be tested continuously. In order to solve this problem, this algorithm proposes an adaptive parameter adjustment DBscan algorithm, that is, to continuously adjust the parameters until the target number of clusters is the same as the number of people obtained in step S6:
[0123] After the AOA value of the dynamic target after joint estimation is adjusted by the DBscan algorithm with adaptive parameters, the clustering is obtained. Figure 4 , which indicates that the target number of clusters is 9.
[0124] See also Figure 5 Specifically, in step S11, Figure 5 As shown, if the measurable radio signal reaches the angles θ1 and θ2 of antenna arrays 1 and 2 after being reflected by the target, the position of the target can be determined;
[0125] Among them, the angle estimation algorithm refers to the MUSIC algorithm and the MNM algorithm, and the expression of the target position is:
[0126]
[0127] The target position is (x, y), and the positions of antenna arrays 1 and 2 are (x1, y1) and (x2, y2) respectively.
[0128] Embodiment 3:
[0129] Based on the above-mentioned Embodiment 1 and Embodiment 2, further description is given.
[0130] A Wi-Fi-based people detection and multi-person positioning and tracking system, which includes a positioning subsystem, a signal transceiver subsystem, and a signal calculation subsystem;
[0131] The signal transceiver subsystem uses two sets of sending and receiving devices to perform one-transmit and two-receive operations;
[0132] The signal calculation subsystem uses a variety of algorithms to separate and analyze the received signals. The algorithms include but are not limited to dynamic and static signal separation algorithms based on eigenvector decomposition. These algorithms can accurately separate various signals of moving targets from signals containing complex noise and multipath;
[0133] The positioning subsystem, combined with the position at the previous moment, distinguishes which moving target the angle information belongs to and locates different targets respectively.
[0134] The initial positions of the number of people and targets in the room are predicted by a trained neural network model based on a multi-task self-attention mechanism. Real-time positioning and tracking use angle estimation algorithms of two groups of antennas and an adaptive angle clustering algorithm to distinguish different target angle information. The system is easy to set up and popularize on a large scale.
[0135] The above is only a preferred specific implementation of the present invention; however, the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved conception within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for detecting, locating and tracking people based on Wi-Fi, characterized by: The specific implementation steps of this method of number detection and multi-person positioning and tracking are as follows: Step S1, the wireless Wi-Fi signal transmitting device and two receiving devices, the network card and the computer start working; Step S2, obtaining the channel state information CSI to be detected of two groups of receiving antennas from the array antenna of the receiving device; Step S3, phase correction and static elimination of the wireless signal obtained in step S2; Step S4: The signal d of the dynamic path obtained in step S3 l , respectively extract the amplitude and phase S of the dynamic signal d Signal and its short-time Fourier transform (STFT) spectrogram, and then conduct training. During the training, multiple people are preset, and the area to be detected is divided into 6×6 areas, and relevant data is collected in the database; Step S5: training the neural network model using a multi-task based cross-domain attention mechanism; Step S6: using the neural network model of step S5, obtaining the number of people in the room and their initial positions; Step S7: Based on the MNM algorithm, the AOA of the dynamic target is estimated; Step S9: adjusting the DBsacn spatiotemporal angle clustering algorithm based on the adaptive parameters; Step S10: differentiating different target angle information according to the initial position and the number of people; Step S11: Target positioning based on angle information.
2. The Wi-Fi-based method for detecting, locating and tracking people according to claim 1, characterized in that: In step S1, the wireless signal includes but is not limited to 2.4 GHZ and 5.8 GHZ.
3. The Wi-Fi-based method for detecting, locating and tracking people according to claim 1, characterized in that: In step S2, the channel state information CSI of the wireless signal Wi-Fi signal usually received includes static object information, dynamic object information and noise interference signal in the environment, and its mathematical expression is: Where L represents the total number of dynamic and static paths in the environment; S l (m,k) represents the CSI signal of the k-th subcarrier of the m-th antenna of the l-th path; N(i,k) represents the noise in the environment; d l (i, k) represents the signal of the lth dynamic path; s l (i,k) represents the signal of the lth static path.
4. The Wi-Fi-based method for detecting, locating and tracking people according to claim 1, characterized in that: In step S3, the method of phase correction and static elimination is conjugate multiplication.
5. The Wi-Fi-based method for detecting, locating and tracking people according to claim 1, characterized in that: In step S4, in the training phase, multiple people are preset including but not limited to three people, and the test area is divided into but not limited to a 6×6 area. The specific division is as follows: a: When there is one person in the room, collect the walking time of three people in different areas, and obtain S from step S4 d Signal and its short-time Fourier transform (STFT) spectrogram, each data was collected with 1000 data packets, the duration was 1 second, and each position was collected 20 times, resulting in a total of 3 × 6 × 6 × 20 data; b: When no one is indoors, collect data 20 times, each of which contains 1000 data packets and lasts for 1 second; c: When there are two people in the room, choose two C3 from the three people 2 Each person can collect C3 at 36 different locations 2 ×36×36×20 data; d: When there are three people in the room, each person can collect a total of 36×36×36×20 data at 36 different locations.
6. The Wi-Fi-based method for detecting, locating and tracking people according to claim 5, characterized in that: The specific implementation steps of step S5 are as follows: The labeled source domain training data obtained in step S4 is subjected to feature extraction through a network composed of some convolutional layers and pooling layers to obtain network extracted features; Use the self-attention mechanism to extract the core parameters. After the features are extracted, they are input into the softmax function for classification after passing through the fully connected layer to obtain the number recognition and positioning loss. The target domain unlabeled data only passes through the feature extraction network, self-attention mechanism and fully connected layer; The source domain labeled data and the target domain unlabeled data share the parameters of the feature extraction network and the fully connected layer, and the data input is synchronous. The model uses the difference in feature distribution between domains as the inter-domain distribution loss L T , combining the number of people recognition and positioning loss L G The total loss of the inter-domain distribution loss model becomes: L=L G +θL T in, Is the balance L G and L T The coefficient of size between .
7. The Wi-Fi-based method for detecting, locating and tracking people according to claim 1, characterized in that: In step S7, each antenna is provided with 30 subcarriers, and the antenna is extended by using the phase deviation caused by the flight time of different subcarriers on different paths; The steering vector of the signal of the lth path caused by the subcarrier and the antenna is: The total steering vector is: Angle of arrival for dynamic paths: Then, the spectrum function is calculated and the estimated value of its direction of arrival is obtained by finding the peak value; Since the CSI receiving device has only three antennas, it can only identify the arrival angles AOA of two paths at most, which is far from enough to identify the arrival angles of three or more targets.
8. The Wi-Fi-based method for detecting, locating and tracking people according to claim 1, characterized in that: In step S9, the angle information and the time information are clustered together, and the time variation scale parameter ρ is added. The new time parameter is defined as: t'=ρt The basic principles of clustering are as follows: N eps (p)={q∈D|dist(p,q)≤Eps} If the number of elements in the p neighborhood is less than the specified parameter Minpts, it is considered a noise point; If the number of elements in the neighborhood of p is greater than or equal to Minpts, a new cluster is created and the point is added to the cluster.
9. The Wi-Fi-based method for detecting, locating and tracking people according to claim 1, characterized in that: In the step S11, if the measurable radio signal reaches the angles θ1 and θ2 of the antenna arrays 1 and 2 after being reflected by the target, the position of the target can be determined; Among them, the angle estimation algorithm refers to the MUSIC algorithm and the MNM algorithm, and the expression of the target position is: The target position is (x, y), and the positions of antenna arrays 1 and 2 are (x1, y1) and (x2, y2) respectively.
10. The Wi-Fi-based people detection and multi-person positioning and tracking system according to any one or more of claims 1 to 9, characterized in that: The system includes a positioning subsystem, a signal transceiver subsystem, and a signal calculation subsystem; The signal transceiver subsystem uses two sets of transmitting and receiving devices to perform one-transmitting and two-receiving operations; The signal calculation subsystem uses a variety of algorithms to separate and analyze the received signals; The positioning subsystem, in combination with the position at the previous moment, distinguishes which moving target the angle information belongs to, and positions different targets respectively.
Citation Information
Cited By
Real-time human body detection method and system based on microwave radar
CN120652412A
A real-time human body detection method and system based on microwave radar
CN120652412B
