Method and system for high-precision positioning of magnetic dipoles
By using lightweight convolutional neural networks and meta-learning strategies, combined with wavelet thresholding denoising and min-max normalization, a high-precision magnetic dipole positioning model is constructed. This solves the problems of large sample requirements and poor adaptability to complex scenarios, achieving high-precision positioning with a small number of labeled samples, and is suitable for medical and industrial scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ARIEMEDI MEDICAL SCI BEIJING CO LTD
- Filing Date
- 2026-03-03
- Publication Date
- 2026-06-19
AI Technical Summary
Existing magnetic dipole localization models require a large amount of sample data, have low localization accuracy in small sample scenarios, and poor adaptability to complex scenarios, making it impossible to achieve high-precision localization in scenarios where sample acquisition is difficult, such as medical settings.
A feature extraction module for magnetic field signals is designed by employing a lightweight convolutional neural network and a meta-learning strategy, combined with wavelet thresholding denoising and min-max normalization. A location prototype is constructed using a meta-learning adaptation module, and the positioning results are optimized by Kalman filtering.
It achieves high-precision positioning with a small number of labeled samples, adapts to complex scenarios, reduces dependence on large-scale labeled data, and is suitable for scenarios with high requirements for accuracy and real-time performance, such as medical and industrial applications.
Smart Images

Figure CN122241251A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of magnetic positioning technology and machine learning, and in particular to a high-precision positioning method and system for magnetic dipoles based on few-shot learning. Background Technology
[0002] Magnetic dipole positioning technology is a technique that infers the spatial location of a magnetic dipole by detecting the distribution of its magnetic field. It is widely used in non-destructive testing of industrial equipment, surgical instrument positioning in the medical field, and geological exploration. Traditional magnetic dipole positioning methods are mainly based on analytical models, such as the LM algorithm and particle swarm optimization algorithm. These methods establish mathematical expressions for the magnetic field distribution and solve for position parameters using measurement data. However, analytical models often overlook complex interference factors in real-world scenarios, leading to limited positioning accuracy.
[0003] With the development of deep learning technology, deep learning-based magnetic dipole localization models have gradually become a research hotspot. These models train neural networks using a large number of labeled samples, leveraging the powerful fitting ability of neural networks to learn the mapping relationship between magnetic field data and location, significantly improving localization accuracy.
[0004] However, existing deep learning-based magnetic dipole localization models generally suffer from a large demand for sample data, requiring the collection of numerous magnetic field samples from different locations and environments for training. In practical applications, many scenarios are limited by collection conditions (such as the localization of magnetic medical devices in medical settings, where sample collection is difficult and costly), making it impossible to obtain sufficient labeled samples. This results in existing models exhibiting poor generalization ability and a sharp decline in localization accuracy in scenarios with small sample sizes.
[0005] Few-shot learning (FSL) techniques aim to solve the model training problem with a limited number of labeled samples. Through strategies such as meta-learning and transfer learning, it enables models to quickly adapt to new tasks. Applying FSL to magnetic dipole localization models is expected to address the pain point of existing models requiring a large number of samples. However, the application of existing FSL methods in magnetic dipole localization scenarios still has many shortcomings: on the one hand, the feature extraction modules of existing FSL models mostly adopt general network architectures without optimization for the characteristics of magnetic field signals, resulting in low feature extraction efficiency and poor specificity; on the other hand, the model's adaptation strategy fails to fully consider the spatial correlation of the magnetic field distribution of the magnetic dipole, resulting in poor adaptation performance in complex scenarios and an inability to guarantee localization accuracy.
[0006] Therefore, how to provide a magnetic dipole positioning model that can achieve high-precision positioning with a small number of labeled samples and is adaptable to complex scenarios is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0007] In view of the above problems, the present invention provides a high-precision magnetic dipole positioning method and system to overcome or at least partially solve the above problems. It solves the technical problems of existing magnetic dipole positioning models, such as large sample data requirements, low positioning accuracy in small sample scenarios, and poor adaptability to complex scenarios, achieving high-precision magnetic dipole positioning with a small number of labeled samples.
[0008] This invention provides the following solution:
[0009] A high-precision positioning method for a magnetic dipole includes: The original magnetic field signal generated by the magnetic dipole is acquired by the magnetic sensor, and the original magnetic field signal is preprocessed by the data preprocessing module to obtain standardized magnetic field data. The standardized magnetic field data is used to extract features using a small sample feature extraction module to obtain deep magnetic field feature vectors. The small sample feature extraction module employs a lightweight convolutional neural network to extract the deep magnetic field feature vectors. The lightweight convolutional neural network includes a network structure designed for the temporal and spatial characteristics of the magnetic field signal. The meta-learning adaptation module is used to construct the position prototype corresponding to each magnetic dipole position by combining the deep magnetic field feature vector and the support set samples, and the model parameters are adapted through the meta-learning strategy; the support set samples include a small number of labeled magnetic field samples and their corresponding position labels. The similarity between the deep magnetic field feature vector and each of the location prototypes is calculated using the positioning output module to obtain preliminary positioning results; the preliminary positioning results are then optimized to output the final positioning results.
[0010] Preferably, the preprocessing includes denoising and normalization. The denoising uses a wavelet threshold denoising algorithm, and the normalization uses a min-max normalization algorithm.
[0011] Preferably, the lightweight convolutional neural network structure includes three convolutional blocks stacked sequentially, each convolutional block including a convolutional layer, a batch normalization layer and a ReLU activation function, and a max pooling layer is set between adjacent convolutional blocks.
[0012] Preferably: the convolutional layer has a kernel size of 3×1, a stride of 1, and a padding method of "same"; the batch normalization layer is used to accelerate model convergence and reduce the risk of overfitting; the ReLU activation function is used to introduce nonlinearity and enhance the expressive power of the model; the max pooling layer has a kernel size of 2×1 and a stride of 2, which is used to reduce dimensionality and retain key features.
[0013] Preferably, the meta-learning adaptation module is constructed based on the prototype network and the MAML algorithm, and the meta-learning adaptation module includes a support set feature aggregation unit and a meta-adaptation unit; The support set feature aggregation unit is used to perform mean aggregation on the deep magnetic field feature vectors corresponding to the same position label in the support set to construct the position prototype corresponding to each magnetic dipole position. The meta-adaptation unit uses the MAML algorithm to train the model's meta-parameters through a meta-learning strategy, enabling the model to quickly adapt to new positioning scenarios through fine-tuning with a small number of samples.
[0014] Preferably, the position prototype is represented by the following formula:
[0015] In the formula: Indicates the first The location prototype corresponding to each location. This indicates support for the centralized belonging to the first Number of samples at each location Indicates support for the centralized first The deep magnetic field feature vector of each sample, where Σ is the summation operation.
[0016] Preferably, the steps of training the meta-adaptive unit include: Initialize the model's meta-parameters ; During the meta-training phase, multiple tasks are sampled from the training task set, and each task contains a support set and a query set. For each task, the loss function is calculated using the support set samples, and the meta-parameters are updated using gradient descent. Obtain task-specific parameters ; Calculate using query set samples The corresponding loss function updates the meta-parameters through gradient descent. Complete one-dimensional training iteration; Repeat the iterations until the model converges and the optimal meta-parameters are obtained.
[0017] Preferably, Euclidean distance is used to measure the similarity between the deep feature vector and each of the location prototypes; and Kalman filtering algorithm is used to smooth the preliminary localization results to achieve optimization.
[0018] Preferably: the distance between the deep feature vector and the prototype at each location is calculated using Euclidean distance; The state equation of the Kalman filter algorithm is expressed by the following equation:
[0019] The observation equation of the Kalman filter algorithm is expressed by the following equation:
[0020] In the formula: Represents the state transition matrix. Represents the observation matrix. and These represent process noise and observation noise, respectively.
[0021] A high-precision magnetic dipole positioning system for performing the above-described high-precision magnetic dipole positioning method, the system comprising: The data preprocessing unit is used to acquire the raw magnetic field signal generated by the magnetic dipole collected by the magnetic sensor, and to preprocess the raw magnetic field signal using the data preprocessing module to obtain standardized magnetic field data. The small sample feature extraction unit is used to extract features from the standardized magnetic field data using the small sample feature extraction module to obtain deep magnetic field feature vectors. The small sample feature extraction module uses a lightweight convolutional neural network to extract the deep magnetic field feature vectors. The lightweight convolutional neural network includes a network structure designed for the temporal and spatial characteristics of the magnetic field signal. The meta-learning adaptation unit is used to construct the position prototype corresponding to each magnetic dipole position by combining the deep magnetic field feature vector and the support set samples with the meta-learning adaptation module, and to adapt the model parameters through the meta-learning strategy; the support set samples include a small number of labeled magnetic field samples and their corresponding position labels. The positioning output unit is used to calculate the similarity between the deep magnetic field feature vector and each of the location prototypes using the positioning output module to obtain a preliminary positioning result; and to optimize the preliminary positioning result to output the final positioning result.
[0022] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: The embodiments of this application provide a high-precision magnetic dipole positioning method and system with high sample efficiency. By introducing meta-learning (MAML) and prototype networks, the model can quickly adapt to new positioning scenarios with only a very small number of labeled samples, greatly reducing the dependence on large-scale labeled data.
[0023] With high positioning accuracy, the lightweight CNN designed for magnetic field signals can effectively extract deep discriminative features. Combined with metric learning of the prototype network and post-optimization of Kalman filtering, it can still achieve sub-millimeter-level high-precision positioning under conditions of few samples.
[0024] It has strong scene adaptability. The meta-learning training strategy enables the model to have a strong ability to adapt quickly across scenes. When facing new and complex electromagnetic environments, it can quickly achieve the best performance through fine-tuning with a small number of samples and has good robustness.
[0025] It is highly practical, with a lightweight model structure and a complete data processing flow, forming a closed loop from signal preprocessing to result optimization. It is particularly suitable for real-world scenarios such as medical and industrial applications where high accuracy and real-time performance are required and sample acquisition is difficult.
[0026] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0028] Figure 1 This is a flowchart of the high-precision positioning method for magnetic dipoles provided in an embodiment of the present invention; Figure 2 This is a flowchart of the MAML-based meta-training process provided in an embodiment of the present invention; Figure 3 This is a network architecture diagram provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the high-precision magnetic dipole positioning system provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the high-precision magnetic dipole positioning device provided in an embodiment of the present invention. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.
[0030] See Figure 1 This invention provides a high-precision positioning method for a magnetic dipole, such as... Figure 1 As shown, the method may include: S101: Acquire the original magnetic field signal generated by the magnetic dipole collected by the magnetic sensor, and preprocess the original magnetic field signal using the data preprocessing module to obtain standardized magnetic field data; in specific implementation, the embodiments of this application may provide that the preprocessing includes denoising processing and normalization processing, wherein the denoising processing adopts a wavelet threshold denoising algorithm, and the normalization processing adopts a min-max normalization algorithm.
[0031] S102: The standardized magnetic field data is feature extracted using a small sample feature extraction module to obtain a deep magnetic field feature vector. The small sample feature extraction module uses a lightweight convolutional neural network to extract the deep magnetic field feature vector. The lightweight convolutional neural network includes a network structure designed for the temporal and spatial characteristics of the magnetic field signal. In a specific implementation, the embodiment of the present invention can provide that the network structure of the lightweight convolutional neural network includes three convolutional blocks stacked sequentially. Each convolutional block includes a convolutional layer, a batch normalization layer, and a ReLU activation function. A max pooling layer is set between adjacent convolutional blocks.
[0032] Furthermore, the convolutional layer has a kernel size of 3×1, a stride of 1, and a padding method of "same"; the batch normalization layer is used to accelerate model convergence and reduce the risk of overfitting; the ReLU activation function is used to introduce nonlinearity and enhance the expressive power of the model; the max pooling layer has a kernel size of 2×1 and a stride of 2, which is used to reduce dimensionality and retain key features.
[0033] S103: The meta-learning adaptation module is used to combine the deep magnetic field feature vector and support set samples to construct the position prototype corresponding to each magnetic dipole position, and the model parameters are adapted through the meta-learning strategy; the support set samples include a small number of labeled magnetic field samples and their corresponding position labels; in specific implementation, the embodiments of the present invention can provide that the meta-learning adaptation module is constructed based on the prototype network and the MAML algorithm, and the meta-learning adaptation module includes a support set feature aggregation unit and a meta-adaptation unit; The support set feature aggregation unit is used to perform mean aggregation on the deep magnetic field feature vectors corresponding to the same position label in the support set to construct the position prototype corresponding to each magnetic dipole position. The meta-adaptation unit uses the MAML algorithm to train the model's meta-parameters through a meta-learning strategy, enabling the model to quickly adapt to new positioning scenarios through fine-tuning with a small number of samples.
[0034] Furthermore, the position prototype is represented by the following formula:
[0035] In the formula: Indicates the first The location prototype corresponding to each location. This indicates support for the centralized belonging to the first Number of samples at each location Indicates support for the centralized first The deep magnetic field feature vector of each sample, where Σ is the summation operation.
[0036] The steps for training the meta-adaptive unit include: Initialize the model's meta-parameters ; During the meta-training phase, multiple tasks are sampled from the training task set, and each task contains a support set and a query set. For each task, the loss function is calculated using the support set samples, and the meta-parameters are updated using gradient descent. Obtain task-specific parameters ; Calculate using query set samples The corresponding loss function updates the meta-parameters through gradient descent. Complete one-dimensional training iteration; Repeat the iterations until the model converges and the optimal meta-parameters are obtained.
[0037] S104: Calculate the similarity between the deep magnetic field feature vector and each of the location prototypes using the positioning output module to obtain a preliminary positioning result; optimize the preliminary positioning result and output the final positioning result. Specifically, embodiments of the present invention can use Euclidean distance to measure the similarity between the deep feature vector and each of the location prototypes; and use a Kalman filter algorithm to smooth the preliminary positioning result for optimization.
[0038] Furthermore, Euclidean distance is used to calculate the distance between the deep feature vector and the prototype at each location; The state equation of the Kalman filter algorithm is expressed by the following equation:
[0039] The observation equation of the Kalman filter algorithm is expressed by the following equation:
[0040] In the formula: Represents the state transition matrix. Represents the observation matrix. and These represent process noise and observation noise, respectively.
[0041] The magnetic dipole high-precision positioning method provided in this application has high sample efficiency. By introducing meta-learning (MAML) and prototype networks, the model can quickly adapt to new positioning scenarios with only a very small number of labeled samples, greatly reducing the dependence on large-scale labeled data.
[0042] With high positioning accuracy, the lightweight CNN designed for magnetic field signals can effectively extract deep discriminative features. Combined with metric learning of the prototype network and post-optimization of Kalman filtering, it can still achieve sub-millimeter-level high-precision positioning under conditions of few samples.
[0043] It has strong scene adaptability. The meta-learning training strategy enables the model to have a strong ability to adapt quickly across scenes. When facing new and complex electromagnetic environments, it can quickly achieve the best performance through fine-tuning with a small number of samples and has good robustness.
[0044] This method boasts high practicality, a lightweight model structure, and a complete data processing workflow, forming a closed loop from signal preprocessing to result optimization. It is particularly suitable for real-world scenarios in medical and industrial fields where high accuracy and real-time performance are required, and where sample acquisition is challenging. This approach is applicable to scenarios such as medical navigation, industrial robotics, and precision assembly, where precise pose localization requires a limited number of samples.
[0045] In practice, the modules work together in the order of preprocessing, feature extraction, meta-adaptation, and localization output.
[0046] The high-precision positioning method for magnetic dipoles provided by this invention will be described in detail below.
[0047] The model used in the high-precision magnetic dipole positioning method provided by this invention includes a data preprocessing module, a small sample feature extraction module, a meta-learning adaptation module, and a positioning output module connected in sequence.
[0048] The specific functions of each module are as follows: 1. Data preprocessing module, used to denoise and normalize the acquired raw magnetic field signals to obtain standardized magnetic field data.
[0049] Data preprocessing module setup: Wavelet thresholding denoising and min-max normalization are implemented using Python. The db4 wavelet is selected for wavelet decomposition, with a decomposition level of 3. The adaptive threshold is dynamically adjusted according to the noise level, using the formula λ = σ√(2lnN), where σ is the noise standard deviation and N is the signal length. Min-max normalization is achieved by iterating through the magnetic field signal data, calculating the maximum and minimum values, and then substituting them into the normalization formula to complete data standardization.
[0050] The core function of this module is to preprocess the raw magnetic field signals acquired by the magnetic sensor, removing noise interference and standardizing the magnetic field data to provide high-quality data for subsequent feature extraction and model training. Specifically, this includes two steps: denoising and normalization. (1) Denoising: Wavelet thresholding denoising algorithm is used. The original magnetic field signal is easily affected by environmental electromagnetic interference and sensor noise during the acquisition process. Wavelet thresholding can effectively separate the signal from the noise. The specific steps are as follows: First, the acquired magnetic field signal is decomposed by wavelet to obtain wavelet coefficients at different scales, where the noise is mainly concentrated in the high-frequency wavelet coefficients; then, an adaptive threshold is set to perform thresholding on the high-frequency wavelet coefficients to suppress the wavelet coefficients corresponding to the noise; finally, the processed wavelet coefficients are subjected to inverse wavelet transform to reconstruct the denoised magnetic field signal.
[0051] (2) Normalization: The min-max normalization algorithm is used. Since the amplitude of the magnetic field signal varies greatly depending on the location and acquisition conditions, directly inputting it into the model will affect the training effect. Min-max normalization maps the denoised magnetic field signal to the [0,1] interval, eliminating the influence of amplitude differences. The normalization formula is:
[0052] in, The data is the denoised magnetic field signal. This represents the minimum value of the magnetic field signal data. This represents the maximum value of the magnetic field signal data. This is the normalized, standardized magnetic field data.
[0053] 2. The small sample feature extraction module employs a lightweight convolutional neural network to extract deep magnetic field feature vectors from the standardized magnetic field data.
[0054] Few-sample feature extraction module construction: a lightweight convolutional neural network is built based on the PyTorch architecture. The network structure is as follows: The input layer receives standardized magnetic field data (1 channel, 128 sampling points) with dimensions (1, 128); First convolutional block: Convolutional layer (3×1 convolutional kernel, 16 output channels, stride 1, same padding) → Batch normalization layer → ReLU activation function; Max pooling layer (2×1 pooling kernel, stride 2); Second convolutional block: Convolutional layer (3×1 convolutional kernel, 32 output channels, stride 1, same padding) → Batch normalization layer → ReLU activation function; Max pooling layer (2×1 pooling kernel, stride 2); Third convolutional block: Convolutional layer (3×1 convolutional kernel, 64 output channels, stride 1, same padding) → Batch normalization layer → ReLU activation function; Max pooling layer (2×1 pooling kernel, stride 2); Fully connected layer: Flattens the pooled feature map into a one-dimensional vector, outputting a deep magnetic field feature vector with dimension 256.
[0055] This module employs a lightweight convolutional neural network (CNN), with a network structure designed specifically for the temporal and spatial characteristics of magnetic field signals, enabling efficient deep feature extraction from standardized magnetic field data. The lightweight CNN design balances feature extraction capability and computational efficiency, with the following structure: it consists of three stacked convolutional blocks, each composed of a convolutional layer, a batch normalization layer, and a ReLU activation function, with max-pooling layers between adjacent blocks. The convolutional layers have a 3×1 kernel size, a stride of 1, and use the same padding method, allowing for the extraction of local features while maintaining the feature map size. The batch normalization layer accelerates model convergence and reduces the risk of overfitting. The ReLU activation function introduces non-linearity, enhancing the model's expressive power. The max-pooling layer has a 2×1 kernel size and a stride of 2, used for dimensionality reduction and preservation of key features. This lightweight network can extract discriminative deep magnetic field feature vectors from standardized magnetic field data, providing effective feature support for subsequent localization.
[0056] 3. Meta-learning adaptation module, built on prototype network and meta-learning strategy, is used to construct position prototypes corresponding to different magnetic dipole positions using a small number of labeled magnetic field samples, and to realize the rapid adaptation of the model to new positioning scenarios.
[0057] The meta-learning adaptation module is built based on a prototype network and the MAML algorithm. The support set feature aggregation unit constructs a location prototype by averaging the feature vectors of labels at the same location. The meta-adaptation unit uses the MAML algorithm, and the meta-parameters are initialized using He normal initialization. During the meta-training phase, the task set consists of magnetic field samples from different scenarios, with each task containing 5 support set samples (1-shot) and 10 query set samples. The loss function is the cross-entropy loss function. The inner optimizer uses SGD with a learning rate of 0.01, and the outer optimizer uses Adam with a learning rate of 0.001. The training iterations are 10,000 times until the model converges.
[0058] This module is the core of few-shot localization. Based on a prototype network architecture (Prototypical Networks are an architecture for few-shot learning and meta-learning, whose core idea is to classify by calculating the distance between a sample and its class prototype), combined with a meta-learning strategy, it enables the model to quickly adapt to new localization scenarios. This module includes a feature aggregation unit and a meta-adaptation unit: (1) Support Set Feature Aggregation Unit: The support set consists of a small number of labeled magnetic field samples and their corresponding location labels. This unit performs mean aggregation on the deep magnetic field feature vectors corresponding to the same location label in the support set to construct the location prototype corresponding to each magnetic dipole location. The location prototype can characterize the core information of the magnetic field feature at that location, and the construction formula is as follows:
[0059] in, For the first The location prototype corresponding to each location. To support the centralized belonging to the first Number of samples at each location To support the centralized The deep magnetic field feature vector of each sample For summation operations.
[0060] (2) Meta-adaptation unit: The MAML (Model-Agnostic Meta-Learning) algorithm is used to train the model's meta-parameters through a meta-learning strategy, enabling the model to quickly adapt to new localization scenarios through fine-tuning with a small number of samples. The specific steps are as follows: First, initialize the model's meta-parameters. During the meta-training phase, multiple tasks are sampled from the training task set, each task containing a support set and a query set. For each task, the loss function is calculated using the support set samples, and the meta-parameters are updated via gradient descent. Obtain task-specific parameters Then, using the query set samples, calculate... The corresponding loss function updates the meta-parameters through gradient descent. The process involves one iteration of meta-training; this process is repeated until the model converges and the optimal meta-parameters are obtained. Through meta-learning training, the model acquires the ability to quickly adapt to new scenarios, requiring only a small number of labeled samples to complete the adaptation.
[0061] 4. A positioning output module is used to calculate the similarity between the deep magnetic field feature vector of the sample to be located and each of the location prototypes to determine the preliminary position, optimize the preliminary position, and output the final positioning result.
[0062] The positioning output module is built as follows: Euclidean distance calculation is implemented using the torch.norm function; the result optimization unit uses Kalman filtering, and the state equation is set as follows:
[0063] The observation equation is set as follows:
[0064] in, Here is the state transition matrix. For the observation matrix, and These are process noise and observation noise, respectively, and the noise covariance matrix is determined through statistical analysis of experimental data.
[0065] This module's function is to calculate the similarity between the deep feature vector of the sample to be located output by the small sample feature extraction module and the location prototype constructed by the meta-learning adaptation module, determine the location of the magnetic dipole, and optimize the localization result. Specifically, it includes two steps: similarity calculation and result optimization. (1) Similarity calculation: Euclidean distance is used to measure the similarity between the deep feature vector of the sample to be located and the prototype at each location. The smaller the Euclidean distance, the closer the sample to be located is to the location corresponding to the prototype at that location. The location corresponding to the prototype with the smallest distance is taken as the preliminary location result.
[0066] (2) Result optimization: To further reduce the positioning error, a result optimization unit is set up, and the Kalman filter algorithm is used to smooth the preliminary positioning results. The Kalman filter can use the positioning results of the previous moment and the measurement results of the current moment to suppress random errors through state estimation and update, and obtain more stable and accurate positioning results.
[0067] Model testing: (1) Test data preparation: Build a magnetic dipole positioning experimental platform, use a three-axis sensor to collect vector magnetic field information, select multiple (e.g., 100~1000) different locations as positioning targets within a 1m×1m×1m space range, collect 20 sets of magnetic field signals at each location, of which 1 set is used as a support set sample and 19 sets are used as test samples; at the same time, environmental electromagnetic interference is added to simulate complex scenarios.
[0068] (2) Testing process: The collected magnetic field signal is input into the data preprocessing module for denoising and normalization; the input into the small sample feature extraction module is used to extract deep features; the meta-learning adaptation module uses 50 support set samples of each location to construct the location prototype and complete the model adaptation; the deep features of the test sample are input into the positioning output module to calculate the Euclidean distance with each location prototype to obtain the preliminary positioning result, and the final positioning result is output after Kalman filtering optimization.
[0069] (3) Test results: In the 1-shot scenario (1 labeled sample per location), the positioning error of the model of this invention is significantly lower than that of existing deep learning-based models, demonstrating excellent positioning performance; in the 5-shot scenario (5 labeled samples per location), the positioning error is further reduced, reaching the sub-millimeter level. At the same time, the model adapts to new scenarios rapidly, requiring very little time, demonstrating excellent rapid scene adaptation capability.
[0070] See Figure 4 This application embodiment can also provide a magnetic dipole high-precision positioning system for performing the above-described magnetic dipole high-precision positioning method, such as... Figure 4 As shown, the system may include: The data preprocessing unit 401 is used to acquire the original magnetic field signal generated by the magnetic dipole collected by the magnetic sensor, and to preprocess the original magnetic field signal using the data preprocessing module to obtain standardized magnetic field data. The small sample feature extraction unit 402 is used to extract features from the standardized magnetic field data using the small sample feature extraction module to obtain deep magnetic field feature vectors. The small sample feature extraction module uses a lightweight convolutional neural network to extract the deep magnetic field feature vectors. The lightweight convolutional neural network includes a network structure designed for the temporal and spatial characteristics of the magnetic field signal. The meta-learning adaptation unit 403 is used to construct the position prototype corresponding to each magnetic dipole position by combining the deep magnetic field feature vector and the support set samples with the meta-learning adaptation module, and to adapt the model parameters through the meta-learning strategy; the support set samples include a small number of labeled magnetic field samples and their corresponding position labels. The positioning output unit 404 is used to calculate the similarity between the deep magnetic field feature vector and each of the location prototypes using the positioning output module to obtain a preliminary positioning result; and to optimize the preliminary positioning result to output the final positioning result.
[0071] In practice, the data preprocessing unit, small sample feature extraction unit, meta-learning adaptation unit, and localization output unit are all implemented by the processor calling program instructions in the memory.
[0072] This application embodiment can also provide a high-precision magnetic dipole positioning device, the device including a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of the above-described high-precision magnetic dipole positioning method according to the instructions in the program code.
[0073] like Figure 5 As shown in the embodiment of this application, a high-precision magnetic dipole positioning device may include: a processor 10, a memory 11, a communication interface 12, and a communication bus 13. The processor 10, memory 11, and communication interface 12 all communicate with each other through the communication bus 13.
[0074] In this embodiment, the processor 10 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic devices.
[0075] The processor 10 can call the program stored in the memory 11. Specifically, the processor 10 can execute the operations in the embodiments of the magnetic dipole high-precision positioning method.
[0076] The memory 11 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 11 stores at least a program for implementing the following functions: The original magnetic field signal generated by the magnetic dipole is acquired by the magnetic sensor, and the original magnetic field signal is preprocessed by the data preprocessing module to obtain standardized magnetic field data. The standardized magnetic field data is used to extract features using a small sample feature extraction module to obtain deep magnetic field feature vectors. The small sample feature extraction module employs a lightweight convolutional neural network to extract the deep magnetic field feature vectors. The lightweight convolutional neural network includes a network structure designed for the temporal and spatial characteristics of the magnetic field signal. The meta-learning adaptation module is used to construct the position prototype corresponding to each magnetic dipole position by combining the deep magnetic field feature vector and the support set samples, and the model parameters are adapted through the meta-learning strategy; the support set samples include a small number of labeled magnetic field samples and their corresponding position labels. The similarity between the deep magnetic field feature vector and each of the location prototypes is calculated using the positioning output module to obtain preliminary positioning results; the preliminary positioning results are then optimized to output the final positioning results.
[0077] In one possible implementation, the memory 11 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function (such as file creation or data read / write). The data storage area may store data created during use, such as initialization data.
[0078] In addition, memory 11 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.
[0079] Communication interface 12 can be an interface for the communication module, used to connect with other devices or systems.
[0080] Of course, it should be noted that, Figure 5 The structure shown does not constitute a limitation on the high-precision magnetic dipole positioning device in the embodiments of this application. In practical applications, the high-precision magnetic dipole positioning device may include devices with higher precision than magnetic dipole positioning devices. Figure 5 More or fewer components as shown, or combinations of certain components.
[0081] This application embodiment may also provide a computer-readable storage medium for storing program code for executing the steps of the above-described high-precision magnetic dipole positioning method.
[0082] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0083] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0084] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0085] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A high-precision positioning method for a magnetic dipole, characterized in that, include: The original magnetic field signal generated by the magnetic dipole is acquired by the magnetic sensor, and the original magnetic field signal is preprocessed by the data preprocessing module to obtain standardized magnetic field data. The standardized magnetic field data is used to extract features using a small sample feature extraction module to obtain deep magnetic field feature vectors. The small sample feature extraction module employs a lightweight convolutional neural network to extract the deep magnetic field feature vectors. The lightweight convolutional neural network includes a network structure designed for the temporal and spatial characteristics of the magnetic field signal. The meta-learning adaptation module is used to construct the position prototype corresponding to each magnetic dipole position by combining the deep magnetic field feature vector and the support set samples, and the model parameters are adapted through the meta-learning strategy; the support set samples include a small number of labeled magnetic field samples and their corresponding position labels. The similarity between the deep magnetic field feature vector and each of the location prototypes is calculated using the positioning output module to obtain preliminary positioning results; the preliminary positioning results are then optimized to output the final positioning results.
2. The high-precision positioning method for magnetic dipoles according to claim 1, characterized in that, The preprocessing includes denoising and normalization. The denoising uses a wavelet threshold denoising algorithm, and the normalization uses a min-max normalization algorithm.
3. The high-precision positioning method for magnetic dipoles according to claim 1, characterized in that, The lightweight convolutional neural network structure includes three convolutional blocks stacked sequentially. Each convolutional block includes a convolutional layer, a batch normalization layer, and a ReLU activation function. A max pooling layer is set between adjacent convolutional blocks.
4. The high-precision positioning method for a magnetic dipole according to claim 3, characterized in that, The convolutional layer has a kernel size of 3×1, a stride of 1, and uses the same padding method. The batch normalization layer is used to accelerate model convergence and reduce the risk of overfitting. The ReLU activation function is used to introduce nonlinearity and enhance the expressive power of the model. The max pooling layer has a kernel size of 2×1 and a stride of 2, which is used to reduce dimensionality and retain key features.
5. The high-precision positioning method for a magnetic dipole according to claim 1, characterized in that, The meta-learning adaptation module is built based on the prototype network and the MAML algorithm. The meta-learning adaptation module includes a support set feature aggregation unit and a meta-adaptation unit. The support set feature aggregation unit is used to perform mean aggregation on the deep magnetic field feature vectors corresponding to the same position label in the support set to construct the position prototype corresponding to each magnetic dipole position. The meta-adaptation unit uses the MAML algorithm to train the model's meta-parameters through a meta-learning strategy, enabling the model to quickly adapt to new positioning scenarios through fine-tuning with a small number of samples.
6. The high-precision positioning method for a magnetic dipole according to claim 5, characterized in that, The position prototype is represented by the following formula: In the formula: Indicates the first The location prototype corresponding to each location. This indicates support for the centralized belonging to the first Number of samples at each location Indicates support for the centralized first The deep magnetic field feature vector of each sample, where Σ is the summation operation.
7. The high-precision positioning method for a magnetic dipole according to claim 5, characterized in that, The steps for training the meta-adaptive unit include: Initialize the model's meta-parameters ; During the meta-training phase, multiple tasks are sampled from the training task set, and each task contains a support set and a query set. For each task, the loss function is calculated using the support set samples, and the meta-parameters are updated using gradient descent. Obtain task-specific parameters ; Calculate using query set samples The corresponding loss function updates the meta-parameters through gradient descent. Complete one-dimensional training iteration; Repeat the iterations until the model converges and the optimal meta-parameters are obtained.
8. The high-precision positioning method for a magnetic dipole according to claim 1, characterized in that, The similarity between the deep feature vector and each of the location prototypes is measured using Euclidean distance; the preliminary localization results are smoothed and optimized using a Kalman filter algorithm.
9. The high-precision positioning method for a magnetic dipole according to claim 8, characterized in that, The distance between the deep feature vector and the prototype at each location is calculated using Euclidean distance. The state equation of the Kalman filter algorithm is expressed by the following equation: The observation equation of the Kalman filter algorithm is expressed by the following equation: In the formula: Represents the state transition matrix. Represents the observation matrix. and These represent process noise and observation noise, respectively.
10. A high-precision positioning system for a magnetic dipole, used to execute the high-precision positioning method for a magnetic dipole as described in any one of claims 1 to 9, characterized in that, The system includes: The data preprocessing unit is used to acquire the raw magnetic field signal generated by the magnetic dipole collected by the magnetic sensor, and to preprocess the raw magnetic field signal using the data preprocessing module to obtain standardized magnetic field data. The small sample feature extraction unit is used to extract features from the standardized magnetic field data using the small sample feature extraction module to obtain deep magnetic field feature vectors. The small sample feature extraction module uses a lightweight convolutional neural network to extract the deep magnetic field feature vectors. The lightweight convolutional neural network includes a network structure designed for the temporal and spatial characteristics of the magnetic field signal. The meta-learning adaptation unit is used to construct the position prototype corresponding to each magnetic dipole position by combining the deep magnetic field feature vector and the support set samples with the meta-learning adaptation module, and to adapt the model parameters through the meta-learning strategy; the support set samples include a small number of labeled magnetic field samples and their corresponding position labels. The positioning output unit is used to calculate the similarity between the deep magnetic field feature vector and each of the location prototypes using the positioning output module to obtain a preliminary positioning result; and to optimize the preliminary positioning result to output the final positioning result.