A geomagnetic indoor high-precision positioning method based on generative model

By combining the generative model and the attention mechanism, a geomagnetic fingerprint library is constructed and geomagnetic sequence positioning is performed, which solves the problems of high precision and low cost of geomagnetic indoor positioning and realizes real-time high-precision positioning on miniaturized equipment.

CN116295400BActive Publication Date: 2025-09-16CHANGAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310074129.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-02
Publication Date
2025-09-16
Estimated Expiration
2043-02-02

AI Technical Summary

Technical Problem

Existing geomagnetic indoor positioning technology has the problems of high labor costs in building fingerprint databases and poor positioning accuracy, especially when the position is ambiguous and the online positioning calculation is highly complex, making it difficult to achieve real-time high-precision positioning on miniaturized terminals.

Method used

A generative model-based approach is adopted to construct a fingerprint library using the conditional variational autoencoder (CVAE) and the conditional generative adversarial network (CGAN). The convolutional gated recurrent unit (CNN-GRU) with an attention mechanism is then used for geomagnetic sequence positioning, reducing the workload of fingerprint library construction and improving positioning accuracy.

Benefits of technology

High-precision geomagnetic indoor positioning is achieved, reducing the workload of building a fingerprint database. The positioning error is 0.16m, and real-time positioning is achieved on a miniaturized device with a hardware size of (10×8×8)cm3.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116295400B_ABST
    Figure CN116295400B_ABST
Patent Text Reader

Abstract

The present invention provides a high-precision indoor geomagnetic positioning method based on a generative model, which belongs to the field of indoor positioning. The present invention addresses the bottleneck that the construction of a sophisticated geomagnetic fingerprint library currently requires a large amount of manpower costs. The present invention proposes two generative models, a conditional variational autoencoder and a conditional adversarial generative network, which can effectively construct a usable geomagnetic fingerprint library. At the same time, in order to address the problem of low accuracy in single-point geomagnetic fingerprint positioning, the present invention designs a geomagnetic sequence positioning method based on a convolutional gated recurrent unit with an attention mechanism, which can effectively utilize the spatial and temporal characteristics of fingerprints to achieve precise positioning. In addition, the present invention also designs and builds a real-time, portable mobile data acquisition and positioning system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an indoor high-precision positioning method, in particular to a geomagnetic indoor high-precision positioning method based on a generation model. Background Art

[0002] The Global Navigation Satellite System (GNSS, such as the Global Positioning System (GPS)) can provide real-time and highly accurate positioning results outdoors. However, in large shopping malls and office buildings, GPS cannot achieve the decimeter-level positioning accuracy that people need due to building obstructions. Therefore, a high-precision indoor positioning system solution is urgently needed. WiFi and Bluetooth signals are mainly used to construct fingerprints. The biggest technical challenge of using this method is that indoor obstacles will cause attenuation and interference of radio frequency signal propagation, thereby changing the accuracy of the original signal. In addition, this method requires the deployment of specific equipment in the positioning area, the use of additional hardware, and regular maintenance of basic equipment.

[0003] In recent years, geomagnetic-based indoor positioning technology has become a research hotspot. This technology offers advantages such as low cost, low complexity, and high accuracy, requiring no additional equipment architecture. The principle behind this technology is that the indoor geomagnetic field is disturbed by magnetic materials in buildings (such as iron, steel, and gold-containing iron alloys), creating geomagnetic anomalies. This results in different magnetic field distributions at different locations. Indoor positioning based on geomagnetic fingerprints can effectively distinguish the characteristic patterns at different locations. Furthermore, geomagnetic signals are relatively stable, do not fluctuate over time, and do not require additional energy consumption or infrastructure support.

[0004] The positioning algorithm based on geomagnetic fingerprint requires the construction of a fingerprint library. The positioning accuracy of geomagnetic fingerprint is related to the fineness of the constructed geomagnetic fingerprint library. The finer the geomagnetic fingerprint library, the higher the positioning accuracy. However, building a fine geomagnetic fingerprint library requires a lot of manpower costs. At the same time, due to the position ambiguity problem of geomagnetic fingerprint positioning based on a single point (different locations have similar single-point geomagnetic fingerprints), this method has poor positioning accuracy in indoor scenarios. In addition, online positioning requires a computer to process the positioning results, and fails to apply deep learning algorithms to real-time positioning of miniaturized terminals. Summary of the Invention

[0005] Purpose of the invention: The technical problem to be solved by the present invention is to provide a high-precision indoor geomagnetic positioning method based on a generative model in response to the shortcomings of the existing technology.

[0006] In order to solve the above technical problems, the present invention discloses a geomagnetic indoor high-precision positioning method based on a generative model, which includes two parts: construction of a generative fingerprint library based on the generative model and a geomagnetic sequence positioning method based on a convolutional gated recurrent unit of an attention mechanism; wherein the construction of the generative fingerprint library based on the generative model includes: constructing a generative fingerprint library according to two generative network models, namely, a conditional variational autoencoder CVAE and a conditional adversarial generative network CGAN; the geomagnetic sequence positioning method based on a convolutional gated recurrent unit of an attention mechanism includes: using the constructed fingerprint library for positioning to complete the geomagnetic indoor high-precision positioning based on the generative model.

[0007] The present invention also discloses a mobile terminal collection and real-time positioning system, including a collection system and a real-time positioning method;

[0008] The acquisition system includes: an acquisition device, a Raspberry Pi processor, a nine-axis geomagnetic sensor MPU and a liquid crystal display; the liquid crystal display and the nine-axis geomagnetic sensor communicate with the Raspberry Pi processor via the IIC communication protocol;

[0009] The real-time positioning method adopts the geomagnetic indoor high-precision positioning method based on the generation model described in claim 7, including: an offline stage, training the positioning model; an online stage, using the acquisition system to collect geomagnetic data in real time, and using the trained positioning model to output the position result in real time.

[0010] Beneficial effects:

[0011] 1. In order to effectively reduce the workload of constructing the geomagnetic fingerprint reference map, the present invention proposes two generative models, Conditional Variational AutoEncoder (CVAE) and Conditional Generative Adversarial Networks (CGAN), to construct a complete data set. By learning the real data distribution of a small number of collected samples, and then using random noise to generate data for the specified location, a single-point fingerprint database is constructed, and the quality of the generated data is tested using a multi-layer perceptron (MLP) neural network model. The experimental results show that the positioning accuracy achieved by collecting 400 reference points can be reduced by 3 times by only collecting 100 reference points using the generative model.

[0012] 2. This paper constructs a geomagnetic fingerprint sequence and proposes a convolutional gated recurrent unit (CNN-GRU) geomagnetic sequence positioning algorithm based on an attention mechanism. CNN and GRU extract the spatial and temporal features of the geomagnetic sequence fingerprint, respectively. The attention mechanism is added to enable the network to assign different weights to features at different times in the geomagnetic sequence fingerprint based on the degree of correlation between the geomagnetic sequence fingerprint and location. Finally, the position result is obtained through weighted summation, achieving an average positioning error of 0.16m.

[0013] 3. This invention realizes a small and portable positioning system. The hardware device uses a Raspberry Pi (4B) as a data processor and memory, and uses a nine-axis geomagnetic sensor to collect geomagnetic data. The overall size of the hardware is (10×8×8) cm 3 , and implemented the CNN-GRU geomagnetic sequence positioning algorithm based on the attention mechanism on this system. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more apparent.

[0015] Figure 1 It is a schematic diagram of the mathematical model of indoor geomagnetic positioning in the present invention.

[0016] Figure 2 It is a schematic diagram of the geomagnetic sensor coordinate system in the present invention.

[0017] Figure 3 It is a schematic diagram of the CVAE process in the present invention.

[0018] Figure 4 It is a schematic diagram of the CGAN network model in the present invention.

[0019] Figure 5 It is a schematic diagram of the construction process of generating the geomagnetic fingerprint library in the present invention.

[0020] Figure 6 It is a schematic diagram of the construction process of the sliding window to construct the geomagnetic sequence fingerprint in the present invention.

[0021] Figure 7 This is a schematic diagram of the convolutional gated recurrent unit network model based on the attention mechanism in the present invention.

[0022] Figure 8 It is a schematic diagram of the operation process of the one-dimensional convolutional neural network in the present invention.

[0023] Figure 9 It is a schematic diagram of the GRU workflow in the present invention.

[0024] Figure 10 Schematic diagram of the mobile terminal hardware structure in the present invention.

[0025] Figure 11 This is a schematic diagram of the online positioning measurement of the hardware positioning system in the present invention.

[0026] Figure 12 It is a schematic diagram of the plane space in the present invention.

[0027] Figure 13 The present invention uses MFD constructed with a reference interval of 0.4m and GMFD generated with a reference interval of 0.4m to train the positioning model. Schematic diagram of the cumulative error distribution function CDF of GMFD and MFD.

[0028] Figure 14 This is a schematic diagram showing the effect of reference point spacing on positioning accuracy and workload in the present invention.

[0029] Figure 15 This is a schematic diagram of the positioning error CDF of GMFD and MFD trained using the MFD constructed with a reference interval of 0.2m and the GMFD generated with a reference interval of 0.4m in the present invention.

[0030] Figure 16 This figure shows the average positioning error of the positioning model trained by MFD, with a reference point spacing of 1.0m. A schematic diagram shows the average positioning error of the positioning model trained by GMFD, using two generative networks for geomagnetic fingerprint generation with cell sizes of 0.2m×0.2m, 0.4m×0.4m, 0.6m×0.6m, and 0.8m×0.8m.

[0031] Figure 17 Schematic diagram of the CDF of the positioning error of the MLP neural network model, the RNN neural network model and the neural network model proposed in the present invention.

[0032] Figure 18 Schematic diagram of the true path and the path recovered by the proposed neural network model in this invention. DETAILED DESCRIPTION

[0033] The present invention proposes a geomagnetic indoor high-precision positioning method based on a generative model, which includes two parts: construction of a generative fingerprint library based on the generative model and a geomagnetic sequence positioning method based on a convolutional gated recurrent unit (CNN-GRU) with an attention mechanism. The construction of the generative fingerprint library based on the generative model includes: constructing a fingerprint library based on two generative network models, a conditional variational autoencoder (CVAE) and a conditional adversarial generative network (CGAN); the geomagnetic sequence positioning method based on the convolutional gated recurrent unit with an attention mechanism includes: using the constructed fingerprint library for positioning to complete the geomagnetic indoor high-precision positioning based on the generative model.

[0034] Among them, the technical solution adopted for constructing the fingerprint library based on the generation model is: two generation models are used to construct the geomagnetic fingerprint library, including an offline stage and a fingerprint generation stage; the offline stage

[0035] The mobile device collects the geomagnetic characteristic values ​​of the reference point and builds a geomagnetic fingerprint library.

[0036] Geomagnetic data conversion,The geomagnetic fingerprint library is established based on the world coordinate axis.

[0037] Model training. Two generative networks (CVAE and CGAN) are used. Taking advantage of the stable distribution of indoor magnetic fields, the generative network learns the probability distribution of indoor magnetic field strength and reconstructs the geomagnetic fingerprint of a specified location.

[0038] The fingerprint generation phase includes:

[0039] Fingerprint location fingerprint generation, uses the trained CVAE and CGAN networks to generate geomagnetic fingerprints, and uses the decoder of the CVAE network and the generator network of the CGAN network as the generator of the virtual fingerprint respectively. The input of the generator is random noise that obeys the standard normal distribution and the specified location coordinates, and the output of the generator is the geomagnetic fingerprint.

[0040] Generate a geomagnetic fingerprint library and merge the generated geomagnetic fingerprint and the collected geomagnetic fingerprint to form a generated geomagnetic fingerprint library.

[0041] Furthermore, the construction formula of the fingerprint database (Magnetic Fingerprint Database, MFD) is:

[0042]

[0043] Where (x i ,y i ) is the position coordinate of the i-th reference point, i=1,2,…,n, n is the number of reference points, M x_i 、My_i 、M z_i are the intensities of the Earth’s magnetic field along the x-axis, y-axis, and z-axis at the i-th reference point, respectively. i Represents the modulus of the Earth's magnetic field strength at the i-th reference point,

[0044] Furthermore, the formula for converting the collected geomagnetic data to the world coordinate system is:

[0045]

[0046] The collected geomagnetic data is (M x ,M y ,M z ), the geomagnetic data in the world coordinate system is (M′ x ,M′ y ,M′ z ).

[0047] The rotation matrix is ​​R = R α R β R γ , R α ,R β ,R γ The expression is as follows:

[0048]

[0049] Where, the rotation angles along the x-axis, y-axis, and z-axis of the geomagnetic sensor are called the pitch angle (β), roll angle (γ), and heading angle (α), respectively.

[0050] Furthermore, the CVAE training process is:

[0051] The geomagnetic fingerprint sample m and the specified position c are input into the Encoder for encoding to obtain the probability distribution of the geomagnetic fingerprint, and then the probability distribution is resampled to obtain the latent variable a. The latent variable a and the specified position c are input into the Decoder for decoding to reconstruct the geomagnetic fingerprint m′, that is, given the position c, from the distribution p θ (m|a,c) generates geomagnetic fingerprint m′, where θ is the parameter of the Decoder network model. θ (a|m,c) is not easy to calculate, and the stochastic gradient variational Bayes (SGVB) framework is used to estimate the posterior distribution probability of the encoder as q φ (a|m,c), where φ is the Encoder network model parameter. Therefore, the loss function of CVAE is:

[0052]

[0053] In the formula is the reconstruction loss of CVAE, which is used to measure the difference between input and output. Generally, MSE or the mean of the two-category cross entropy is used instead of the above formula. KL (q φ (a|m,c)‖p(a|c))=D Kl (N(μ a ,σ a 2 )‖N(0,I)) is the KL divergence (Kullback-Leibler divergence, KL). Substituting the mean and variance generated in the geomagnetic fingerprint sample into the KL divergence formula, we get:

[0054]

[0055] Where K represents the K groups of mean and variance generated by a geomagnetic fingerprint sample, j represents the specific number of groups of the current mean and standard deviation, KL b For any sample b, the KL divergence is calculated by weighting the means and variances of all K groups.

[0056] Using the reparameterizing trick, the latent variable a is sampled from the standard normal distribution, so that the latent variable a can be back-propagated and the CVAE is trained using the gradient descent algorithm. Therefore, the CVAE back-propagation loss function is:

[0057]

[0058] Where M is the number of geomagnetic samples, m p is the geomagnetic sample input of the encoder, Reconstructed geomagnetic samples output for the decoder.

[0059] Furthermore, the CGAN training process is:

[0060] The conditional information and random noise are used as inputs of the generative network. The generative network generates geomagnetic fingerprint samples according to the given conditional information (position coordinates). Given the distribution law of the noise d and the given conditions (position coordinates), the generative network converts the noise d into geomagnetic fingerprint data e′ with unknown distribution law. The generative network minimizes p G (e′,f) and p data The divergence distance between (e,f), where p G (e′,f) is the distribution function of the generated geomagnetic fingerprint e′, p data (e,f) is the true geomagnetic fingerprint distribution function. The smaller the divergence distance, the more similar the geomagnetic fingerprint e′ distribution generated by the generative network is to the true geomagnetic fingerprint data distribution, and the better the generative model effect. The loss function of the generative network is shown in Formula 7:

[0061]

[0062] The discriminant model is also called the discriminant network, which is used to calculate p G (e′,f) and p data The divergence distance between (e,f). The loss function of the discriminant network is shown in Formula 8:

[0063]

[0064] After the conditional adversarial generative network (CGAN) has gone through a preset number of iterations, the training of the generative network and the discriminative network is completed. The final optimization function of CGAN is shown in Formula 9:

[0065]

[0066] Where p d is the probability distribution obeyed by the input noise d, p f is the probability distribution of the input condition f.

[0067] Another part of the present invention is a geomagnetic sequence positioning method based on a convolutional gated recurrent unit with an attention mechanism, that is, a CNN-GRU positioning algorithm based on an attention mechanism, including an offline stage and an online stage, wherein the offline stage includes:

[0068] Based on the Generate Magnetic Fingerprint Database (GMFD), a sliding window is designed to construct the geomagnetic sequence fingerprint. The geomagnetic data of the reference points in the path are connected to form a geomagnetic sequence using the order of the sliding window. The position label of the geomagnetic sequence is the last position in the sliding window, and a sequence fingerprint library is constructed.

[0069] Design a network model, the network consists of four parts: one-dimensional convolutional network, gated recurrent unit, attention mechanism and predictor.

[0070] Model training, training the neural network model based on the sequence fingerprint library.

[0071] Online stage:

[0072] Collect geomagnetic features at test points and construct geomagnetic sequences.

[0073] Fingerprint matching, online collection and construction of geomagnetic sequence feature values ​​are input into the trained CNN-GRU network to obtain the location results.

[0074] The last technical solution of the present invention is a design of a mobile terminal acquisition and real-time positioning system, characterized by: an acquisition system and real-time positioning; the acquisition system includes:

[0075] The acquisition device consists of a Raspberry Pi (processor), a nine-axis geomagnetic sensor (Microprocessor Unit, MPU) and an LCD display.

[0076] Communication protocol, the LCD display and the nine-axis geomagnetic sensor communicate with the Raspberry Pi through the IIC protocol.

[0077] The specific hardware parameters of the mobile device are shown in Table 1:

[0078] Table 1 Hardware parameters of geomagnetic positioning system

[0079]

[0080] Real-time positioning includes:

[0081] In the offline stage, the positioning model is trained.

[0082] In the online stage, geomagnetic data is collected in real time, and the trained model is used to output the position results in real time.

[0083] Furthermore, the mobile device's processor is a Raspberry Pi (4B), responsible for data processing and storage. The sensor device model is a nine-axis geomagnetic sensor MPU9250, which can collect geomagnetic data, acceleration, and angular velocity. The display is used to display the positioning results in real time.

[0084] Furthermore, mobile devices are used to collect geomagnetic feature data and build a geomagnetic fingerprint library.

[0085] Furthermore, the mobile device's processor uses Python to train a model based on the Generate Magnetic Fingerprint Database (GMFD). During the offline phase, a deep learning positioning model is trained. During the online phase, geomagnetic feature data is acquired in real time, and the trained neural network model is used to output positioning results, which are then displayed on the screen.

[0086] Analysis of experimental results and analysis of generative model results.

[0087] Based on the MFD, two generative networks (CVAE and CGAN) are used to expand the geomagnetic fingerprint and construct the GMFD. The quality of the generated fingerprint data is then tested using a unified MLP neural network to train the positioning model. The MLP consists of three parts: an input layer, a hidden layer, and an output layer. Based on the geomagnetic fingerprint of a single point, the MLP can effectively train a regression model to estimate the user's target location. For each specified location, 100 sets of geomagnetic fingerprints are generated. All generated geomagnetic fingerprints and the actual collected geomagnetic data are combined to form the GMFD. The MFD and GMFD are used as training sets, and the MLP-based regression model is trained on the system built in this article.

[0088] The reference point interval collected is set to 0.4m to construct MFD, and the two generation networks generate virtual location fingerprints according to a grid size of 0.2m×0.2m. Based on the same test set, the positioning accuracy of the positioning model trained by MFD and GMFD is shown in Table 2.

[0089] Table 2 Positioning accuracy of positioning models trained with MFD and GMFD

[0090]

[0091] As can be seen from Table 2, the two generation networks generate geomagnetic fingerprints for the specified location, enriching the number of samples and effectively improving the positioning accuracy.

[0092] Different reference point intervals (0.2m, 0.4m, 0.6m, 0.8m, 1.0m, 2.0m) are used to construct the MFD. The detailed information of the MFD at different reference intervals is shown in Table 3.

[0093] Table 3 MFD data information at different reference points

[0094]

[0095] Analysis of the results of the convolutional gated recurrent unit localization algorithm based on the attention mechanism

[0096] The path and sequence fingerprint library is constructed. The positioning path trajectory is constructed based on GMFD. A two-dimensional array with a dimension of 20×20 is defined. Each array element corresponds to a reference point. Pedestrians can move to the next neighboring grid without repeating. All paths are traversed using the depth-first traversal algorithm to simulate various trajectories of different users. The path direction is from end A to end B of the hall. According to Figure 6 The geomagnetic sequence fingerprint library was constructed in this way.

[0097] Table 4 shows the positioning results of computer simulations for an MLP positioning algorithm based on a single-point geomagnetic fingerprint, an RNN positioning algorithm based on a geomagnetic sequence, and the proposed positioning algorithm based on a geomagnetic sequence. The test metrics are minimum error, maximum error, variance, and root mean square error (RMS). As can be seen from the table, the positioning accuracy of the geomagnetic sequence is higher than that of the single-point geomagnetic fingerprint. The proposed network model has a lower variance and more stable positioning error, with a RMS error of 0.16 m, a 25% improvement over the RNN algorithm.

[0098] Table 4. Test set positioning results of the two models

[0099]

[0100] Example:

[0101] The application principle of the present application is further described below with reference to the accompanying drawings and specific embodiments.

[0102] Indoor geomagnetic positioning mathematical model such as Figure 1 As shown, where M x 、M y 、M z The x-, y-, and z-axis intensities of the Earth's magnetic field in that environment, respectively. Mobile devices equipped with geomagnetic sensors collect data and build a geomagnetic fingerprint database. Each location has unique magnetic field signature patterns, and indoor positioning is achieved by mapping these patterns to location.

[0103] The geomagnetic sensor coordinate system is as follows Figure 2 As shown: the geomagnetic sensor is placed horizontally with the center of mass of the geomagnetic sensor as the coordinate origin, the x-axis points to the right side of the geomagnetic sensor, the y-axis points directly above the geomagnetic sensor, and the z-axis is perpendicular to the geomagnetic sensor and points outside the geomagnetic sensor.

[0104] Figure 3 The following is a flowchart of CVAE, which consists of an encoder and a decoder. The real data sample x and the label y are combined (cat) and fed into the encoder for encoding, resulting in a latent space that follows a Gaussian distribution. The latent space is then sampled to obtain the latent variable z. The latent variable z and the label y are combined and fed into the decoder for decoding, resulting in the reconstructed output x′.

[0105] Figure 4 The CGAN network model, in which the generative model and discriminative model learn from each other and compete with each other, achieves a better generative model and discriminative model. The generative model generates fake data samples under given Gaussian noise and additional conditional information. The fake data samples and real data samples are input into the discriminator to determine authenticity. When the CGAN model is initialized, the fake data samples generated by the generator are marked as 0 (fake) and the real data samples are marked as 1 (true).

[0106] Figure 5 In order to generate the geomagnetic fingerprint library, the geomagnetic data are collected by mobile devices to build the geomagnetic fingerprint library, and then the geomagnetic fingerprint is generated by the generation model. Then, the generated geomagnetic fingerprint and the collected geomagnetic fingerprint are merged to form the generated geomagnetic fingerprint library.

[0107] Figure 6 This paper designs a sliding window process for constructing geomagnetic sequence fingerprints, where n is the number of reference points in a path. The geomagnetic data of the reference points along the path are concatenated using the order of the sliding window to form a geomagnetic sequence. The position label of the geomagnetic sequence is the last position in the sliding window. In this paper, the sliding window is set to 3, and the sliding step is 1.

[0108] Figure 7 This paper proposes a convolutional gated recurrent unit network model based on the attention mechanism, which consists of four parts: a one-dimensional convolutional neural network, a gated logic unit, an attention mechanism and a predictor.

[0109] Figure 8 This is the computational process of a one-dimensional convolutional neural network. The one-dimensional convolutional neural network consists of two one-dimensional convolutional layers and a flatten layer. The convolutional network is used to extract the spatial features of the geomagnetic sequence, and the flatten layer is used for flattening.

[0110] Figure 9 For the GRU workflow, where x t is the input of the GRU network at time t, h t is the cell state information at time t, y t is the output of the GRU network at time t, α t Give y to the attention mechanism t The Dropout function addresses the overfitting problem of the GRU network by randomly disconnecting some of its links. The fully connected layer has 512 neurons and uses the ReLU activation function to perform nonlinear transformations on the linear output of the fully connected layer, ultimately outputting the position result.

[0111] Figure 10 For the mobile hardware structure, the mobile device is equipped with a Raspberry Pi (processor), a nine-axis geomagnetic sensor (Microprocessor Unit, MPU) and an LCD display. The LCD display and the nine-axis geomagnetic sensor communicate with the Raspberry Pi through the IIC protocol.

[0112] Figure 11 In order to locate the measured map online using the hardware positioning system, the experimenters used a handheld positioning device to obtain geomagnetic data in real time through a nine-axis geomagnetic sensor. The Raspberry Pi (4B) processor used the Python language to process the data online to obtain the positioning results and displayed the position coordinates on the LCD screen.

[0113] Figure 12 This is a schematic diagram of a plane space. This paper uses the hall of a laboratory building in China University of Mining and Technology as the experimental environment. The scale of the site is 4m×4m. The hall is divided into grids of 0.2m×0.2m. Figure 10 The mobile device collects, processes and saves data. The sampling time of each reference point is 10s, the sampling frequency is 10Hz, and a total of 400 reference points are collected.

[0114] Figure 13Figure 2 shows the cumulative error distribution function (CDF) for GMFD and MFD. It can be seen from the figure that for the positioning model trained with GMFD-1, 97% of the data had a positioning error within 0.6m; for the positioning model trained with GMFD-2, 94% of the data had a positioning error within 0.6m; however, for the positioning model trained with MFD, only 92% of the data had a positioning error within 0.6m.

[0115] Figure 14 The figure shows the impact of reference point spacing on positioning accuracy and workload. The figure shows that positioning error increases with increasing reference point spacing. However, increasing the reference point spacing significantly reduces the number of reference points collected, thereby reducing acquisition costs. The figure also shows that the GMFD positioning accuracy of the CVAE and CGAN networks is roughly the same, and the optimal reference point spacing is 0.4 to 0.6 meters.

[0116] Figure 15 The CDF plots of the positioning errors for GMFD and MFD are shown. The positioning models were trained using MFD constructed with a reference interval of 0.2m and GMFD generated with a reference interval of 0.4m. As can be seen from the figure, when the reference point interval is 0.4m, 87% of the data in the positioning model trained with GMFD has a positioning error within 0.4m; when the reference point interval is 0.2m, 89% of the data in the positioning model trained with MFD has a positioning error within 0.4m. With a reference point interval of 0.2m, 400 reference points need to be collected, while with a reference point interval of 0.4m, only 100 reference points need to be collected. This also demonstrates the correctness and effectiveness of the generative network proposed in this paper.

[0117] Figure 16 The average positioning error of the generated GMFD-trained positioning model, with a reference point spacing of 1.0m, and the average positioning error of the MFD-trained positioning model is 1.08m. The two generative networks generate geomagnetic fingerprints for cell sizes of 0.2m×0.2m, 0.4m×0.4m, 0.6m×0.6m, and 0.8m×0.8m. The figure shows that the fingerprint library generated by the CGAN network slightly outperforms the fingerprint library generated by the CVAE network. It can be seen that the average positioning error increases with increasing generation spacing.

[0118] Figure 17 This is the CDF diagram of the positioning error of the RNN neural network model and the proposed neural network model. It can be observed from the figure that for the proposed neural network model, the data with positioning error within 0.4m accounts for 96%, while the RNN model and MLP model account for 94% and 87% respectively.

[0119] Figure 18The true path and the recovered path are plotted. It can be observed from the figure that the network proposed in this paper can effectively recover the trajectory.

[0120] In a specific implementation, the present application provides a computer storage medium and a corresponding data processing unit, wherein the computer storage medium is capable of storing a computer program that, when executed by the data processing unit, can run the invention content of the method for high-precision indoor geomagnetic positioning based on a generative model provided by the present invention and some or all of the steps in each embodiment. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0121] Those skilled in the art can clearly understand that the technical solutions in the embodiments of the present invention can be implemented by means of computer programs and their corresponding general hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a computer program, i.e., a software product. The computer program software product can be stored in a storage medium and includes a number of instructions for enabling a device including a data processing unit (which can be a personal computer, server, single-chip microcomputer, MUU or network device, etc.) to execute the methods described in various embodiments of the present invention or certain parts of the embodiments.

[0122] The present invention provides a method and concept for a high-precision indoor geomagnetic positioning method based on a generative model. There are many methods and approaches for implementing this technical solution. The above is only a preferred embodiment of the present invention. It should be noted that those skilled in the art may make various improvements and modifications without departing from the principles of the present invention, and such improvements and modifications should also be considered within the scope of protection of the present invention. Any components not specified in this embodiment may be implemented using existing technologies.

Claims

1. A geomagnetic indoor high-precision positioning method based on a generative model, characterized in that: It consists of two parts: the construction of a generative fingerprint library based on a generative model and a geomagnetic sequence positioning method based on a convolutional gated recurrent unit with an attention mechanism; The construction of a generative fingerprint library based on a generative model includes: constructing a generative fingerprint library based on two generative network models, the conditional variational autoencoder (CVAE) and the conditional adversarial generative network (CGAN); a geomagnetic sequence positioning method based on a convolutional gated recurrent unit with an attention mechanism, including: using the constructed fingerprint library for positioning to complete high-precision indoor geomagnetic positioning based on a generative model; The generation model-based fingerprint library construction includes: an offline stage and a fingerprint generation stage; The offline phase includes: Step 1: Use mobile collection equipment to collect geomagnetic characteristics of reference points and build a geomagnetic fingerprint library; Step 2: convert the geomagnetic fingerprint in the geomagnetic fingerprint library constructed in step 1 into the world coordinate system to establish the geomagnetic fingerprint library in the world coordinate system; Step 3: Model training. Two generative network models, the conditional variational autoencoder (CVAE) and the conditional adversarial generative network (CGAN), are used to learn the probability distribution of indoor magnetic field strength and reconstruct the geomagnetic fingerprint of a specified location. This involves training the conditional variational autoencoder (CVAE) and the conditional adversarial generative network (CGAN). The fingerprint generation phase includes: Step 4, geomagnetic fingerprint generation, using the trained conditional variational autoencoder CVAE and conditional adversarial generative network CGAN to generate geomagnetic fingerprints, respectively, the decoder in the conditional variational autoencoder CVAE and the generative network in the conditional adversarial generative network CGAN are used as virtual fingerprint generators, the input of the generator is random noise obeying the standard normal distribution and the specified location coordinates, and the output of the generator is a virtual fingerprint, i.e., the geomagnetic fingerprint of the specified location; Step 5: construct a generated geomagnetic fingerprint library GMFD, and merge the geomagnetic fingerprint output by the generator described in step 4 with the geomagnetic fingerprint library described in step 2 to form a generated geomagnetic fingerprint library.

2. The method for high-precision indoor geomagnetic positioning based on a generative model according to claim 1, characterized in that: The geomagnetic fingerprint library MFD described in step 1 is expressed as follows: Among them, (x i ,y i ) is the position coordinate of the i-th reference point, i=1,2,…,n, n is the number of reference points, M x_i 、M y_i and M z_i are the intensities of the Earth’s magnetic field along the x-axis, y-axis, and z-axis at the i-th reference point, respectively. i Represents the modulus of the Earth's magnetic field strength at the i-th reference point. The calculation method is as follows:

3. The method for high-precision indoor geomagnetic positioning based on a generative model according to claim 2, wherein: The step 2 of establishing a geomagnetic fingerprint library in a world coordinate system is to convert the geomagnetic fingerprint in the geomagnetic fingerprint library constructed in step 1, i.e., the collected geomagnetic data, into a world coordinate system. The specific method includes: Among them, the collected geomagnetic data is (M x ,M y ,M z ), the geomagnetic fingerprint in the transformed world coordinate system is (M′ x ,M′ y ,M′ z ), the rotation matrix R is calculated as follows: R=R α R β R γ Among them, the rotation matrix around the z axis is R α , the rotation matrix around the x-axis is R β And the rotation matrix R around the y-axis γ The expression is as follows: The pitch angle γ, the roll angle γ, and the heading angle α are the rotation angles of the geomagnetic sensor in the mobile acquisition device described in step 1 along the x-axis, y-axis, and z-axis.

4. The method for high-precision indoor geomagnetic positioning based on a generative model according to claim 3, wherein: The training of the conditional variational autoencoder (CVAE) described in step 3 includes the following steps: The geomagnetic fingerprint sample m in the geomagnetic fingerprint library and the specified position c are input into the encoder of the conditional variational autoencoder CVAE for encoding to obtain the probability distribution of the geomagnetic fingerprint, and then the probability distribution is resampled to obtain the latent variable a; the latent variable a and the specified position c are input into the decoder of the conditional variational autoencoder CVAE for decoding to reconstruct the geomagnetic fingerprint m′, that is, given the position c, from the probability distribution p θ (m|a,c) generates geomagnetic fingerprint m′, where θ is the parameter of the decoder in the conditional variational autoencoder CVAE; the posterior distribution probability of the encoder is estimated as q using the stochastic gradient variational Bayes SGVB framework. φ (a|m,c), where φ is the parameter of the encoder; the loss function L(θ,φ;m,a) of the conditional variational autoencoder CVAE is: in, is the reconstruction loss of the conditional variational autoencoder CVAE, which is used to measure the difference between input and output, D KL (q φ (a|m,c)‖p(a|c))=D KL (N(μ a ,σ a 2 )‖N(0,I)) is the KL divergence, where μ a represents the mean of the latent variable, σ a 2 represents the variance of the latent variable, N represents normal distribution, and I represents the unit matrix. Substituting the mean and variance generated in the geomagnetic fingerprint sample into the KL divergence formula, we get: Among them, K represents a geomagnetic fingerprint sample generating K groups of means and variances, j represents the specific number of groups of the current mean and standard deviation, KL b The KL divergence is calculated by weighting the mean and variance of all K groups of any sample b. represents the variance of the jth group, represents the square of the mean of group j; Using the reparameterization technique, that is, the latent variable a is sampled from the standard normal distribution, so that the latent variable a is back-propagated, and the conditional variational autoencoder CVAE is trained using the gradient descent algorithm. The back-propagation loss function L(θ,φ) of the conditional variational autoencoder CVAE is: Where M is the number of geomagnetic fingerprints in the geomagnetic fingerprint database, m p is the pth geomagnetic fingerprint sample input of the encoder, Reconstructed geomagnetic samples output for the decoder.

5. The method for high-precision indoor geomagnetic positioning based on a generative model according to claim 4, characterized in that: The training of the conditional adversarial generative network (CGAN) described in step 3 specifically includes: The conditional information and random noise are taken as the input of the conditional adversarial generation network CGAN. The conditional adversarial generation network CGAN generates geomagnetic fingerprint samples according to the given conditional information, i.e., the position coordinates. Given the distribution law of the noise d and the given condition, i.e., the position coordinates f, the conditional adversarial generation network CGAN converts the noise d into geomagnetic fingerprint data e′ with unknown distribution law. The conditional adversarial generation network CGAN minimizes p G (e′,f) and p data The divergence distance between (e,f), where p G (e′,f) is the distribution function of the generated geomagnetic fingerprint e′, p data (e,f) are the true geomagnetic fingerprint distribution function and the loss function L of the conditional adversarial generation network CGAN G as follows: in, represents the expectation of generating data distribution, D represents the discriminator, and G represents the generator; The distribution function p of the geomagnetic fingerprint generated by the discriminant network G (e′,f) and the true geomagnetic fingerprint distribution function p data The divergence distance between (e,f), the loss function L of the discriminant network D as follows: in, Represents the expectation of the true data distribution; After the conditional adversarial generative network CGAN has gone through a preset number of iterations, the training of the generative network and the discriminative network is completed, and the conditional adversarial generative network optimization function as follows: Among them, p d is the probability distribution obeyed by the input noise d, p f is the probability distribution of the input condition f.

6. The method for high-precision indoor geomagnetic positioning based on a generative model according to claim 5, characterized in that: The geomagnetic sequence positioning method based on the convolutional gated recurrent unit of the attention mechanism includes: an offline stage and an online stage; The offline phase includes: Based on the generated fingerprint library GMFD, a sliding window is designed to construct the geomagnetic sequence. The geomagnetic fingerprint data of the reference points in the path are connected in the order of the sliding window to form a geomagnetic sequence. The position label of the geomagnetic sequence is the last position in the sliding window, and the geomagnetic sequence fingerprint library is constructed based on this. Design a network model of convolutional gated recurrent unit (CNN-GRU) based on the attention mechanism, which consists of four parts: a one-dimensional convolutional network, a gated recurrent unit, an attention mechanism, and a predictor. Training the network model based on the geomagnetic sequence fingerprint library; The online phase includes: Collect geomagnetic characteristics of test points and construct geomagnetic sequences; Fingerprint matching, online collection and construction of the feature value of the geomagnetic sequence is input into the trained network model of the convolutional gated recurrent unit CNN-GRU based on the attention mechanism, and the position result is obtained to complete the geomagnetic indoor high-precision positioning based on the generative model.

7. A mobile terminal collection and real-time positioning system, characterized in that: Including acquisition system and real-time positioning method; The acquisition system includes: an acquisition device, a Raspberry Pi processor, a nine-axis geomagnetic sensor MPU and a liquid crystal display; the liquid crystal display and the nine-axis geomagnetic sensor communicate with the Raspberry Pi processor via the IIC communication protocol; The real-time positioning method adopts the geomagnetic indoor high-precision positioning method based on the generation model described in claim 6, including: an offline stage, training the positioning model; an online stage, using the acquisition system to collect geomagnetic data in real time, and using the trained positioning model to output the position result in real time.

8. A mobile terminal data collection and real-time positioning system according to claim 7, characterized in that: The Raspberry Pi processor is used for data processing and storage. The nine-axis geomagnetic sensor model is MPU9250, which is used to collect geomagnetic data, acceleration and angular velocity. The display screen is used to display the positioning results in real time.

9. A mobile terminal data collection and real-time positioning system according to claim 8, characterized in that: The method for training the positioning model is: using Python language to perform model training.

Citation Information

Patent Citations

  • iBeacon-assisted geomagnetic indoor real scene navigation method

    CN108120436A

  • Indoor fingerprint positioning method and system based on geomagnetic sensor array

    CN109115205A