A near real-time Wi-Fi indoor positioning method based on subcarrier selection

Through the method of combining subcarrier selection and deep neural network, the problem of signal complexity and high computational load of Wi-Fi indoor positioning system is solved, real-time precise positioning on mobile devices is achieved, the cost is reduced and the system robustness is improved. Great sex.

CN114845390BActive Publication Date: 2024-08-27UNIV OF SCI & TECH OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210661379.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2024-08-27
Estimated Expiration
2042-06-13

AI Technical Summary

Technical Problem

Existing Wi-Fi indoor positioning systems are difficult to achieve precise positioning due to signal complexity and high computational load, and their deployment and installation costs are high, which limits their wide application.

Method used

Adopt a near-real-time Wi-Fi indoor positioning method based on subcarrier selection, select the optimal subcarriers through a lightweight deep neural network, combine with the MUSIC algorithm for position estimation, reduce the amount of calculation, and use knowledge distillation and model compression on mobile devices Achieve real-time positioning.

Benefits of technology

It greatly reduces the amount of calculations without sacrificing accuracy, reduces positioning costs, achieves near-real-time indoor positioning on mobile devices, and resists the influence of environmental noise, providing smoother and more robust positioning results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114845390B
    Figure CN114845390B
Patent Text Reader

Abstract

The present invention discloses a near real-time Wi-Fi indoor positioning method based on subcarrier selection, and the steps include: 1. using deep learning to select the best subcarrier from the subcarrier, and using the multi-signal classification (MUSIC) algorithm to calculate AoA and position estimation to improve performance and reduce the amount of calculation, 2. a smoothing method for adversarial robustness, by adding noise simulation to the intermediate layer features and restricting them in the output layer to achieve the robustness of the model to noise, 3. a model compression method for the mobile terminal, using knowledge distillation to further reduce the number of model parameters, 4. a data enhancement method for WiFi signals. The present invention can be deployed in commercial equipment, which can significantly reduce the computational complexity of traditional WiFi-based indoor positioning methods without sacrificing accuracy, thereby achieving near real-time high-precision positioning on the mobile terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of indoor positioning, and in particular to a near real-time Wi-Fi indoor positioning method based on subcarrier selection. Background Art

[0002] In recent years, great progress has been made in the research of positioning and tracking targets using Wi-Fi. The most advanced systems have successfully achieved decimeter-level accuracy. For example, AWL uses channel hopping to create virtual antennas, so that decimeter-level positioning can be achieved with only one access point (AP). SpotFi uses a super-resolution algorithm to accurately calculate the angle of arrival (AoA), and uses filtering and estimation functions to identify the most likely direct path between the positioning target and the AP. However, unlike the positioning system based on radio frequency identification (RFID), the positioning system based on Wi-Fi is more complex and more difficult to achieve accurate positioning due to the complexity of its signals. Although many researchers have proposed improvements in their papers, there are still many challenges. The first is the deployment cost. Although dense deployment of APs will improve accuracy, it is not conducive to widespread application. The second problem is the high installation cost. The ideal indoor positioning system should be robust and cost-effective. A typical negative example is the fingerprint-based positioning system. The fingerprint recognition-based method requires all fingerprints to be collected every time to update its fingerprint database when the environment changes, which is time-consuming and labor-intensive. Summary of the invention

[0003] The present invention aims to solve the deficiencies of the above-mentioned prior art and proposes a near real-time Wi-Fi indoor positioning method based on subcarrier selection, so as to extract the best subcarrier from all subcarriers for MUSIC algorithm to estimate the position, thereby reducing the amount of calculation without sacrificing positioning accuracy, and providing the possibility of running the positioning system on a mobile device.

[0004] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:

[0005] The characteristic of the near real-time Wi-Fi indoor positioning method based on subcarrier selection of the present invention is that it is performed according to the following steps:

[0006] Step 1: Data collection;

[0007] In an indoor scenario, N receiving ends with M antennas and a transmitting end with one antenna are set, and the antennas of each receiving end are arranged in a straight line at equal intervals d; while moving the transmitting end at a uniform speed, the N receiving ends are used to continuously collect W subcarrier signals of the transmitting end on the transmitting channel at a fixed sampling rate, so as to obtain a two-dimensional CSI complex matrix with a dimension of M×W at n different positions on each receiving end;

[0008] Let n different locations L on a single receiving end AP s ={L1, ..., L o , ..., L n The n two-dimensional CSI complex matrices corresponding to} are Among them, L o represents the oth position; Indicates the oth position L o The two-dimensional CSI complex matrix on , 1≤o≤n;

[0009] Calculate the single receiving end AP at position o L o The two-dimensional CSI complex matrix on The phase matrix CSI o , thus obtaining the phase matrix sample set X s ={CSI1, ..., CSI o ,...,CSI n};

[0010] Measure n different positions L s The actual arrival angle relative to a single receiving AP is denoted as in, Indicates the oth position L o The actual arrival angle of the transmitter relative to the single receiving AP;

[0011] Step 2: Data preprocessing;

[0012] Step 2.1: For the phase matrix sample set X of a single receiving AP s Perform data enhancement and preprocessing in sequence to obtain a new sample set X′ with a dimension of W×W s ={CSI′1, ..., CSI′ o , ..., CSI′ n}, where CSI′ o represents the oth position L after preprocessing o The upper phase matrix, for the oth position L after preprocessing o The phase matrix CSI′ on o Perform standardization to obtain the oth position L o The normalized phase matrix , thus obtaining the standardized phase matrix set

[0013] Step 2.2, label allocation;

[0014] Step 2.2.1, let the oth position L o Upper Phase Matrix The kth column subcarrier is recorded as in, Indicates that the i-th antenna of a single receiving AP is at the o-th position L o The complex signal on the k-th subcarrier received on the receiver, 1≤i≤M, 1≤k≤W;

[0015] Step 2.2.2: Set the incident angle of the received signal of any two adjacent antennas in the single receiving end AP to θ, and use formula (1) to obtain the phase difference Φ generated by the k-th column subcarrier k (θ):

[0016]

[0017] In formula (1), c is the speed of light, f k is the center frequency of the kth column subcarrier; d is the spacing between the antennas of the receiving AP;

[0018] Step 2.2.3: Use formula (2) to get the value of L at the oth position when the incident angle is θ. o The kth column subcarrier b o,k (θ):

[0019]

[0020] In formula (2), for noise;

[0021] Step 2.2.4, using b o,k and its conjugate transpose After multiplication, we get the covariance matrix shown in formula (3):

[0022]

[0023] In formula (3), Indicates that the Mth antenna of a single receiving AP receives the signal at the oth position L o The complex signal on the kth subcarrier The conjugate transpose of ;

[0024] Step 2.2.5: Solve the covariance matrix The corresponding eigenvalues ​​and their corresponding eigenvectors are sorted in descending order to obtain the sorted M eigenvalues. The sorted eigenvalues The corresponding eigenvector is represented as in, represents the Mth eigenvalue, Represents the Mth eigenvalue The corresponding eigenvector;

[0025] Step 2.2.6: Take the eigenvalues ​​after sorting The eigenvectors corresponding to all elements less than the set threshold Va in the filter are used to form the augmented matrix of the filtered eigenvectors. represents the Kth eigenvalue The corresponding eigenvector, let the eigenvector augment the matrix The conjugate transpose of is 1≤K≤M;

[0026] Step 2.2.7: Use equation (4) to calculate the spectral function corresponding to the kth subcarrier when the incident angle is θ:

[0027]

[0028] Step 2.2.8, let the incident angle θ start from 0° and gradually increase to 180° at equal intervals, and simultaneously calculate the spectral function in equation (4): The arrival angle corresponding to the maximum value is selected from all the values ​​and used as the single receiving end AP at the oth position L o The estimated arrival angle corresponding to the kth subcarrier Thus, a single receiving end AP at position o L is obtained o The estimated arrival angle corresponding to the W subcarriers on Then we can get a single receiving AP at n different locations L s ={L1, .., L o , ..., L n The estimated arrival angle corresponding to the W subcarriers of

[0029] Step 2.2.9. Calculate Ao A E and AoA GT The absolute error between in, Indicates that a single receiving end AP is at position o L o The absolute error between the estimated arrival angle and the actual arrival angle corresponding to the last W subcarriers is: Indicates that a single receiving end AP is at position o L o The absolute error between the estimated angle of arrival and the true angle of arrival corresponding to the k-th subcarrier, 1≤k≤W;

[0030] Step 2.2.10: From Select several subcarriers whose errors are less than the set constant threshold Th as the optimal subcarrier candidate set, and mark their corresponding labels as "1", and the corresponding labels of the remaining subcarriers as "0", so as to obtain the corresponding label vector yo = [y o, 1,…,y o,k , ..., y o,w ],y o,k Indicates that a single receiving end AP is at position o L o The label corresponding to the kth subcarrier on the top; then obtain the label set corresponding to n different positions

[0031] Step 3: Model training;

[0032] Step 3.1: From the phase matrix set The corresponding label set is divided into the following parts without overlapping: p The training set of samples and its corresponding label set And contains v q The validation set of samples and its corresponding label set in, Indicates that a single receiving AP is o Locations The CSI signal received on Indicates the tth o The optimal subcarrier label of the position; Indicates that a single receiving AP is in the vth o Locations The CSI signal received on Indicates the vth o The optimal subcarrier label of the position; and t p +v q =n;

[0033] Step 3.2: Construct a subcarrier detection network, including: Backbone network F θ and head classifier Among them, the backbone network F θ It consists of F inverse residual modules;

[0034] Any m-th inverse residual module consists of A1 convolutional layer, A2 depthwise separable convolutional layer, A3 batch normalization layer and A4 ReLU6 layer, 1≤m≤F, A1≥1, A2≥1, A3≥1, A4≥1;

[0035] Connect a DropOut layer to the output of the Fth and F-1th inverse residual modules respectively;

[0036] The head classifier is a fully connected layer with W output channels;

[0037] The training set Middle t o Location Input into the optimal subcarrier detection network and pass through the backbone network F θ The processing includes:

[0038] When m=1, the tth o Samples After being processed by the mth inverse residual module, the mth intermediate feature map is output

[0039] When m=2, 3, ..., F-2, the m-1th intermediate feature map After being processed by the mth inverse residual module, the mth intermediate feature map is output

[0040] When m=F-1, the m-1th intermediate feature map After being processed by the mth inverse residual module and its DropOut layer, the mth intermediate feature map is output

[0041] When m=F, the m-1th intermediate feature map After being processed by the mth inverse residual module and its DropOut layer, the mth intermediate feature map is output Will After superimposing a random Gaussian noise, we get the noisy feature

[0042] Will and noisy features Input to the head classifier respectively The original output of the sample is obtained And the sample perturbation output The SoftMax function is used to and After processing, the corresponding output subcarrier prediction probability is and ;

[0043] Step 3.3: Use formula (5) to construct the cross entropy loss BCELoss:

[0044]

[0045] In formula (5), ω is the manually designed weight.

[0046] Using formula (6) to establish JS divergence

[0047]

[0048] In formula (9), KL represents the Kullback-Leibler divergence;

[0049] The total loss function Losstotal of the subcarrier detection network is established using formula (7):

[0050]

[0051] Step 3.4: Based on the training set, the subcarrier detection network is trained using the Adam optimizer, and the total loss function is calculated to update the network parameters. When the number of iterations reaches the set threshold ep or the total loss function converges, the training is stopped, and the model weight set of the optimal subcarrier detection network after training is obtained. The model weight saved when the number of iterations is ep; using the validation set and the corresponding label set Select the model weights of the optimal subcarrier detection network with the best performance: Input to model weight set In the above example, we can get the prediction results corresponding to each model weight. in, Represents the prediction result of the epth model weight; combined with Pre and Calculate the weight of each model in the validation set The accuracy on , thus taking the model weight corresponding to the maximum accuracy, loading it into the model, and obtaining its corresponding model is recorded as

[0052] Step 4: Model compression training;

[0053] Step 4.1: Make the model Model for teachers in, is the backbone network of the teacher model T, is the head classifier of the teacher model; let only the model weight set The model with half the number of parameters is the student model in is the backbone network of the student model S, is the head classifier of the student model S;

[0054] Step 4.2: The training set Middle t o Location Input the teacher model T for processing and get the output At the same time, the training set Middle t o Location Input the student model S for processing and get the output

[0055] Step 4.3: Use formula (8) to construct the knowledge distillation loss KD loss :

[0056]

[0057] Use formula (9) to establish the total loss function of the student network

[0058]

[0059] Step 4.4: Based on the training set, use the Adam optimizer to train the student model S and calculate the total loss function. Used to update network parameters. When the number of iterations reaches the set threshold ep or the total loss function converges, the training is stopped and the trained student model weight set S = {S1, S2, ..., S ep},S ep The model weight saved at the epth iteration; using the validation set and the corresponding label set Select the network weights of the best performing student model: Input to the weight set S = {S1, S2, ..., S ep}, the prediction results corresponding to each model weight are obtained in, Represents the epth model weight S ep Prediction results; combined with Pre S and Calculate the weight of each model in the validation set The accuracy on the , take the model weight corresponding to the maximum accuracy, load it into the model, and get its corresponding model denoted as S ax ;

[0060] Step 6: Model reasoning and application;

[0061] Step 6.1: Let the M×W two-dimensional CSI complex matrix corresponding to a certain position received during the actual test be Then, the phase matrix is ​​obtained by preprocessing it according to step 1 Will Input to Model S ax In the output prediction probability prob te , the category with the highest probability is the optimal subcarrier Subopt;

[0062] Step 6.2: Positioning estimation:

[0063] According to the optimal subcarrier index Subopt, take its corresponding CSI complex matrix The Subopt column in the , the corresponding one-dimensional CSI is in, is the CSI data of the Subopt th subcarrier received by the i th antenna at the receiving end;

[0064] The estimated arrival angle is calculated according to equations (3) and (4); thus, the estimated arrival angles corresponding to N APs are obtained, and the center of gravity of the polygon formed by the intersection of the N estimated arrival angles is the final position estimate.

[0065] Compared with the prior art, the present invention has the following beneficial effects:

[0066] 1. Based on the phenomenon that different WiFi subcarriers have different performance characteristics, the present invention uses a lightweight deep neural network to select the optimal subcarrier, and uses the optimal subcarrier combined with the MUSIC algorithm arrival angle to estimate the final position from multiple APs. This solution overcomes the high computational complexity caused by the need to use all subcarriers in traditional WiFi-based indoor positioning methods, and only uses the optimal subcarrier to estimate the position, thereby achieving a significant reduction in computational complexity without sacrificing accuracy, making it possible to achieve near-real-time indoor positioning on mobile devices.

[0067] 2. Aiming at the fact that WiFi signals are easily affected by the environment, the present invention constructs a robust smoothing method, adds noise to the intermediate feature layer, and constructs restriction items on the original and noise-contaminated outputs to make the model output smoother. At the same time, the present invention proposes several data enhancement methods for WiFi data, enriches the input of deep neural networks, and provides guarantees for deployment in the real world.

[0068] 3. The present invention proposes to use a knowledge distillation compressed deep neural network model for mobile devices, so that the present invention can further provide indoor positioning services in real time on mobile devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 This is a schematic diagram of a method for estimating a position based on AoA, taking three receiving-end APs as an example;

[0070] Figure 2a This is a diagram of the AoA error of each subcarrier of 5 samples in the early observation of the positioning performance of the WiFi subcarrier in the present invention;

[0071] Figure 2bThis is a distribution statistical diagram of the minimum AoA error on each subcarrier in the early observation of the positioning performance of the WiFi subcarrier in the present invention;

[0072] Figure 3 It is a structural diagram of Bottleneck in the subcarrier detection network of the present invention;

[0073] Figure 4 It is a schematic diagram of a model compression method for mobile devices of the present invention;

[0074] Figure 5 This is a diagram showing the time consumption of the present invention and the classic method SpotFi on different devices. DETAILED DESCRIPTION

[0075] In this embodiment, a near real-time Wi-Fi indoor positioning method based on subcarrier selection is obtained through experimental observation. Figure 2a and Figure 2b The phenomenon shown in the figure is that the performance of different WiFi subcarriers for indoor positioning is inconsistent. Therefore, the optimal subcarrier can always be selected for indoor positioning services. At the same time, selecting a single optimal subcarrier from all subcarriers for positioning calculation can also greatly reduce the amount of calculation, thereby providing a guarantee for deployment on mobile devices. Specifically, the method is carried out in the following steps:

[0076] Step 1: Data collection;

[0077] In an indoor scenario, N receiving ends with M antennas and a transmitting end with one antenna are set up, and the antennas of each receiving end are arranged in a straight line with equal intervals d. While moving the transmitting end at a uniform speed, the N receiving ends are used to continuously collect the W subcarrier signals of the transmitting end on the transmitting channel at a fixed sampling rate, so that a two-dimensional CSI complex matrix with a dimension of M×W at n different positions is obtained on each receiving end.

[0078] Let n different locations L on a single receiving end AP s ={L1, ..., L o , ..., L n The n two-dimensional CSI complex matrices corresponding to} are Among them, L o represents the oth position; Indicates the oth position L o The two-dimensional CSI complex matrix on , 1≤o≤n;

[0079] Calculate the single receiving end AP at position o L o The two-dimensional CSI complex matrix on The phase matrix CSI o , thus obtaining the phase matrix sample set Xs ={CSI1, ..., CSI o …, CSI n};

[0080] Measure n different positions L s The actual arrival angle relative to a single receiving AP is denoted as in, Indicates the oth position L o The actual arrival angle of the transmitter relative to the single receiving AP;

[0081] Step 2: Data preprocessing;

[0082] Step 2.1: For the phase matrix sample set X of a single receiving AP s Perform data enhancement and preprocessing in sequence to obtain a new sample set X′ with a dimension of W×W s ={CSI′1, ..., CSI′ o , ..., CSI′ n}, where CSI′ o represents the oth position L after preprocessing o The upper phase matrix, for the oth position L after preprocessing o The phase matrix CSI′ on o Perform standardization to obtain the oth position L o The normalized phase matrix Thus, the standardized phase matrix set is obtained

[0083] Step 2.2, label allocation;

[0084] Step 2.2.1, let the oth position L o Upper Phase Matrix The kth column subcarrier is recorded as in, Indicates that the i-th antenna of a single receiving AP is at the o-th position L o The complex signal on the k-th subcarrier received on the receiver, 1≤i≤M, 1≤k≤W;

[0085] Step 2.2.2: Set the incident angle of the received signal of any two adjacent antennas in a single receiving end AP to θ, and use formula (1) to obtain the phase difference Φ generated by the k-th column subcarrier k (θ):

[0086]

[0087] In formula (1), c is the speed of light, fk is the center frequency of the kth column subcarrier; d is the spacing between the antennas of the receiving AP;

[0088] Step 2.2.3: Use formula (2) to get the value of L at the oth position when the incident angle is θ. o The kth column subcarrier b o,k (θ):

[0089]

[0090] In formula (2), for noise;

[0091] Step 2.2.4, using b o,k and its conjugate transpose After multiplication, we get the covariance matrix shown in formula (3):

[0092]

[0093] In formula (3), Indicates that the Mth antenna of a single receiving AP receives the signal at the oth position L o The complex signal on the kth subcarrier The conjugate transpose of ;

[0094] Step 2.2.5: Solve the covariance matrix The corresponding eigenvalues ​​and their corresponding eigenvectors are sorted in descending order to obtain the sorted M eigenvalues. The sorted eigenvalues The corresponding eigenvector representation is recorded as in, represents the Mth eigenvalue, Represents the Mth eigenvalue The corresponding eigenvector;

[0095] Step 2.2.6: Take the eigenvalues ​​after sorting The eigenvectors corresponding to all elements less than the set threshold Va in the filter are used to form the augmented matrix of the filtered eigenvectors. represents the Kth eigenvalue The corresponding eigenvector, let the eigenvector augment the matrix The conjugate transpose of is 1≤K≤M;

[0096] Step 2.2.7: Use equation (4) to calculate the spectral function corresponding to the kth subcarrier when the incident angle is θ:

[0097]

[0098] Step 2.2.8, let the incident angle θ start from 0° and gradually increase to 180° at equal intervals, and simultaneously calculate the spectral function in equation (4): The arrival angle corresponding to the maximum value is selected from all the values ​​and used as the single receiving end AP at the oth position L o The estimated arrival angle corresponding to the kth subcarrier Thus, a single receiving end AP at position o L is obtained o The estimated arrival angle corresponding to the W subcarriers on Then we can get a single receiving AP at n different locations L s ={L1, .., L o , ..., L n The estimated arrival angle corresponding to the W subcarriers of

[0099] Step 2.2.9. Calculate AoA E With AoA GT The absolute error between in, Indicates that a single receiving end AP is at position o L o The absolute error between the estimated arrival angle and the actual arrival angle corresponding to the last W subcarriers is: Indicates that a single receiving end AP is at position o L o The absolute error between the estimated angle of arrival and the true angle of arrival corresponding to the k-th subcarrier, 1≤k≤W;

[0100] Step 2.2.10: From Select several subcarriers whose errors are less than the set constant threshold Th as the optimal subcarrier candidate set, and mark their corresponding labels as "1", and the corresponding labels of the remaining subcarriers as "0", so as to obtain the corresponding label vector y o =[y o,1 , …, y o,k , ..., y o,w ],y o,k Indicates that a single receiving end AP is at position o L o The label corresponding to the kth subcarrier on the top; then obtain the label set corresponding to n different positions

[0101] Step 3: Model training;

[0102] Step 3.1: From the phase matrix set The corresponding label set is divided into the following parts without overlapping: p The training set of samples and its corresponding label set And contains v q The validation set of samples and its corresponding label set Among them, the training set and its corresponding label set Used to train the model and validate the set and its corresponding label set Used to select the optimal model weights during training; where, Indicates that a single receiving AP is o Locations The CSI signal received on Indicates the tth o The optimal subcarrier label of the position; Indicates that a single receiving AP is in the vth o Locations The CSI signal received on Indicates the vth o The optimal subcarrier label of the position; and t p +v q =n;

[0103] Step 3.2: Construct a subcarrier detection network, including: Backbone network F θ and head classifier Among them, the backbone network F θ By F Figure 3 The inverse residual module shown is composed of:

[0104] Any m-th inverse residual module consists of A1 convolutional layer, A2 depthwise separable convolutional layer, A3 batch normalization layer and A4 ReLU6 layer, 1≤m≤F, A1≥1, A2≥1, A3≥1, A4≥1;

[0105] Connect a DropOut layer to the output of the Fth and F-1th inverse residual modules respectively;

[0106] Head Classifier is a fully connected layer with W output channels;

[0107] Training set Middle t o Location Input to the optimal subcarrier detection network and pass through the backbone network F θ The processing includes:

[0108] When m=1, the tth o Samples After being processed by the mth inverse residual module, the mth intermediate feature map is output

[0109] When m=2, 3, ..., F-2, the m-1th intermediate feature map After being processed by the mth inverse residual module, the mth intermediate feature map is output

[0110] When m=F-1, the m-1th intermediate feature map After being processed by the mth inverse residual module and its DropOut layer, the mth intermediate feature map is output

[0111] When m=F, the m-1th intermediate feature map After being processed by the mth inverse residual module and its DropOut layer, the mth intermediate feature map is output Will After superimposing a random Gaussian noise, we get the noisy feature

[0112] Will and noisy features Input to the head classifier respectively The original output of the sample is obtained And the sample perturbation output The SoftMax function is used to and After processing, the corresponding output subcarrier prediction probability is and

[0113] Step 3.3: Use formula (5) to construct the cross entropy loss BCELoss:

[0114]

[0115] In formula (5), ω is the manually designed weight.

[0116] Using formula (6) to establish JS divergence Sample raw output with metrics And the sample perturbation output The distribution distance between them is limited to make the model output smoother:

[0117]

[0118] In formula (9), KL represents the Kullback-Leibler divergence;

[0119] The total loss function Losstotal of the subcarrier detection network is established using formula (7):

[0120]

[0121] Step 3.4: Based on the training set, use the Adam optimizer to train the subcarrier detection network and calculate the total loss function to update the network parameters. When the number of iterations reaches the set threshold ep or the total loss function converges, stop the training and obtain the model weight set of the optimal subcarrier detection network after training. The model weight saved when the number of iterations is ep; using the validation set and the corresponding label set Select the model weights of the optimal subcarrier detection network with the best performance: Input to all model weights In the above example, we can get the prediction results corresponding to each model weight. Among them, Preep represents the prediction result of the epth model weight; combined with Pre and Calculate the weight of each model in the validation set The accuracy on , thus taking the model weight corresponding to the maximum accuracy, loading it into the model, and obtaining its corresponding model is recorded as

[0122] Step 4: Model compression training;

[0123] Step 4.1: Figure 4 As shown, let the trained optimal subcarrier detection network Model for teachers in, is the backbone network of the teacher model T, is the head classifier of the teacher model; let only the optimal subcarrier detection network The model with half the number of parameters is the student model in is the backbone network of the student model S, is the head classifier of the student model S;

[0124] Step 4.2: The training set Middle t o Location Input the teacher model T for processing and get the output At the same time, the training set Middle t o Location Input the student model S for processing and get the output

[0125] Step 4.3: Use formula (8) to construct the knowledge distillation loss KD loss :

[0126]

[0127] Use formula (9) to establish the total loss function of the student network

[0128]

[0129] Step 4.4: Based on the training set, use the Adam optimizer to train the student model S and calculate the total loss function. Used to update network parameters. When the number of iterations reaches the set threshold ep or the total loss function converges, the training is stopped and the trained student model weight set S = {S1, S2, ..., S ep},S ep The model weight saved at the epth iteration; using the validation set and the corresponding label set Select the network weights of the best performing student model: Input to the weight set S = {S1, S2, ..., S ep}, the prediction results corresponding to each model weight are obtained in, Represents the epth model weight S ep Prediction results; combined with Pre S and Calculate the weight of each model in the validation set The accuracy on the , take the model weight corresponding to the maximum accuracy, load it into the model, and get its corresponding model denoted as S ax ;

[0130] Step 6: Model reasoning and application;

[0131] Step 6.1: Let the M×W two-dimensional CSI complex matrix corresponding to a certain position received during the actual test be Then, the phase matrix is ​​obtained by preprocessing it according to step 1 Will Input to S ax In the output prediction probability prob te , the category with the highest probability is the optimal subcarrier Sub opt ;

[0132] Step 6.2: Positioning estimation:

[0133] According to the optimal subcarrier index Sub opt , take its corresponding CSI complex matrix Sub opt Column, the corresponding one-dimensional CSI is in, The Sub opt CSI data of subcarriers;

[0134] The estimated arrival angle is calculated according to equations (3) and (4); thus, the estimated arrival angles corresponding to N APs are obtained, and the center of gravity of the polygon formed by the intersection of the N estimated arrival angles is the final position estimate. Figure 1 The schematic diagram of indoor positioning with three APs as receivers. Theoretical analysis shows that the SVD decomposition in the MUSIC algorithm constitutes the main part of the calculation, and for a two-dimensional matrix of M×W, the calculation time complexity of SVD is 2MW 2 +W 3 +W+MW. After selecting the optimal subcarrier, W will be reduced to 1, and the computational time complexity of SVD will also be reduced to 3M. Figure 5 The time comparison of running the method of the present invention and the classic method SpotFi on a personal computer and a mobile device shows that the method of the present invention has a significant improvement in running speed.

Claims

1. A near real-time Wi-Fi indoor positioning method based on subcarrier selection, It is characterized in that The steps are as follows: Step 1: Data collection; In an indoor scenario, N receiving ends with M antennas and a transmitting end with one antenna are set up, and the antennas of each receiving end are arranged in a straight line with equal intervals d; While moving the transmitting end at a uniform speed, using the N receiving ends to continuously collect W subcarrier signals of the transmitting end on the transmitting channel at a fixed sampling rate, thereby obtaining a two-dimensional CSI complex matrix with a dimension of M×W at n different positions on each receiving end; Let n different locations L on a single receiving end AP s ={L 1 ,…,L o ,…,L n The n two-dimensional CSI complex matrices corresponding to} are Among them, L o represents the oth position; Indicates the oth position L o The two-dimensional CSI complex matrix on , 1≤o≤n; Calculate the single receiving end AP at position o L o The two-dimensional CSI complex matrix on The phase matrix CSI o , thus obtaining the phase matrix sample set X s ={CSI 1 ,…,CSI o ,…,CSI n }; Measure n different positions L s The actual arrival angle relative to a single receiving AP is denoted as in, Indicates the oth position L o The actual arrival angle of the transmitter relative to a single receiving AP; Step 2: Data preprocessing; Step 2.1: For the phase matrix sample set X of a single receiving AP s Perform data enhancement and preprocessing in sequence to obtain a new sample set X' with a dimension of W×W s ={CSI' 1 ,…,CSI' o ,…,CSI' n }, where CSI' o represents the oth position L after preprocessing o The upper phase matrix, for the oth position L after preprocessing o The phase matrix CSI' o Perform standardization to obtain the oth position L o The normalized phase matrix Thus, the standardized phase matrix set is obtained Step 2.2: Label assignment; Step 2.2.1, let the oth position L o Upper Phase Matrix The kth column subcarrier is recorded as in, Indicates that the i-th antenna of a single receiving AP is at the o-th position L o The complex signal on the k-th subcarrier received on the receiver, 1≤i≤M,1≤k≤W; Step 2.2.2: Set the incident angle of the received signal of any two adjacent antennas in the single receiving end AP to θ, and use formula (1) to obtain the phase difference Φ generated by the k-th column subcarrier k (θ): In formula (1), c is the speed of light, f k is the center frequency of the kth column subcarrier; d is the spacing between the antennas of the receiving AP; Step 2.2.3: Use formula (2) to get the value of L at the oth position when the incident angle is θ. o The kth column subcarrier b o,k (θ): In formula (2), for noise; Step 2.2.4, using b o,k and its conjugate transpose After multiplication, we get the covariance matrix shown in formula (3): In formula (3), Indicates that the Mth antenna of a single receiving AP receives the signal at the oth position L o The complex signal on the kth subcarrier The conjugate transpose of ; Step 2.2.5: Solve the covariance matrix The corresponding eigenvalues ​​and their corresponding eigenvectors are sorted in descending order to obtain the sorted M eigenvalues. The sorted eigenvalues The corresponding eigenvector representation is recorded as in, represents the Mth eigenvalue, Represents the Mth eigenvalue The corresponding eigenvector; Step 2.2.6: Take the eigenvalues ​​after sorting The eigenvectors corresponding to all elements less than the set threshold Va in the filter are used to form the augmented matrix of the filtered eigenvectors. represents the Kth eigenvalue The corresponding eigenvector, let the eigenvector augment the matrix The conjugate transpose of is Step 2.2.7: Use equation (4) to calculate the spectral function corresponding to the kth subcarrier when the incident angle is θ: Step 2.2.8, let the incident angle θ start from 0° and gradually increase to 180° at equal intervals, and simultaneously calculate the spectral function in equation (4): The arrival angle corresponding to the maximum value is selected from all the values ​​and used as the single receiving end AP at the oth position L o The estimated arrival angle corresponding to the kth subcarrier Thus, a single receiving end AP at position o L is obtained o The estimated arrival angle corresponding to the W subcarriers on Then we can get a single receiving AP at n different locations L s ={L 1 ,..,L o ,…,L n The estimated arrival angle corresponding to the W subcarriers of Step 2.2.

9. Calculate AoA E With AoA GT The absolute error between in, Indicates that a single receiving end AP is at position o L o The absolute error between the estimated arrival angle and the actual arrival angle corresponding to the last W subcarriers is: Indicates that a single receiving end AP is at position o L o The absolute error between the estimated angle of arrival and the true angle of arrival corresponding to the k-th subcarrier, 1≤k≤W; Step 2.2.10: From Select several subcarriers whose errors are less than the set constant threshold Th as the optimal subcarrier candidate set, and mark their corresponding labels as "1", and the corresponding labels of the remaining subcarriers as "0", so as to obtain the corresponding label vector y o =[y o,1 ,…,y o,k ,…,y o,W ],y o,k Indicates that a single receiving end AP is at position o L o The label corresponding to the kth subcarrier on the top; and then obtain the label set corresponding to n different positions Step 3: Model training; Step 3.1: From the phase matrix set The corresponding label set is divided into the following parts without overlapping: p The training set of samples and its corresponding label set And contains v q The validation set of samples and its corresponding label set in, Indicates that a single receiving AP is o Locations The CSI signal received on Indicates the tth o The optimal subcarrier label of the position; Indicates that a single receiving AP is in the vth o Locations The CSI signal received on Indicates the vth o The optimal subcarrier label of the position; and t p +v q =n; Step 3.2: Construct a subcarrier detection network, including: Backbone network F θ and head classifier Among them, the backbone network F θ It consists of F inverse residual modules; Any m-th inverse residual module consists of A 1 Convolutional layer, A 2 Layer depth separable convolutional layer, A 3 layer batch normalization layer and A 4 Layer ReLU6 layers, 1≤m≤F,A 1 ≥1, A 2 ≥1, A 3 ≥1, A 4 ≥1; Connect a DropOut layer to the output of the Fth and F-1th inverse residual modules respectively; The head classifier is a fully connected layer with W output channels; The training set Middle t o Location Input into the optimal subcarrier detection network and pass through the backbone network F θ The processing includes: When m=1, the tth o Samples After being processed by the mth inverse residual module, the mth intermediate feature map is output When m=2,3,…,F-2, the m-1th intermediate feature map After being processed by the mth inverse residual module, the mth intermediate feature map is output When m=F-1, the m-1th intermediate feature map After being processed by the mth inverse residual module and its DropOut layer, the mth intermediate feature map is output When m=F, the m-1th intermediate feature map After being processed by the mth inverse residual module and its DropOut layer, the mth intermediate feature map is output Will After superimposing a random Gaussian noise, we get the noisy feature Will and noisy features Input to the head classifier respectively The original output of the sample is obtained And the sample perturbation output The SoftMax function is used to and After processing, the corresponding output subcarrier prediction probability is and Step 3.3: Use formula (5) to construct the cross entropy loss BCELoss: In formula (5), ω is the manually designed weight; Using formula (6) to establish JS divergence In formula (9), KL represents the Kullback-Leibler divergence; Using formula (7), we can establish the total loss function Loss of the subcarrier detection network. total : Step 3.4: Based on the training set, the subcarrier detection network is trained using the Adam optimizer, and the total loss function is calculated to update the network parameters. When the number of iterations reaches the set threshold ep or the total loss function converges, the training is stopped, and the model weight set of the optimal subcarrier detection network after training is obtained. The model weight saved when the number of iterations is ep; using the validation set and the corresponding label set Select the model weights of the optimal subcarrier detection network with the best performance: Input to model weight set In the above example, we can get the prediction results corresponding to each model weight. Among them, Pre ep Represents the prediction result of the epth model weight; combined with Pre and Calculate the weight of each model in the validation set The accuracy on , thus taking the model weight corresponding to the maximum accuracy, loading it into the model, and obtaining its corresponding model is recorded as Step 4: Model compression training; Step 4.1: Make the model Model for teachers in, is the backbone network of the teacher model T, is the head classifier of the teacher model; let only the model weight set The model with half the number of parameters is the student model in is the backbone network of the student model S, is the head classifier of the student model S; Step 4.2: The training set Middle t o Location Input the teacher model T for processing and get the output At the same time, the training set Middle t o Location Input the student model S for processing and get the output Step 4.3: Use formula (8) to construct the knowledge distillation loss KD loss : Use formula (9) to establish the total loss function of the student network Step 4.4: Based on the training set, use the Adam optimizer to train the student model S and calculate the total loss function. Used to update network parameters. When the number of iterations reaches the set threshold ep or the total loss function converges, the training is stopped and the trained student model weight set S = {S 1 ,S 2 ,…,S ep },S ep The model weight saved at the epth iteration; using the validation set and the corresponding label set Select the network weights of the best performing student model: Input to the weight set S = {S 1 ,S 2 ,…,S ep }, the prediction results corresponding to each model weight are obtained in, Represents the epth model weight S ep The prediction results; combined with Pre S and Calculate the weight of each model in the validation set The accuracy on the , take the model weight corresponding to the maximum accuracy, load it into the model, and get its corresponding model denoted as S ax ; Step 6: Model reasoning and application; Step 6.1: Let the M×W two-dimensional CSI complex matrix corresponding to a certain position received during the actual test be Then, the phase matrix is ​​obtained by preprocessing it according to step 1 Will Input to Model S ax In the output prediction probability prob te , the category with the highest probability is the optimal subcarrier Sub opt ; Step 6.2: Positioning estimation: According to the optimal subcarrier index Sub opt , take its corresponding CSI complex matrix Sub opt Column, the corresponding one-dimensional CSI is in, The Sub opt CSI data of subcarriers; The estimated arrival angle is calculated according to equations (3) and (4); thus, the estimated arrival angles corresponding to N APs are obtained, and the center of gravity of the polygon formed by the intersection of the N estimated arrival angles is the final position estimate.

Citation Information

Patent Citations

  • Novel CSI indoor positioning method based on convolutional neural network

    CN111212379A

  • Shipborne environment indoor positioning method based on CSI dual-cycle neural network

    CN112423265A

  • Indoor positioning method, device and equipment based on WiFi

    CN114501315A

  • CSI method for recognizing human fall in wi-fi interference environment

    WO2021160189A1