Multi-magnetic-source initial positioning method based on NSS-VMGT fusion
By using the NSS-VMGT fusion method and the STM32H743 hardware platform, the problems of misjudgment of the number of magnetic sources and missed edge detection in the initial localization of multiple magnetic sources are solved, improving the localization accuracy and efficiency, and making it suitable for scenarios such as multi-magnetic capsule therapy in the digestive tract.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies cannot effectively solve the problems of low positioning accuracy and poor efficiency caused by misjudgment of the number of magnetic sources, missed detection of edge magnets, and disorder of search space in the initial positioning of multiple magnetic sources. Especially in the targeted therapy of multi-magnetic capsules in the digestive tract, a positioning error of more than 3mm will lead to inaccurate drug coverage and damage to healthy tissues.
A multi-magnetic source initial localization method based on NSS-VMGT fusion is adopted. By constructing an information processing module, a magnetic gradient tensor MGT calculation module, a vertical magnetic gradient tensor VMGT calculation module, an NSS horizontal candidate point screening module, and a candidate point identification module, combined with the STM32H743 hardware platform, the method realizes the identification of the number of multiple magnetic sources and the delineation of the initial search area, eliminates false peak interference, and improves the identification accuracy and search coverage.
It achieved an accuracy rate of 94% in identifying the number of magnetic sources, 100% coverage of the initial search area, reduced the search space by 70% for subsequent precision algorithms, and improved computational efficiency by 37.5%, making it suitable for complex scenarios such as multi-magnetic capsule localization in the digestive tract.
Smart Images

Figure CN121765616A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of magnetic positioning technology, specifically relating to a method for initial positioning of multiple magnetic sources based on the fusion of normalized source strength (NSS) and vertical magnetic gradient tensor (VMGT). It is applicable to scenarios such as targeted therapy with multiple magnetic capsules in the digestive tract, collaborative control of multiple magnets in industry, and intelligent navigation positioning with multiple magnetic markers. It can accurately identify the number of multiple permanent magnets and reliably estimate their initial positions, providing core initial conditions for subsequent precise positioning of multiple magnetic sources and supporting the efficient operation of clinical and industrial positioning systems. Background Technology
[0002] In the field of targeted therapy for gastrointestinal tumors, multi-magnetic capsules need to be arranged on the tumor surface at a preset spacing (±1mm accuracy) to construct a drug release area. Their positioning accuracy directly determines whether the drug can accurately cover the lesion—if the positioning error exceeds 3mm, the tumor cell clearance rate will decrease by more than 40%, and may even lead to damage to healthy tissue. The primary challenge in multi-magnetic source positioning is distinguishing individual magnetic source signals from the superimposed magnetic field data collected by the sensor array; this is the foundation for ensuring subsequent accurate positioning.
[0003] Current multi-magnetic-source initial localization techniques mainly rely on the single normalized source intensity (NSS) detection method, which determines the number and location of magnetic sources by analyzing the eigenvalues of the magnetic gradient tensor. However, this technique has two major flaws: First, when the distance between two permanent magnets is less than twice the distance between the sensors (e.g., when the sensor distance is 25mm, the magnetic source distance is <50mm), magnetic field coupling will produce "pseudo-peaks," leading to misjudgment of the number of magnetic sources (false positive rate exceeding 30%). Second, for a 7*7 sensor array, no dedicated detection mechanism is designed for the edge region of the sensor array, specifically for the 1st row, 7th row, 1st column, and 7th column. Due to incomplete magnetic field signal acquisition at the edge magnets, only 60%-70% of the effective signal is typically obtained, making them prone to missed detection (false positive rate exceeding 25%). In addition, traditional methods do not limit the initial search area, resulting in an excessively large search space for subsequent fine calculation algorithms, increasing the computational load by more than 60%, and achieving a convergence success rate of less than 85%.
[0004] Existing improvement solutions include some technologies that increase the number of sensors to improve coverage, but this doubles the system complexity and cost. Other solutions employ multi-sensor data fusion, but rely on CT / MRI image calibration, which is complex and unsuitable for dynamic digestive tract scenarios. In summary, existing technologies cannot simultaneously solve the problems of misjudgment of magnetic source count, missed edge detection, and low search efficiency, making it difficult to meet the stringent initial localization requirements of multi-magnetic capsule targeted therapy, namely, a count recognition accuracy of ≥90% and an initial search area coverage of ≥95%. Summary of the Invention
[0005] Based on this, this invention provides a multi-magnetic source initial localization method based on NSS-VMGT fusion to solve the problems of low initial localization accuracy and poor subsequent calculation efficiency caused by misjudgment of the number of magnetic sources, missed detection of edge magnets, and disorder of the search space in the prior art.
[0006] A first aspect of this invention provides a multi-magnetic source initial localization method based on NSS-VMGT fusion, the method comprising:
[0007] Based on the initial localization requirements of multiple magnetic sources and the characteristics of the magnetic gradient tensor, an information processing module, a magnetic gradient tensor (MGT) calculation module, a vertical magnetic gradient tensor (VMGT) calculation module, an NSS horizontal candidate point screening module, a candidate point identification module, and a candidate point fusion module are constructed. These modules work together to identify the number of multiple magnetic sources and delineate the initial search area. According to functional logic, the modules are divided into an information processing module, a VMGT calculation module, an NSS horizontal candidate point screening module, a candidate point identification module, and a candidate point fusion module.
[0008] An information processing module is constructed to acquire magnetic gradient tensor (MGT) data, sensor position data, and sensor spacing (preset to 25mm, adjustable within the range of 20-30mm) from a 7×7 three-component sensor array. Based on the above data, a 7×7 sensor mesh is reconstructed in a preset spatial coordinate system (with the center of the sensor array as the origin, the XY plane coinciding with the array plane, and the Z axis vertically upward), determining the three-dimensional coordinates of each sensor (e.g., the first sensor). Line 1 The coordinates of the column sensor are In the data preprocessing stage, erroneous data is removed by 32-bit CRC check and generator polynomial 0xEDB88320. Then, the moving average filter (window size 5) is used to suppress environmental noise, so that the signal-to-noise ratio is improved to more than 40dB.
[0009] Furthermore, a magnetic gradient tensor (MGT) calculation module is constructed. The magnetic gradient tensor is the spatial derivative of the magnetic field vector, defined as the decay rate, or rate of change, of the three components of the total magnetic field value in three directions. Therefore, the value of the magnetic gradient tensor cannot usually be directly measured by a magnetic sensor; multiple vector magnetic sensors must be used to further process the measured three-component magnetic field values. Let... , , The total magnetic field is respectively in , , The magnetic gradient tensor expression for the three directional components can be written as:
[0010] (1)
[0011] Furthermore, a vertical magnetic gradient tensor (VMGT) calculation module is constructed to calculate the angle of the vertical magnetic gradient tensor (VMG) at each measurement point according to formula (2). Formula (1) is as follows:
[0012] (2)
[0013] In the formula, This represents the angle value of the vertical magnetic gradient component. , and They represent the first OK The third row of the magnetic gradient tensor of the sensor corresponds to the X, Y, and Z components of the gradient in the Z direction; then the gradient in the X direction is calculated using formula (3), which is:
[0014] (3)
[0015] The gradient in the Y direction is calculated using formula (4), which is:
[0016] (4)
[0017] Furthermore, an NSS horizontal candidate point screening module is constructed. When the coupling between two adjacent magnets is too strong, an additional NSS extremum point will appear between the two magnets, which can lead to misjudgment of the number of magnetic sources. By detecting the local extremum points of the NSS field distribution, the horizontal projection position of the magnet can be determined. However, the magnet between two adjacent magnets needs to be re-evaluated. The NSS calculation formula is:
[0018] (5)
[0019] In the formula, Let G be the eigenvalue of the magnetic gradient tensor matrix G.
[0020] Furthermore, a candidate point identification module is constructed to identify points that meet the following criteria: and "The X-axis coordinates of the measured points under the given conditions are calculated using formula (6):"
[0021] (6)
[0022] Identify those that meet the following criteria: and "The coordinates of the candidate points in the Y direction are calculated using formula (7) based on the measured points of the given conditions:"
[0023] (7)
[0024] The positions that are candidate points in both the X and Y directions are marked as internal candidate points, and the number of these points is counted as the initial number of magnetic sources; then the horizontal search area is determined according to formula (8):
[0025] (8)
[0026] In the formula The horizontal search area is defined, and the vertical search area is uniformly set to 3-5 times the sensor spacing to meet the applicable conditions of the magnetic dipole model.
[0027] Furthermore, a candidate point fusion module is constructed to detect the maximum VMGT value in the edge region of the sensor array, and the point with the smallest VMGT angle at the edge is selected as the initial edge candidate point; then the NSS value is calculated by formula (7) to verify the validity of the candidate point.
[0028] A second aspect of this invention provides a multi-magnetic-source initial positioning device and system based on the STM32H743 hardware platform, the device and system comprising:
[0029] The 7*7 sensor array positioning board layout based on the lis2mdltr three-component magnetic sensor achieves the acquisition of raw magnetic field data through a square magnetic sensor array with equal spacing; the sensors are numbered to facilitate the distinction between the center sensor and the edge sensor, and the data of the edge sensor is processed by edge processing.
[0030] Furthermore, a hardware signal filtering circuit is constructed to reduce sensor signal fluctuations, and a matching voltage regulator circuit and protection circuit are built.
[0031] Furthermore, an MCU processing system built using two STM32H743 chips addresses the issue that the resources of a single chip's simulated IIC I / O ports are insufficient to cover all channels when collecting data from 49 sensors (7 sensors per row) on a 7×7 positioning board. A regional acquisition architecture is adopted: one chip is responsible for acquiring data from the first four rows (28 sensors) of the positioning board, using its configured simulated IIC channels to obtain real-time sensor data such as magnetic field strength and spatial coordinates for the corresponding area; the other chip is responsible for acquiring data from the last three rows (21 sensors) of the positioning board, also using its own simulated IIC channels to acquire sensor data for that area.
[0032] Furthermore, the two chips establish a data interaction link through serial communication. After completing the data acquisition in their respective areas, the data collected by both chips are synchronized and integrated through this link to ensure the consistency of the data from the first four rows and the last three rows of a total of 49 sensors in the time dimension.
[0033] Furthermore, the MCU processing system sends the synchronized complete positioning data back to the computer via a serial port, and the computer calculates the magnet's pose information using a preset model and algorithm.
[0034] Furthermore, based on the initial localization requirements of multiple magnetic sources and the characteristics of the magnetic gradient tensor, an information processing module, a VMGT calculation module, a candidate point identification module, and a candidate point fusion module are established. Each module works together to identify the number of multiple magnetic sources and delineate the initial search area. The modules are divided into an information processing module, a VMGT calculation module, a candidate point identification module, and a candidate point fusion module according to their functional logic.
[0035] The method, device, and system for initial localization of multiple magnetic sources based on NSS-VMGT fusion eliminate spurious peak interference using the NSS-VMGT fusion architecture, improving the accuracy of magnetic source number identification to 94%. Through the edge candidate point detection mechanism, the initial search area coverage reaches 100%. This reduces the search space for subsequent precise algorithms by 70%, improves computational efficiency by 37.5%, and balances accuracy, completeness, and cost-effectiveness, making it suitable for complex scenarios such as multi-magnetic capsule localization in the digestive tract. Attached Figure Description
[0036] Figure 1 is a flowchart of the multi-magnetic source initial localization method based on NSS-VMGT fusion provided in an embodiment of the present invention;
[0037] Figure 2 is a schematic diagram of the 7×7 sensor grid and spatial coordinate system provided in an embodiment of the present invention;
[0038] Figure 3 is a hardware system architecture diagram provided in an embodiment of the present invention. Detailed Implementation
[0039] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0040] like Figure 1 As shown, Figure 1 The implementation flow of the multi-magnetic source initial localization method based on NSS-VMGT fusion provided by the embodiments of the present invention is shown, specifically including steps S01 to S04.
[0041] Step S01: Construct an information processing module to complete data preparation and grid reconstruction.
[0042] Acquire the raw magnetic gradient tensor data (including) collected by the 7×7 sensor array. , (Equal components), sensor spacing (s), and physical position parameters; calculate the coordinates of each sensor in a preset spatial coordinate system, for example, the coordinates of the sensor located in the 5th column of the 3rd row are... During data preprocessing, each frame of data is first checked with a 32-bit CRC check. If the check fails, the frame is discarded. If the check passes, a moving average filter is used with a window size of 5, i.e., current data = (previous 2 frames + current frame + next 2 frames) / 5. This filters out interference from environmental magnetic field fluctuations (such as changes in the geomagnetic field) and ensures that the standard deviation of the processed data is ≤0.5μT.
[0043] It should be noted that the sensor array should be kept away from strong magnetic interference sources (such as motors and transformers), and the experimental environment temperature should be controlled at 25±2℃ to avoid sensor accuracy drift caused by temperature and humidity changes (lis2mdltr accuracy fluctuation ≤0.5% within this range); when the two STM32H743 chips are synchronized through dual-machine communication, the clock needs to be pre-calibrated (using the internal RTC clock, synchronization period 1ms) to ensure consistent data acquisition timing.
[0044] Step S02: Construct the magnetic gradient tensor (MGT) calculation module to complete the magnetic gradient tensor calculation.
[0045] The value of the magnetic gradient tensor cannot usually be directly measured by a magnetic sensor. Multiple vector magnetic sensors must be used to further process the measured three-component magnetic field values. The value of the magnetic gradient tensor corresponding to the sensor position can be calculated using the three-component sensor data through formula (1).
[0046] Furthermore, only 5 key elements are retained from the nine-component matrix data, and subsequent calculations use the simplified lower half matrix as the corresponding tensor matrix.
[0047] Step S03: Construct the VMGT calculation module to complete the VMGT angle and gradient calculation.
[0048] Based on the values obtained from the MGT calculation module, the corresponding VMGT angle values at each sensor position are calculated. The previous MGT calculation module has already simplified the magnetic gradient tensor G.
[0049] Furthermore, extract from the preprocessed magnetic gradient tensor data , , The components are substituted into formula (1) to calculate the VMGT angle at each measurement point, for example, at a certain sensor. , , ,but:
[0050]
[0051] Next, calculate the gradient in the X direction according to formula (2). Considering that the sensor array is uniformly arranged, the division operation is omitted to simplify the calculation. By using the maximum value of VMGT to find candidate points for the magnetic source location, first calculate the gradient in the X direction and the gradient in the Y direction based on the VMGT angle value. Then, based on the gradient change, when both directions change from positive to negative, it is proven that the point is a point of sudden change, that is, an extreme point, and is extracted as a candidate point. Let the VMGT value corresponding to the sensor array be where the row of the sensor represents the number of columns of the sensor. Then the gradient in the X direction,
[0052]
[0053] Similarly, the gradient in the Y direction can be obtained.
[0054]
[0055] Ensure gradient calculations cover all sensor locations, excluding those at boundaries (e.g., j=7). Pick Value padding is used to avoid calculation errors.
[0056] Step S04: Construct the NSS horizontal candidate point filtering module to complete the horizontal plane candidate point filtering.
[0057] First, the eigenvalues are calculated using the magnetic gradient tensor matrix obtained from the MGT calculation module, and then the corresponding NSS values are calculated.
[0058] Furthermore, the most drastically changing magnetic gradient tensor field is identified using NSS, and its preliminary horizontal coordinates are obtained. Then, by combining the sensitivity of the vertical deflection angle of VMGT, spurious peaks obtained from NSS coupling are eliminated. Finally, the number of real magnetic sources is determined, and the initial coordinates and corresponding algorithm search regions are obtained.
[0059] Step S05: Construct a candidate point recognition and fusion module to complete edge candidate point detection and fusion.
[0060] Candidate points in the x-direction and y-direction can be found through gradient transformation. If the x-direction and y-direction conditions are satisfied simultaneously, then...
[0061] (16)
[0062] (17)
[0063] Based on the candidate points obtained, the horizontal search area for each magnetic source is determined.
[0064]
[0065] Furthermore, the points confirmed by Formula 18 are candidate points inside the sensor array, which will cause edge candidate points to be ignored. Therefore, a boundary candidate point search is performed on the boundary to avoid the inability to accurately calculate the edge points when the permanent magnet is close to the boundary due to incomplete permanent magnet information obtained by the sensor array.
[0066] Furthermore, the edge regions of the sensor array (row 1, row 7, column 1, column 7) are clearly defined to solve the problem of missing edge magnetic sources in the internal candidate points; by combining the sensitivity of VMGT to vertical gradients and the magnetic source feature recognition capability of NSS, edge candidate point detection and global candidate point optimization are realized, and finally the complete number of magnetic sources and the initial search area are output.
[0067] Furthermore, the VMGT angle values of the edge region sensors are iterated, and the point with the minimum VMGT angle of a single edge is selected as the initial edge candidate point. For the corner region, the VMGT distribution of the two adjacent edges is referenced, and the point with the minimum VMGT among the three surrounding sensors is selected. The NSS value of the initial candidate point is calculated according to formula (5), and the threshold is set to 0.1A / m². If NSS ≥ the threshold, it is a valid edge candidate point; otherwise, noise points are eliminated.
[0068] If there are two adjacent valid candidate points near an edge or corner (spacing < 0.5 times the sensor spacing), they are merged into a single candidate point: the nearest point is selected based on the internal candidate point, and if there is no internal candidate point, the point with the larger NSS value is selected; the internal candidate point is merged with the valid edge candidate point, and the horizontal Euclidean distance between any two points is calculated. If the distance is < 0.5 times the sensor spacing, duplicates are removed (the point with the larger NSS is retained). Finally, the number of magnetic sources and the initial search area of each magnetic source are output (horizontally, it is "candidate point coordinates ± sensor spacing", and vertically, it is 3-5 times the sensor spacing).
[0069] The above description discloses only one preferred embodiment of the present invention, and should not be construed as limiting the scope of the present invention. Those skilled in the art will understand that all or part of the processes of the above embodiments can be implemented, and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. A method for initial positioning of multiple magnetic sources based on NSS-VMGT fusion, characterized in that, Different functional modules are established based on the initial positioning requirements of multiple magnetic sources and the characteristics of magnetic gradient tensor, and each module cooperates to realize the identification of the number of multiple magnetic sources and the initial search area division, and the method comprises: According to the functional logic, the modules are divided into information processing module, magnetic gradient tensor (MGT) calculation module, vertical magnetic gradient tensor (VMGT) calculation module, NSS horizontal candidate point screening module, candidate point identification module and candidate point fusion module.
2. The information processing module is constructed, the magnetic gradient tensor data, sensor position data and sensor spacing collected by the 7x7 three-component sensor array are acquired, the 7x7 sensor grid is reconstructed in the preset spatial coordinate system, and the three-dimensional coordinates of each sensor are determined, at the same time, the error data is removed through 32-bit CRC check, and the environmental noise is suppressed through sliding average filtering.
3. Further, the magnetic gradient tensor calculation module is constructed, the spatial variation rate of the magnetic field, i.e. the magnetic gradient tensor, is calculated based on the components of the total magnetic field in X, Y and Z directions; Further, the vertical magnetic gradient tensor calculation module is constructed, the VMGT angle and X, Y direction gradient of each measurement point are calculated, wherein the VMGT angle reflects the included angle between the vertical gradient vector and the Z axis, and the X, Y direction gradient reflects the variation rate of the VMGT angle in the horizontal direction; Further, the NSS horizontal candidate point screening module is constructed, the local extreme points of the magnetic gradient tensor field are detected by calculating the normalized source intensity (NSS), the horizontal projection position of the magnet is determined, and the false peaks generated by the coupling of adjacent magnets are investigated; Further, the candidate point identification module is constructed, the positions where the X and Y direction gradients both satisfy the extreme value condition are extracted as internal candidate points, the number is counted as the preliminary number of magnetic sources, and the horizontal and vertical search areas are divided; Finally, the candidate point fusion module is constructed, the VMGT feature detection is performed on the edge area of the sensor array, the effectiveness of the edge candidate points is verified through the NSS value, the internal candidate points and the effective edge candidate points are merged and the repeated points are removed, and the final number of magnetic sources and the initial search area are obtained.
4. The information processing module according to claim 1, wherein: The sensor spacing is preset to 25mm, which can be adjusted in the range of 20-30mm; the 32-bit CRC check adopts the generating polynomial 0xEDB88320, the sliding average filtering window size is set to 5, the signal-to-noise ratio of the processed data is improved to more than 40dB, and the standard deviation is less than or equal to 0.5μT.
5. The vertical magnetic gradient tensor calculation module according to claim 1, wherein: When calculating the X direction gradient, the missing adjacent data of the rightmost column of the sensor array is completed by taking its own value; when calculating the Y direction gradient, the missing adjacent data of the uppermost row is completed by taking its own value, so as to ensure that the gradient calculation covers all sensor positions.
6. The candidate point identification module according to claim 1, wherein: The X-direction gradient extreme value condition is "the gradient of the current point > 0 and the gradient of the right adjacent point < 0", and the Y-direction gradient extreme value condition is "the gradient of the current point > 0 and the gradient of the upper adjacent point < 0"; the horizontal search region is centered on the candidate point coordinates, and is expanded by one sensor spacing in the X and Y directions, and the vertical search region is set to 3-5 times the sensor spacing, satisfying the applicable condition of the magnetic dipole model.
7. The candidate point fusion module according to claim 1, characterized in that: The edge region includes the first row, the seventh row, the first column and the seventh column of the sensor array; the edge candidate point is determined by detecting the minimum value of the VMGT angle at the edge; the NSS threshold for validity verification is 0.1 A / m2; the Euclidean distance threshold for repeated point determination is 0.5 times the sensor spacing, and the candidate point with a larger NSS value is retained.
8. A multi-magnetic source primary positioning device based on an STM32H743 hardware platform, characterized in that, For implementing the method of any one of claims 1-5, comprising: a 7x7 sensor array positioning plate, using a lis2mdltr three-component magnetic sensor, arranged in a square array at equal intervals, and numbered to distinguish between center and edge sensors; a hardware signal processing circuit, including a filter circuit to reduce sensor signal fluctuations and a voltage stabilizing protection circuit; a MCU processing system composed of two STM32H743 chips, one responsible for data acquisition of the first four rows of 28 sensors, and the other responsible for data acquisition of the last three rows of 21 sensors, both acquiring data through analog IIC channels; the two chips establish a data interaction link through serial communication, synchronously integrate the collected data, and ensure time dimension consistency; the MCU processing system sends the synchronized complete data back to the computer end through the serial port for solving the magnet pose information.