WiFi fingerprint indoor positioning method based on multi-modal simulation migration and confidence adaptive weighting

CN122994722APending Publication Date: 2026-10-27GUILIN UNIV OF AEROSPACE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611359939.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-03
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0006]鉴于以上内容,有必要提供一种基于多模态仿真迁移与置信度自适应加权的WiFi指纹室内定位方法,该方法依托三维混合射线追踪批量生成多模态仿真指纹,搭配对抗域适应完成仿真-真实分布对齐,仅需少量现场采集数据,大幅降低指纹库人工采集成本,并能解决仿真指纹库样本可信度不均导致的模型偏差问题

Benefits of technology

[0088]1、大幅降低指纹库构建成本:通过仿真生成替代大部分人工采集,仅需20%左右的真实样本即可达到接近全量采集的定位精度,显著减少现场采集的人力与时间投入。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994722A_ABST
    Figure CN122994722A_ABST
Patent Text Reader

Abstract

The application provides a WiFi fingerprint indoor positioning method based on multi-modal simulation migration and confidence adaptive weighting, comprising: constructing and preprocessing a real WiFi multi-modal fingerprint library; generating a multi-modal simulation fingerprint based on three-dimensional scene modeling and a hybrid ray tracing algorithm; realizing simulation-real cross-domain migration through an adversarial domain adaptive network; constructing a DWAKNN model based on AP-modal two-dimensional adaptive weighting; constructing a DCWLightGBM regression model based on domain confidence-space confidence double-driven weighting; dynamically fusing coordinates of the DWAKNN model and the DCWLightGBM model; selecting optimal model hyperparameters according to calculation evaluation indexes; deploying the best positioning model and outputting positioning coordinates. The DWAKNN model proposed in the method introduces domain bias weights of modal dimensions on the basis of AP space confidence, improves the accuracy of neighborhood screening and the reliability of preliminary positioning, and the DCWLightGBM regression model proposed deeply embeds sample-level dynamic confidence weights into the core calculation link of the model, and solves the model bias problem caused by uneven sample reliability of the simulation fingerprint library.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of indoor positioning technology, and in particular to a WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting. Background Technology

[0002] With the rapid development of wireless communication technology and mobile internet, indoor positioning technology has been widely used in various fields such as shopping mall navigation, smart warehousing, elderly care monitoring, and emergency rescue. Traditional satellite positioning systems cannot provide stable and accurate positioning services in indoor environments due to wall obstruction and multipath effects. Therefore, indoor positioning technology has become a research focus, among which WiFi fingerprint positioning is widely used because it can utilize existing WiFi network infrastructure, requires no additional hardware deployment, and is inexpensive.

[0003] However, WiFi fingerprint positioning technology faces the challenge of high costs when building fingerprint databases offline. Traditional fingerprint collection requires manual point-by-point traversal of the positioning area, which is time-consuming, labor-intensive, and difficult to cover the entire space, especially in large indoor scenarios where collection costs increase significantly. In contrast, domain-adaptive transfer learning methods, by transferring knowledge from the simulated domain to the real domain, improve positioning performance while reducing collection workload, demonstrating significant application potential. Among them, the staged transfer method, which combines simulation generation with domain alignment, can balance data scale and distribution realism, effectively reducing fingerprint construction costs.

[0004] Furthermore, during the online phase, existing WiFi fingerprinting methods mostly employ traditional single models, which struggle to cope with the multiple challenges posed by dynamic signal changes, heterogeneous devices, and spatial complexity in indoor environments. Although accuracy can be improved through parameter adjustments or fingerprint database processing, single-model structures suffer from significant structural uncertainty and limited generalization ability. The K-nearest neighbors (KNN)-lightweight gradient boosting machine (LightGBM) fusion model utilizes KNN for local search and data processing while leveraging the advantages of LightGBM for global modeling and efficient computation, ultimately achieving a more accurate, stable, efficient, and generalized indoor positioning method. However, existing KNN-LightGBM joint models still have two significant shortcomings: First, in the KNN model's domain selection and coordinate calculation, the input fingerprint data is either not weighted by confidence or only weighted in a single dimension. It does not dynamically adjust the confidence weights of multimodal features based on the alignment between the simulation and real domains, resulting in high- and low-quality access points (APs) participating in the calculation equally with modal features, leading to severe noise interference. Secondly, the LightGBM model treats all training samples equally, while the domain alignment and spatial stability of different samples in the simulated transfer fingerprint database vary. Low-confidence simulation samples can interfere with model fitting and limit further improvement in localization accuracy, resulting in a limited overall performance ceiling for the model.

[0005] In summary, the core challenges that urgently need to be overcome in current WiFi fingerprint localization are how to leverage the cost-saving and efficiency-enhancing advantages of simulation transfer while improving the alignment effect between the simulation and real domains, and how to achieve adaptive weighting of the confidence of each multimodal fingerprint data input to the KNN-LightGBM model to balance positioning accuracy and computational efficiency. Summary of the Invention

[0006] In view of the above, it is necessary to provide a WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting. This method relies on three-dimensional hybrid ray tracing to generate multimodal simulated fingerprints in batches, and combines it with adversarial domain adaptation to complete the simulation-real distribution alignment. It requires only a small amount of on-site data collection, which greatly reduces the cost of manual collection of fingerprint databases, and can solve the model bias problem caused by uneven confidence of simulated fingerprint database samples.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0008] The WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence-adaptive weighting includes the following steps:

[0009] S101: Building and preprocessing a real-world WiFi multimodal fingerprint database

[0010] Multiple access points (APs) are deployed within the positioning area and grid reference points are divided at equal intervals. Multimodal fingerprint information of each AP is collected at some grid reference points, and a small-scale real WiFi multimodal fingerprint database is constructed based on this. At the same time, the real multimodal fingerprint data in the real WiFi multimodal fingerprint database is preprocessed.

[0011] S102: Generating Multimodal Simulation Fingerprints Based on 3D Scene Modeling and Hybrid Ray Tracing Algorithm

[0012] A three-dimensional wireless propagation simulation model is built based on the structural information of the indoor area to be located; a hybrid ray tracing algorithm is used to simulate the propagation path of the signal, and simulated multimodal fingerprint data is generated in batches at reference points set throughout the positioning area;

[0013] S103: Simulation of Adversarial Domain Adaptive Network Implementation - Real Cross-Domain Migration

[0014] Using the simulated multimodal fingerprint data from step S102 as the source domain and a small amount of real multimodal fingerprint data from step S101 as the target domain, an adversarial domain adaptation network with a gradient inversion layer (GRL) is constructed to achieve the alignment migration of simulated fingerprints to the real domain distribution, thus obtaining the migrated multimodal fingerprint database.

[0015] S104: Constructing a DWAKNN model based on AP-modal dual-dimensional adaptive weighting

[0016] For the multimodal fingerprint database obtained after migration in step S103, a two-layer confidence weight is calculated from both the AP spatial dimension and the modal domain deviation dimension. Finally, the two-dimensional confidence weight matrix is ​​generated per AP and per modality. Based on this weight matrix, a DWAKNN localization model is constructed to complete the screening of neighborhood samples and the calculation of preliminary localization coordinates.

[0017] S105: Constructing a DCWLightGBM regression model based on a dual-driven weighted approach of domain confidence and spatial confidence.

[0018] The core mechanism of LightGBM is improved from the perspective of sample confidence. The dual-confidence sample weights, consisting of domain alignment confidence and spatial neighborhood confidence, are deeply embedded into the loss function, node splitting criterion, and leaf output calculation of the LightGBM prediction model, achieving full-link confidence weighting. Based on the neighborhood samples selected by the DWAKNN localization model in step S104, refined nonlinear fitting is performed. After the model training is complete, the multimodal features of the samples to be localized are input, and the predicted coordinates of the DCWLightGBM regression model are finally output. ;

[0019] S106: Dynamic coordinate fusion of DWAKNN model and DCWLightGBM regression model

[0020] The fusion coefficient is dynamically calculated by combining the local signal fluctuation factor and the modal domain deviation factor. Based on fusion coefficient The initial positioning coordinates output by the DWAKNN positioning model The predicted coordinates output by the DCWLightGBM regression model The coordinates are merged to obtain the merged positioning coordinates;

[0021] S107: Calculate evaluation indicators and select the optimal model hyperparameters

[0022] Calculate the evaluation index, and determine the optimal parameters of the DWAKNN localization model in step S104 and the optimal parameters of the DCWLightGBM regression model in step S105 based on the evaluation index.

[0023] S108: Optimal Positioning Model Deployment and Positioning Coordinate Output

[0024] The three-dimensional wireless propagation simulation module in step S102, the adversarial domain migration module composed of the adversarial domain adaptation network in step S103, and the DWAKNN-DCWLightGBM fusion positioning module composed of steps S104-S106 are integrated into a complete WiFi positioning system. The simulated multimodal fingerprint database generated in steps S101 to S103 is input into the positioning system, and the positioning system outputs the final indoor two-dimensional positioning coordinates.

[0025] Furthermore, in step S103, the adversarial domain adaptation network mainly consists of three parts: a feature mapper, a domain discriminator, and a task regressor. The feature mapper uses a fully connected layer and a batch normalization structure to map the features of simulated multimodal fingerprints and a small number of real multimodal fingerprints to a transfer feature space of the same dimension, so as to ensure that the dimension of the transferred fingerprint is consistent with the dimension of the original AP. The domain discriminator uses a three-layer fully connected discriminator network, which forms an adversarial relationship with the feature mapper through a gradient inversion layer (GRL), and its goal is to distinguish between source domain and target domain samples. The task regressor uses a two-layer fully connected regression network, which uses the real coordinates corresponding to the input samples as supervision labels to ensure that the features retain spatial location information during the domain alignment process.

[0026] GRL is introduced between the feature mapper and the domain discriminator and is the core component for adversarial training in adversarial domain adaptation networks. During forward propagation, GRL performs an identity mapping, directly passing the feature vector output by the feature mapper to the domain discriminator without modification. During backpropagation to update parameters, it automatically multiplies the gradient from the domain discriminator by a negative adaptive tradeoff coefficient to reverse the gradient direction.

[0027] Furthermore, in step S103, the adversarial domain adaptation network is trained using a mini-batch gradient descent method. Each batch of training data contains an equal number of simulated fingerprints and real fingerprint samples. Through a complete iteration of forward propagation to calculate the loss and backpropagation to update the parameters, the simulated fingerprints are gradually migrated to the real domain distribution.

[0028] 1) Forward propagation computation stage: Simulated fingerprints and real fingerprints from the training batch are simultaneously input into the feature mapper, which outputs two corresponding high-dimensional transfer features. The first part of the high-dimensional transfer features is directly fed into the task regressor to calculate the coordinate prediction values ​​of the simulated samples and real samples respectively. The mean square error is calculated by combining the coordinate ground values ​​to obtain the task regression loss. The second part of the high-dimensional transfer features is fed into the domain discriminator after passing through GRL, which outputs the domain classification probability of each sample. The binary cross-entropy is calculated by combining the preset domain labels to obtain the domain discrimination loss.

[0029] 2) Backpropagation parameter update stage: The task regression loss and the domain discrimination loss are weighted and summed to obtain the total loss, and the gradient is backpropagated along the network; when the gradient flows through the GRL, the gradient of the domain discrimination branch is automatically multiplied by a negative adaptive coefficient before being passed into the feature mapper.

[0030] Furthermore, in step S104, the spatial confidence score of the AP spatial dimension is calculated using the following method:

[0031] The confidence weights of each AP are calculated from three indicators: spatial discrimination, temporal stability, and spatial coverage uniformity. Spatial discrimination is measured by information entropy, temporal stability is measured by the standard deviation of signals sampled multiple times at the same location, and spatial coverage uniformity is measured by the spatial coverage correction coefficient.

[0032] 1) Information entropy of the i-th AP The calculation method is shown in formula (3):

[0033] (3)

[0034] In the formula, Let B be the probability density of the b-th RSSI intensity interval of the i-th AP, and B be the total number of RSSI intensity intervals (total number of boxes).

[0035] 2) Time stability of the i-th AP The calculation method is shown in formula (4):

[0036] (4)

[0037] In the formula, Let be the standard deviation of the signal of the i-th AP. These are normalized baseline parameters;

[0038] 3) Spatial coverage uniformity of the i-th AP The calculation method is shown in formula (5):

[0039] (5)

[0040] In the formula, Let be the standard deviation of the coverage rate of the i-th AP in each sub-region. This represents the maximum standard deviation of all AP coverage.

[0041] 4) The spatial confidence adaptive weights of the i-th AP are: The calculation method is shown in formulas (6) and (7):

[0042] (6)

[0043] (7)

[0044] In the formula, The maximum value of the information entropy of all APs. These are the weighted fusion coefficients for three dimensions: spatial distinguishability, temporal stability, and coverage uniformity.

[0045] Furthermore, in step S104, the domain bias confidence score of the modal dimension is calculated using the following method:

[0046] Based on the training results of the adversarial domain adaptation network in step S103, the simulation-real domain alignment degree is quantified for the multi-modal features of the fingerprint data, and this is used as the basis for calculating the modal confidence, constituting the weights at the modal level; specifically,

[0047] First, single-modal domain bias quantization is performed. After the adversarial domain adaptation network is trained, the independent features of each modality are extracted and input into the trained domain discriminator to calculate the average domain discrimination loss between the simulated sample and the real sample in that modality.

[0048] Subsequently, modal confidence mapping is performed, and the single-modal domain discrimination loss is mapped to modal confidence weights in the interval [0,1] through an exponential decay function;

[0049] Next, the weights of the three modes are normalized.

[0050] Furthermore, in step S104, the fused two-dimensional confidence weight matrix is ​​obtained through the following method:

[0051] The outer product of the spatial weight vector of the AP spatial dimension and the domain bias weight vector of the modality dimension is calculated to obtain... Two-dimensional confidence weight matrix The calculation method is shown in formula (11):

[0052] (11)

[0053] The element in the i-th row and m-th column of the weight matrix is:

[0054] (12)

[0055] Formula (12) represents the contribution of the m-th modal feature of the i-th AP to localization matching.

[0056] Furthermore, in step S104, the neighborhood sample selection is achieved in the following way:

[0057] Based on the two-dimensional confidence weight matrix, a double-weighted Euclidean distance is constructed. Specifically, the multimodal feature vector to be located is collected in real time by the online terminal, and the distance between the nth reference point and the sample to be located is calculated by formula (13):

[0058] (13)

[0059] In the formula, Let be the feature value of the i-th AP and the m-th mode in the sample to be located. The migration feature value corresponding to the nth reference point;

[0060] The top K reference points are selected in ascending order based on double-weighted Euclidean distance to construct a local neighborhood sample subset. .

[0061] Furthermore, in step S104, the preliminary positioning coordinates are obtained in the following way:

[0062] By using the coordinates of the K neighboring samples of the selected sample to be located, the inverse distance weighted centroid is calculated to obtain the preliminary localization coordinates of the DWAKNN model. The x-coordinate is calculated using equation (14):

[0063] (14)

[0064] In the formula, Let x be the true value of the x-coordinate of the nth neighboring reference point. To prevent the smoothing constant from having a denominator of 0; similarly, preliminary positioning coordinates are obtained. The ordinate.

[0065] Furthermore, in step S105, the construction of the DCWLightGBM regression model includes the following aspects:

[0066] 1) Single-sample double confidence quantification

[0067] The total confidence weight at the sample level is calculated for each reference point sample in the multimodal fingerprint database obtained after the transfer in step S103. This total confidence weight at the sample level is obtained by fusing the domain alignment confidence and the spatial neighborhood confidence. The domain alignment confidence is derived from the domain discriminator trained in step S103 and is the domain classification probability output by the transfer feature of the nth reference point. The spatial neighborhood confidence is obtained by calculating the average feature distance between the nth reference point and its neighboring samples obtained in step S104. The domain alignment confidence and the spatial neighborhood confidence are multiplied together and then globally normalized to obtain the total confidence weight at the sample level.

[0068] 2) Loss function with embedded sample weights

[0069] The total confidence weight at the sample level is introduced into the quantile loss function, and the weighted quantile loss is used as the training objective of the DCWLightGBM model; the weighted quantile loss function is calculated by equation (19):

[0070] (19)

[0071] In the formula, The number of training samples, For the true coordinates, Predict coordinates for the DCWLightGBM model. The quantile loss function, is the quantile coefficient; Equation (19) is the loss function calculated for the X-axis coordinate, and the loss function for the Y-axis coordinate is obtained in the same way;

[0072] 3) Weighted node splitting criterion and leaf output optimization

[0073] The sample-level total confidence weight is embedded into the histogram split gain calculation and leaf node output calculation of the DCWLightGBM regression model to achieve full-link weighting from loss to tree structure;

[0074] The formula for calculating the split gain for candidate split points is as follows:

[0075] (20)

[0076] In the formula, , These represent the first and second gradients of the weighted quantile loss function with respect to the predicted values, respectively. The subscripts L and R correspond to the left and right child nodes after the split, respectively, and All corresponds to the parent node before the split. The regularization coefficient is used.

[0077] The final predicted value for each leaf node is calculated using the weighted method of equation (21):

[0078] (twenty one)

[0079] In the formula, leaf represents the leaf node currently performing output prediction. This represents the predicted value of the X-axis coordinate, while the predicted value of the Y-axis coordinate is obtained in the same way as the predicted value of the X-axis coordinate.

[0080] Furthermore, in step S106, the dynamic fusion coefficient The result is obtained by calculation using equation (22):

[0081] (twenty two)

[0082] In the formula, The standard deviation of the signal within the neighborhood. The standard deviation is the normalized benchmark value. This represents the average confidence level of all modes corresponding to the current point to be located. This is the adjustment coefficient;

[0083] Based on the above fusion coefficients, the fused positioning coordinates are calculated using equation (23):

[0084] (twenty three)

[0085] In the formula, x km and y km Constructing preliminary positioning coordinates x lgb and y lgb Constructing predicted coordinates .

[0086] This invention provides a WiFi fingerprint indoor positioning method based on multimodal simulation migration and confidence-adaptive weighting. The method first deploys multiple access points (APs) and receiving terminals within the positioning area to collect a small amount of real fingerprint data. Simultaneously, it generates simulated fingerprints covering the entire area in batches using 3D scene modeling and ray tracing algorithms. Next, an adversarial domain adaptation network (GRL) embedded with GRL is used to align the simulated data with the feature distribution of the real environment, eliminating the inherent domain offset bias between simulated and measured data, resulting in a calibrated migration fingerprint database. This significantly improves the usability of the simulated fingerprints with only a small number of real samples. For the simulated migration fingerprint database, the AP spatial confidence weight and the signal modal domain bias confidence weight are calculated to construct a two-layer two-dimensional confidence weight matrix. Then, a DWAKNN (Dual Weight Adaptive K-nearest neighbors) algorithm is used. The DWAKNN localization model uses a two-layer confidence weight matrix to calculate the weighted feature distance between the test sample and the migration fingerprint database, selects the K nearest neighbor samples with the best matching degree, and obtains the preliminary reference coordinates with strong spatial continuity by calculating the centroid of the distance inverse. Then, the training set is divided into the global migration fingerprint dataset. The training subset containing the K nearest neighbor samples initially selected by the DWAKNN localization model is used to train the DCWLightGBM (Dual Confidence Weighted Light Gradient Boosting Machine) regression model with sample dual confidence weights. The weighted loss function and weighted tree splitting rules are used to mine the complex nonlinear mapping relationship between wireless signals and spatial coordinates, and output high-precision predicted coordinates. Finally, the prediction results of the two models are dynamically fused to obtain the final localization coordinates.

[0087] Therefore, compared with the prior art, the present invention has the following beneficial effects:

[0088] 1. Significantly reduce the cost of building a fingerprint database: By replacing most of the manual collection with simulation generation, only about 20% of real samples are needed to achieve positioning accuracy close to that of full collection, significantly reducing the manpower and time investment in on-site collection.

[0089] 2. Effectively eliminate the difference between the simulation and real domains: The adversarial domain adaptation mechanism based on the GRL mechanism makes the simulated fingerprint approximate the real fingerprint in terms of feature distribution, which solves the problem of large positioning error when directly using simulated fingerprints.

[0090] 3. The DWAKNN-DCWLightGBM fusion localization model significantly improves localization accuracy: The DWAKNN model introduces modal dimension domain bias weights on top of AP spatial confidence, improving the accuracy of neighborhood screening and the reliability of preliminary localization, suppressing interference from low-quality features, and improving the accuracy of matching and modeling. The DCWLightGBM regression model deeply embeds sample-level dynamic confidence weights into the core calculation process of the model, solving the model bias problem caused by uneven confidence of simulated fingerprint samples, and strengthening the model's ability to fit high-confidence samples. In other words, the DWAKNN localization model has extremely strong spatial constraints and continuous and stable localization results, while the DCWLightGBM regression model has strong nonlinear fitting ability and a high upper limit of localization accuracy. The adaptive dynamic combination of the advantages of the two models achieves higher accuracy and more stable localization.

[0091] In summary, this application can effectively solve the problems of high collection cost and weak environmental adaptability in indoor WiFi fingerprint positioning. It can significantly reduce the workload of manual collection while maintaining high positioning accuracy and robustness, and is suitable for various indoor positioning scenarios such as large shopping malls, warehouses, and office buildings. Attached Figure Description

[0092] Figure 1 This is a flowchart of the present invention.

[0093] Figure 2 A schematic diagram comparing the localization RMSE of the DWAKNN-DCWLightGBM model under different K values;

[0094] Figure 3 A schematic diagram comparing the positioning errors of different positioning methods and the WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting provided in this application;

[0095] Figure 4 A schematic diagram comparing the RMSE of different positioning methods and the WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting provided in this application during positioning.

[0096] Figure 5 A comparative diagram showing the mean absolute error (MAE) of different positioning methods and the WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting provided in this application.

[0097] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0098] Please see Figures 1 to 5In a preferred embodiment of the present invention, the WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting includes the following steps:

[0099] S101: Building and preprocessing a real-world WiFi multimodal fingerprint database

[0100] Select an indoor area to be located, deploy multiple access points (APs) and divide the area into grid reference points at equal intervals. Collect multimodal fingerprint information of each AP at some of the grid reference points, and build a small-scale real WiFi multimodal fingerprint database based on this. At the same time, preprocess the real multimodal fingerprint data in the real WiFi multimodal fingerprint database.

[0101] In this step, the preprocessing specifically involves normalizing the real multimodal fingerprint data, linearly mapping it to the unified interval [0,1] to eliminate the magnitude difference in the intensity of different AP signals, ensure the consistency of feature scale, and provide standardized input for subsequent domain transfer model training and localization matching.

[0102] S102: Generating Multimodal Simulation Fingerprints Based on 3D Scene Modeling and Hybrid Ray Tracing Algorithm

[0103] A three-dimensional wireless propagation simulation model is built based on the structural information of the indoor area to be located. Specifically, the CAD drawing of the indoor area to be located is drawn, and the geometric dimensions and electromagnetic material parameters of the walls, doors, windows, and cabinets are extracted. The electromagnetic material parameters include dielectric constant, penetration loss, and reflection coefficient. Based on this, a three-dimensional wireless propagation simulation model is built. A hybrid ray tracing algorithm is used to simulate the signal propagation path, which includes direct, reflected, diffracted, and transmitted paths. Simulated multimodal fingerprint data is generated in batches at the reference points set in the entire indoor area to be located in step S101.

[0104] In this step, the hybrid ray tracing algorithm combines geometric optics and uniform diffraction theory to calculate the signal characteristics of each AP point by point, thereby generating a simulated fingerprint database covering the entire area under low-cost manual acquisition conditions. The basic path loss calculation method for ray tracing is shown in formula (1):

[0105] (1)

[0106] In the formula, For reference distance Path loss at the location, This is the path loss index. The distance between the transmitting and receiving ends, For log-normal shadowing fading, For wall penetration loss;

[0107] In this invention, a single multimodal fingerprint contains three complementary features: Received Signal Strength Indicator (RSSI), Channel State Information Phase (CSIPhase), and Channel Impulse Response (CIR), along with the true coordinates of the reference point. By introducing multimodal features, this invention enriches the fingerprint's discriminative power and provides more comprehensive feature information for subsequent domain migration.

[0108] S103: Simulation of Adversarial Domain Adaptive Network Implementation - Real Cross-Domain Migration

[0109] Using the simulated multimodal fingerprint data from step S102 as the source domain and a small amount of real multimodal fingerprint data from step S101 as the target domain, an adversarial domain adaptation network with a gradient inversion layer (GRL) is constructed to achieve the alignment and migration of simulated fingerprints to the real domain distribution, resulting in a migrated multimodal fingerprint database.

[0110] In this step, the adversarial domain adaptation network mainly consists of three parts: a feature mapper, a domain discriminator, and a task regressor.

[0111] The feature mapper, the first part of the adversarial domain adaptation network, adopts a fully connected layer and batch normalization structure to map the features of simulated multimodal fingerprints and a small number of real multimodal fingerprints to the same dimension of the transfer feature space. This ensures that the dimension of the transferred fingerprint is consistent with the dimension of the original AP, which facilitates subsequent confidence-weighted matching.

[0112] The domain discriminator is the second part of the adversarial domain adaptation network. It adopts a three-layer fully connected discriminator network and forms an adversarial relationship with the feature mapper through the gradient inversion layer (GRL). Its goal is to distinguish between source domain and target domain samples.

[0113] The task regressor is the third part of the adversarial domain adaptation network. It adopts a two-layer fully connected regression network and uses the real coordinates corresponding to the input samples as supervision labels to ensure that the features retain spatial location information during the domain alignment process, thus avoiding the problem of "distribution alignment but localization failure".

[0114] GRL, introduced between the feature mapper and the domain discriminator, is a core component for adversarial training in adversarial domain adaptation networks. During forward propagation, GRL performs an identity mapping, directly passing the feature vector output from the feature mapper to the domain discriminator without modification. During backpropagation parameter updates, it automatically multiplies the gradient from the domain discriminator by a negative adaptive tradeoff coefficient, reversing the gradient direction. This creates an adversarial game between the feature mapper and the domain discriminator during parameter updates.

[0115] In this invention, the adversarial domain adaptation network is trained using a mini-batch gradient descent method. Each batch of training data contains an equal number of simulated fingerprints and real fingerprint samples. Through a complete iteration of forward propagation to calculate the loss and backpropagation to update the parameters, the simulated fingerprints are gradually migrated to the real domain distribution.

[0116] 1) Forward propagation computation stage: Simulated fingerprints and real fingerprints from the training batch are simultaneously input into the feature mapper, which outputs two corresponding high-dimensional transfer features. The first part of the high-dimensional transfer features is directly fed into the task regressor to calculate the coordinate prediction values ​​of simulated samples and real samples respectively. The mean square error is calculated by combining the coordinate ground truth values ​​to obtain the task regression loss. The second part of the high-dimensional transfer features is fed into the domain discriminator after passing through GRL, which outputs the domain classification probability of each sample. The binary cross-entropy is calculated by combining the preset domain labels to obtain the domain discriminant loss.

[0117] 2) Backpropagation parameter update stage: The task regression loss and the domain discrimination loss are weighted and summed to obtain the total loss, and the gradient is backpropagated along the network; when the gradient flows through the GRL, the gradient of the domain discrimination branch is automatically multiplied by a negative adaptive coefficient before being passed into the feature mapper.

[0118] Based on the two stages mentioned above, the total loss function for adversarial training is defined as follows: As shown:

[0119] (2)

[0120] In the formula, For the loss of mission return, To determine the loss for the domain, As an adaptive tradeoff coefficient, it increases linearly from 0 to the maximum value with each training iteration, realizing a transfer strategy from easy to difficult.

[0121] In summary, in step S103, the adversarial domain adaptation network of the present invention makes the migration fingerprint output by the feature mapper approximate the real fingerprint in distribution through adversarial training, thereby eliminating the domain difference between the simulated fingerprint and the real fingerprint.

[0122] S104: Constructing a DWAKNN model based on AP-modal dual-dimensional adaptive weighting

[0123] For the multimodal fingerprint database obtained after migration in step S103, two-layer confidence weights are calculated simultaneously from the AP spatial dimension and the modal domain deviation dimension. Finally, these weights are fused to generate a two-dimensional confidence weight matrix per AP and per modality. Based on this weight matrix, a DWAKNN localization model is constructed to complete the screening of neighborhood samples and the calculation of preliminary localization coordinates. This model is an AP-modal dual-dimensional weight fusion, replacing the traditional weighting scheme of single AP equal weight or fixed modal weight.

[0124] This step involves calculating the spatial confidence score of the AP dimension and the domain bias confidence score of the modality dimension, as detailed below:

[0125] 1. Spatial confidence score for the AP dimension is calculated using the following method:

[0126] The confidence weights of each AP are calculated based on three indicators: spatial discrimination, temporal stability, and spatial coverage uniformity. Spatial discrimination is measured using information entropy; a higher entropy value indicates a more uniform spatial distribution of the AP signal and lower discrimination. Temporal stability is measured using the standard deviation of signals sampled multiple times at the same location; a smaller standard deviation indicates a more stable signal and higher confidence. Spatial coverage uniformity is measured using a spatial coverage correction coefficient; the weights are adjusted based on the uniformity of the AP signal coverage grid distribution to reduce the contribution of locally concentrated APs.

[0127] 1) Information entropy of the i-th AP The calculation method is shown in formula (3):

[0128] (3)

[0129] In the formula, Let B be the probability density of the b-th RSSI intensity interval of the i-th AP, and B be the total number of RSSI intensity intervals (total number of boxes).

[0130] 2) Time stability of the i-th AP The calculation method is shown in formula (4):

[0131] (4)

[0132] In the formula, Let be the standard deviation of the signal of the i-th AP. These are normalized baseline parameters;

[0133] 3) Spatial coverage uniformity of the i-th AP The calculation method for (also known as the uniformity of the distribution of the i-th AP signal in the positioning grid) is shown in formula (5):

[0134] (5)

[0135] In the formula, Let be the standard deviation of the coverage rate of the i-th AP in each sub-region. This represents the maximum standard deviation of all AP coverage.

[0136] 4) The spatial confidence adaptive weights of the i-th AP are: The calculation method is shown in formulas (6) and (7):

[0137] (6)

[0138] (7)

[0139] In the formula, The maximum value of the information entropy of all APs. These are the weighted fusion coefficients for three dimensions: spatial distinguishability, temporal stability, and coverage uniformity.

[0140] In the spatial confidence calculation process of the AP dimension mentioned above, three indicators are integrated: spatial discrimination, temporal stability, and spatial coverage uniformity. First, the information entropy of spatial discrimination and temporal stability are combined to obtain the confidence weight of each AP. Then, spatial coverage uniformity is introduced for secondary correction. Finally, the weights are normalized to ensure that the weight sum is 1. The larger the weight, the higher the contribution of the AP in localization matching.

[0141] 2. The confidence score of the domain bias in the modal dimension is calculated using the following method:

[0142] Based on the training results of the adversarial domain adaptation network in step S103, the simulation-real domain alignment degree is quantified for various modal features of the fingerprint data, such as RSSI, CSI, and CIR. This is used as the basis for calculating modal confidence and constitutes the weights at the modal level. Specifically,

[0143] First, single-modal domain bias quantization is performed. After the adversarial domain adaptation network is trained, independent features of each modality are extracted and input into the trained domain discriminator to calculate the average domain discrimination loss between the simulated sample and the real sample in that modality. In this invention, the domain bias loss of the m-th modality is calculated as shown in equation (8):

[0144] (8)

[0145] In the formula, , These represent the number of simulated samples in the source domain and the number of real samples in the target domain, respectively. The output probability of the domain discriminator. , These are the features of the nth simulated sample and the real sample in the mth modality, respectively. The smaller the domain discrimination loss, the smaller the difference between the simulated and real distributions in that modality, and the higher the credibility of the simulation data.

[0146] Subsequently, modal confidence mapping is performed, mapping the single-modal domain discrimination loss to modal confidence weights in the interval [0,1] using an exponential decay function. In this invention, the modal confidence weights for the m-th modality are shown in equation (9):

[0147] (9)

[0148] In the formula, This represents the maximum value of the domain discrimination loss for the three modalities.

[0149] Next, the weights of the three modes are normalized. Specifically, the following condition formula (10) must be satisfied:

[0150] (10)

[0151] In the formula, M represents the total number of modes.

[0152] In this invention, the two-dimensional confidence weight matrix obtained in step S104 is obtained through the following method:

[0153] The outer product of the spatial weight vector of the AP dimension and the domain bias weight vector of the modality dimension is calculated to obtain... Two-dimensional confidence weight matrix The calculation method is shown in formula (11):

[0154] (11)

[0155] The element in the i-th row and m-th column of the weight matrix is:

[0156] (12)

[0157] formula The element represents the contribution of the m-th modality feature of the i-th AP to localization matching. High-confidence modalities of high-discrimination APs receive high weights, while low-confidence modalities of low-discrimination APs are significantly suppressed.

[0158] In this invention, the neighborhood sample screening in step S104 is achieved in the following manner:

[0159] Based on the two-dimensional confidence weight matrix, a double-weighted Euclidean distance is constructed. Specifically, the multimodal feature vector to be located is collected in real time by the online terminal, and the distance between the nth reference point and the sample to be located is calculated by formula (13):

[0160] (13)

[0161] In the formula, Let be the feature value of the i-th AP and the m-th mode in the sample to be located. The migration feature value corresponding to the nth reference point;

[0162] The top K reference points are selected in ascending order based on double-weighted distance to construct a local neighborhood sample subset. .

[0163] In this step, a double-weighted Euclidean distance is constructed based on a two-dimensional confidence weight matrix as the similarity metric for the DWAKNN localization model. This allows the similarity calculation to better reflect the actual credibility of the features. By using a double-weighted distance metric, the contribution of high-credibility features to the similarity calculation is amplified, while the influence of low-quality noise features is suppressed. This results in a subset of local neighborhood samples that filters out globally irrelevant reference points, enabling the selection of nearest neighbor samples with better spatial matching and higher feature credibility. This fundamentally improves the quality of neighborhood samples and avoids the neighborhood selection bias caused by noise features, which is easily influenced by traditional KNN.

[0164] In this invention, the preliminary positioning coordinates in step S104 are obtained in the following manner:

[0165] By using the coordinates of the K neighboring samples of the selected sample to be located, the inverse distance weighted centroid is calculated to obtain the preliminary positioning coordinates of the DWAKNN positioning model. The x-coordinate is calculated using equation (14):

[0166] (14)

[0167] In the formula, Let x be the true value of the x-coordinate of the nth neighboring reference point. To prevent the smoothing constant from having a denominator of 0; similarly, preliminary positioning coordinates are obtained. The ordinate.

[0168] In summary, in step S104 of the present invention, the DWAKNN localization model can not only output a high-quality subset of neighborhood samples, reducing the input size and computational load for the subsequent DCWLightGBM regression model, but its own output of preliminary coordinates also has strong spatial continuity and reliability.

[0169] S105: Constructing a DCWLightGBM regression model based on a dual-driven weighted approach of domain confidence and spatial confidence.

[0170] The core mechanism of LightGBM is improved from the perspective of sample confidence. The dual-confidence sample weights, consisting of domain alignment confidence and spatial neighborhood confidence, are deeply embedded into the loss function, node splitting criterion, and leaf output calculation of the LightGBM prediction model, achieving full-link confidence weighting. Based on the neighborhood samples selected by the DWAKNN localization model in step S104, refined nonlinear fitting is performed. After the model training is complete, the multimodal features of the samples to be localized are input, and the predicted coordinates of the DCWLightGBM regression model are finally output. .

[0171] In step S105, the construction of the DCWLightGBM regression model includes the following aspects:

[0172] 1) Single-sample double confidence quantification

[0173] The total confidence weight at the sample level is calculated for each reference point sample in the multimodal fingerprint database obtained after the transfer in step S103. This total confidence weight at the sample level is obtained by fusing the domain alignment confidence and the spatial neighborhood confidence. The domain alignment confidence is derived from the domain discriminator trained in step S103 and is the domain classification probability output by the transfer feature of the nth reference point. The spatial neighborhood confidence is obtained by calculating the average feature distance between the nth reference point and its neighboring samples obtained in step S104. The domain alignment confidence and the spatial neighborhood confidence are multiplied together and then globally normalized to obtain the total confidence weight at the sample level.

[0174] In this step, the closer the domain alignment confidence score is to 1, the closer the sample is to the real fingerprint distribution after domain alignment, and the higher the simulation confidence. The formula for calculating its value is shown in equation (15):

[0175] (15)

[0176] The smaller the confidence level of the spatial neighborhood, the stronger the spatial consistency of the signal and the higher the sample stability in that region. Its value is calculated by equations (16)-(17):

[0177] (16)

[0178] (17)

[0179] In the formula, Let n be the average feature distance of the neighborhood of the nth sample. Let be the feature value of the i-th AP and m-th modality of the j-th nearest neighbor sample. This is the normalized scaling parameter.

[0180] The formula for calculating the total confidence weight at the sample level is shown in equation (18):

[0181] (18)

[0182] In the formula, The total number of samples in the fingerprint database is 1. After normalization, the mean of the weights of all samples is 1, ensuring that the convergence speed of model training is not affected by weight scaling.

[0183] 2) Loss function with embedded sample weights

[0184] By incorporating the total confidence weight at the sample level into the quantile loss function and using the weighted quantile loss as the training objective of the DCWLightGBM regression model, high-confidence samples can contribute more to the model parameter updates, while the interference from low-confidence samples is weakened. In this invention, the weighted quantile loss function is calculated using equation (19):

[0185] (19)

[0186] In the formula, The number of training samples, For the true coordinates, Predict coordinates for the DCWLightGBM model. The quantile loss function, is the quantile coefficient. When it is 0.5, it is equivalent to median regression and has the best anti-outlier performance. Equation (19) is the loss function calculated for the X-axis coordinate. The loss function for the Y-axis coordinate is obtained in the same way.

[0187] 3) Weighted node splitting criterion and leaf output optimization

[0188] By embedding the sample-level total confidence weight into the histogram split gain calculation and leaf node output calculation of the DCWLightGBM regression model, full-link weighting from loss to tree structure is achieved.

[0189] The formula for calculating the split gain for candidate split points is as follows:

[0190] (20)

[0191] In the formula, , These represent the first and second gradients of the weighted quantile loss function with respect to the predicted values, respectively. The subscripts L and R correspond to the left and right child nodes after the split, respectively, and All corresponds to the parent node before the split. is the regularization coefficient. As can be seen from the above calculation of the split gain, when a node splits, the split gain is determined by the difference in weighted loss before and after the split; this mechanism makes high-confidence samples have a greater influence on the decision of the split direction, and low-alignment samples are less likely to mislead the tree structure growth.

[0192] The final predicted value for each leaf node is calculated using the weighted method of equation (21):

[0193] (twenty one)

[0194] In the formula, leaf represents the leaf node currently performing output prediction. This represents the predicted value of the X-axis coordinate, while the predicted value of the Y-axis coordinate is obtained in the same way as the predicted value of the X-axis coordinate.

[0195] In this step, the DCWLightGBM regression model reflects the differences in sample confidence throughout the entire process from loss calculation and node splitting to output prediction. In the scenario of uneven confidence of samples in the simulated migration fingerprint database, it can always fit to the high-confidence true distribution.

[0196] S106: Dynamic coordinate fusion of DWAKNN localization model and DCWLightGBM regression model

[0197] The fusion coefficient is dynamically calculated by combining the local signal fluctuation factor and the modal domain deviation factor. Based on fusion coefficient The initial positioning coordinates output by the DWAKNN positioning model The predicted coordinates output by the DCWLightGBM regression model The fusion yields the fused positioning coordinates;

[0198] In step S106, considering that the DWAKNN positioning model has advantages in strong spatial constraints, continuous and stable positioning results, and strong resistance to abrupt changes, but its nonlinear fitting ability is limited due to relying solely on linear weighted centroids; while the DCWLightGBM regression model has advantages in strong nonlinear fitting ability and high upper limit of positioning accuracy, but its purely data-driven approach is prone to spatial coordinate abrupt changes. Therefore, this invention complements the characteristics of the two models, taking advantage of their strengths and compensating for their weaknesses. By using dynamic fusion coefficients that can change according to fluctuations in the positioning environment, the positioning coordinates of the two models can be adaptively combined, thus balancing stability and positioning accuracy.

[0199] In this invention, the dynamic fusion coefficient The result is obtained by calculation using equation (22):

[0200] (twenty two)

[0201] In the formula, The standard deviation of the signal within the neighborhood. The standard deviation is the normalized benchmark value. This represents the average confidence level of all modes corresponding to the current point to be located. The adjustment coefficient is given by equation (22). It can be seen from equation (22) that when the local signal fluctuation is large and the overall modal reliability is low, By selecting higher values, the spatial neighborhood constraint effect of the DWAKNN model is strengthened. Stable spatial proximity ensures the reliability of the localization results. When the signal is stable and the modal alignment is high, By selecting lower values, the nonlinear fitting advantages of the DCWLightGBM regression model can be fully utilized to achieve higher positioning accuracy.

[0202] Based on the above fusion coefficients, the fused positioning coordinates are calculated using equation (23):

[0203] (twenty three)

[0204] In the formula, x km and y km Constructing preliminary positioning coordinates x lgb and y lgb Constructing predicted coordinates This fusion approach retains the physical interpretability and spatial stability of the DWAKNN model while leveraging the high-precision fitting capability of the DCWLightGBM regression model. By using dynamic weights to achieve an adaptive match of the advantages of both models, it possesses stronger environmental adaptability and robustness.

[0205] S107: Calculate evaluation indicators and select the optimal model hyperparameters

[0206] Calculate the evaluation index, and determine the optimal parameters of the DWAKNN model in step S104 and the optimal parameters of the DCWLightGBM regression model in step S105 based on the evaluation index.

[0207] In this invention, in order to ensure the optimal performance of the step model in terms of accuracy and stability, the root mean square error (RMSE) is used as the main evaluation index to guide the selection of model parameters.

[0208] Specifically, for the number of neighbors in the DWAKNN positioning module, multiple candidate values ​​are set and their corresponding positioning RMSE is calculated for each value. The value with the smallest error is then selected as the optimal parameter for the DWAKNN positioning module.

[0209] Regarding the parameter settings for the DCWLightGBM regression model, including hyperparameters such as the maximum number of leaf nodes, learning rate, maximum depth, and number of iterations, to improve training efficiency and model convergence, the default parameter configuration of the DCWLightGBM network model was used as the initial configuration. A grid search combined with K-fold cross-validation was employed for standardized optimization, traversing all candidate hyperparameter combinations to select the optimal hyperparameter combination that simultaneously satisfies high fitting accuracy and strong generalization ability, thus avoiding underfitting and overfitting of the model. The effectiveness of the parameters was verified through comparative experiments to demonstrate their impact on localization accuracy and model stability, ensuring that the final parameter selection achieves a balance between computational cost and prediction performance.

[0210] S108: Optimal Positioning Model Deployment and Positioning Coordinate Output

[0211] The three-dimensional wireless propagation simulation module in step S102, the adversarial domain migration module composed of the adversarial domain adaptation network in step S103, and the DWAKNN-DCWLightGBM fusion positioning module composed of steps S104-S106 are integrated into a complete WiFi positioning system. The multimodal fingerprint database generated in step S103 is input into the positioning system. The positioning system will automatically complete feature normalization, neighborhood filtering, preliminary positioning coordinate calculation, gradient tree training and prediction, dynamic coordinate fusion, and output the final two-dimensional coordinates of the indoor area to be positioned.

[0212] That is, after obtaining the complete WiFi positioning system, during the online phase, it is only necessary to upload real-time 6-channel AP multimodal RSSI / CSI / CIR data through the acquisition terminal. The system automatically completes feature normalization, neighborhood filtering, gradient tree prediction, dynamic fusion, and outputs the final indoor two-dimensional positioning coordinates.

[0213] Using the simulated multimodal migration fingerprint database generated in steps S101 to S103 as input, the constructed positioning system is used for positioning tests. By repeatedly evaluating the positioning error at preset reference points, the average positioning error, RMSE, and other indicators are calculated to measure the performance of the positioning model in actual positioning tasks.

[0214] Example

[0215] To verify the effectiveness of the proposed WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence-adaptive weighting, a test scenario was built in an indoor experimental environment with an area of ​​10m×10m. The experimental area was uniformly divided into 1m×1m grids, with a total of 100 reference points. Six WiFi signal transmitting nodes were deployed on-site, and real fingerprint data was collected at each reference point using a smart acquisition terminal device.

[0216] In the offline database construction phase, a 3D wireless propagation simulation model was first built based on the experimental scenario's CAD drawings. Wall reflection coefficients and glass penetration loss parameters were set, and a large number of multimodal simulated fingerprints were generated in batches using a hybrid ray tracing algorithm. Only 20 reference points (20% of the total) were randomly selected to manually collect real RSSI / CSI / CIR data as the target domain dataset, significantly reducing the workload. Systematic bias and random noise were introduced into the simulation data to simulate signal fluctuations in the real environment, making the simulation data closer to actual distributions. The simulated fingerprints were used as the source domain, and the 20% of real collected fingerprints were used as the target domain. The data was then input into an adversarial domain adaptation network containing GRL for transfer learning training. After training, the output result is the transferred simulated fingerprint database.

[0217] In the online localization phase, the DWAKNN localization model matrix is ​​first used to calculate the weighted feature distance between the sample to be localized and the global migration fingerprint. The K most reliable neighboring fingerprints are selected, and their preliminary localization coordinates are obtained by weighting the centroids using the inverse distance. Simultaneously, the K highly matching neighboring samples selected by the DWAKNN localization model serve as the core training data foundation for the DCWLightGBM regression model. Then, the trained DCWLightGBM regression model is used to localize the test point, yielding high-precision predicted coordinates. Finally, the predicted coordinates from the two models are weighted and merged using dynamic fusion coefficients to obtain the final localization coordinates. To ensure the rationality of the localization model parameter settings, RMSE is used as the core evaluation metric. Experiments are conducted to adjust the number of nearest neighbor samples in the DWAKNN model, and the optimal K value is determined based on the principle of minimizing error. Meanwhile, the hyperparameters of the DCWLightGBM regression model use the default recommended configuration, and the optimal parameter combination is sought during training iterations. Its convergence stability and generalization ability are verified in experiments.

[0218] The main parameters of the model used in the simulation are shown in Table 1, and the results are shown in [Table 1]. Figure 2-5 And Table 2.

[0219] Table 1. Main parameter settings table for the model involved in this invention.

[0220]

[0221] Depend on Figure 2 It can be seen that as the value of K increases, the RMSE first decreases and then increases, reaching its minimum when K is 6, indicating that the positioning prediction model has the best positioning accuracy at this value. Therefore, it is evident that appropriately selecting the number of neighbors is crucial for improving positioning accuracy and prediction performance.

[0222] Depend on Figure 3 As shown in Table 2, the multimodal simulation transfer + DWAKNN-DCWLightGBM algorithm has the highest positioning accuracy and the smallest positioning error. Its positioning performance is significantly better than other positioning algorithms, and the positioning results are more reliable, thus verifying the effectiveness of the multimodal simulation transfer + DWAKNN-DCWLightGBM algorithm.

[0223] Table 2. Positioning performance of different positioning methods and the WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting provided in this application.

[0224]

[0225] Depend on Figure 4 , Figure 5As shown in Table 2, the WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence adaptive weighting proposed in this application has the minimum RMSE and MAE when performing indoor positioning, and has higher positioning accuracy and better error control.

[0226] The above description is a detailed description of the preferred embodiments of the present invention. However, the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modifications made under the technical spirit of the present invention should fall within the patent scope covered by the present invention.

Claims

1. A WiFi fingerprint indoor positioning method based on multimodal simulation transfer and confidence-adaptive weighting, characterized in that, Includes the following steps: S101: Construct and preprocess a real-world WiFi multimodal fingerprint database Multiple access points (APs) are deployed within the positioning area and grid reference points are divided at equal intervals. Multimodal fingerprint information of each AP is collected at some grid reference points, and a small-scale real WiFi multimodal fingerprint database is constructed based on this. At the same time, the real multimodal fingerprint data in the real WiFi multimodal fingerprint database is preprocessed. S102: Generating Multimodal Simulated Fingerprints Based on 3D Scene Modeling and Hybrid Ray Tracing Algorithm A three-dimensional wireless propagation simulation model is built based on the structural information of the indoor area to be located; a hybrid ray tracing algorithm is used to simulate the propagation path of the signal, and simulated multimodal fingerprint data is generated in batches at reference points set throughout the positioning area; S103: Simulation of Adversarial Domain Adaptive Network Implementation - Real Cross-Domain Migration Using the simulated multimodal fingerprint data from step S102 as the source domain and a small amount of real multimodal fingerprint data from step S101 as the target domain, an adversarial domain adaptation network with a gradient inversion layer (GRL) is constructed to achieve the alignment and migration of simulated fingerprints to the real domain distribution, thus obtaining the migrated multimodal fingerprint database. S104: Constructing a DWAKNN model based on AP-modal dual-dimensional adaptive weighting For the multimodal fingerprint database obtained after migration in step S103, a two-layer confidence weight is calculated from both the AP spatial dimension and the modal domain deviation dimension. Finally, the two-dimensional confidence weight matrix is ​​generated per AP and per modality. Based on this weight matrix, a DWAKNN localization model is constructed to complete the screening of neighborhood samples and the calculation of preliminary localization coordinates. S105: Constructing a DCWLightGBM regression model based on a dual-driven weighted approach of domain confidence and spatial confidence. The core mechanism of LightGBM is improved from the perspective of sample confidence. The dual-confidence sample weights, composed of domain alignment confidence and spatial neighborhood confidence, are deeply embedded into the loss function, node splitting criterion, and leaf output calculation of the LightGBM prediction model, achieving full-link confidence weighting. Based on the neighborhood samples selected by the DWAKNN localization model in step S104, refined nonlinear fitting is performed. After the model training is complete, the multimodal features of the sample to be localized are input, and the predicted coordinates of the DCWLightGBM regression model are finally output. ; S106: Dynamic coordinate fusion of DWAKNN model and DCWLightGBM regression model The fusion coefficient is dynamically calculated by combining the local signal fluctuation factor and the modal domain deviation factor. Based on fusion coefficient The initial positioning coordinates output by the DWAKNN positioning model The predicted coordinates output by the DCWLightGBM regression model The coordinates are merged to obtain the merged positioning coordinates; S107: Calculate evaluation indicators and select the optimal model hyperparameters Calculate the evaluation index, and determine the optimal parameters of the DWAKNN localization model in step S104 and the optimal parameters of the DCWLightGBM regression model in step S105 based on the evaluation index. S108: Optimal Positioning Model Deployment and Positioning Coordinate Output The three-dimensional wireless propagation simulation module in step S102, the adversarial domain migration module composed of the adversarial domain adaptation network in step S103, and the DWAKNN-DCWLightGBM fusion positioning module composed of steps S104-S106 are integrated into a complete WiFi positioning system. The multimodal fingerprint database generated in step S103 is input into the positioning system, and the positioning system outputs the final two-dimensional coordinates of the indoor area to be located.

2. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S103, the adversarial domain adaptation network mainly consists of three parts: a feature mapper, a domain discriminator, and a task regressor. The feature mapper uses a fully connected layer and a batch normalization structure to map the features of simulated multimodal fingerprints and a small number of real multimodal fingerprints to a transfer feature space of the same dimension, so as to ensure that the dimension of the transferred fingerprint is consistent with the dimension of the original AP. The domain discriminator uses a three-layer fully connected discriminator network, which forms an adversarial relationship with the feature mapper through a gradient inversion layer (GRL), and its goal is to distinguish between source domain and target domain samples. The task regressor uses a two-layer fully connected regression network, which uses the real coordinates corresponding to the input samples as supervision labels to ensure that the features retain spatial location information during the domain alignment process. GRL is introduced between the feature mapper and the domain discriminator and is the core component for adversarial training in adversarial domain adaptation networks. During forward propagation, GRL performs an identity mapping, directly passing the feature vector output by the feature mapper to the domain discriminator without modification. During backpropagation to update parameters, it automatically multiplies the gradient from the domain discriminator by a negative adaptive tradeoff coefficient to reverse the gradient direction.

3. The WiFi fingerprint indoor positioning method as described in claim 2, characterized in that, In step S103, the adversarial domain adaptation network is trained using mini-batch gradient descent. Each batch of training data contains an equal number of simulated fingerprints and real fingerprint samples. Through a complete iteration of forward propagation to calculate the loss and backpropagation to update the parameters, the simulated fingerprints are gradually migrated to the real domain distribution. 1) Forward propagation computation stage: Simulated fingerprints and real fingerprints from the training batch are simultaneously input into the feature mapper, which outputs two corresponding high-dimensional transfer features. The first part of the high-dimensional transfer features is directly fed into the task regressor to calculate the coordinate prediction values ​​of the simulated samples and real samples respectively. The mean square error is calculated by combining the coordinate ground values ​​to obtain the task regression loss. The second part of the high-dimensional transfer features is fed into the domain discriminator after passing through GRL, which outputs the domain classification probability of each sample. The binary cross-entropy is calculated by combining the preset domain labels to obtain the domain discrimination loss. 2) Backpropagation parameter update stage: The task regression loss and the domain discrimination loss are weighted and summed to obtain the total loss, and the gradient is backpropagated along the network; when the gradient flows through the GRL, the gradient of the domain discrimination branch is automatically multiplied by a negative adaptive coefficient before being passed into the feature mapper.

4. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S104, the spatial confidence score of the AP spatial dimension is calculated using the following method: The confidence weights of each AP are calculated from three indicators: spatial discrimination, temporal stability, and spatial coverage uniformity. Spatial discrimination is measured by information entropy, temporal stability is measured by the standard deviation of signals sampled multiple times at the same location, and spatial coverage uniformity is measured by the spatial coverage correction coefficient. 1) Information entropy of the i-th AP The calculation method is shown in formula (3): (3) In the formula, Let B be the probability density of the b-th RSSI intensity interval of the i-th AP, and B be the total number of RSSI intensity intervals (total number of boxes). 2) Time stability of the i-th AP The calculation method is shown in formula (4): (4) In the formula, Let be the standard deviation of the signal of the i-th AP. These are normalized baseline parameters; 3) Spatial coverage uniformity of the i-th AP The calculation method is shown in formula (5): (5) In the formula, Let be the standard deviation of the coverage rate of the i-th AP in each sub-region. This represents the maximum standard deviation of all AP coverage. 4) The spatial confidence adaptive weights of the i-th AP are: The calculation method is shown in formulas (6) and (7): (6) (7) In the formula, The maximum value of the information entropy of all APs. These are the weighted fusion coefficients for three dimensions: spatial distinguishability, temporal stability, and coverage uniformity.

5. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S104, the domain bias confidence score of the modal dimension is calculated using the following method: Based on the training results of the adversarial domain adaptation network in step S103, the simulation-real domain alignment degree is quantified for the multi-modal features of the fingerprint data, and this is used as the basis for calculating the modal confidence, constituting the weights at the modal level; specifically, First, single-modal domain bias quantization is performed. After the adversarial domain adaptation network is trained, the independent features of each modality are extracted and input into the trained domain discriminator to calculate the average domain discrimination loss between the simulated sample and the real sample in that modality. Subsequently, modal confidence mapping is performed, and the single-modal domain discrimination loss is mapped to modal confidence weights in the interval [0,1] through an exponential decay function; Next, the weights of the three modes are normalized.

6. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S104, the fused two-dimensional confidence weight matrix is ​​obtained through the following method: The outer product of the spatial weight vector of the AP spatial dimension and the domain bias weight vector of the modality dimension is calculated to obtain... Two-dimensional confidence weight matrix The calculation method is shown in formula (11): (11) The element in the i-th row and m-th column of the weight matrix is: (12) Formula (12) represents the contribution of the m-th modal feature of the i-th AP to localization matching.

7. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S104, neighborhood sample filtering is achieved in the following way: Based on the two-dimensional confidence weight matrix, a double-weighted Euclidean distance is constructed. Specifically, the multimodal feature vector to be located is collected in real time by the online terminal, and the distance between the nth reference point and the sample to be located is calculated by formula (13): (13) In the formula, Let be the feature value of the i-th AP and the m-th mode in the sample to be located. The migration feature value corresponding to the nth reference point; The top K reference points are selected in ascending order based on double-weighted Euclidean distance to construct a local neighborhood sample subset. .

8. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S104, the preliminary positioning coordinates are obtained in the following way: By using the coordinates of the K neighboring samples of the selected sample to be located, the inverse distance weighted centroid is calculated to obtain the preliminary localization coordinates of the DWAKNN model. The x-coordinate is calculated using equation (14): (14) In the formula, Let x be the true value of the x-coordinate of the nth neighboring reference point. To prevent the smoothing constant from having a denominator of 0; similarly, the preliminary positioning coordinates are obtained. The ordinate.

9. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S105, the construction of the DCWLightGBM regression model includes the following aspects: 1) Single-sample double confidence quantification The total confidence weight at the sample level is calculated for each reference point sample in the multimodal fingerprint database obtained after the transfer in step S103. This total confidence weight at the sample level is obtained by fusing the domain alignment confidence and the spatial neighborhood confidence. The domain alignment confidence is derived from the domain discriminator trained in step S103 and is the domain classification probability output by the transfer feature of the nth reference point. The spatial neighborhood confidence is obtained by calculating the average feature distance between the nth reference point and its neighboring samples obtained in step S104. The domain alignment confidence and the spatial neighborhood confidence are multiplied together and then globally normalized to obtain the total confidence weight at the sample level. 2) Loss function with embedded sample weights The total confidence weight at the sample level is introduced into the quantile loss function, and the weighted quantile loss is used as the training objective of the DCWLightGBM model; the weighted quantile loss function is calculated by equation (19): (19) In the formula, The number of training samples, For the true coordinates, Predict coordinates for the DCWLightGBM model. The quantile loss function, is the quantile coefficient; Equation (19) is the loss function calculated for the X-axis coordinate, and the loss function for the Y-axis coordinate is obtained in the same way; 3) Weighted node splitting criterion and leaf output optimization The sample-level total confidence weight is embedded into the histogram split gain calculation and leaf node output calculation of the DCWLightGBM regression model to achieve full-link weighting from loss to tree structure; The formula for calculating the split gain for candidate split points is as follows: (20) In the formula, , These represent the first and second gradients of the weighted quantile loss function with respect to the predicted values, respectively. The subscripts L and R correspond to the left and right child nodes after the split, respectively, and All corresponds to the parent node before the split. The regularization coefficient is used. The final predicted value for each leaf node is calculated using the weighted method of equation (21): (21) In the formula, leaf represents the leaf node currently performing output prediction. This represents the predicted value of the X-axis coordinate, while the predicted value of the Y-axis coordinate is obtained in the same way as the predicted value of the X-axis coordinate.

10. The WiFi fingerprint indoor positioning method as described in claim 1, characterized in that, In step S106, the dynamic fusion coefficient The result is obtained by calculation using equation (22): (22) In the formula, The standard deviation of the signal within the neighborhood. The standard deviation is the normalized benchmark value. This represents the average confidence level of all modes corresponding to the current point to be located. This is the adjustment coefficient; Based on the above fusion coefficients, the fused positioning coordinates are calculated using equation (23): (23) In the formula, x km and y km Constructing preliminary positioning coordinates x lgb and y lgb Constructing predicted coordinates .