A permanent magnet positioning adaptive sampling method and device based on bidirectional uncertainty driving

By employing an adaptive sampling method driven by bidirectional uncertainty, combined with neural networks and a hybrid expert architecture, the problems of low sampling efficiency and low automation in existing permanent magnet positioning technologies are solved, achieving high-precision and highly robust permanent magnet positioning.

CN122196544APending Publication Date: 2026-06-12GUANGDONG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG UNIV OF TECH
Filing Date
2026-03-23
Publication Date
2026-06-12

Smart Images

  • Figure CN122196544A_ABST
    Figure CN122196544A_ABST
Patent Text Reader

Abstract

The application discloses a permanent magnet positioning adaptive sampling method and device based on bidirectional uncertainty driving, relates to the field of permanent magnet positioning, and comprises the following steps: acquiring an entire attitude space, a real calibration set and a synthetic data set; dividing the attitude space into a plurality of continuous angular regions; constructing a magnetic field generation and pose inference neural network; pre-training an initial model in combination with the two types of data sets; based on the initial model, obtaining a current predicted mean and variance in each angular region by using an expert model trained in a previous region, calculating a BIUM score of a candidate trajectory point according to the current predicted mean and variance, obtaining a sampling probability distribution through normalization, collecting magnetic field data of a high-information-value pose point, generating a real sample data set of each region and training a dedicated expert model; after the training of all the expert models is completed, integrating the pose inference models of the regions into a hybrid expert architecture, performing end-to-end joint training in combination with the real samples of the regions to obtain a final positioning model, and thus the accurate positioning of the permanent magnet is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of permanent magnet positioning, and in particular to an adaptive sampling method and apparatus for permanent magnet positioning based on bidirectional uncertainty driving. Background Technology

[0002] Permanent Magnetic Localization (PML) is a non-line-of-sight, low-cost positioning technology based on magnetic field sensing, widely used in medical device navigation, voice rehabilitation assistance (such as tongue movement tracking), and other fields. Its core problem is to infer the three-dimensional position and orientation (5 degrees of freedom) of a permanent magnet from magnetic field data collected by a magnetic sensor array, which is a typical high-order nonlinear inverse problem. Early PML methods were mainly based on the ideal magnetic dipole model, combined with numerical optimization algorithms (such as Levenberg-Marquardt, particle swarm optimization, etc.). While these methods have a certain degree of physical interpretability, they have significant limitations: 1) Model bias: The dipole model cannot accurately describe the real magnetic field distribution in the near-field region or complex magnetic environments; 2) Sensitivity to initial values ​​and noise: The optimization process is prone to getting trapped in local optima and has poor anti-interference capabilities; 3) Reliance on globally uniform sampling: To construct a complete mapping relationship, dense and uniform data collection is usually required in the workspace, which is time-consuming and inefficient.

[0003] In recent years, neural network-based methods have significantly improved the accuracy and robustness of magnetic tracking matrix (PML). Examples include: using back propagation neural networks (BPNNs) enhanced with prior knowledge for far-field magnetic tracking; collecting data and training networks based on fully automated 5-degree-of-freedom (5-DOF) motion platforms; pre-training networks using simulation data and then fine-tuning them using the Levenberg-Marquardt (LM) algorithm; employing structures such as residual networks (ResNet) and introducing magnetic field reconstruction errors for adaptive fusion; and designing Mixture of Experts (MoE) frameworks or CNN-Transformer hybrid models to enhance the ability to model spatial correlations through attention mechanisms.

[0004] However, existing neural network methods still generally suffer from the following problems: 1) Passive data acquisition strategy: Most of them use uniform sampling, do not consider the heterogeneous distribution of magnetic field nonlinearity in space, and have long calibration measurement time; 2) Insensitive to high information density areas: They cannot adaptively focus on areas with drastic magnetic field changes or low signal-to-noise ratio; 3) System calibration depends on manual intervention: The sampling process requires manual participation, which limits the automation and scalability of system deployment.

[0005] In addition, existing technologies have five major drawbacks in achieving efficient and robust permanent magnet positioning.

[0006] 1. Sampling strategies are passive and inefficient, resulting in high data costs. Most existing methods, including the current state-of-the-art neural network models, rely on uniform, dense gridded sampling within a pre-defined workspace to construct the training dataset. This strategy fails to consider the complexity of real-world magnetic field environments: on the one hand, magnetic field strength decays non-linearly with distance, resulting in weak signals and low signal-to-noise ratios in the far field, yet uniform sampling still allocates a proportional number of samples to this region, wasting resources; on the other hand, the magnetic field distribution in the near field is highly non-linear and susceptible to interference, meaning uniform sampling may fail to capture crucial, rapidly changing local features. This leads to long data acquisition times, high labor and equipment costs, and limited information value from a large number of collected samples, representing a key bottleneck restricting the practical deployment of PML systems.

[0007] 2. Decoupling of model training and data acquisition leads to a lack of adaptive optimization capabilities. Current processes typically treat "data acquisition" and "model training" as two independent stages. All data is collected at once, followed by model training. This open-loop approach prevents the model from proactively and specifically guiding subsequent data acquisition based on its current "cognitive weaknesses" (i.e., areas of high predictive uncertainty) during training. The model passively accepts all data, failing to achieve the closed-loop optimization goal of obtaining optimal performance with minimal data cost.

[0008] 3. Insufficient consideration of the unique bidirectional sources of uncertainty in PML. Traditional active learning strategies (such as query methods based on entropy, confidence, or model changes) are mainly aimed at scenarios with high annotation costs (such as image classification), and their uncertainty is unidirectional (i.e., uncertainty in model prediction). However, the uncertainty of PML originates from two directions: a) Forward uncertainty: The physical generation process from magnet attitude to magnetic field reading is difficult to model in the near field and in the presence of magnetic interference, resulting in high uncertainty. b) Backward uncertainty: The inverse problem of solving the attitude problem from magnetic field reading exhibits ill-conditioned characteristics in the far field due to weak signals and is extremely sensitive to noise.

[0009] 4. Existing methods generally lack joint measurement and utilization of this bidirectional coupling uncertainty, resulting in sampling strategies that cannot simultaneously optimize the accuracy of the magnetic field model and the positioning model. The system has low levels of automation and intelligence, relying heavily on manual intervention. Even advanced PML solutions still require significant manual operation and monitoring during data acquisition, such as manually adjusting magnet pose and monitoring the acquisition process. This not only limits the scale and repeatability of data acquisition but also makes the entire calibration process difficult to scale and standardize, increasing the complexity of deployment and maintenance.

[0010] 5. The potential of hybrid expert frameworks has not been fully realized, and collaboration among experts is insufficient. In existing technologies, MoE-based PML methods often improve model capacity and robustness by dividing regions and training specialized experts. However, these experts are trained independently and in parallel, relying on pre-collected full-region data obtained through uniform sampling. There is no knowledge transfer mechanism of mentorship among experts; later-trained experts cannot benefit from the experience accumulated by earlier-trained experts regarding uncertainty distribution during exploration. This results in a lack of global coordination in the learning process and fails to address the fundamental problem of sampling efficiency.

[0011] Therefore, how to achieve a high-precision and highly robust PML model with the fewest possible samples has become a key challenge. Summary of the Invention

[0012] The purpose of this application is to provide an adaptive sampling method and device for permanent magnet positioning based on bidirectional uncertainty driving, which can achieve precise positioning of permanent magnets.

[0013] To achieve the above objectives, this application provides the following solution.

[0014] In a first aspect, this application provides an adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving, comprising the following steps.

[0015] Obtain the entire pose space, the real calibration set, and the synthetic dataset; the real calibration set is a set covering the center and boundary of the workspace; the synthetic dataset is a set generated based on the training set; the training set includes several candidate pose data.

[0016] The entire attitude space is divided into several consecutive angular regions.

[0017] A magnetic field generation neural network and a pose inference neural network with a gated multilayer perceptron as the backbone are constructed, each equipped with a dual regression head to output the predicted mean and predicted variance.

[0018] By combining the real calibration set and the synthetic dataset, and minimizing the negative Gaussian log-likelihood loss, the magnetic field generation neural network and the pose inference neural network are pre-trained respectively to obtain the initial pose inference model and the initial magnetic field generation model.

[0019] Based on the initial pose inference model and the initial magnetic field generation model, in each angular region, the current prediction mean and the current prediction variance are obtained using the expert model trained in the previous angular region. Based on the current prediction variance, the BIUM score of all candidate trajectory points in the corresponding angular region is calculated. The expert model includes: pose inference model and magnetic field generation model.

[0020] After normalizing the BIUM scores of all candidate trajectory points in the corresponding angular region, the results are converted into a sampling probability distribution. Based on the sampling probability distribution, sampling without replacement is performed to select several pose points with the most informational value. The robotic arm is then driven to precisely move the magnetic tracker to the target pose. At the same time, the wearable sensor array synchronously collects magnetic field data to obtain the real sample dataset for each angular region.

[0021] Based on the real sample dataset within the current angular region, an expert model specific to the current angular region is trained by minimizing the negative Gaussian log-likelihood loss.

[0022] After all regional expert models are trained, the pose inference models specific to each region are integrated into the hybrid expert architecture, and end-to-end joint training is performed using real sample datasets within each corner region to obtain the final localization model; the hybrid expert architecture includes several expert models; the final localization model is used to achieve pose prediction.

[0023] Optionally, obtaining the synthetic dataset specifically includes the following steps.

[0024] Obtain all candidate pose data from the training set.

[0025] The synthetic magnetic field data is generated by substituting all the candidate pose data in the training set into the calibrated formula.

[0026] A synthetic dataset is obtained based on all the candidate pose data and the synthetic magnetic field data.

[0027] Optionally, the calibrated formula is as follows.

[0028] in, For the magnetic dipole in position The magnetic flux density generated at that location; , , These are the position coordinates of the magnetic tracker; The pitch angle of the magnetic tracker; This refers to the roll angle of the magnetic tracker; The position of the magnetic dipole; The direction of the magnetic dipole; Remanence; and These are the diameter and length of the cylindrical magnet, respectively. These are the sensor gain matrix and the mounting orientation correction matrix, respectively. The position coordinates of the sensor ; For sensor bias; Raw readings from a single triaxial sensor; Represents the raw readings of the sensor It is a three-dimensional vector; Environmental noise interference; Represents the parameter set Optimize the loss function to make it more efficient. minimize; For the true calibration set; For the first Raw sensor readings for each sample; To make the first The magnetic flux density is obtained by substituting the pose of each sample into the magnetic dipole model.

[0029] Optionally, the expression for minimizing the negative Gaussian log-likelihood loss is as follows.

[0030] in, Model for generating magnetic fields The loss function; For pose inference model The loss function; The total number of samples in the training dataset; Let be the dimension of the magnetic field vector; The dimension of the pose vector; For dimension indexing; Model for generating magnetic fields For the The sample, in the first Standard deviation of the prediction across each magnetic field dimension; For the magnetic field generation model, the first The sample, in the first Predicted values ​​in each magnetic field dimension; For the first The sample, in the first The actual measured values ​​in each magnetic field dimension; For pose inference model For the The sample, in the first Standard deviation of the prediction over each pose dimension; For the pose inference model for the first The sample, in the first Predicted values ​​in each pose dimension; For the first The sample, in the first The true value in each pose dimension.

[0031] Optionally, the formula for calculating the BIUM score is as follows.

[0032] in, For the first The pose of each sample; For a pose BIUM score; This is the normalization function; for Individual prediction variances The geometric mean; for Individual prediction variances The geometric mean.

[0033] Optionally, the formula for calculating the sampling probability distribution is as follows.

[0034] in, For the current angular region, the first Trajectory; This refers to the temperature parameter.

[0035] Optionally, the expression for the pose prediction is as follows.

[0036] in, The predicted pose; Soft selection weights for experts in each region; For the first The predicted pose output by the pose inference expert network for each region.

[0037] In a second aspect, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving as described above.

[0038] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty-driven as described above.

[0039] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving described above.

[0040] According to the specific embodiments provided in this application, this application has the following technical effects.

[0041] This application provides an adaptive sampling method and apparatus for permanent magnet positioning based on bidirectional uncertainty. By combining the real calibration set and the synthetic dataset in the entire attitude space, and minimizing the negative Gaussian log-likelihood loss, the magnetic field generation neural network and the pose inference neural network are pre-trained respectively to obtain the initial pose inference model and the initial magnetic field generation model. This solves the problems of insufficient real calibration data, high acquisition cost, weak model generalization ability, and easy overfitting. It realizes data expansion, reduces the number of sampling samples, and improves the basic ability of the initial model in magnetic field generation and pose inference, laying the foundation for subsequent fine-tuning.

[0042] This application addresses the problems of insufficient regional feature mining and low sampling efficiency during model training. Traditional methods cannot distinguish between near-field strong nonlinearity and far-field weak signal regions, leading to overfitting in some regions and underfitting in others. It achieves a deep integration of the BIUM-driven active learning process with regionally trained expert models, enabling fully automated closed-loop training of the model. This allows for the transfer of uncertainty across regions and progressive advancement of the learning frontier, avoiding the inefficiency of uniform sampling and significantly improving data utilization. Furthermore, the proposed BIUM enables the perception of uncertainties in forward magnetic field generation and reverse pose inference, allowing the system to automatically strengthen targeted learning for highly nonlinear near-field and low signal-to-noise ratio far-field regions. This comprehensively improves the model's generalization ability and robustness in complex real magnetic fields.

[0043] After training all regional expert models, this application integrates the regional pose inference models into a hybrid expert architecture and performs end-to-end joint training using real sample datasets from each corner region to obtain the final localization model. This solves the technical problems of insufficient adaptability of a single model to pose features of different corner regions, cross-regional localization accuracy decay, and insufficient feature fusion between independently trained models. It achieves efficient fusion and accurate adaptation of pose features from multiple regions, significantly improving localization accuracy and model robustness. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a schematic diagram of the architecture of an autonomous five-degree-of-freedom PML calibration platform based on a bidirectional uncertainty-driven adaptive sampling method for permanent magnet positioning in one embodiment of this application. Figure 2 This is an application environment diagram of a permanent magnet positioning adaptive sampling method based on bidirectional uncertainty driving according to an embodiment of this application; Figure 3 A flowchart illustrating an adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty-driven principles, provided in an embodiment of this application; Figure 4 A neural network architecture diagram of the magnetic field generation model and pose inference model in a permanent magnet positioning adaptive sampling method based on bidirectional uncertainty driven by an embodiment of this application; Figure 5 A hybrid expert model network architecture diagram is provided in an embodiment of this application for a permanent magnet positioning adaptive sampling method based on bidirectional uncertainty driving. Figure 6 A flowchart of a bidirectional uncertainty-driven active learning framework for an adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty-driven methods is provided in an embodiment of this application. Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] Active learning (AL) can significantly improve data efficiency by intelligently selecting the most informative samples for annotation during the training process. However, its application in PML has not been fully explored. Furthermore, traditional AL methods assume that the sample pool already exists and that annotation alone is costly, making them unsuitable for scenarios in PML where "samples need to be generated through physical measurements".

[0049] Existing research has yielded the following technical solution: "Permanent Magnet Localization Method Based on Hybrid Expert Framework (MoE)". The core components of this method are as follows: 1) Overall Architecture: The workspace is divided into multiple sub-regions. Each sub-region trains a dedicated expert network (such as a gated multilayer perceptron gMLP), and the outputs of each expert are dynamically integrated through a gated network to improve the model's ability to model region-specific magnetic field characteristics. 2) Training Method: Uniform sampling is used to acquire training data for each sub-region. Each expert trains independently, and finally, joint fine-tuning is performed. 3) Advantages: Regional modeling alleviates the overfitting problem of the global model and improves the localization robustness under complex magnetic field distributions.

[0050] However, the limitations of this existing approach include the following.

[0051] 1) Low sampling efficiency: Uniform sampling is still used, and adaptive sampling is not performed for the nonlinear intensity of the magnetic field and the signal-to-noise ratio distribution, resulting in a large number of samples with low information content and low data utilization.

[0052] 2) Unable to achieve closed-loop optimization: The sampling and training processes are separated, and a dynamic loop of "evaluation-sampling-training" is not established. The model cannot actively explore regions with high uncertainty during the training process.

[0053] 3) Insufficient expert knowledge transfer: Each expert was trained independently, and no cross-regional uncertainty transfer mechanism was designed, resulting in the model's instability at regional boundaries or in areas with drastic magnetic field changes.

[0054] 4) Limited system automation: It relies on a pre-collected complete dataset and has not achieved a fully automated closed-loop system from physical sampling to model update.

[0055] Based on this, this application proposes a "bidirectional uncertainty-driven active learning framework" to address the aforementioned shortcomings. By designing a bidirectional uncertainty metric (BIUM), constructing an adaptive sampling-training closed loop, and realizing cross-regional uncertainty propagation and progressive expert cultivation, it significantly improves data efficiency and system automation while maintaining the advantages of the MoE structure.

[0056] This application aims to provide a novel, data-efficient, and highly automated permanent magnet positioning solution, with the specific objectives as follows.

[0057] 1. Fundamental Objective: To significantly reduce the physical sampling cost and time overhead of PML systems. An active learning framework is proposed that intelligently selects sampling points with the highest information content, achieving or surpassing the localization accuracy of advanced models trained on the entire dataset with minimal amount of measured data. This reduces data acquisition time by more than 40% (experiments have shown it can reach 49%), significantly improving system deployment efficiency.

[0058] 2. Core Innovation: A novel bidirectional uncertainty metric is proposed and utilized to drive adaptive sampling. A novel bidirectional uncertainty metric method is designed to simultaneously quantify uncertainties in both magnet attitude prediction and magnetic field strength reconstruction. Using this as the core indicator, pose points that minimize the uncertainties of both the forward and backward models are actively selected for physical measurement, achieving a "two birds with one stone" effect and fundamentally solving the problem of low sampling efficiency in PML.

[0059] 3. Construct a closed-loop system for collaborative optimization of sampling and training. Deeply integrate data acquisition and model training to form an automated closed loop of "evaluation-planning-execution-learning." Based on the uncertainty assessment results of the current model, the system plans the optimal sampling path, drives the robotic arm to perform measurements, and immediately updates the model with new data. This closed loop enables the system to dynamically focus on the most uncertain and valuable spatial region, achieving continuous and efficient improvement in model performance.

[0060] 4. Implement progressive, curriculum-based training of regional expert models. In the hybrid expert architecture, a sequential, curriculum-guided training mechanism is introduced. First, an expert is trained in one region, using their learned bidirectional uncertainty knowledge to select the most informative candidate sampling points (i.e., "uncertain samples") for their neighboring next region. New regional experts then begin training on this "carefully prepared" data. This process acts like a relay race, enabling the learning frontier to advance robustly and efficiently throughout the workspace. Ultimately, all experts are seamlessly integrated through a gating network to form a unified and powerful prediction system.

[0061] 5. Develop a fully automated intelligent calibration platform to enhance system practicality and scalability. Combine the aforementioned algorithms with a high-precision five-DOF robotic arm, a wearable magnetic sensor array, and a synchronous acquisition system to construct a fully autonomous PML calibration platform from perception and decision-making to execution. This platform can automatically complete intelligent sparse sampling of the entire space according to algorithmic instructions, completely eliminating reliance on manual operation and providing a feasible engineering foundation for the large-scale, standardized application of PML technology in fields such as medicine.

[0062] The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty-driven principles provided in this application can employ methods such as... Figure 1 The deployment method of the autonomous five-DOF PML calibration platform shown is illustrated. This platform employs the proposed bidirectional uncertainty metric to drive an adaptive sparse sampling strategy, forming a closed-loop system that unifies uncertainty quantification with precision electromechanical control. This method can construct an accurate positioning model with far fewer measurements than traditional methods. The platform comprises four core modules: a high-precision five-DOF robotic arm (5-D robotic arm), a wearable magnetic sensor array and synchronous data acquisition system, a portable workstation, and integrated software for control and visualization. The integrated software for control and visualization is deployed on the portable workstation, collectively forming the closed-loop system.

[0063] The connection between the four core modules is as follows: the robotic arm moves the magnetic tracker to the target pose; the wearable magnetic sensor array collects magnetic field data in real time at this pose; the synchronization module aligns the data based on the reference sensor and transmits it to a portable workstation for processing via WiFi; the integrated software monitors the data transmission status, the magnetic tracker's pose and sampling trajectory in real time, and performs data processing and analysis. All these components work together through this process to complete a closed loop from positioning control to data acquisition, transmission, and processing.

[0064] The high-precision five-DOF robotic arm specifically includes a disk-shaped permanent magnet (6 mm in diameter × 1 mm in thickness, with a remanence of 14,300 Gauss) as a magnetic tracker, mounted on the end effector of the robotic arm. The robotic arm is controlled by a multi-axis motion controller, zmotion ECI2418B, achieving a positional repeatability of ±0.005 mm (X, Y, Z axes) and an angular repeatability of ±0.01° (pitch and roll). This module provides precise physical actuation capabilities, enabling it to reach non-uniformly distributed points selected by the algorithm within a 5 × 7 × 5 cubic centimeter workspace, forming the physical basis for uncertainty-driven sampling.

[0065] As an alternative implementation, a key mechanical improvement in this application is the use of a worm gear system driven by a stepper motor. This system minimizes backlash and provides self-locking capability, thereby enhancing the stability and accuracy of angular positioning. Specifically, the worm gear system is located on the end effector of the five-DOF robot arm, adjacent to the magnetic tracker. The worm wheel and worm are high-precision gear pairs, with optimized tooth profiles and assembly to ensure tight meshing and minimize backlash. The lead angle of the worm is smaller than the friction angle, ensuring that, in a stationary state, the load on the worm wheel cannot reverse the worm to provide self-locking capability.

[0066] The wearable magnetic sensing array and synchronous data acquisition system specifically includes an array of 33 QMC5883P triaxial magnetic sensors for acquiring magnetic field data. 32 of these sensors are divided into four spatially distributed modules, positioned on the right cheek, left cheek, front of the face, and below the jaw, respectively, to sensitively detect changes in the magnetic field caused by tongue movement. Specifically, as shown... Figure 1 The wearable magnetic sensor array shown comprises 32 sensors divided into four groups, each integrated onto a separate PCB board. When worn, these sensors are positioned on the right cheek, left cheek, front of the face, and below the chin. A third sensor serves as a dedicated reference sensor, continuously monitoring the ambient geomagnetic field for real-time dynamic compensation. A synchronization module, powered by an STM32F4 microcontroller, coordinates all sensors, enabling synchronous data acquisition at 100 Hz and subsequent time-aligned wireless transmission to the host computer via WiFi. This setup ensures high-fidelity, synchronized raw magnetic field input, crucial for reliably estimating bidirectional uncertainties.

[0067] The portable workstation is equipped with an Intel Core i5-12600 processor, 32GB of memory, and an NVIDIA GeForce RTX 4060 graphics processor. The proposed BIUM-Active Learning (BIUM-AL) algorithm runs on this portable workstation. This module acts as a central controller, executing a fully autonomous "evaluation-planning-execution-learning" closed loop.

[0068] Evaluation: The current regional expert model is a dense set of candidate pose computation BIUMs, quantifying the information gain that each point can provide to the pose inference model and the magnetic field generation model.

[0069] Planning: Based on BIUM scores, a heuristic sampling strategy is proposed to generate the optimal sparse sampling location sequence, prioritizing the points with the highest information value, thereby surpassing the uniform grid traversal approach.

[0070] Execution: The sampling sequence is converted into control commands for the robotic arm, which automatically moves to the selected pose to perform magnetic field measurement.

[0071] Learning: Newly acquired real-world data is immediately used to train the next region expert model. The updated model then informs the next iteration of the cycle.

[0072] This closed-loop operation creates a collaborative cycle between data acquisition and model optimization. By directing sampling to regions with high magnetic field nonlinearity or low signal-to-noise ratio (SNR), it significantly improves the cost-effectiveness of the modeling process.

[0073] The integrated software for control and visualization is a comprehensive software suite based on Qt, which provides a unified graphical user interface for system control, real-time monitoring, 3D trajectory visualization, and data management, and supports experimental configuration and interactive supervision.

[0074] This platform has evolved from a passive data logging instrument into an autonomous calibration agent with sensing, decision-making, and execution capabilities. It physically embodies the BIUM-AL algorithm, translating it into precise spatial actions, thereby significantly reducing the physical calibration overhead in PML systems.

[0075] The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving provided in this application embodiment can be applied to, for example... Figure 2The application environment shown is illustrated. Terminal 202 communicates with server 204 via a network. A data storage system can store the data that server 204 needs to process. The data storage system can be set up independently, integrated into server 204, or placed in the cloud or on another server. Terminal 202 can send the acquired entire pose space, real calibration set, and synthetic dataset to server 204. Upon receiving the entire pose space, real calibration set, and synthetic dataset, server 204 divides the entire pose space into several consecutive angular regions. It constructs a magnetic field generation neural network and a pose inference neural network with a gated multilayer perceptron as the backbone, each equipped with a dual regression head to output the prediction mean and prediction variance. The real calibration set and the synthetic dataset are combined, and the magnetic field generation neural network and pose inference neural network are pre-trained by minimizing the negative Gaussian log-likelihood loss to obtain initial pose inference models and initial magnetic field generation models. Based on the initial pose inference models and the initial magnetic field generation models, within each angular region, the current prediction mean and current prediction variance are obtained using the expert model trained in the previous angular region. The variance is calculated to obtain the BIUM score of all candidate trajectory points within the corresponding angular region. The expert model includes a pose inference model and a magnetic field generation model. The BIUM scores of all candidate trajectory points within the corresponding angular region are normalized and converted into a sampling probability distribution. Based on the sampling probability distribution, sampling without replacement is performed to select several pose points with the most informational value. The robotic arm is driven to precisely move the magnetic tracker to the target pose, while the wearable sensor array synchronously collects magnetic field data to obtain a real sample dataset for each angular region. Based on the real sample dataset of the current angular region, an expert model specific to the current angular region is trained by minimizing the negative Gaussian log-likelihood loss. After all regional expert models are trained, the pose inference models specific to each region are integrated into a hybrid expert architecture and end-to-end joint training is performed using the real sample dataset of each angular region to obtain the final localization model. The hybrid expert architecture includes several expert models. The final localization model is used to achieve pose prediction.

[0076] Server 204 can feed back the final positioning model to terminal 202. Furthermore, in some embodiments, the permanent magnet positioning adaptive sampling method based on bidirectional uncertainty-driven approaches can also be implemented independently by server 204 or terminal 202. For example, terminal 202 can directly construct the final positioning model for the entire attitude space to be processed, the real calibration set, and the synthetic dataset; alternatively, server 204 can obtain the entire attitude space to be processed, the real calibration set, and the synthetic dataset from the data storage system, and construct the final positioning model for these datasets.

[0077] The terminal 202 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The terminal 202 can also be the device described in this application. Figure 1 Portable workstations. Server 204 can be implemented using a standalone server, a server cluster consisting of multiple servers, or a cloud server.

[0078] In one exemplary embodiment, such as Figure 3 As shown, an adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty-driven methods is presented. This method consists of... Figure 1 The autonomous five-DOF PML calibration platform shown is executed, specifically including the following steps.

[0079] S1: Obtain the entire pose space, the real calibration set, and the synthetic dataset; the real calibration set is a set covering the center and boundary of the workspace; the synthetic dataset is a set generated based on the training set; the training set includes several candidate pose data.

[0080] S2: Divide the entire attitude space into several consecutive angular regions.

[0081] S3: Construct a magnetic field generation neural network and a pose inference neural network with a gated multilayer perceptron as the backbone, each equipped with a dual regression head to output the predicted mean and predicted variance.

[0082] S4: Combine the real calibration set and the synthetic dataset, and pre-train the magnetic field generation neural network and the pose inference neural network respectively by minimizing the negative Gaussian log-likelihood loss to obtain the initial pose inference model and the initial magnetic field generation model. The initial pose inference model and the initial magnetic field generation model are used to calculate the BIUM score of the first region, and also serve as the initial parameters for training the expert model for each corner region. This step injects prior physical knowledge into the neural network, providing a high-quality initial starting point for subsequent active learning.

[0083] S5: Based on the initial pose inference model and the initial magnetic field generation model, in each angular region, the current prediction mean and the current prediction variance are obtained using the expert model trained in the previous angular region. Based on the current prediction variance, the BIUM score of all candidate trajectory points in the corresponding angular region is calculated. The expert model includes: pose inference model and magnetic field generation model.

[0084] S6: Normalize the BIUM scores of all candidate trajectory points in the corresponding angular region and convert them into a sampling probability distribution. Based on the sampling probability distribution, perform sampling without replacement, select several pose points with the most informational value, drive the robotic arm to move the magnetic tracker precisely to the target pose, and at the same time, the wearable sensor array synchronously collects magnetic field data to obtain the real sample dataset in each angular region.

[0085] S7: Based on the real sample dataset within the current angular region, train an expert model specific to the current angular region by minimizing the negative Gaussian log-likelihood loss.

[0086] S8: After all regional expert models are trained, the pose inference models specific to each region are integrated into the hybrid expert architecture, and end-to-end joint training is performed using the real sample dataset within each corner region to obtain the final localization model; the hybrid expert architecture includes several expert models; the final localization model is used to achieve pose prediction.

[0087] As an optional implementation, the real calibration set includes trajectories covering the center and peripheral pitch-roll angles. There is a center position (0°, 0°), and four corner positions: (60°, 50°), (-60°, -50°), (75°, -45°), and (-75°, 45°). Therefore, there are a total of five trajectories in different directions. In short, the real calibration set is a small but precise dataset of real-world measurements designed to provide a reliable initial state for subsequent adaptive sampling and training, calibrated through a physical model.

[0088] As an optional implementation, obtaining the synthetic dataset in step S1 specifically includes the following steps.

[0089] Obtain all candidate pose data from the training set.

[0090] The synthetic magnetic field data is generated by substituting all the candidate pose data in the training set into the calibrated formula.

[0091] A synthetic dataset is obtained based on all the candidate pose data and the synthetic magnetic field data.

[0092] As an optional implementation, the calibrated formula is shown below.

[0093] in, For the magnetic dipole in position The magnetic flux density generated at that location; , , These are the position coordinates of the magnetic tracker; The pitch angle of the magnetic tracker; This refers to the roll angle of the magnetic tracker; The position of the magnetic dipole; The direction of the magnetic dipole; Remanence; and These are the diameter and length of the cylindrical magnet, respectively. These are the sensor gain matrix and the mounting orientation correction matrix, respectively. The position coordinates of the sensor ; For sensor bias; Raw readings from a single triaxial sensor; Represents the raw readings of the sensor It is a three-dimensional vector; Environmental noise interference; Represents the parameter set Optimize the loss function to make it more efficient. minimize; For the true calibration set; For the first Raw sensor readings for each sample; To make the first The magnetic flux density is obtained by substituting the pose of each sample into the magnetic dipole model.

[0094] Specifically, the system is calibrated based on the classic far-field magnetic dipole model. The magnetic dipole (which can be considered a magnetic dipole when the distance between the magnetic tracker and the sensor is much larger than the diameter of the magnetic tracker) is obtained in pose. The magnetic flux density produced at the location Given measurement parameters By minimizing the following nonlinear least squares loss (Equation (4)) on the parameters Θ The calibration is performed, and the calibrated formula (1) is obtained based on the calibrated parameters.

[0095] As an optional implementation, dividing the entire attitude space into several consecutive angular regions specifically includes: such as... Figure 6 As shown in the lower left corner, the entire pose space is divided into A continuous angular region (For example, 6 regions). This strategy of dividing regions by attitude angle rather than spatial location can significantly reduce the path length and time overhead of the robotic arm moving back and forth between different regions in practice, thus improving the overall sampling efficiency. Sampling is performed in the order of regions, mimicking course learning, transitioning from simple regions (such as the region directly opposite the magnet) to complex regions (such as the region with a large tilt angle).

[0096] As an alternative implementation method, the key to active learning is to measure the "information value" of an unsampled point. This application proposes a two-way uncertainty measure for the special characteristics of PML two-way physical processes.

[0097] Forward magnetic field generation uncertainty: measures the uncertainty in predicting the corresponding magnetic field given a pose. This reflects the model's insufficient understanding of complex magnetic field nonlinearities (especially near-field distortion).

[0098] Inverse pose inference uncertainty: measures the uncertainty in inferring the pose of a given (synthetic) magnetic field measurement. This reflects the ill-conditioned nature of the inverse problem solution and its sensitivity to noise in regions with weak or smooth magnetic field signals (far field).

[0099] like Figure 4 As shown, to achieve bidirectional uncertainty quantification, this application constructs a magnetic field generation neural network and a pose inference neural network with a gated multilayer perceptron (gMLP) as the backbone, each equipped with a dual regression head for outputting the predicted mean. and prediction variance The magnetic field generation neural network takes the pose as input and outputs the magnetic field; the pose inference neural network takes the magnetic field as input and outputs the pose. Each regression head consists of a Dropout layer followed by a fully connected layer. For the branch that calculates the prediction standard deviation, an exponential activation function is used to ensure non-negativity, and its fully connected layer weights are initialized to zero. This ensures that all outputs have uniform uncertainty initially. This effectively prevents uncertain branches from dominating in the early stages of training and avoids getting stuck in local optima due to excessively large or small initial uncertainties.

[0100] As an optional implementation, the expression for minimizing the negative Gaussian log-likelihood loss is as follows.

[0101] in, Model for generating magnetic fields The loss function; For pose inference model The loss function; The total number of samples in the training dataset; Let be the dimension of the magnetic field vector; The dimension of the pose vector; For dimension indexing; Model for generating magnetic fields For the The sample, in the first Standard deviation of the prediction in each magnetic field dimension (uncertainty in forward magnetic field generation). For the magnetic field generation model, the first The sample, in the first Predicted values ​​(mean) for each magnetic field dimension; For the first The sample, in the first The actual measured values ​​in each magnetic field dimension; For pose inference model For the The sample, in the first Standard deviation of the prediction in each pose dimension (inverse pose inference uncertainty). For the pose inference model for the first The sample, in the first Predicted values ​​(mean) for each pose dimension; For the first The sample, in the first The true value in each pose dimension.

[0102] As an optional implementation, the formula for calculating the BIUM score is as follows.

[0103] For a candidate pose Its BIUM score is defined as the sum of the normalized uncertain ellipsoidal volumes (geometric mean); where, For the first The pose of each sample; For a pose BIUM score; This is the normalization function; for Individual prediction variances The geometric mean; for Individual prediction variances The geometric mean of BIUM. The high scores in BIUM are those points that are most valuable for improving both the magnetic field model and the positioning model.

[0104] As an optional implementation, the formula for calculating the sampling probability distribution is as follows.

[0105] in, For the current angular region, the first Trajectory; The temperature parameter is used to balance exploration (more uniformity) and utilization (focusing on high uncertainty points); Formula (8) is obtained by converting the BIUM score into a sampling probability distribution through the Softmax function.

[0106] As an optional implementation, the expression for the pose prediction is as follows.

[0107] in, The predicted pose; Soft selection weights for experts in each region; For the first The predicted pose output by the pose inference expert network for each region.

[0108] Specifically, after all regional expert models are trained, to avoid suboptimal coordination between regions, a Mixture of Experts (MoE) architecture is introduced for integration. The specific integration process is as follows: Figure 5 As shown.

[0109] Training a gating network The well-trained gating network is The gated network The input is the magnetic field observation value. The output is the soft selection weights for experts in each region. This application uses actively sampled data collected from all regions. The entire system (all expert models and gating networks) is jointly fine-tuned end-to-end to obtain the final localization model; the final localization model is used to realize pose prediction; the final pose prediction is obtained by weighted average of all experts, as shown in formula (9).

[0110] This application utilizes actively sampled data collected from all regions. The entire system (all expert models and gating networks) is jointly fine-tuned end-to-end, enabling the gating network to learn to dynamically call the most suitable expert based on the input magnetic field and promote knowledge collaboration among experts, ultimately forming a globally consistent, smooth-transitioning high-precision positioning system.

[0111] In summary, such as Figure 6 As shown, the core innovation of this application lies in bidirectional uncertainty measurement and progressive regional expert training based on curriculum learning. The artificial intelligence framework of this application consists of three consecutive stages. First, the workspace is divided into different sub-regions (e.g., Figure 6 The space is divided into 6 areas by angle in the lower left corner), and... and Pre-trained pose inference and magnetic field generation models are used to initialize the iterative process. During the core sampling training phase, each sub-region... Sequential processing: First, input the candidate sampling pose into the previous region. The magnetic field generation model is used to obtain the predicted magnetic field and the corresponding uncertainty in magnetic field generation; subsequently, the predicted magnetic field is input into the previous region. The pose inference model is used to obtain the inferred pose and pose inference uncertainty. Then, the two types of uncertainty are combined by the two-way uncertainty measurement formula (Formula (7)) and converted into sampling probability (Formula (8)) to select the pose to be sampled. These pose commands are sent to the five-degree-of-freedom motion control system to drive the robotic arm to move the magnetic tracker to the target pose. At the same time, the wearable sensor array collects magnetic field data synchronously to obtain real "pose-magnetic field" sample pairs. After sampling, the magnetic field generation expert model (Formula (5)) and pose inference expert model (Formula (6)) of the current region are trained using the newly acquired data. This mechanism realizes the "transmission of uncertainty": the experts of the preceding region "recommend" the most uncertain sample on the cognitive boundary to the subsequent region, guiding the learning frontier to advance dynamically and robustly to the unknown complex region. After all the regional expert networks are trained, the pose inference experts of each region are integrated into the MoE architecture and end-to-end joint training is performed using all the collected real sample data to optimize the collaborative prediction performance of the overall system.

[0112] It should be noted that, Figure 6 In For the angular region, where It can be 1, 2, 3, 4, 5, or 6; For the true calibration set; For synthetic datasets; This serves as the initial pose inference model; This is the initial magnetic field generation model; Let be the determinant of the covariance matrix; For the first Covariance in the magnetic field generation model of each region The determinant of a matrix; For the first Covariance in the pose inference model for each region The determinant of a matrix; For the entire region BIUM scores for all pose points in the dataset; This is the real sample dataset within the current angular region; For the first each region Pose data for each sample; For the first Within each region Magnetic field data for each sample; For the first A model for the generation of magnetic fields within the region; For the first Pose inference model within the region; For a well-trained gating network; This is a set of trained expert models for pose inference in each region.

[0113] This application unifies the bidirectional physical uncertainty in PML into a measure of information gain using BIUM, thereby driving an active learning closed loop embedded in a hybrid expert architecture. On the hardware side, it manifests as an autonomous calibration platform capable of automatically executing an "evaluation-planning-execution-learning" cycle; on the algorithmic side, it gradually conquers the workspace through curriculum-based region sampling, ultimately achieving globally optimal performance through expert ensemble. This method represents the first paradigm shift in data acquisition in the PML field, moving from "passive uniformity" to "active intelligence," significantly reducing the cost and time of physical sampling while maintaining accuracy.

[0114] It should be noted that the bidirectional uncertainty measure based on the Gaussian uncertainty assumption proposed in this application can also be replaced by other uncertainty estimation schemes, such as Monte Carlo Dropout, Expected Model Change, or Core-set Methods. As long as it has the function of bidirectional uncertainty measurement for both the magnetic field generation model and the magnetic tracking model, it is acceptable. The models of the sensors, microcontrollers, and host computers in the magnetic positioning calibration system are not limited. Furthermore, there are no restrictions on the regional expert network; it can be gMLP, ResNet, or Transformer, etc.

[0115] This application is based on the bidirectional uncertainty measure of mutual information (BIUM). By uniformly quantifying the uncertainty of forward magnetic field generation and reverse pose inference, and using this as the criterion for information gain, it guides the sampling decision to simultaneously optimize the magnetic field model and the positioning model, thus solving the limitations of traditional single-dimensional uncertainty measure in PML.

[0116] This application's course-based, regionalized active sampling strategy divides the entire workspace's pose angle range into several consecutive sub-regions. Expert models for each region are trained sequentially, and the BIUM score calculated from the previous region's model guides the robot to perform the most informative sparse sampling for the next adjacent region. This achieves cross-regional uncertainty transfer and progressive advancement of the learning frontier, thus avoiding the inefficiency of uniform sampling and significantly improving data utilization.

[0117] This application's closed-loop autonomous system architecture deeply integrates the BIUM-driven active learning process with expert models trained in different regions. Through a fully automated closed loop of "evaluation-planning-execution-learning," it achieves the synergy between algorithmic decision-making and high-precision robot execution, transforming PML calibration into an unattended, online adaptive intelligent calibration process.

[0118] Compared with the prior art, this application has the following advantages.

[0119] First, it achieves a fundamental breakthrough in data acquisition efficiency. Existing technologies rely on uniform or random sampling, requiring the collection of a large amount of redundant data to ensure model accuracy. This invention intelligently identifies the sampling point with the most information through a bidirectional uncertainty metric (BIUM), and combines it with a course-based regionalization strategy to progressively cover the workspace. While ensuring the same or even higher positioning accuracy, it significantly reduces the number of physical sampling points and sampling time, greatly reducing calibration costs and time.

[0120] Secondly, it solves the problem of unbalanced modeling in complex magnetic field environments. Traditional methods cannot distinguish between strong nonlinearity in the near field and weak signal regions in the far field, leading to overfitting in some regions and underfitting in others. The BIUM proposed in this invention can simultaneously perceive the uncertainties in forward magnetic field generation and reverse pose inference, enabling the system to automatically strengthen targeted learning of highly nonlinear near-field and low signal-to-noise ratio far-field, thereby comprehensively improving the model's generalization ability and robustness in complex real magnetic fields.

[0121] Third, the first fully closed-loop, automated PML intelligent calibration system was constructed. Existing technologies suffer from a disconnect between data acquisition, model training, and system calibration, heavily relying on manual operation. This invention integrates algorithmic decision-making, robot control, and real-time learning into an autonomous closed loop of "evaluation-planning-execution-learning," achieving a paradigm shift from "manual operation, open-loop calibration" to "unattended, closed-loop adaptive calibration," significantly improving the system's repeatability, scalability, and practical deployment efficiency.

[0122] Fourth, it provides a generalizable active learning framework that does not depend on a specific network structure. Unlike some customized network models, the BIUM-driven mechanism and hybrid expert architecture of this invention can be adapted to various backbone networks (such as MLP, CNN, and Transformer), and have been verified to be effective in both wraparound and planar sensor layouts, demonstrating strong cross-scene and cross-configuration generalization capabilities and providing flexible solutions for different application needs.

[0123] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data during model training. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements an adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty-driven principles.

[0124] Those skilled in the art will understand that Figure 7 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0125] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0126] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of the relevant data are carried out in compliance with the relevant data protection laws and policies of the country where the location is located, and with the authorization granted by the owner of the corresponding device.

[0128] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0129] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0130] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0131] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty-driven methods, characterized in that, The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty includes: Obtain the entire pose space, the real calibration set, and the synthetic dataset; the real calibration set is a set covering the center and boundary of the workspace; the synthetic dataset is a set generated based on the training set; the training set includes several candidate pose data. The entire attitude space is divided into several consecutive angular regions; A magnetic field generation neural network and a pose inference neural network with a gated multilayer perceptron as the backbone are constructed, each equipped with a dual regression head to output the predicted mean and predicted variance. By combining the real calibration set and the synthetic dataset, and minimizing the negative Gaussian log-likelihood loss, the magnetic field generation neural network and the pose inference neural network are pre-trained respectively to obtain the initial pose inference model and the initial magnetic field generation model. Based on the initial pose inference model and the initial magnetic field generation model, in each angular region, the current prediction mean and the current prediction variance are obtained using the expert model trained in the previous angular region. Based on the current prediction variance, the BIUM score of all candidate trajectory points in the corresponding angular region is calculated. The expert model includes: pose inference model and magnetic field generation model. After normalizing the BIUM scores of all candidate trajectory points in the corresponding angular region, the results are converted into a sampling probability distribution. Based on the sampling probability distribution, sampling without replacement is performed to select several pose points with the most informational value. The robotic arm is then driven to precisely move the magnetic tracker to the target pose. At the same time, the wearable sensor array synchronously collects magnetic field data to obtain the real sample dataset for each angular region. Based on the real sample dataset within the current angular region, an expert model specific to the current angular region is trained by minimizing the negative Gaussian log-likelihood loss. After all regional expert models are trained, the pose inference models specific to each region are integrated into the hybrid expert architecture, and end-to-end joint training is performed using real sample datasets within each corner region to obtain the final localization model; the hybrid expert architecture includes several expert models; the final localization model is used to achieve pose prediction.

2. The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving according to claim 1, characterized in that, The acquisition of the synthetic dataset specifically includes: Obtain all candidate pose data from the training set; Substitute all the candidate pose data in the training set into the calibrated formula to generate synthetic magnetic field data; A synthetic dataset is obtained based on all the candidate pose data and the synthetic magnetic field data.

3. The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving according to claim 2, characterized in that, The calibrated formula is: in, For the magnetic dipole in position The magnetic flux density generated at that location; , , These are the position coordinates of the magnetic tracker; The pitch angle of the magnetic tracker; This refers to the roll angle of the magnetic tracker; The position of the magnetic dipole; The direction of the magnetic dipole; Remanence; and These are the diameter and length of the cylindrical magnet, respectively. These are the sensor gain matrix and the mounting orientation correction matrix, respectively. The position coordinates of the sensor ; For sensor bias; Raw readings from a single triaxial sensor; Represents the raw readings of the sensor It is a three-dimensional vector; Environmental noise interference; Represents the parameter set Optimize the loss function to make it more efficient. minimize; For the true calibration set; For the first Raw sensor readings for each sample; To make the first The magnetic flux density is obtained by substituting the pose of each sample into the magnetic dipole model.

4. The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving according to claim 1, characterized in that, The expression for minimizing the negative Gaussian log-likelihood loss is: in, Model for generating magnetic fields The loss function; Pose inference model The loss function; The total number of samples in the training dataset; is the dimension of the magnetic field vector; Let be the dimension of the pose vector; For dimension indexing; Model for generating magnetic fields For the The sample, in the first Standard deviation of the prediction across each magnetic field dimension; For the magnetic field generation model, the first The sample, in the first Predicted values ​​in each magnetic field dimension; For the first The sample, in the first The actual measured values ​​in each magnetic field dimension; Pose inference model For the The sample, in the first Standard deviation of the prediction over each pose dimension; For the pose inference model for the first The sample, in the first Predicted values ​​in each pose dimension; For the first The sample, in the first The true value in each pose dimension.

5. The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving according to claim 1, characterized in that, The formula for calculating the BIUM score is as follows: in, For the first The pose of each sample; For a pose BIUM score; This is the normalization function; for Individual prediction variances The geometric mean; for Individual prediction variances The geometric mean.

6. The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving according to claim 1, characterized in that, The formula for calculating the sampling probability distribution is: in, For the current angular region, the first Trajectory; This refers to the temperature parameter.

7. The adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving according to claim 1, characterized in that, The expression for pose prediction is: in, The predicted pose; Soft selection weights for experts in each region; For the first The predicted pose output by the pose inference expert network for each region.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the adaptive sampling method for permanent magnet positioning based on bidirectional uncertainty driving as described in any one of claims 1-7.