Multi-task space-time fusion Wi-Fi fingerprint positioning system
By combining a denoising autoencoder, a generative adversarial network, and a channel attention mechanism, a multi-task learning WiFi fingerprint indoor positioning model is constructed, which solves the problems of signal fluctuation and sample imbalance, and achieves high-precision and robust indoor positioning.
Patent Information
- Application Number
- CN202511241692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-10-31
AI Technical Summary
Existing WiFi fingerprinting positioning methods face problems such as signal fluctuations, sample imbalance, and lack of spatiotemporal modeling capabilities in complex indoor environments, resulting in insufficient positioning accuracy and robustness.
By employing a denoising autoencoder (DAE), generative adversarial network (GAN), channel attention mechanism (ECA), and multi-task learning strategy, combined with CNN-GRU, an end-to-end localization model is constructed to achieve joint prediction of building, floor, and spatial coordinates, thereby improving data quality and multi-task collaborative optimization.
It significantly improves the accuracy and robustness of indoor positioning, adapts to changes in behavior patterns in complex environments, and enhances the model's generalization ability and positioning performance.
Smart Images

Figure CN120881733A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of indoor positioning and wireless communication technology, and particularly relates to a WiFi fingerprint indoor high-precision positioning method that integrates multi-task learning (MTL) and spatiotemporal feature modeling. This method extracts the spatial distribution features and temporal evolution of the received signal strength (RSSI) value using a convolutional neural network-gated recurrent unit (CNN-GRU), and combines this with a multi-task joint optimization mechanism of building recognition, floor classification, and coordinate regression to significantly improve positioning accuracy and generalization ability in complex indoor environments. Background Technology
[0002] With the rapid development of the Internet of Things (IoT), smart cities, and smart space technologies, indoor positioning, as a crucial supporting capability, requires increasingly higher accuracy and robustness. Traditional outdoor positioning technologies (such as GPS) cannot function effectively indoors due to severe signal obstruction, thus WiFi fingerprint positioning technology has gained widespread attention. This method utilizes the RSSI values of WiFi access points (APs) at different locations to construct a fingerprint database, and predicts user location through online matching. It has advantages such as low deployment cost and no need for additional hardware.
[0003] However, in practical applications, WiFi fingerprinting positioning methods still face multiple challenges. First, RSSI signals are easily affected by environmental factors (such as multipath effects, pedestrian movement, and occlusion), causing significant fluctuations in values measured at the same location at different times, increasing the difficulty of model fitting the real space. Second, in large-scale buildings, the distribution of sample numbers is extremely uneven across different floors, areas, or buildings, especially in high-rise floors or peripheral areas, which are often in a "minority" state. The trained model is prone to bias, significantly reducing the positioning accuracy in these areas. In addition, traditional methods often model positioning as a simple coordinate regression task, ignoring the guidance information of spatial hierarchy such as buildings and floors, and lacking multi-scale semantic understanding capabilities. Most existing methods still use static RSSI vectors as input, failing to capture the evolution of signals over time, making it difficult for models to adapt to changes in behavioral patterns in dynamic scenes.
[0004] In recent years, although deep learning has demonstrated powerful capabilities in feature representation, and some studies have introduced structures such as CNN (Convolutional Neural Network), RNN (Recurrent Neural Network), and GRU (Gated Recurrent Unit) to improve RSSI modeling performance, shortcomings remain in robustness to signal fluctuations, mitigation of imbalanced sample problems, and collaborative modeling effectiveness among tasks. Therefore, there is an urgent need for an indoor positioning method that possesses spatiotemporal modeling capabilities, supports multi-task joint optimization, and enhances data robustness to improve the overall positioning performance and deployment feasibility of the system in complex environments. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a WiFi fingerprint indoor high-precision positioning method that integrates multi-task learning and generative enhancement. While retaining the advantages of traditional WiFi fingerprint systems such as low cost and ease of deployment, this method comprehensively employs a denoising autoencoder (DAE), a generative adversarial network (GAN), an efficient channel attention (ECA) mechanism, CNN-GRU, and a multi-task joint optimization strategy to construct an end-to-end positioning model suitable for complex indoor scenarios. This model achieves joint prediction of building, floor, and spatial coordinates, exhibiting excellent positioning accuracy, robustness, and application adaptability.
[0006] This method not only significantly improves data quality and category coverage in terms of data preprocessing and sample augmentation, but also fully explores the intrinsic relationship between building recognition, floor classification and spatial coordinate regression through a multi-task learning mechanism, achieving multi-objective collaborative optimization and solving the problem of limited information sharing between tasks in traditional single-task models.
[0007] The method described in this invention includes the following key technical steps:
[0008] Step 1: In the raw WiFi RSSI data, when an AP cannot be detected at the current location, its corresponding value is often recorded as 100 dBm. This invention replaces the item with an RSSI value of 100 dBm with -104 dBm. Z-score normalization is used to process the RSSI features to facilitate subsequent processing by the neural network model.
[0009] Step 2: To address the high-dimensional noise sensitivity of RSSI signals, this invention designs a denoising encoder for feature preprocessing, specifically implementing the following key technologies: (1) It adopts a symmetrical shallow structure, containing an encoder and a decoder; (2) The encoder compresses the input RSSI vector into the latent space representation through two fully connected layers; (3) The decoder performs symmetric reverse recovery and outputs the reconstructed vector of the original dimension; (4) After DAE processing, RSSI features can achieve structured denoising, improving the robustness and generalization ability of the model.
[0010] Step 3: Propose a sample augmentation method based on generative adversarial networks. First, the real RSSI samples of this floor are normalized to [-1,1]. The generator takes 100-dimensional Gaussian noise as input, generates a synthetic vector of the same dimension through a fully connected network, and then inversely normalizes it to restore the real RSSI range. The discriminator judges the authenticity of the samples through a fully connected network. The spatial labels of the generated samples are obtained by sampling from the latitude and longitude normal distribution of the corresponding clusters after K-means clustering of real samples.
[0011] Step 4: Combine the spatiotemporal feature extraction module of a one-dimensional convolutional neural network (1D-CNN) with a bidirectional gated recurrent unit (Bi-GRU). Use the ECA module to further enhance the expressive power of key features. The fused multi-scale features are input to a multi-task output module to achieve joint prediction of building classification, floor classification, and two-dimensional coordinate regression.
[0012] Step 5: During training, the exponential moving average (EMA) is used to stabilize the optimization process, a flooding mechanism is introduced to prevent overfitting, and an early stopping mechanism is combined to avoid overtraining. Attached Figure Description
[0013] Figure 1 This is a schematic diagram of the overall architecture of the indoor positioning system described in this invention;
[0014] Figure 2 For spatiotemporal fusion and ECA attention mechanism network structure;
[0015] Figure 3 This is a comparison chart of the cumulative distribution function (CDF) performance of the system described in this invention and traditional methods in terms of positioning error. Detailed Implementation
[0016] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0017] Figure 1 This is a schematic diagram of the overall architecture of the indoor positioning system described in this invention, illustrating the data processing flow in the model.
[0018] Figure 2 This is a schematic diagram of the spatiotemporal fusion and ECA attention mechanism network structure described in this invention. The diagram illustrates how 1D-CNN and Bi-GRU work together, and how the ECA attention mechanism dynamically adjusts the feature channel weights to achieve adaptive fusion.
[0019] Figure 3 The graph shows a comparison of the CDF performance of the system described in this invention and traditional methods in terms of positioning error. The results show that the present invention has better positioning accuracy.
[0020] To further illustrate the technical solution of this invention, the following detailed description is provided in conjunction with the UJIIndoorLoc dataset and specific experimental procedures:
[0021] Step 1.1 Missing Value Handling: In the original WiFi RSSI data, the original RSSI values range from -104dBm to 0dBm, have a non-zero mean, and exhibit significant differences in statistical characteristics among different AP channels. Directly using these values for neural network training would lead to unstable gradient propagation. When an AP cannot be detected at the current location, its corresponding value is often recorded as 100dBm. This invention replaces the RSSI value of 100dBm with -104dBm.
[0022] Step 1.2 Data Normalization: Since the original RSSI values range from -104dBm to 0dBm, have a non-zero mean, and exhibit significant differences in statistical characteristics across different AP channels, directly using them for neural network training would lead to unstable gradient propagation. Therefore, this invention employs Z-score normalization to process the RSSI features.
[0023]
[0024] in The standardized RSSI value; For the first i The sample at the th j The original RSSI values on each AP; and The i-th in the training set j The mean and standard deviation of all RSSI values on the AP channel.
[0025] Step 2.1 The DAE structure in this invention is a symmetric shallow autoencoder, mainly consisting of an encoder and a decoder. The encoder consists of two fully connected layers, used to compress the RSSI vector of the input dimension into the latent space representation, and then the decoder performs symmetric reverse recovery on it, finally outputting the reconstructed vector of the original dimension. The input dimension is 520, the encoding layer dimension is set to 128, and the activation function is ReLU.
[0026] Step 3.1 The GAN structure constructed in this invention consists of a generator and a discriminator, both using a fully connected neural network design. The generator takes a 100-dimensional Gaussian noise vector as input, and outputs a synthesized RSSI vector with the same dimension as the original RSSI feature length after multiple nonlinear transformations. To ensure that the output range is consistent with the RSSI data, the real RSSI samples are normalized before input, mapping the original range [-104, 0] to the interval [-1, 1]. The normalization formula is as follows:
[0027]
[0028] in is the normalized RSSI value; x is the original RSSI value. After model training, the samples generated by the generator are then used to recover the RSSI signal using the following inverse normalization formula:
[0029]
[0030] The discriminator determines whether an input sample is a real sample or a generated sample. It uses LeakyReLU activation and a sigmoid output, and the loss function is constructed using the standard binary cross-entropy form. During training, the generator and discriminator are optimized through adversarial learning, with the goal of making the generator continuously generate samples that closely approximate the real distribution, making it impossible for the discriminator to accurately distinguish between real and fake samples. and Let represent the loss functions of the discriminator and generator, respectively, and calculate them as follows:
[0031]
[0032]
[0033] D(x) is the discriminator's predicted probability for the real sample x; G(z) is the generator's generated sample for the noise z; m is the batch size.
[0034] Step 3.2 This invention uses K-means clustering to divide the real samples on Floor 4 into 4 clusters. Then, the mean and standard deviation of the latitude and longitude coordinates are calculated for each cluster, and latitude and longitude coordinates are sampled from a normal distribution according to the following formula as spatial labels for the synthesized RSSI samples, where, and The longitude and latitude coordinates of the generated synthetic sample; and For the first i The mean of the longitude and latitude of the real samples in each cluster; and For the first i The standard deviation of the longitude and latitude of real samples in each cluster. This method distributes the generated samples around the cluster centers, simulating location changes in a real-world scenario.
[0035]
[0036]
[0037] Step 4.1 This invention employs 1D-CNN as a spatial feature extractor to model the local correlation and spatial topology between access points. Specifically, each RSSI vector consists of 520 dimensions, representing the received signal strength of each AP at the current location at that time point. To extract the spatial distribution features of the RSSI signal, this invention uses the RSSI vector at each time step... (D=520 represents the number of access points) Inputting a three-layer one-dimensional convolutional network, the specific calculation process is as follows:
[0038]
[0039] in Indicates the first i Feature maps after convolutional operations , and They represent the first i The weights and biases of the convolutional layers are then used to obtain the spatial feature representation through global average pooling.
[0040]
[0041] in This represents the final spatial feature vector. , used to characterize the t Local correlation and overall spatial distribution pattern of RSSI signals at each time step.
[0042] In the above formula, the convolutional layers are followed by batch normalization and ReLU activation functions to improve training stability and non-linear expressive power. Global average pooling compresses the convolutional output into fixed-dimensional spatial embedding features to represent the RSSI spatial distribution pattern at that time step. This feature not only preserves the local correlation of signal combinations from different access points but also enhances the model's ability to discriminate spatial locations.
[0043] Step 4.2 This invention introduces Bi-GRU as a time feature extraction module to model the dynamic evolution of RSSI signals in the time dimension. Bi-GRU consists of a forward GRU and a backward GRU, which respectively capture the forward and backward dependencies of the sequence. For the input sequence... The calculation method for its time feature extraction process is as follows:
[0044]
[0045]
[0046] in and These are the hidden states of the forward and reverse GRU, respectively. The bidirectional hidden states are concatenated and mapped to a unified dimension:
[0047]
[0048] Obtaining time characteristics Used to characterize the time context dependency of RSSI signals, where The weight matrix is used to map the bidirectional hidden states to the temporal feature space. This is the corresponding bias vector.
[0049] The model takes a fixed-length RSSI sequence as input, and the bidirectional GRU extracts contextual dependency information from both the preceding and following directions of the sequence, so that the output features at each time step can integrate the historical and future signal change trends.
[0050] Step 4.3 This invention concatenates spatial and temporal features along the feature dimension to form a spatiotemporal joint representation. This structure first uses 1D-CNN to extract the local correlation of RSSI signals in the spatial dimension, and then models the temporal context dependency through a bidirectional GRU. Subsequently, spatial and temporal features are concatenated along the channel dimension, and an ECA mechanism is introduced for adaptive weighting to enhance attention to key channels. The fused features are used for multi-task output in building recognition, floor classification, and coordinate regression. To achieve adaptive fusion of spatial and temporal features and construct a more discriminative multi-scale spatiotemporal representation, this invention introduces an ECA mechanism after concatenating spatial and temporal features. The specific calculation method is as follows: This invention concatenates spatial features... With time characteristics splicing along the channel dimension:
[0051]
[0052] Subsequently, an ECA channel attention mechanism is introduced to perform weighted fusion of the spliced features:
[0053]
[0054]
[0055] Where Conv1D is a one-dimensional convolution based on the channel dimension; For the Sigmoid function; This represents element-wise multiplication through each channel, ultimately yielding the fused spatiotemporal representation:
[0056]
[0057] Step 4.4 In order to effectively train a multi-task model, this invention designs a weighted combination multi-task loss function, which aims to simultaneously optimize building recognition, floor classification and coordinate regression tasks.
[0058] In building recognition tasks, the model uses cross-entropy loss to predict the building ID of each sample. Building recognition is a classification task, and the loss function is optimized by calculating the cross-entropy error between the predicted class and the true class.
[0059]
[0060] in This is a real label; This represents the predicted class probability.
[0061] In floor classification tasks, due to the imbalance of floor labels in the dataset, especially when some floors have fewer samples, the model may tend to predict floors with higher frequency. To alleviate this problem, a weighted cross-entropy loss is introduced into floor classification tasks. This loss adjusts the weights based on the number of samples for each floor category, giving lower-frequency floors a greater influence during training. The loss function is defined as follows:
[0062]
[0063] in The weight of the floor category is calculated in reverse based on the number of samples in each category.
[0064] For coordinate regression tasks, this invention employs a loss function that combines mean absolute error (MAE) and root mean square error (RMSE) to balance positioning accuracy and stability. Specifically, coordinate regression tasks require predicting the latitude and longitude values of a target location; therefore, the loss function is calculated as follows:
[0065]
[0066] in and These are weight hyperparameters; A small constant to prevent gradient explosion.
[0067] The final multi-task loss function is composed of the weighted sum of the losses from the three tasks mentioned above, and is calculated as follows:
[0068]
[0069] in , , These are the loss weights for building recognition, floor classification, and coordinate regression tasks, respectively. By adjusting these hyperparameters, the contributions of each task can be balanced during model training, ensuring that the performance of the main task, coordinate regression, is effectively improved.
[0070] Step 5.1 The model is trained end-to-end using a multi-task loss function. A loss weighting strategy is introduced to balance the contributions of different tasks through task weights, avoiding gradient shifts or imbalances in dominant tasks during training. The Adam optimizer is selected, and the learning rate is dynamically adjusted to improve convergence efficiency and generalization ability. An early stopping mechanism is implemented during training to prevent overfitting. The final model achieves good results on the validation set and is used for subsequent evaluation and visualization analysis.
Claims
1. A fingerprint indoor positioning method based on WiFi signals, characterized in that, Includes the following steps: Step 1: Preprocess the raw WiFi Received Signal Strength Indicator (RSSI) signal data; standardize the RSSI values of each WiFi access point (AP) by Z-score standardization, and reconstruct the RSSI feature vector using a denoising autoencoder (DAE) to improve signal stability and anti-interference capability. Step 2: To address the issue of imbalanced floor or category samples, RSSI-enhanced samples are generated based on Generative Adversarial Network (GAN), and K-means clustering is used to give the synthetic samples reasonable spatial coordinate labels. Step 3: Construct a spatiotemporal feature extraction structure consisting of a one-dimensional convolutional neural network (1D-CNN) and a bidirectional gated recurrent unit (Bi-GRU), and combine it with an efficient channel attention (ECA) mechanism to receive RSSI time series features; Step 4: Input the aggregated feature vector into the multi-task learning framework to complete the building classification, floor classification and coordinate regression tasks respectively; Step 5: Based on the multi-task loss function synthesis weighted combination algorithm, jointly optimize the synchronization between tasks to improve the overall accuracy of the model; Step 6: During training, the exponential moving average (EMA) is used to stabilize the optimization process, a flooding mechanism is introduced to prevent overfitting, and an early stopping mechanism is combined to avoid overtraining.
2. As described in claim 1, characterized in that, The raw WiFi RSSI signal data is preprocessed, including replacing missing values (recorded as 100 dBm) with -104 dBm; and standardizing the RSSI values of each AP channel by Z-score standardization.
3. As described in claim 1, characterized in that, The denoising process uses a DAE to reconstruct the standardized WiFi RSSI feature vector to suppress interference caused by RSSI signal fluctuations. The DAE consists of an encoder and a decoder with a symmetrical structure, and its training objective is to minimize the mean square error between the input and the reconstructed output.
4. As described in claim 1, characterized in that, The enhanced samples are generated using GAN, including: (1) Train the generator and discriminator so that the generator generates samples that approximate the true RSSI distribution; During training, the generator and discriminator are optimized through adversarial learning. The goal is to make the generator continuously generate samples that closely approximate the true distribution, making it impossible for the discriminator to accurately distinguish between real and fake samples. and Let represent the loss functions of the discriminator and generator, respectively, and calculate them as follows: ; ; D(x) is the probability predicted by the discriminator for the real sample x; G(z) is the sample generated by the generator for the noise z; m is the batch size; (2) Assign spatial coordinate labels to the generated samples based on clustering methods; K-means clustering was used to divide the real samples from a specific floor into K clusters (K≥2). Then, the mean and standard deviation of the latitude and longitude coordinates were calculated in each cluster. Latitude and longitude coordinates were sampled from a normal distribution as spatial labels for the synthesized RSSI samples. The calculation method is as follows: ; ; in, and The longitude and latitude coordinates of the generated synthetic sample; and For the first i The mean of the longitude and latitude of the real samples in each cluster; and For the first i The method uses the standard deviation of longitude and latitude of real samples in each cluster to distribute generated samples near the cluster center, simulating location changes in a real scene.
5. As described in claim 1, characterized in that, The deep neural network model includes: (1) A one-dimensional convolutional neural network is used to extract local spatial features of RSSI data; The calculation method is as follows: ; in, Indicates the first i Feature maps after convolutional operations. , and They represent the first i The weights and biases of the convolutional layers are then used to obtain the spatial feature representation through global average pooling. ; in, This represents the final spatial feature vector. , used to characterize the t The local correlation and overall spatial distribution pattern of RSSI signals at each time step, GAP refers to Global Average Pooling. (2) Bidirectional gated cyclic unit, used to model RSSI time series features; Bi-GRU consists of a forward GRU and a backward GRU, which capture the forward and backward dependencies of a sequence, respectively. For the input sequence... The calculation method for its time feature extraction process is as follows: ; ; in, and These are the hidden states of the forward and reverse GRU, respectively. The bidirectional hidden states are concatenated and mapped to a unified dimension: ; Obtaining time characteristics Used to characterize the time context dependency of RSSI signals, where The weight matrix is used to map the bidirectional hidden states to the temporal feature space. This is the corresponding bias vector; (3) An efficient channel attention mechanism is used to adjust the importance weights of features in each channel; To achieve adaptive fusion of spatial and temporal features and construct a more discriminative multi-scale spatiotemporal representation, this invention introduces an ECA mechanism after splicing spatial and temporal features. The specific calculation method is as follows: This invention combines spatial features... With time characteristics splicing along the channel dimension: ; Subsequently, an ECA channel attention mechanism is introduced to perform weighted fusion of the spliced features: ; ; Where Conv1D is a one-dimensional convolution based on the channel dimension; For the Sigmoid function; This represents element-wise multiplication through each channel, ultimately yielding the fused spatiotemporal representation: 。 6. As described in claim 1, characterized in that, The neural network model includes a multi-task prediction module, which outputs building category, floor category and spatial coordinate position respectively. The classification task output uses the Softmax function, and the coordinate prediction uses linear output.
7. As described in claim 1, characterized in that, The multi-task loss function is a weighted combination of building classification loss, floor classification loss, and coordinate regression loss. The loss functions for buildings, floors, and coordinates are calculated as follows: ; ; ; in This is a real label; The predicted class probability; Weights for floor categories; and These are weight hyperparameters; A small constant to prevent gradient explosion; The multi-task loss function is composed of a weighted average of the losses from the three tasks mentioned above, and is calculated as follows: ; in and The weighted cross-entropy loss; The average positioning error of the regression task; , , These are the loss weights for the building recognition, floor classification, and coordinate regression tasks, respectively.
8. As described in claim 1, characterized in that, The following optimization strategies are employed during training to improve model performance and stability: (1) Update model parameters using the exponential moving average (EMA); (2) The Flooding mechanism controls the fluctuation range of the loss function; (3) Label smoothing mechanism alleviates overfitting; (4) Dynamic learning rate adjustment and early stop mechanism control training progress.
Citation Information
Cited By
Depth filtering positioning system, method and device for realizing multi-epoch multipath signal assistance, processor and readable storage medium thereof
CN121677730A
