Indoor magnetic field data prediction method and device based on double-circulation LSTM neural network

By extracting and adaptively fusing horizontal and vertical features through a dual-loop LSTM neural network, the problems of time-consuming data acquisition and low model convergence efficiency in traditional magnetic field positioning technology are solved, achieving efficient and accurate prediction of magnetic fields on multiple floors, which is suitable for indoor positioning and navigation.

CN121093776APending Publication Date: 2025-12-09ZHONGBEI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511251159.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-12-09

AI Technical Summary

Technical Problem

Existing indoor magnetic field positioning technologies are time-consuming and labor-intensive in data acquisition, and do not fully utilize the spatiotemporal correlation characteristics. Traditional LSTM networks cannot capture the cross-floor magnetic field propagation patterns in the vertical dimension, leading to the failure of spatial feature extraction and easy gradient explosion, which reduces the model convergence efficiency.

Method used

By employing a dual-loop LSTM neural network, feature extraction is performed in both horizontal and vertical directions. This is combined with an adaptive gating mechanism for feature concatenation and weighted fusion. Circular topology modeling is used to address the discontinuity in the neighborhood of edge points, enabling accurate prediction of the magnetic field distribution across multiple floors.

Benefits of technology

It effectively reduces the workload of data collection, improves the accuracy and efficiency of multi-story magnetic field prediction, and is a low-cost positioning system suitable for large multi-story buildings, providing efficient positioning information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121093776A_ABST
    Figure CN121093776A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an indoor magnetic field data prediction method and device based on a double-circulation LSTM neural network. The method comprises the steps of collecting magnetic field intensity sequence data; performing transverse feature extraction and longitudinal feature extraction on the magnetic field intensity sequence data through a double-circulation LSTM neural network; carrying out feature splicing and weighted fusion on the extracted transverse features and longitudinal features based on a self-adaptive gating mechanism to obtain dynamic gating fusion features; mapping the dynamic gating fusion feature into a three-dimensional magnetic field value through a full connection layer to obtain a magnetic field prediction result; wherein the magnetic field intensity sequence data comprises transverse magnetic field intensity sequence data representing magnetic field changes of adjacent sampling points in the same floor, and longitudinal magnetic field intensity sequence data representing magnetic field changes of the same sampling point across floors in different floors; the method can effectively improve the precision and efficiency of multi-floor magnetic field prediction, and is suitable for the field of indoor positioning.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of indoor positioning, in particular to an indoor magnetic field data prediction method and device based on a double-cycle LSTM neural network. BACKGROUND

[0002] Magnetic positioning is a technology that uses magnetic field signals to realize object position (or attitude) perception. Its core is to detect the strength, direction or distribution characteristics of the magnetic field and calculate the spatial coordinates of the target through algorithms. Due to the strong penetration of magnetic field (not affected by non-magnetic shielding) and low device cost, it is widely used in indoor positioning, industrial navigation, consumer electronics and other fields.

[0003] Traditional magnetic positioning technology mostly focuses on single-floor positioning accuracy optimization. For example, researcher Li Peihao improved the KNN matching positioning algorithm to improve the efficiency and stability of indoor positioning technology; Gong Qingqing realized magnetic field fingerprint matching through magnetic signal noise reduction processing and magnetic field strength numerical range change based on Kalman filter. However, these methods need to pre-collect complete magnetic field data of the target floor, and do not fully utilize the spatio-temporal correlation characteristics of indoor magnetic field data.

[0004] In recent years, the development of deep learning technology has provided a new idea for indoor magnetic field prediction. Scholar Fernandes, L. adopted CNN and long short-term memory network (LSTM), and integrated their results through independent training to obtain a probability map of user position; Ouyang G proposed a magnetic field positioning system based on time convolution network (TCN), which preprocessed the magnetic field sequence features through coordinate transformation, smoothing filtering and first-order difference; however, these neural networks need to collect detailed magnetic field data of different floors during the early training, which greatly increases the time cost and reduces the experimental efficiency.

[0005] Therefore, how to construct a magnetic field data prediction model that takes into account high efficiency and high accuracy has become a key problem in the direction of indoor magnetic positioning.

[0006] In summary, the existing indoor magnetic positioning technology relies on layer-by-layer high-density collection of magnetic fingerprint data, which has problems such as time-consuming and laborious data collection, insufficient utilization of spatio-temporal correlation characteristics, etc. The traditional LSTM network can only process horizontal time sequence information between floors and cannot capture the vertical dimension of cross-floor magnetic field propagation rules, and the discontinuity of the neighborhood of the corridor edge point leads to failure of spatial feature extraction. In addition, simply concatenating horizontal and vertical features can easily cause gradient explosion, reducing the convergence efficiency of the model. SUMMARY

[0007] To solve one of the above technical defects, the embodiment of the present application provides an indoor magnetic field data prediction method and device based on a double-loop LSTM neural network, which can effectively improve the accuracy and efficiency of multi-floor magnetic field prediction.

[0008] In a first aspect of the embodiment of the present application, the indoor magnetic field data prediction method based on a double-loop LSTM neural network comprises: collecting magnetic field intensity sequence data; extracting horizontal features and vertical features of the magnetic field intensity sequence data through a double-loop LSTM neural network; performing feature splicing and weighted fusion on the extracted horizontal features and vertical features based on an adaptive gating mechanism to obtain dynamic gated fusion features; mapping the dynamic gated fusion features to three-dimensional magnetic field values through a fully connected layer to obtain a magnetic field prediction result; The magnetic field intensity sequence data includes horizontal magnetic field intensity sequence data representing the magnetic field change of adjacent sampling points in the same floor, and vertical magnetic field intensity sequence data representing the magnetic field change of the same sampling point in different floors.

[0009] In an optional embodiment of the present application, the double-loop LSTM neural network comprises a horizontal LSTM neural network and a vertical LSTM neural network. The double-loop LSTM neural network extracts horizontal features and vertical features of the magnetic field intensity sequence data, comprising: inputting the horizontal magnetic field intensity sequence data into the horizontal LSTM neural network to obtain horizontal features; inputting the vertical magnetic field intensity sequence data into the vertical LSTM neural network to obtain vertical features.

[0010] In an optional embodiment of the present application, the vertical LSTM neural network comprises a bottom-layer LSTM and a top-layer LSTM. The bottom-layer LSTM and the top-layer LSTM adopt a double-layer LSTM stacking structure to learn the linear decay trend of the magnetic field with the floor rising and capture the nonlinear mutation features caused by the building structure, and extract features of the input vertical magnetic field intensity sequence.

[0011] In an optional embodiment of the present application, the calculation expression of the double-layer LSTM stacking structure is: ; Wherein, represents the bottom-layer LSTM, represents the top-layer LSTM; represents the vertical input sequence of the sampling point P. This represents the output feature vector of the longitudinal LSTM neural network, i.e., the longitudinal feature.

[0012] In an optional embodiment of this application, the transverse magnetic field strength sequence data is constructed using a ring topology modeling mechanism, the expression of which is: ; in, Indicates the radius of the domain. Indicates the total number of sampling points. Indicates the number of floors; Indicates the first Within the building, the data is offset backward from the starting sampling point. The magnetic field strength value at each location, Indicates the first Within the floors, shift positively from the last sampling point of the collected data. The magnetic field strength value at each location; The modulo operator is used to convert a linear neighborhood index into a ring topology. This represents the horizontal input sequence of sampling point P on the Pth floor.

[0013] In an optional embodiment of this application, the adaptive gating mechanism performs feature concatenation and weighted fusion on the extracted horizontal and vertical features to obtain dynamically gated fused features; including: Weighting coefficients are constructed based on the floor level scenario; By using a weighted summation method, horizontal and vertical features are fused to obtain dynamically gated fused features.

[0014] In an optional embodiment of this application, the expression for the weighting coefficient is: ; in, Indicates the weighting coefficient; This represents the weight matrix obtained by training and learning scene feature mappings. Indicates splicing characteristics; Represents the sigmoid function; The The expression is: ; in, This represents the output feature vector of the horizontal LSTM neural network, i.e., the horizontal feature.

[0015] In an optional embodiment of this application, the expression for the dynamic gating fusion feature is: ; wherein, represents dynamic gated fusion features; represents element-wise multiplication.

[0016] A second aspect of the embodiments of the present application provides an indoor magnetic field data prediction system based on a double-loop LSTM neural network, comprising: a collection unit configured to collect magnetic field intensity sequence data; a double-loop LSTM neural network configured to perform horizontal feature extraction and longitudinal feature extraction on the magnetic field intensity sequence data; a feature fusion unit configured to perform feature splicing and weighted fusion on the extracted horizontal features and longitudinal features based on an adaptive gating mechanism to obtain dynamic gated fusion features; a mapping output unit configured to map the dynamic gated fusion features to three-dimensional magnetic field values through a fully connected layer to obtain a magnetic field prediction result.

[0017] A third aspect of the embodiments of the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the method of any one of the above.

[0018] Compared with the prior art, the indoor magnetic field data prediction method and device based on a double-loop LSTM neural network provided in the embodiments of the present application have the following advantages: 1. The indoor magnetic field data prediction method and device based on a double-loop LSTM neural network provided in the embodiments of the present application can simultaneously capture the horizontal spatial correlation and vertical propagation law of the magnetic field through a double-loop LSTM neural network, perform horizontal feature extraction and longitudinal feature extraction on the magnetic field intensity sequence data, and combine the adaptive gating mechanism to fuse the horizontal features and longitudinal features of the double modalities, thereby realizing accurate prediction of the multi-floor magnetic field distribution, effectively reducing the data collection workload, meeting the efficient and low-cost application requirements of the positioning system of large multi-story buildings, and having high practicality.

[0019] 2. In the embodiments of the present application, the horizontal magnetic field intensity sequence data is constructed using a ring topology modeling mechanism, and the edge point feature loss problem is solved by using ring neighborhood topology reconstruction, so that the horizontal LSTM neural network can capture the gradient change of the magnetic field in the straight corridor and the spatial correlation of adjacent sampling points, thereby improving the magnetic field prediction accuracy in a single floor.

[0020] Other features and advantages of the present application will be described in the following description, and some will become apparent from the description, or will be learned from practice of the present application. The purpose and other advantages of the present application can be achieved and obtained by the content indicated in the written description, claims, and drawings. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A schematic diagram of the LSTM model; Figure 2 A flowchart illustrating an indoor magnetic field data prediction method based on a dual-loop LSTM neural network, provided as an embodiment of this application; Figure 3 This is a flowchart illustrating steps S20 and S30 of an indoor magnetic field data prediction method based on a dual-loop LSTM neural network provided in an embodiment of this application. Figure 4 This is a schematic diagram illustrating the construction of toroidal magnetic field data in one embodiment of this application; Figure 5 This is a schematic diagram of the sampling node layout in one embodiment of this application; Figure 6 This is a comparison diagram of the sampled data before and after Kalman filtering in one embodiment of this application; Figure 7 This is a schematic diagram comparing the predicted magnetic field result of the fifth layer with the actual value in one embodiment of this application; Figure 8 This is a schematic diagram comparing the predicted magnetic field result of the 6th layer with the actual value in one embodiment of this application; Figure 9 This is a schematic diagram comparing the predicted magnetic field result of the 7th layer with the actual value in one embodiment of this application; Figure 10 This is a schematic diagram comparing the predicted magnetic field result of the 8th layer with the actual value in one embodiment of this application. Detailed Implementation

[0022] The solutions in this application embodiment can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0023] To make the technical solutions and advantages of the embodiments of this application clearer, the exemplary embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0024] A magnetic sequence refers to a sequence of magnetic field strength data collected at different time points or spatial locations. It typically contains three-dimensional components (magnetic field strength along the X, Y, and Z axes, measured in μT). Magnetic sequences exhibit temporal dependence and spatial correlation. For example, in a corridor, a magnetic sequence may include the magnetic field change sequence of adjacent sampling points on the same floor (lateral magnetic field strength sequence data), as well as the magnetic field evolution sequence of the same sampling point on different floors (longitudinal magnetic field strength sequence data).

[0025] LSTM (Long Short-Term Memory) neural network is a special type of recurrent neural network (RNN) used to solve the gradient vanishing or gradient explosion problems that traditional RNNs encounter when processing long sequences. It can effectively capture long-term dependencies in sequence data.

[0026] The core principle of LSTM neural networks lies in their special memory cell structure, which controls the flow of information and the updating of memory through three gating mechanisms (input gate, forget gate, and output gate), thereby achieving long-term preservation of important information and forgetting of irrelevant information.

[0027] like Figure 1 As shown, the LSTM neural network controls the flow of information through its forget gate, input gate, and output gate, processing the input sequence step by step. This process includes: Sequence input: Input data is fed into the LSTM neural network; Gated computation: updating memory cells using sigmoid and tanh functions; Feature output: Generate hidden states to capture long-term dependencies in the sequence for subsequent prediction.

[0028] In indoor magnetic field prediction, the input data for the LSTM neural network is a three-dimensional vector (X, Y, Z axis magnetic field strength, unit μT) of the magnetic field strength sequence data for each time step or spatial step. For example: Input It can be the first The magnetic field data of each sampling point (dimension 1×3) is output as the predicted magnetic field value, i.e. the magnetic field vector at the next time step or target location.

[0029] In practical applications, the input is a historical magnetic field sequence (such as horizontal magnetic field strength sequence data or vertical magnetic field strength sequence data within a floor), with each element being a three-dimensional vector; the output is the predicted three-dimensional magnetic field value (X, Y, Z components), which can be directly used in the positioning system.

[0030] The specific computational process of an LSTM neural network may include: Forget gate: determines which information to discard from memory units, using a forgetting factor calculated by the sigmoid function.

[0031] (1); where, is the output of the forget gate, is the weight matrix of the forget gate, is the hidden state of the previous time step, is the input of the current time step (i.e., one data point in the magnetic sequence, such as a three-dimensional magnetic field vector), is the bias term of the forget gate, is the sigmoid function.

[0032] Input gate: decides which new information will be added to the memory cell. It also uses a sigmoid function to calculate an input factor and combines it with a tanh function to generate a new candidate value.

[0033] (2); (3); Equation (2) shows the output of the input gate, and equation (3) calculates the candidate memory cell state.

[0034] where, and are the weight matrices of the input gate and the candidate memory cell; and are the corresponding bias terms.

[0035] Memory cell update: updates the state of the memory cell based on the results of the forget gate and the input gate.

[0036] (4); where, is the memory cell state of the current time step, is the memory cell state of the previous time step, denotes element-wise multiplication.

[0037] Output gate: calculates the output of the LSTM unit based on the updated memory cell state using a combination of the sigmoid function and the tanh function.

[0038] (5); (6); Equation (5) represents the output of the output gate, and equation (6) is used to calculate the final output of the LSTM neural network.

[0039] where, is the weight matrix of the output gate, is a bias term of the output gate.

[0040] Although the traditional LSTM neural network can realize indoor magnetic field prediction, there are significant limitations in the three-dimensional indoor magnetic field cross-floor prediction task. The one-way time sequence modeling mechanism can only utilize the transverse sequence information between floors to learn and evolve the magnetic field data of the same floor, and cannot capture the spatial correlation between different layers of sampling points. In addition, in the corridor scene, the distribution of sampling points has a spatial topological feature, and the neighborhood relationship of edge points (such as the starting point and the end point) will also present discontinuity due to the building structure, making it difficult for the traditional LSTM neural network to construct an effective spatial dependence model. If the longitudinal and transverse features are simply combined, it will easily cause gradient explosion due to feature redundancy, reducing the model convergence efficiency.

[0041] To solve the above problems, the embodiment of the present application proposes a dual-loop LSTM neural network (Dual-loop LSTM, referred to as DL-LSTM), which realizes collaborative modeling of multi-dimensional features through a heterogeneous dual-branch structure.

[0042] As shown in Figure 2 The indoor magnetic field data prediction method based on the dual-loop LSTM neural network proposed in the embodiment of the present application comprises: S10, collecting magnetic field intensity sequence data; S20, performing transverse feature extraction and longitudinal feature extraction on the magnetic field intensity sequence data through the dual-loop LSTM neural network; S30, performing feature splicing and weighted fusion on the extracted transverse features and longitudinal features based on an adaptive gating mechanism to obtain dynamic gated fusion features; S40, mapping the dynamic gated fusion features to three-dimensional magnetic field values through a fully connected layer to obtain a magnetic field prediction result; The magnetic field intensity sequence data includes transverse magnetic field intensity sequence data representing the magnetic field change of adjacent sampling points in the same floor, and longitudinal magnetic field intensity sequence data representing the magnetic field change of the same sampling point in different floors.

[0043] In the embodiment of the present application, the dual-loop LSTM neural network is used to simultaneously capture the horizontal spatial correlation and vertical propagation law of the magnetic field, and perform transverse feature extraction and longitudinal feature extraction on the magnetic field intensity sequence data. In combination with the adaptive gating mechanism, the transverse features and longitudinal features of the dual modal are fused to realize accurate prediction of the multi-floor magnetic field distribution, which can effectively reduce the data collection workload, meet the efficient and low-cost application requirements of the positioning system of large multi-story buildings, and has strong practicality.

[0044] In the embodiment of the present application, as Figure 3As shown, the double-cycle LSTM neural network mainly includes two parallel LSTM branches, namely: a horizontal LSTM neural network (mainly used for processing spatial topological sequences) and a vertical LSTM neural network (mainly used for processing vertical dimension sequences).

[0045] The S20 performs horizontal feature extraction and vertical feature extraction on the magnetic field intensity sequence data by using the double-cycle LSTM neural network; and the S20 includes the following steps. S201, input the horizontal magnetic field intensity sequence data into the horizontal LSTM neural network to obtain horizontal features. S202, input the vertical magnetic field intensity sequence data into the vertical LSTM neural network to obtain vertical features.

[0046] Specifically, the vertical LSTM neural network includes a bottom-layer LSTM and a top-layer LSTM. The bottom-layer LSTM and the top-layer LSTM adopt a double-layer LSTM stacking structure, and perform feature extraction on the input vertical magnetic field intensity sequence by learning a linear decay trend of the magnetic field with the increase of the floor and capturing nonlinear mutation features caused by the building structure.

[0047] In the embodiments of the present application, for the magnetic field data evolution characteristics across floors, the magnetic field data of the sampling point P at the historical k floors (l to k floors) are extracted and arranged as an input sequence to capture the evolution law of the magnetic field in the vertical dimension. That is, the vertical magnetic field intensity sequence data (referred to as vertical sequence) refers to the magnetic field data sequence formed by the magnetic field data collected by the corresponding sampling points at the same horizontal position (such as the same coordinate point) but different heights in different floors. For example, when k=3, the model can learn the magnetic field change trend of the sampling point P caused by the height change in the previous 3 floors of the current prediction floor, solving the problem that the traditional single-floor model cannot model the height correlation.

[0048] The input of the vertical LSTM neural network is the vertical magnetic field intensity sequence data, and its expression is: (7) ; Wherein refers to the vertical input sequence of the sampling point P, and the dimension is k x 3, k is the number of historical floors, and 3 corresponds to the x, y, and z components of the magnetic field.

[0049] With the increase of the floor, the magnetic field strength will appear nonlinear variation characteristics (such as exponential decay or mutation), in order to better capture the change rule and improve the problem that the longitudinal magnetic field data sequence is too short to fully learn the magnetic field data change, in the application, a double-layer LSTM stack is introduced to enhance the extraction ability of nonlinear evolution characteristics; compared with a single-layer structure, the double-layer LSTM stack design can enhance the nonlinear feature extraction capability. In the double-layer LSTM stack structure, the bottom-layer LSTM learns the linear decay trend of the magnetic field with the increase of the floor (such as the vertical decay of the Z-axis component), and the top-layer LSTM captures the nonlinear mutation caused by the building structure (such as the interference of reinforced concrete on the magnetic field), so that the longitudinal LSTM neural network can adapt to the complex mapping relationship of "floor-magnetic field", and improve the prediction ability of the magnetic field strength in the high-order change of the magnetic field strength with the increase of the floor.

[0050] In the embodiment of the application, the calculation expression of the double-layer LSTM stack structure is: (8) ; Wherein, represents the bottom-layer LSTM, represents the top-layer LSTM. represents the longitudinal input sequence of the sampling point P. represents the output feature vector of the longitudinal LSTM neural network, that is, the longitudinal feature.

[0051] In a specific embodiment, wherein the number of neurons of the bottom-layer LSTM can be 128, and the floor-to-floor magnetic field change trend is learned; the number of neurons of the top-layer LSTM can be 64, and the nonlinear mutation characteristics (such as the magnetic field interference of the reinforced concrete structure) are captured; the dimension of the output feature vector can be 64, and the cross-floor magnetic field evolution law is represented.

[0052] As shown in Figure 4 , in the embodiment of the application, the transverse magnetic field strength sequence data is constructed by using a ring topology modeling mechanism, and its expression is: (9) ; Wherein, represents the field radius, represents the total number of sampling points, represents the number of floors; represents the magnetic field strength value of the sampling point offset by positions in the reverse direction (wherein the reverse direction can be counterclockwise) from the starting sampling point of the collected data in the i-th floor, represents the magnetic field strength value of the sampling point offset by positions in the reverse direction (wherein the reverse direction can be counterclockwise) from the starting sampling point of the collected data in the i-th floor, floor, offset from the last sampling point in the data collection direction the magnetic field strength value of the position in the forward direction (wherein the forward direction can be the clockwise direction); represents a modulo operator symbol, used to convert the linear neighborhood index to a ring topology; represents the first the lateral input sequence of the floor sampling point P.

[0053] The lateral feature extraction formula is: (10); Specifically, the lateral feature is extracted by a single-layer lateral LSTM neural network, learning the magnetic field variation law caused by the spatial distribution of the sampling points in the same floor; through the ring neighborhood input, the lateral LSTM neural network can capture the gradient change of the magnetic field in the straight corridor and the spatial correlation of adjacent sampling points, improving the magnetic field prediction accuracy in a single floor.

[0054] In the embodiments of the application, the linear neighborhood index is converted into a ring topology by using a modulo operation, ensuring that the edge point neighborhood is closed, ensuring that the sampling points at the doorway can still obtain complete neighborhood information, avoiding the loss of edge features caused by the traditional linear index, and solving the problem of discontinuous neighborhood of the edge points (such as the starting point) of the corridor.

[0055] In the embodiments of the application, the S30, based on the adaptive gating mechanism, performs feature splicing and weighted fusion on the extracted lateral features and longitudinal features to obtain dynamic gating fusion features; comprising: S301, constructing a weight coefficient based on the floor scene; S302, performing feature fusion on the lateral features and the longitudinal features by weighted summation to obtain dynamic gating fusion features.

[0056] Specifically, the expression of the weight coefficient is: (11); wherein, represents the weight coefficient, ranging from 0 to 1; represents a weight matrix obtained by training and learning the scene feature mapping, which can be increased in the corridor scene to increase the lateral weight, and to increase the longitudinal weight in the stairwell scene; represents the spliced features; represents a sigmoid function; The expression of the is: (12); wherein, represents the output feature vector of the transverse LSTM neural network, namely: transverse feature.

[0057] Further, the expression of the dynamic gate fusion feature is: (13) ; wherein, represents the dynamic gate fusion feature; represents element-wise multiplication.

[0058] In the embodiment of the application, the double-branch features are fused by weighted summation to suppress redundant information. When the longitudinal feature and the transverse feature conflict, the gate mechanism will automatically reduce the weight of the conflicting feature, avoiding prediction bias.

[0059] In the embodiment of the application, the S40 maps the dynamic gate fusion feature to a three-dimensional magnetic field value through a fully connected layer, and the expression of the magnetic field prediction result is: (14) ; wherein, represents the weight relationship learned by training to map the abstract feature to the magnetic field physical space, and the dimension of the output layer weight matrix is 3xd (d is the dimension of the fusion feature); represents the output layer bias vector, which has a dimension of 1x3 and is used to adjust the baseline of the predicted value to avoid prediction bias caused by feature value deviation; represents the three-dimensional magnetic field prediction value of the l-th sampling point p, which has a dimension of 1x3 and corresponds to the x, y and z three-axis components, and the unit is μT.

[0060] It should be understood that although each step in the flowchart is displayed in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the figure can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.

[0061] One embodiment of the application provides an indoor magnetic field data prediction system based on a double-loop LSTM neural network, comprising: An acquisition unit for acquiring magnetic field intensity sequence data; The double-cycle LSTM neural network is used for transverse feature extraction and longitudinal feature extraction on the magnetic field intensity sequence data. The feature fusion unit is configured to perform feature splicing and weighted fusion on the extracted transverse features and longitudinal features based on an adaptive gating mechanism to obtain dynamic gated fusion features. The mapping output unit is configured to map the dynamic gated fusion features to three-dimensional magnetic field values through a fully connected layer to obtain a magnetic field prediction result.

[0062] For specific limitations of the indoor magnetic field data prediction system based on the double-cycle LSTM neural network described above, refer to the limitations of the indoor magnetic field data prediction method based on the double-cycle LSTM neural network described above, which will not be repeated here.

[0063] Each module in the indoor magnetic field data prediction system based on the double-cycle LSTM neural network described above can be realized by software, hardware, and combinations thereof, in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0064] In one embodiment, a computer device is provided, which includes a processor, a memory, a network interface and a database connected by a system bus. Wherein, the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data. The network interface of the computer device is configured to communicate with external terminals through network connection. The computer program is executed by the processor to implement the indoor magnetic field data prediction method based on the double-cycle LSTM neural network as described above. Including: including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement any step in the indoor magnetic field data prediction method based on the double-cycle LSTM neural network as described above.

[0065] In one embodiment, a computer-readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement any step in the indoor magnetic field data prediction method based on the double-cycle LSTM neural network as described above.

[0066] In a specific embodiment, a magnetic field data prediction experiment is performed in an indoor environment, and data is collected in a corridor from the second floor to the eighth floor. The sampling point layout and the corridor environment are shown in Figure 5 ​

[0067] The interval between sampling points is 80 cm, which is the same as the size of the floor tile to ensure the consistency of the corresponding sampling points between different floors. 75 sampling points are selected on each floor to collect magnetic field data. The positions of the corresponding sampling points between different floors remain consistent. The mobile phone collection frequency is 100 Hz, and 5 seconds of data (500 magnetic field data) are collected at each sampling point.

[0068] As shown in Figure 6 After data collection, Kalman filtering is performed on the 500 collected data of each single sampling point to make the collected data smoother and reduce data errors. Then, the average value of the 500 filtered data of each sampling point is calculated by dividing them into 5 groups to further reduce errors, and 5 magnetic field data are obtained for subsequent model learning.

[0069] After data processing, five magnetic field data are retained for each sampling point, and the corresponding number of magnetic field data is extracted to form a magnetic field strength sequence data. For example, the first magnetic field data of each sampling point is extracted, which forms a sequence of 75 data. Similarly, there are five data sequences on each floor as training samples for the horizontal LSTM neural network. In a specific embodiment, two, three, and four layers of data can be used as training samples (15 sequences are used for training).

[0070] In the longitudinal sampling points, the first magnetic field data of each sampling point is selected to form the training data sequence. The longitudinal magnetic field strength sequence data should be composed of the corresponding magnetic field data of the first three layers, i.e., each sampling point has three data for longitudinal training.

[0071] The prediction results obtained by the indoor magnetic field data prediction method based on the double-loop LSTM neural network in the present application are as follows: As shown in Figure 7 Floor 5 (Floor 5), the magnetic field prediction results of the straight-line collection area are compared with the true values. A total of 75 sampling points are involved, and the 5 sampling data of each sampling point are involved in the comparison. A total of 325 data points are analyzed visually, and the shadow part of the figure highlights the data trend. From the error distribution, the prediction curve of Floor 5 is highly consistent with the true value fluctuation trend. The overall three-axis error of individual points such as the 9th sampling point is higher than the average error, which is 17.15, 7.05, and 16.44 μT, respectively. The single-axis error of the 58th sampling point is larger, and the Z-axis error is 31.74 μT, but the magnetic field change of these sampling points before and after is larger, and the data fluctuation does not exceed half of it.

[0072] As shown in FIG. 8, Figure 9As shown, the trends and values ​​of the predicted data for the 5th floor (Floor 6) and the 7th floor (Floor 7) are closer to the actual values. The average error of the three axes of the floors gradually decreases. The error range of individual singularities is similar to that of singularities in Floor 5, and is still controlled within 50% of the difference between the previous and subsequent points. For example, the X-axis error of the 68th sampling point of the 6th floor is 23.59μT, the absolute difference of the X-axis between the sampling point and the previous sampling point is 62μT, and the difference between the sampling point and the subsequent sampling point is 80μT.

[0073] like Figure 10 As shown, although the predicted data for Floor 8 generally matches the actual values, the overall error is slightly higher. Overall, the average errors for floors 5-8 are 3.64μT, 2.87μT, 2.56μT, and 3.44μT, respectively. Floor 7 has the lowest error, floors 5-7 show a decreasing trend, and floor 8 has a slightly higher error due to its higher elevation. The error in most areas of each floor is stable between 1-3μT. The triaxial average error records for each floor are shown in the table below.

[0074]

[0075] As can be seen from the above, the indoor magnetic field data prediction method and device based on dual-loop LSTM neural network provided in this application captures the nonlinear attenuation law of magnetic field with increasing floor level through longitudinal LSTM neural network, solves the problem of discontinuity in the neighborhood of corridor edge points by using ring topology input and transverse LSTM neural network, and effectively improves the accuracy and efficiency of multi-floor magnetic field prediction by introducing dynamic gating mechanism to adaptively fuse dual-branch features, providing an efficient and low-cost magnetic field data generation solution for multi-story building positioning systems.

[0076] This application is applicable to fields such as indoor positioning, navigation, and emergency rescue, providing users with more accurate and efficient positioning information.

[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0078] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0079] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0080] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0081] While the preferred embodiments of the application have been described, additional variations and modifications can be employed by those skilled in the art. Therefore, the appended claims intend to cover all such modifications and variations as fall within the true spirit and scope of the application.

[0082] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A method for predicting indoor magnetic field data based on a dual-loop LSTM neural network, characterized in that, include: Collect magnetic field strength sequence data; Horizontal and vertical features were extracted from the magnetic field strength sequence data using a dual-loop LSTM neural network. Based on an adaptive gating mechanism, the extracted horizontal and vertical features are concatenated and weighted to obtain dynamically gated fused features. The dynamic gated fusion features are mapped to three-dimensional magnetic field values ​​through a fully connected layer to obtain the magnetic field prediction results; The magnetic field strength sequence data includes: transverse magnetic field strength sequence data representing the change in magnetic field between adjacent sampling points on the same floor, and longitudinal magnetic field strength sequence data representing the change in magnetic field between the same sampling point across different floors.

2. The indoor magnetic field data prediction method based on a dual-loop LSTM neural network according to claim 1, characterized in that, The dual-recurrent LSTM neural network includes: a horizontal LSTM neural network and a vertical LSTM neural network; The step of extracting horizontal and vertical features from the magnetic field strength sequence data using a dual-recurrent LSTM neural network includes: The transverse magnetic field strength sequence data is input into a transverse LSTM neural network to obtain transverse features; The longitudinal magnetic field strength sequence data is input into a longitudinal LSTM neural network to obtain longitudinal features.

3. The indoor magnetic field data prediction method based on a dual-loop LSTM neural network according to claim 2, characterized in that, The longitudinal LSTM neural network includes: a bottom-level LSTM and a top-level LSTM; The bottom and top LSTMs adopt a double-layer LSTM stacked structure. By learning the linear decay trend of the magnetic field with the increase of the floor and capturing the nonlinear abrupt change characteristics caused by the building structure, the input longitudinal magnetic field strength sequence is used to extract features.

4. The indoor magnetic field data prediction method based on a dual-loop LSTM neural network according to claim 3, characterized in that, The calculation expression for the dual-layer LSTM stacked structure is: ; in, This indicates the underlying LSTM. Indicates the top-level LSTM; This represents the vertical input sequence of sampling point P; This represents the output feature vector of the longitudinal LSTM neural network, i.e., the longitudinal feature.

5. The indoor magnetic field data prediction method based on a dual-loop LSTM neural network according to claim 2, characterized in that, The transverse magnetic field strength sequence data is constructed using a ring topology modeling mechanism, and its expression is: ; in, Indicates the radius of the domain. Indicates the total number of sampling points. Indicates the number of floors; Indicates the first Within the building, the data is offset backward from the starting sampling point. The magnetic field strength value at each location, Indicates the first Within the floors, shift positively from the last sampling point of the collected data. The magnetic field strength value at each location; The modulo operator is used to convert a linear neighborhood index into a ring topology. Indicates the first The horizontal input sequence of floor sampling point P.

6. The indoor magnetic field data prediction method based on a dual-loop LSTM neural network according to claim 4, characterized in that, The adaptive gating mechanism performs feature concatenation and weighted fusion on the extracted horizontal and vertical features to obtain dynamically gated fused features; including: Weighting coefficients are constructed based on the floor layout. By using a weighted summation method, horizontal and vertical features are fused to obtain dynamically gated fused features.

7. The indoor magnetic field data prediction method based on a dual-loop LSTM neural network according to claim 6, characterized in that, The expression for the weighting coefficient is: ; in, Indicates the weighting coefficient; This represents the weight matrix obtained by training and learning scene feature mappings. Indicates splicing characteristics; Represents the sigmoid function; The The expression is: ; in, This represents the output feature vector of the horizontal LSTM neural network, i.e., the horizontal feature.

8. The indoor magnetic field data prediction method based on a dual-loop LSTM neural network according to claim 7, characterized in that, The expression for the dynamic gating fusion feature is: ; in, This indicates dynamic gating fusion characteristics; This indicates element-wise multiplication.

9. An indoor magnetic field data prediction system based on a dual-loop LSTM neural network, characterized in that, include: The acquisition unit is used to acquire magnetic field strength sequence data; A dual-loop LSTM neural network is used to extract lateral and vertical features from magnetic field strength sequence data. The feature fusion unit is used to perform feature concatenation and weighted fusion of the extracted horizontal and vertical features through an adaptive gating mechanism to obtain dynamically gated fused features. The mapping output unit is used to map the dynamically gated fusion features into three-dimensional magnetic field values ​​through a fully connected layer to obtain the magnetic field prediction results.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.