Indoor CSI fingerprint positioning method based on deep learning
By employing a deep learning-based CSI fingerprinting method, combined with data preprocessing and a hybrid model, the accuracy and robustness of indoor positioning are improved, addressing positioning challenges in complex environments and achieving a high-precision, low-cost indoor positioning solution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHEASTERN UNIV AT QINHUANGDAO
- Filing Date
- 2026-01-07
- Publication Date
- 2026-05-01
AI Technical Summary
Existing indoor positioning technologies struggle to achieve high-precision and robust positioning in complex environments, especially under conditions such as non-line-of-sight and dynamic multipath, where positioning accuracy drops significantly and robustness to sudden signal interference is insufficient.
We employ a deep learning-based CSI fingerprint localization method, including CSI data acquisition and preprocessing, CNN-BiLSTM-Attention hybrid model construction and training. By removing outliers, Hampel filtering and wavelet denoising, principal component analysis for dimensionality reduction, and combining convolutional neural networks, bidirectional long short-term memory networks and attention mechanisms, we improve feature extraction and model focusing capabilities.
It achieves high-precision positioning in both LOS and NLOS environments. The algorithm maintains stability in dynamic multipath and signal obstruction scenarios, with small positioning errors and low fluctuations, reducing hardware costs and making it suitable for scenarios such as homes, shopping malls, and laboratories.
Smart Images

Figure CN121968014A_ABST
Abstract
Description
Indoor CSI fingerprint localization method based on deep learning Technical Field
[0001] This invention relates to the field of indoor wireless positioning technology, and in particular to an indoor CSI fingerprint positioning method based on deep learning. Background Technology
[0002] Indoor positioning technology refers to information technology that uses various technical means to obtain the precise location of people, equipment, and other objects in real time in indoor environments where satellite signals are limited. It effectively solves the problem of GPS signals being blocked by buildings, which prevents accurate positioning. Currently, it mainly relies on communication methods such as Wi-Fi, Bluetooth, ZigBee, radio frequency identification (RFID), ultra-wideband (UWB), and visible light to achieve positioning functions, and has become an indispensable basic technical support for the era of the Internet of Things and intelligence.
[0003] Channel State Information (CSI) refers to the detailed characteristics of the channel a wireless signal experiences during transmission between the transmitter and receiver, primarily including key parameters such as signal strength, phase, and delay. These parameters are affected by various factors, including propagation distance, signal scattering, multipath effects, obstacle obstruction, and signal fading. The performance of a signal in different frequency bands typically includes two dimensions: amplitude / frequency response and phase / frequency response. CSI allows the acquisition of amplitude and phase information on each subcarrier, providing more refined data characteristics than traditional measurement metrics. In traditional indoor positioning technologies, such as those based on Wi-Fi signal strength (RSSI), the reliance on a single, highly unstable, and coarse RSSI metric makes accurate positioning difficult in complex and changing environments. However, the introduction of CSI into indoor positioning technology represents a revolutionary advancement.
[0004] Machine learning and deep learning are playing an increasingly crucial role in channel state information-based positioning. Traditional indoor positioning technologies often struggle to establish accurate analytical models due to the complex and ever-changing environment. However, combining machine learning—especially deep learning—with indoor positioning technologies transforms the positioning problem into a data-driven model learning task, effectively addressing this core challenge. Compared to traditional machine learning methods, deep learning, with its higher accuracy and greater flexibility, is gradually becoming the mainstream technology in this field, significantly improving the accuracy and robustness of positioning systems.
[0005] Most existing research focuses on utilizing Channel State Information (CSI) to achieve basic indoor positioning, but generally neglects the pursuit of a system balance between high accuracy, high robustness, and low complexity, exhibiting significant shortcomings, especially in complex indoor scenarios. Some positioning algorithms fail to adequately optimize the raw CSI data or employ only a single denoising method, resulting in residual noise and outliers that severely impact the accuracy of subsequent feature extraction and model training. Furthermore, traditional deep learning models struggle to collaboratively capture local spatial features and temporal correlations within CSI data, and most fusion models lack attention mechanisms, failing to focus on key information, leading to a significant decrease in positioning accuracy under complex propagation conditions such as non-line-of-sight and dynamic multipath propagation. In addition, existing methods generally lack robustness to sudden signal interference, resulting in large fluctuations in positioning errors, fundamentally limiting the system's ability to achieve stable and accurate positioning in real-world complex environments. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to address the shortcomings of the prior art by providing an indoor CSI fingerprint localization method based on deep learning, which effectively improves the discriminative power of CSI fingerprint features and the model's ability to focus on key features, and achieves high-precision and high-stability localization in complex scenarios such as non-line-of-sight and dynamic multipath.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0008] A deep learning-based indoor CSI fingerprint localization method includes CSI data acquisition and preprocessing, CNN-BiLSTM-Attention hybrid model construction and training, and final localization calculation; the specific steps are as follows:
[0009] Step 1: Collect raw CSI data and preprocess it, including outlier removal, Hampel filtering, and wavelet denoising, while performing phase deconvolution; then, use principal component analysis (PCA) to reduce the dimensionality of the processed amplitude and phase data to 25 dimensions respectively, and merge them into a 1×50 feature matrix; label and shuffle the dataset, and divide it into training and test sets, with each label corresponding to the real physical coordinates;
[0010] Step 2: Construct a CNN-BiLSTM-Attention hybrid model, train the CNN-BiLSTM-Attention network based on the partitioned dataset, and save the trained model;
[0011] The model uses a convolutional neural network (CNN) to extract local features from 50-dimensional input data. First, it performs three consecutive convolution operations with a kernel size of 3×1, followed by a 2×1 max pooling operation to gradually reduce the feature map dimension from 50×1 to 6×1, while increasing the number of channels from 32 to 128, ultimately forming a 6×1×128 three-dimensional feature tensor. After flattening the feature tensor into a 768-dimensional vector, it is input into a bidirectional long short-term memory network (BiLSTM). Finally, an attention mechanism is implemented.
[0012] Step 3: Collect CSI fingerprints of unknown locations and input them into the trained model. Use Softmax probability analysis to determine the five most similar reference points, and then perform weighted calculations on the coordinates of these reference points to finally obtain the location coordinates.
[0013] Furthermore, the specific steps for removing outliers in step 1 are as follows:
[0014] Step 1.11: Randomly select subsamples from the collected CSI data to construct multiple decision trees. ;
[0015] Step 1.12: Calculate the isolation depth; for each data point Calculate its isolation depth in each decision tree. ;
[0016] Step 1.13: Calculate data points The average isolation depth, which is the average isolation depth of the data point across all decision trees, is calculated as follows:
[0017] ;
[0018] Step 1.14: Calculate the outlier score for each data point using the outlier scoring formula. :
[0019] ;
[0020] in, Let be a constant, defined as: ; Indicates the first The first harmonic number is defined as: ; The total number of samples;
[0021] Step 1.15: Set a threshold Classify data points into normal or abnormal data: If ,but This is an outlier and needs to be deleted.
[0022] Furthermore, in step 1, Hampell filtering and wavelet denoising are performed as follows:
[0023] First, select a sliding window for each data point; use a window of size [size missing]. Window processing of CSI data sequences The initial value of k is set to 2;
[0024] First, calculate the median m of the data within the window, then calculate the absolute deviation of each data point within the window. :
[0025] ;
[0026] Calculate the absolute deviation of the median within the window. :
[0027] ;
[0028] Then, calculate the standard deviation s of the absolute deviation:
[0029] ;
[0030] Set the threshold k1: Where h is a constant.
[0031] Identify outliers and replace CSI data within the processing window. ,but ;
[0032] Wavelet denoising was used to process the filtered CSI data. The parameters were set as follows: the minimum and maximum threshold selection method was used to implement soft thresholding, the noise standard deviation was estimated by the median absolute deviation, a five-level decomposition structure was adopted, and the Symlet wavelet basis function was used.
[0033] Furthermore, in step 1, the specific steps for dimensionality reduction of the data using principal component analysis are as follows:
[0034] Step 1.21: Extract the amplitude and phase components of the CSI data from each acquisition point, then process and merge them to form a feature matrix, where rows correspond to sampling points and columns correspond to feature dimensions;
[0035] Step 1.22: Standardize the data using the following formula so that the mean of each feature is 0 and the standard deviation is 1:
[0036] ;
[0037] in, The characteristic mean, is the characteristic standard deviation; X represents the data before standardization. This represents the data after standardization.
[0038] Step 1.23: Calculate the covariance matrix C of the normalized data using the following formula to describe the relationships between the features:
[0039] ;
[0040] Where n is the sample size;
[0041] Step 1.24: Perform eigenvalue decomposition on the covariance matrix C. , to obtain eigenvalues and the corresponding feature vector v;
[0042] Step 1.25: Select the first k2 principal components based on the magnitude of the eigenvalues. When the cumulative variance contribution rate of the selected principal components reaches 95%, select the corresponding eigenvector.
[0043] Step 1.26: Combine the selected eigenvectors into a dimensionality-reduced matrix W. ;
[0044] Step 1.27: Project the standardized data into the new space to obtain the dimensionality-reduced data Y. .
[0045] Furthermore, in step 2, when processing the input feature data... In a CNN network, the output feature map Y corresponding to the convolutional kernel K is calculated as follows:
[0046] ;
[0047] in, and These represent the output feature maps respectively. Row indexes and column indexes; and They represent the convolution kernels respectively. Row indexes and column indexes; This represents the feature data input to the convolutional layer;
[0048] Assuming the input for batch normalization is Y, the output Z after batch normalization is calculated as follows:
[0049] ;
[0050] in, and These are the mean and variance of the current batch of data, respectively. and These are learnable parameters; It is a very small constant added to prevent the denominator from being zero, in order to ensure numerical stability;
[0051] Then, the ReLU activation function is applied to increase nonlinearity, and the output equation is:
[0052] ;
[0053] The output P of the pooling operation is calculated as follows:
[0054] ;
[0055] in, and These represent the row and column indices of the output feature map after pooling, respectively. Indicates the row offset within the pooling window; Indicates the height of the pooling window; This is the input feature map before pooling.
[0056] Furthermore, the specific process in the bidirectional long short-term memory network is as follows:
[0057] For time step t, the update formula for the Long Short-Term Memory (LSTM) network is as follows:
[0058] Forgotten Gate:
[0059] ;
[0060] in, This represents the Sigmoid activation function; The weight matrix represents the forget gate. This represents the corresponding bias vector; This is the hidden state from the previous time step; Let be the input vector at the current time step t; [ , ] indicates vector concatenation;
[0061] Input Gate:
[0062] ;
[0063] in, This represents the weight matrix of the input gate. This represents the corresponding bias vector;
[0064] Candidate memory units:
[0065] ;
[0066] in, The weight matrix represents the candidate memory units. This represents the corresponding bias vector;
[0067] Memory cell state:
[0068] ;
[0069] Output gate:
[0070] ;
[0071] in, This represents the weight matrix of the output gate; This represents the corresponding bias vector;
[0072] Finally, calculate the hidden state at the current time step:
[0073] ;
[0074] Bi-LSTM includes two LSTM units:
[0075] Forward LSTM: Processes data from the beginning of the sequence to the end, and the output is... ;
[0076] Reverse LSTM: Processes data from the end of the sequence to the beginning, and the output is... ;
[0077] For each time step t, the final output of Bi-LSTM is a fusion of the forward and backward hidden states:
[0078] ;
[0079] in, This represents the vector concatenation operation, i.e., the forward hidden state. and reverse hidden state The features are concatenated along their respective dimensions to form a final feature vector whose dimension is the sum of the two concatenations. .
[0080] Furthermore, the implementation steps of the attention mechanism are as follows:
[0081] Step 2.1: Calculate the query, key, and value in the attention mechanism:
[0082] , , ;
[0083] in, This represents the features extracted by the Bidirectional Long Short-Term Memory (Bi-LSTM) network model. , , These are the query, key, and value, respectively. , , The weight matrix is a learnable weight matrix;
[0084] Step 2.2: Calculate the attention score using the standard attention mechanism formula:
[0085] ;
[0086] in, The dimension of the key vector;
[0087] Step 2.3: Normalize the attention weights:
[0088] ;
[0089] Step 2.4: Calculate the weighted vector:
[0090] ;
[0091] in, This represents the final feature vector incorporating attention weights, which will serve as input to the subsequent classifier.
[0092] Furthermore, in step 3, the specific process of finally obtaining the positioning coordinates is as follows:
[0093] Collect CSI fingerprints from unknown locations and input them into a trained model. Use Softmax to obtain the class probability distribution P for each fingerprint.
[0094] ;
[0095] in, It is the predicted probability of fingerprint category l, where L is the total number of categories;
[0096] Based on the output probabilities, select the 5 fingerprints with the highest probabilities and their corresponding coordinates and weights, and let the indices of the first five fingerprints be... The corresponding probability is The corresponding coordinates are:
[0097] ;
[0098] Calculate the weighted average coordinates based on the weighted probabilities of these 5 fingerprints. As the final location result:
[0099] ;
[0100] ;
[0101] The final positioning coordinates are expressed as follows:
[0102] .
[0103] The beneficial effects of adopting the above technical solution are as follows: The deep learning-based indoor CSI fingerprint positioning method provided by this invention exhibits outstanding positioning accuracy in LOS environments, while its extremely high fingerprint classification performance provides solid support for positioning accuracy. In NLOS environments, the algorithm still maintains excellent positioning accuracy, and its stable classification performance further ensures the reliability of the positioning results. In custom experimental scenarios, even if random movement of personnel interferes with signal propagation, the algorithm can still accurately complete the positioning, keeping the positioning error at a low level with minimal error fluctuation, and consistently maintaining stable high-precision output. In dynamic multipath, signal obstruction, and sudden interference scenarios, the model classification accuracy of this invention decreases very little, the positioning error fluctuation is very small, and the robustness is strong, far superior to the fluctuation level of existing algorithms. PCA dimensionality reduction significantly reduces the feature dimension, shortens the model training time considerably compared to the GTCN model with equivalent accuracy, improves inference speed, and has high computational efficiency, meeting real-time positioning requirements. Based on existing Wi-Fi infrastructure, there is no need to deploy additional RFID, UWB, or other equipment, significantly reducing hardware costs and making it suitable for various scenarios such as homes, shopping malls, and laboratories. Attached Figure Description
[0104] Figure 1 is a schematic diagram of the structure of the indoor CSI fingerprint positioning method based on deep learning provided in an embodiment of the present invention;
[0105] Figure 2 is a comparison chart of CSI amplitude data processing before and after the embodiment of the present invention;
[0106] Figure 3 is a comparison diagram of CSI phase data processing before and after the embodiment of the present invention;
[0107] Figure 4 is a schematic diagram of the LOS environment test set grouping obfuscation matrix provided in an embodiment of the present invention;
[0108] Figure 5 is a schematic diagram of the NLOS environment test set grouping confusion matrix provided in an embodiment of the present invention;
[0109] Figure 6 is a CDF curve of the LOS environmental positioning error provided in the embodiment of the present invention;
[0110] Figure 7 is a CDF curve of the NLOS environmental positioning error provided in the embodiment of the present invention;
[0111] Figure 8 is a 2D floor plan of a custom laboratory scene provided in an embodiment of the present invention;
[0112] Figure 9 is a CDF curve of the custom experimental positioning error provided in the embodiment of the present invention;
[0113] Figure 10 is a custom experimental RMSE error curve provided in an embodiment of the present invention. Detailed Implementation
[0114] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0115] This embodiment constructs a complete preprocessing workflow including outlier removal, multi-level filtering and denoising, and principal component analysis. Outlier detection is performed using the Isolation Forest algorithm, combined with Hampel filtering and wavelet denoising to eliminate noise interference. PCA is then used to reduce the dimensionality of amplitude and phase data, effectively improving data quality and laying the foundation for subsequent model training. A hybrid model combining convolutional neural networks (CNNs), bidirectional long short-term memory (BLSTMs), and an attention mechanism is employed. CNNs are responsible for extracting local spatial features, BiLSTMs capture temporal dependencies, and the attention mechanism dynamically focuses on key features, forming a complementary advantage and significantly improving fingerprint classification accuracy. The probability distribution of each reference point is output through the softmax function, and the five reference points with the highest probabilities are selected. A weighted average is calculated using these probabilities as weights. This method effectively utilizes the spatial correlation of adjacent fingerprints, smoothing the localization results and achieving high localization accuracy while reducing fluctuations. As shown in Figure 1, the specific details of this embodiment are as follows.
[0116] Step 1: Collect raw CSI data and preprocess it, including outlier removal, Hampel filtering, and wavelet denoising, while performing phase deconvolution. Subsequently, Principal Component Analysis (PCA) is used to reduce the dimensionality of the processed amplitude and phase data to 25 dimensions respectively, and they are merged into a 1×50 feature matrix. The dataset is labeled, shuffled, and divided into training and test sets, with each label corresponding to a real physical coordinate.
[0117] The specific steps for removing outliers are as follows:
[0118] Step 1.11: Randomly select subsamples from the collected CSI data to construct multiple decision trees. ;
[0119] Step 1.12: Calculate the isolation depth; for each data point Calculate its isolation depth in each decision tree. ;
[0120] Step 1.13: Calculate data points The average isolation depth, which is the average isolation depth of the data point across all decision trees, is calculated as follows:
[0121] ;
[0122] Step 1.14: Calculate the outlier score for each data point using the outlier scoring formula. :
[0123] ;
[0124] in, Let be a constant, defined as: ; Indicates the first The first harmonic number is defined as: ; The total number of samples;
[0125] Step 1.15: Set a threshold Classify data points into normal or abnormal data: If ,but This is an outlier and needs to be deleted.
[0126] After deleting outliers, perform Hampel filtering as follows:
[0127] First, select a sliding window for each data point; use a window of size [size missing]. Window processing of CSI data sequences The initial value of k is set to 2;
[0128] First, calculate the median m of the data within the window, then calculate the absolute deviation of each data point within the window. :
[0129] ;
[0130] Calculate the absolute deviation of the median within the window. :
[0131] ;
[0132] Then, calculate the standard deviation s of the absolute deviation:
[0133] ;
[0134] Set the threshold k1, Where h is a constant.
[0135] Identify outliers and replace CSI data within the processing window. ,but .
[0136] Wavelet denoising was used to process the filtered CSI data. The parameters were set as follows: the minimum and maximum threshold selection method was used to implement soft thresholding, the noise standard deviation was estimated by the median absolute deviation, a five-level decomposition structure was adopted, and the Symlet wavelet basis function was used.
[0137] After the aforementioned series of preprocessing steps, the quality of the CSI data was significantly improved. Figure 2 shows a comparison of the CSI amplitude data before and after processing. It can be seen that high-frequency noise and sudden outliers in the original amplitude data were effectively filtered out, and the processed curves are smoother while retaining the main trend characteristics of the signal. Figure 3 shows a comparison of the CSI phase data before and after processing. After phase deconvolution and other processing, the messy transitions in the original phase data were corrected, presenting clearer linear or periodic patterns. These processes provide a high-quality data foundation for subsequent feature extraction and model training.
[0138] Finally, principal component analysis (PCA) was used to reduce the dimensionality of the data. The specific steps are as follows:
[0139] Step 1.21: Extract the amplitude and phase components of the CSI data from each acquisition point, then process and merge them to form a feature matrix, where rows correspond to sampling points and columns correspond to feature dimensions;
[0140] Step 1.22: Standardize the data using the following formula so that the mean of each feature is 0 and the standard deviation is 1:
[0141] ;
[0142] in, The characteristic mean, is the characteristic standard deviation; X represents the data before standardization. This represents the data after standardization.
[0143] Step 1.23: Calculate the covariance matrix C of the normalized data using the following formula to describe the relationships between the features:
[0144] ;
[0145] Where n is the sample size;
[0146] Step 1.24: Perform eigenvalue decomposition on the covariance matrix C. , to obtain eigenvalues and the corresponding feature vector v;
[0147] Step 1.25: Select the first k2 principal components based on the magnitude of the eigenvalues. When the cumulative variance contribution rate of the selected principal components reaches 95%, select the corresponding eigenvector.
[0148] Step 1.26: Combine the selected eigenvectors into a dimensionality-reduced matrix W. ;
[0149] Step 1.27: Project the standardized data into the new space to obtain the dimensionality-reduced data Y. .
[0150] Step 2: Construct a CNN-BiLSTM-Attention hybrid model, train the CNN-BiLSTM-Attention network based on the partitioned dataset, and save the trained model.
[0151] The model employs a convolutional neural network (CNN) to extract local features from 50-dimensional input data. It first performs three consecutive convolution operations with a kernel size of 3×1, followed by a 2×1 max pooling operation, gradually reducing the feature map dimension from 50×1 to 6×1 while increasing the number of channels from 32 to 128, ultimately forming a 6×1×128 three-dimensional feature tensor. This process involves handling the input feature data... In a CNN network, the output feature map Y corresponding to the convolutional kernel K is calculated as follows:
[0152] ;
[0153] in, and These represent the output feature maps respectively. Row indexes and column indexes; and They represent the convolution kernels respectively. Row indexes and column indexes; This represents the feature data input to the convolutional layer.
[0154] Assuming the input for batch normalization is Y, the output Z after batch normalization is calculated as follows:
[0155] ;
[0156] in, and These are the mean and variance of the current batch of data, respectively. and These are learnable parameters; It is a very small constant added to prevent the denominator from being zero, in order to ensure numerical stability.
[0157] Then, the ReLU activation function is applied to increase nonlinearity, and the output equation is:
[0158] ;
[0159] The output P of the pooling operation is calculated as follows:
[0160] ;
[0161] in, and These represent the row and column indices of the output feature map after pooling, respectively. Indicates the row offset within the pooling window; Indicates the height of the pooling window; This is the input feature map before pooling.
[0162] Furthermore, the feature tensor is flattened into a 768-dimensional vector and then input into a bidirectional long short-term memory (BiLSTM) network. For time step t, the update formula for the long short-term memory network (LSTM) is as follows:
[0163] Forgotten Gate:
[0164] ;
[0165] in, This represents the Sigmoid activation function; The weight matrix represents the forget gate. This represents the corresponding bias vector; This is the hidden state from the previous time step; Let be the input vector at the current time step t; [ , ] indicates vector concatenation.
[0166] Input Gate:
[0167] ;
[0168] in, This represents the weight matrix of the input gate; This represents the corresponding bias vector.
[0169] Candidate memory units:
[0170] ;
[0171] in, The weight matrix representing the candidate memory units; This represents the corresponding bias vector.
[0172] Memory cell state:
[0173] ;
[0174] Output gate:
[0175] ;
[0176] in, This represents the weight matrix of the output gate; This represents the corresponding bias vector.
[0177] Finally, calculate the hidden state at the current time step:
[0178] ;
[0179] Bi-LSTM includes two LSTM units:
[0180] Forward LSTM: Processes data from the beginning of the sequence to the end, and the output is... ;
[0181] Reverse LSTM: Processes data from the end of the sequence to the beginning, and the output is... .
[0182] For each time step t, the final output of Bi-LSTM is a fusion of the forward and backward hidden states:
[0183] ;
[0184] in, This represents the vector concatenation operation, i.e., the forward hidden state. and reverse hidden state The features are concatenated along their respective dimensions to form a final feature vector whose dimension is the sum of the two concatenations. .
[0185] The further steps to implement the attention mechanism are as follows:
[0186] Step 2.1: Calculate the query, key, and value in the attention mechanism:
[0187] , , ;
[0188] in, This represents the features extracted by the Bidirectional Long Short-Term Memory (Bi-LSTM) network model. , , These are the query, key, and value, respectively. , , The weight matrix is a learnable weight matrix;
[0189] Step 2.2: Calculate the attention score using the standard attention mechanism formula:
[0190] ;
[0191] in, The dimension of the key vector;
[0192] Step 2.3: Normalize the attention weights:
[0193] ;
[0194] Step 2.4: Calculate the weighted vector:
[0195] ;
[0196] in, This represents the final feature vector incorporating attention weights, which will serve as input to the subsequent classifier.
[0197] Step 3: Collect CSI fingerprints for unknown locations and input them into the trained model. Use Softmax probability analysis to determine the five most similar reference points, then perform weighted calculations on the coordinates of these reference points to obtain the final location coordinates. The specific process is as follows:
[0198] Collect CSI fingerprints from unknown locations and input them into a trained model. Use Softmax to obtain the class probability distribution P for each fingerprint.
[0199] ;
[0200] in, It is the predicted probability of fingerprint category l, where L is the total number of categories;
[0201] Based on the output probabilities, select the 5 fingerprints with the highest probabilities and their corresponding coordinates and weights, and let the indices of the first five fingerprints be... The corresponding probability is The corresponding coordinates are:
[0202] ;
[0203] Calculate the weighted average coordinates based on the weighted probabilities of these 5 fingerprints. As the final location result:
[0204] ;
[0205] ;
[0206] The final positioning coordinates are expressed as follows:
[0207] .
[0208] The effectiveness of the method in this embodiment is verified through two parts: public dataset verification and custom experiment verification. The public dataset verification includes two environments: LOS and NLOS. The LOS environment is a 7m × 10m unobstructed conference room with 176 sampling points (50cm spacing), collecting 35,200 CSI samples. The NLOS environment is a 13.5m × 11m laboratory with obstructions such as tables, chairs, and equipment cabinets, with 317 sampling points (50cm spacing), collecting 63,400 CSI samples. The custom experiment environment is an 11m × 6m rectangular space, where four participants are randomly moved to create interference. Figure 8 shows the floor plan of this environment. 64 sampling points (50cm spacing) are set up, and 20 sampling points are selected as verification points.
[0209] For the customized experimental equipment configuration, the transmitter used a TP-LINK router (1 transmitting antenna), placed in the upper left corner of the test area, 1m above the ground; the receiver used a Dell computer (3 receiving antennas) equipped with an Intel WIFI Link 5300 802.11n wireless network card, placed on the ground.
[0210] The data processing parameters were set as follows: the model training used the Adam gradient descent algorithm, the initial learning rate was 0.001, the L2 regularization coefficient was 0.0001, the maximum number of training epochs was 40, and the learning rate decay coefficient was reduced to 0.1 every 400 training epochs.
[0211] The experimental procedure is as follows: collect CSI data → perform preprocessing (Isolated Forest algorithm + Hampel filter + wavelet denoising + PCA dimensionality reduction) → divide the training set and test set (8:2) → train the CNN-BiLSTM-Attention model → test the localization accuracy at the validation points.
[0212] Figures 4 and 6 show the grouping confusion matrix and cumulative distribution function of localization error in the test set under the LOS environment, respectively. Experimental results show that, under the LOS environment, the model of this embodiment only has a few misclassified samples in a large number of sample points, with extremely high classification accuracy, achieving near-ideal classification performance; the algorithm achieves a localization accuracy of 93% when the error threshold is 1.8519m, demonstrating significant localization performance.
[0213] Figures 5 and 7 show the group confusion matrix and cumulative distribution function of localization error in the test set under NLOS environment, respectively. Experimental results show that the model also had only a small number of misclassified samples under NLOS environment, and the classification accuracy remained basically unchanged compared with LOS environment, proving that even under NLOS environment, the model in this embodiment can still maintain excellent classification performance; the algorithm achieved a localization accuracy of 93% when the error threshold was 3.1612m.
[0214] Figure 9 shows the cumulative distribution function of the method in this embodiment under customized experimental conditions. Experimental results show that the algorithm achieves a positioning accuracy of 90% when the error threshold is 1.5848 meters, demonstrating the superior positioning stability of the method in high-interference environments.
[0215] Figure 10 shows the RMSE error of the method in this embodiment in a custom experiment. The experimental results show that the mean error of the method in this embodiment is 0.9683m and the standard deviation is 0.5558m. It maintains a low and stable error level throughout the process, further verifying its robustness in dynamic environments.
[0216] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the present invention.
Claims
1. A deep learning-based indoor CSI fingerprint localization method, characterized in that: The process includes CSI data acquisition and preprocessing, CNN-BiLSTM-Attention hybrid model construction and training, and final localization calculation. The specific steps are as follows: Step 1: Acquire raw CSI data and preprocess it, including outlier removal, Hampel filtering and wavelet denoising, while performing phase deconvolution. Subsequently, the processed amplitude data and phase data are reduced to 25 dimensions respectively through principal component analysis and merged into a 1×50 feature matrix. The dataset is labeled, shuffled, and divided into training and testing sets, with each label corresponding to the real physical coordinates; Step 2: Construct a CNN-BiLSTM-Attention hybrid model, train the CNN-BiLSTM-Attention network based on the divided dataset, and save the trained model; The model uses a convolutional neural network (CNN) to extract local features from 50-dimensional input data. First, three consecutive convolution operations are performed with a kernel size of 3×1, followed by a 2×1 max pooling operation, which gradually reduces the feature map dimension from 50×1 to 6×1, while increasing the number of channels from 32 to 128, finally forming a 6×1×128 three-dimensional feature tensor; After flattening the feature tensor into a 768-dimensional vector, it is input into a bidirectional long short-term memory network (BiLSTM); finally, the attention mechanism is implemented; Step 3: Collect CSI fingerprints of unknown locations and input them into the trained model. Softmax probability analysis is used to determine the five most similar reference points, and then the coordinates of these reference points are weighted to obtain the final location coordinates.
2. The indoor CSI fingerprint localization method based on deep learning according to claim 1, characterized in that: In step 1, the specific steps for removing outliers are as follows: Step 1.11: Randomly select subsamples from the collected CSI data and construct multiple decision trees. ; Step 1.12: Calculate the isolation depth; for each data point Calculate its isolation depth in each decision tree. ; Step 1.13: Calculate data points The average isolation depth, which is the average isolation depth of the data point across all decision trees, is calculated as follows: Step 1.14: Calculate the outlier score for each data point using the outlier scoring formula. : ;in, Let be a constant, defined as: ; Indicates the first The first harmonic number is defined as: ; Total number of samples; Step 1.15: Set a threshold Classify data points into normal or abnormal data: If ,but This is an outlier and needs to be deleted.
3. The deep learning-based indoor CSI fingerprint localization method according to claim 2, characterized in that: In step 1, Hampell filtering and wavelet denoising are performed as follows: First, a sliding window is selected for each data point; a window of size [size missing] is used. Window processing of CSI data sequences The initial value k is set to 2; first, the median m of the data within the window is calculated, and then the absolute deviation of each data point within the window is calculated. : ; Calculate the absolute deviation of the median within the window : ; Then, calculate the standard deviation s of the absolute deviation: Set threshold k1: Where h is a constant; identify outliers and replace CSI data within the processing window, if ,but Wavelet denoising was used to process the filtered CSI data. The parameters were set as follows: the minimum and maximum threshold selection method was used to implement soft thresholding, the noise standard deviation was estimated by the median absolute deviation, a five-level decomposition structure was adopted, and the Symlet wavelet basis function was used.
4. The indoor CSI fingerprint localization method based on deep learning according to claim 3, characterized in that: In step 1, the specific steps for dimensionality reduction of the data using principal component analysis are as follows: Step 1.21: Extract the amplitude and phase components of the CSI data for each acquisition point, then process and merge them to form a feature matrix, where rows correspond to sampling points and columns correspond to feature dimensions; Step 1.22: Standardize the data using the following formula to make the mean of each feature 0 and the standard deviation 1: ;in, The characteristic mean, is the characteristic standard deviation; X represents the data before standardization. This represents the standardized data; Step 1.23: Calculate the covariance matrix C of the normalized data using the following formula to describe the relationships between features: Where n is the sample size; Step 1.24: Perform eigenvalue decomposition on the covariance matrix C. , to obtain eigenvalues And the corresponding eigenvector v; Step 1.25: Select the first k2 principal components based on the magnitude of the eigenvalues. When the cumulative variance contribution rate of the selected principal components reaches 95%, select the corresponding eigenvector; Step 1.26: Combine the selected eigenvectors into a dimensionality-reduced matrix W. Step 1.27: Project the standardized data into the new space to obtain the dimensionality-reduced data Y. 。 5. The indoor CSI fingerprint localization method based on deep learning according to claim 4, characterized in that: In step 2, the input feature data is processed. In a CNN network, the output feature map Y corresponding to the convolutional kernel K is calculated as follows: ;in, and These represent the output feature maps respectively. Row indexes and column indexes; and They represent the convolution kernels respectively. Row indexes and column indexes; This represents the feature data input to the convolutional layer; assuming the batch normalized input is Y, the batch normalized output Z is calculated as follows: ;in, and These are the mean and variance of the current batch of data, respectively. and These are learnable parameters; This is a very small constant added to prevent the denominator from being zero, ensuring numerical stability; then, the ReLU activation function is applied to increase nonlinearity, and the output equation is: The output P of the pooling operation is calculated as follows: ;in, and These represent the row and column indices of the output feature map after pooling, respectively. Indicates the row offset within the pooling window; Indicates the height of the pooling window; This is the input feature map before pooling.
6. The deep learning-based indoor CSI fingerprint localization method according to claim 5, characterized in that: The specific process in the bidirectional Long Short-Term Memory (LSTM) network is as follows: For time step t, the update formula for the LSTM network is as follows: Forget gate: ;in, This represents the Sigmoid activation function; The weight matrix represents the forget gate. This represents the corresponding bias vector; This is the hidden state from the previous time step; The input vector is the input vector at the current time step t; [, ] indicates vector concatenation; input gate: ;in, This represents the weight matrix of the input gate. Represents the corresponding bias vector; candidate memory unit: ;in, The weight matrix represents the candidate memory units. Represents the corresponding bias vector; memory cell state: Output gate: ;in, This represents the weight matrix of the output gate; This represents the corresponding bias vector; finally, the hidden state at the current time step is calculated: Bi-LSTM includes two LSTM units: Forward LSTM, which processes data from the beginning of the sequence to the end, and the output is... Reverse LSTM: processes data from the end of the sequence to the beginning, and the output is... For each time step t, the final output of the Bi-LSTM is a fusion of the forward and backward hidden states: ;in, This represents the vector concatenation operation, i.e., the forward hidden state. and reverse hidden state The features are concatenated along their respective dimensions to form a final feature vector whose dimension is the sum of the two concatenations. 。 7. The deep learning-based indoor CSI fingerprint localization method according to claim 6, characterized in that: The implementation steps of the attention mechanism are as follows: Step 2.1: Calculate the query, key, and value in the attention mechanism: , , ;in, This represents the features extracted by the Bi-LSTM model of the bidirectional long short-term memory network. 、 、 These are the query, key, and value, respectively. 、 、 The learnable weight matrix is used; Step 2.2: Calculate the attention score using the standard attention mechanism formula: ;in, Let be the dimension of the key vector; Step 2.3: Normalize the attention weights: Step 2.4: Calculate the weighted vector: ;in, This represents the final feature vector incorporating attention weights, which will serve as input to the subsequent classifier.
8. The deep learning-based indoor CSI fingerprint localization method according to claim 7, characterized in that: In step 3, the specific process for obtaining the final location coordinates is as follows: Collect CSI fingerprints of unknown locations and input them into the trained model. Use Softmax to obtain the class probability distribution P corresponding to each fingerprint: ;in, This represents the predicted probability of fingerprint category l, where L is the total number of categories. Based on the output probability, the five fingerprints with the highest probabilities, along with their corresponding coordinates and weights, are selected. Let the indices of the first five fingerprints be... The corresponding probability is The corresponding coordinates are: Calculate the weighted average coordinates based on the weighted probabilities of these 5 fingerprints. As the final location result: ; The final positioning coordinates are expressed as follows: 。