Active magnetic compensation methods, systems, computer devices, computer-readable storage media, and products based on BP neural networks.

An active magnetic compensation method optimized by BP neural network and particle swarm optimization algorithm solves the problems of magnetic leakage and coil coupling in magnetically shielded rooms, improves the accuracy and uniformity of magnetic field compensation, and is suitable for magnetic measurement of heart and brain and verification of cutting-edge physics theories.

CN114023526BActive Publication Date: 2025-11-14HANGZHOU ZERO MAGNETIC MEDICAL EQUIPMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111102609.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-18
Publication Date
2025-11-14
Estimated Expiration
2041-09-18

AI Technical Summary

Technical Problem

Existing magnetic shielding rooms suffer from magnetic leakage and coil magnetic field coupling problems, resulting in low magnetic field compensation accuracy, small uniform area, and large magnetic field interference, which affects the effect of extremely weak magnetic field measurement.

Method used

An active magnetic compensation method based on BP neural network is adopted. The magnetic field signal is acquired by a three-axis vector sensor, and the signal is processed by BP neural network to output a control signal to drive the magnetic field compensation device for negative feedback adjustment. The BP neural network is optimized by combining particle swarm optimization algorithm to improve the compensation accuracy and anti-interference capability.

Benefits of technology

It improves the accuracy and uniformity of magnetic field compensation, reduces residual magnetism, and optimizes the compensation effect of magnetic field, making it suitable for magnetic field measurement of the heart and brain and verification of cutting-edge physics theories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114023526B_ABST
    Figure CN114023526B_ABST
Patent Text Reader

Abstract

This application discloses an active magnetic compensation method, system, computer device, computer-readable storage medium, and computer product based on a BP neural network, used to compensate for residual magnetism in a magnetically shielded room. The active magnetic compensation method includes: acquiring a magnetic field signal based on the residual magnetism in the space, wherein the magnetic field signal is obtained by detecting the residual magnetism in the space using a magnetic field vector sensor, and the magnetic field signal is divided into multiple paths according to vector information; receiving the multiple magnetic field signals; processing the multiple magnetic field signals using a first BP neural network; and outputting a corresponding control signal, wherein the control signal is used to drive a magnetic field compensation device to perform negative feedback adjustment of the residual magnetism in the space. This application solves the problems of low compensation accuracy and large magnetic field interference caused by magnetic field leakage in the magnetically shielded room and magnetic field coupling in different axes of the coil. By simulating the coupling and decoupling process of the magnetic field in three-dimensional space through the multi-layer feedforward mechanism of the BP neural network, the effect of active magnetic compensation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of extremely weak magnetic field measurement technology, and in particular to an active magnetic compensation method, system, computer device, computer-readable storage medium, and computer product based on a BP neural network. Background Technology

[0002] A near-zero magnetic environment is a necessary condition for extremely weak magnetic field measurements; the lower the spatial remanence of the environment, the higher the measurement sensitivity. A near-zero magnetic environment is of great significance for safer and higher spatial resolution magnetic resonance imaging (MRI) of the heart and brain, as well as for verifying cutting-edge physical theories. In recent years, with breakthroughs in artificial intelligence technology, using quantum magnetic field precision measurement methods to measure heart and brain magnetoencephalography (MRI) and generate novel non-destructive, passive, high-resolution MRI images for studying heart and brain activity or pathology is a future development trend.

[0003] To achieve a near-zero magnetic environment, all activities are conducted within a magnetically shielded room. Heavy-duty shielded rooms typically use three or more layers of permalloy shielding to shield low-frequency magnetic fields, and are constructed with pure aluminum to shield high-frequency magnetic fields. However, compared to magnetically shielded barrels, magnetically shielded rooms are larger, prone to magnetic leakage at sharp corners, and introduce more defects during installation and construction, all of which limit their shielding performance. Furthermore, permalloy, a high-permeability soft magnetic material, not only has high permeability but also low coercivity. Any ferromagnetic material, once magnetized, will exhibit magnetic domains, locally distributed and pointing in different directions. During measurement, movement of the magnetometer or fluctuations in the magnetic field can cause it to malfunction. Therefore, to create a near-zero magnetic environment within the magnetically shielded room, an active magnetic compensation device must be incorporated.

[0004] However, due to the spatial distribution characteristics of magnetic fields, magnetic field coupling is unavoidable during detection. For example, when using a triaxial magnetic field coil for detection, it is difficult for the magnetic compensation coil to achieve complete non-coupling across the three axes, especially with commonly used Helmholtz coils, where triaxial magnetic field coupling is quite severe, posing challenges to ordinary magnetic field compensation. In active magnetic compensation of spatial residual magnetism, the control methods for negative feedback of active magnetic compensation generally employ the simple least squares method and polynomial fitting method; however, the mismatch between the least squares method and polynomial fitting method and the characteristics of the magnetic field, as well as problems such as low fitting accuracy, affect the effectiveness of active magnetic compensation. Summary of the Invention

[0005] Therefore, it is necessary to provide an active magnetic compensation method based on BP neural network to address the aforementioned technical problems.

[0006] This application presents an active magnetic compensation method based on a BP neural network for compensating for residual magnetism in a magnetically shielded room. The active magnetic compensation method includes:

[0007] A magnetic field signal based on spatial remanence is acquired. The magnetic field signal is obtained by detecting spatial remanence using a magnetic field vector sensor, and the magnetic field signal is divided into multiple paths according to vector information.

[0008] The system receives multiple magnetic field signals, processes them using a first BP neural network, and outputs corresponding control signals. These control signals are used to drive the magnetic field compensation device to perform negative feedback adjustment of the spatial residual magnetism.

[0009] Several alternative methods are provided below, but they are not intended as additional limitations on the overall solution above. They are merely further additions or optimizations. Provided there are no technical or logical contradictions, each alternative method can be combined individually with respect to the overall solution above, or multiple alternative methods can be combined with each other.

[0010] Optionally, each magnetic field signal is obtained by weighted calculation of multiple initial magnetic field signals, each of which is collected from a different spatial location.

[0011] Optionally, the magnetic field vector sensor is a three-axis vector sensor based on the SERF principle. The sensitive axes of the three-axis vector sensor are arranged in a spatially perpendicular manner, including the X, Y, and Z directions, with each direction corresponding to one magnetic field signal.

[0012] Optionally, the triaxial vector sensor includes multiple sensors and is deployed at different spatial locations, and each of the triaxial vector sensors acquires the initial magnetic field signal in each direction at its location;

[0013] Each initial magnetic field signal in the same direction is weighted to obtain a corresponding magnetic field signal. The weights used in the weighting operation are based on the distance between each three-axis vector sensor and the target to be detected in the magnetically shielded room.

[0014] Optionally, based on each magnetic field signal, the output layer of the first BP neural network outputs a corresponding control signal, and each control signal drives the magnetic field compensation device according to the vector information related to the magnetic field signal.

[0015] Optionally, the first BP neural network is obtained by learning and training from the second BP neural network, wherein the learning and training includes:

[0016] Set a training error threshold;

[0017] The second BP neural network is trained on at least a portion of the sample dataset to obtain the optimal weight matrix and the optimal threshold matrix;

[0018] The second BP neural network uses gradient descent to update the weight matrix and threshold matrix based on the optimal weight matrix and the optimal threshold matrix;

[0019] If the training error reaches the training error threshold, training stops, and the first BP neural network is obtained.

[0020] Optionally, the second BP neural network is trained on at least a portion of the sample dataset to obtain the optimal weight matrix and the optimal threshold matrix, specifically including:

[0021] Set the initial weight matrix and initial threshold matrix of the second BP neural network;

[0022] The initial weight matrix and initial threshold matrix are used as position parameters in the particle swarm algorithm;

[0023] The particle swarm optimization algorithm is used for iterative calculations to update the position and velocity parameters of the particles.

[0024] Based on the position and velocity parameters at the point where the iterative calculation stops, the global optimal position parameters of the particle are obtained, namely the optimal weight matrix and the optimal threshold matrix.

[0025] This application also provides an active magnetic compensation system based on a BP neural network, the system comprising:

[0026] The detection device detects the residual magnetism in the space of the magnetically shielded room and outputs multiple magnetic field signals, which are divided into multiple channels based on vector information.

[0027] The computer device receives multiple magnetic field signals, processes the multiple magnetic field signals using a first BP neural network, and outputs corresponding control signals.

[0028] The magnetic field compensation device receives the control signal and generates a compensation magnetic field accordingly to perform negative feedback adjustment on the residual magnetism in the shielded room.

[0029] This application also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the active magnetic compensation method based on a BP neural network described in this application.

[0030] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the active magnetic compensation method based on a BP neural network described in this application.

[0031] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the active magnetic compensation method based on a BP neural network described in this application.

[0032] The active magnetic compensation method, system, computer device, and computer-readable storage medium based on BP neural network of this application have at least one of the following technical effects:

[0033] This application proposes an active magnetic compensation method based on a BP neural network. This method solves the problems of low compensation accuracy, small uniform area, and large magnetic field interference caused by magnetic leakage in the magnetic shielding room and magnetic field coupling in different axes of the coil. By simulating the nonlinear coupling and decoupling process of the compensation magnetic field in three-dimensional space through the multi-layer feedforward mechanism of the BP neural network, the magnetic field compensation is dynamically performed, which improves the uniformity of the spatial magnetic field, reduces residual magnetism, and optimizes the effect of active magnetic compensation.

[0034] This application proposes an active magnetic compensation method based on a BP neural network. By utilizing the particle swarm optimization (PSO) algorithm, the method maximizes the nonlinear fitting capability of the first BP neural network while significantly improving the active compensation accuracy of residual magnetism in large zero-magnetic spaces and its anti-interference capability against magnetic disturbances. Attached Figure Description

[0035] Figure 1 This is a flowchart illustrating an embodiment of the active magnetic compensation method based on a BP neural network in this application.

[0036] Figure 2 for Figure 1 A block diagram illustrating the principle of the method described herein;

[0037] Figure 3 This is a schematic diagram of the learning and training process of the second BP neural network in one embodiment of this application;

[0038] Figure 4 This is a schematic diagram of the structure of a BP neural network control model in one embodiment of this application;

[0039] Figure 5 This is a schematic diagram of the learning and training process of the second BP neural network in one embodiment of this application;

[0040] Figure 6 This is a schematic diagram of the process of learning and training a second BP neural network using the particle swarm optimization algorithm in one embodiment of this application;

[0041] Figure 7 This is a schematic diagram of the process of learning and training a second BP neural network using the particle swarm optimization algorithm in one embodiment of this application;

[0042] Figure 8 This is an internal structural diagram of a computer device according to an embodiment of this application;

[0043] Figure 9 This is a schematic diagram of the active magnetic compensation system based on a BP neural network in one embodiment of this application. Detailed Implementation

[0044] 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.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0046] In this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number or order of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0047] In this application, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a system, product, or device that includes a series of units is not necessarily limited to those units that are explicitly listed, but may include other units that are not explicitly listed or that are inherent to such products or devices.

[0048] The SERF atomic magnetometer is a high-precision magnetic field detection device. Magnetic field interference can affect the SERF atomic magnetometer's measurement of extremely weak magnetic fields. To ensure the operating environment of the SERF atomic magnetometer, existing technologies typically employ magnetic field compensation techniques to compensate for the ambient magnetic field, achieving a near-zero magnetic environment. Due to the characteristics of magnetic fields, no single coil can achieve a perfect uniaxial magnetic field effect; magnetic field signals from other axes will inevitably be present. This inevitably leads to coupling effects between the compensation magnetic fields generated by compensation coils of different axes (e.g., triaxial coils) (e.g., triaxial compensation magnetic fields generated by triaxial coils). Therefore, decoupling the magnetic fields is difficult, affecting the effectiveness of active magnetic compensation.

[0049] See Figures 1-2 To address the problems of low compensation accuracy and significant magnetic field interference caused by magnetic field leakage in magnetic shielding rooms and magnetic field coupling of coils, this application provides an embodiment of an active magnetic compensation method based on a BP neural network for compensating for residual magnetism in a magnetically shielded room. The active magnetic compensation method includes:

[0050] Step S10: Obtain the magnetic field signal based on spatial remanence. The magnetic field signal is obtained by the detection of spatial remanence by a magnetic field vector sensor, and the magnetic field signal is divided into multiple paths according to the vector information.

[0051] Step S20: Receive multiple magnetic field signals, process the multiple magnetic field signals using the first BP neural network, and output corresponding control signals. The control signals are used to drive the magnetic field compensation device to perform negative feedback adjustment of the spatial residual magnetism.

[0052] like Figure 2 As shown, the active magnetic compensation process is dynamic. At the start of operation, the residual magnetism in space is a magnetic field. Magnetic field vector sensor receives magnetic field The first BP neural network receives magnetic field signals and drives the magnetic field compensation device to generate a compensation magnetic field. Compensation magnetic field magnetic field Negative feedback adjustment is implemented. After operating for a period of time, the residual magnetism in space becomes the compensating magnetic field. Difference with magnetic field B(11) The overall negative feedback regulation forms a closed-loop control system. When the residual magnetism reaches the required level, i.e., the spatial residual magnetism... The system reaches dynamic equilibrium without interfering with the detection results of the magnetic field vector sensor. It can be understood that the magnetic field vector sensor is suitable for space magnetic field measurement in the field of extremely weak magnetic field measurement; for example, it could be a magnetic field sensor constructed based on the SERF principle, or it could be a superconducting quantum interference device (SQI).

[0053] For step S10, in order to obtain a more accurate magnetic field signal, in one embodiment, the magnetic field vector sensor is a three-axis vector sensor based on the SERF principle. The sensitive axes of the three-axis vector sensor are arranged in a spatially perpendicular manner, including the X, Y, and Z directions (three axes orthogonal), and each direction corresponds to one magnetic field signal.

[0054] The first BP neural network is a model of a BP neural network actually applied in various embodiments of this application. It includes the input layer, hidden layer, and output layer of a BP neural network in the prior art. In this embodiment, the input layer of the first BP neural network has three input ports, each corresponding to multiple signals. Each magnetic field signal is connected to the first BP neural network through a specific input port. The output layer of the first BP neural network outputs control signals, the number and position of which are the same as the number of multiple magnetic field signals.

[0055] The basic principle of active magnetic compensation is to adjust the residual magnetism in space through negative feedback. However, in existing technologies, the coupling effect between magnetic field signals along different axes leads to low compensation accuracy. The BP neural network algorithm comprises two aspects: forward propagation of the signal and backward propagation of the error. That is, the actual output is calculated from input to output, while the correction of the weight matrix and threshold matrix is ​​performed from output to input. A fully trained first BP neural network control algorithm is used to compensate for the internal magnetic field. This first BP neural network can establish an advanced control system through training, thereby achieving a relatively ideal control effect despite complex nonlinear coupling.

[0056] Regarding step S20, to achieve better performance from the first BP neural network, in one embodiment, based on each magnetic field signal, the output layer of the first BP neural network outputs a corresponding control signal. Each control signal drives the magnetic field compensation device according to the vector information related to the magnetic field signal. Further, the control signals are divided into multiple paths based on the vector information, and each control signal controls the triaxial static magnetic field compensation coil to generate a compensation magnetic field by adjusting an independent current source signal. Furthermore, the compensation magnetic field generated by the magnetic field compensation device corresponds to the vector information of the magnetic field signal.

[0057] The first BP neural network generates three control signals to drive a triaxial static magnetic field compensation coil to generate compensation magnetic fields corresponding to different axes. The vector information of the control signals and the magnetic field signals is consistent. That is, the detected magnetic field signals are triaxially orthogonal, and the control signals are also triaxially orthogonal, with a one-to-one correspondence between their vector information. It can be understood that even when the vector information of the spatial remanent magnetization and the control signals is inconsistent, the embodiments described in this paper can still be implemented. In this case, the coupling and decoupling processes of the magnetic field are different, but the BP neural network can still learn the decoupling and coupling processes of the magnetic field. When the vector information of the spatial remanent magnetization and the control signals is consistent, the decoupling and coupling processes of the magnetic field are simulated synchronously, further ensuring the effect of active magnetic compensation.

[0058] Regarding step S10, since the effectiveness of the extremely weak magnetic field measurement is affected by the distance from the detection target, in one embodiment, each magnetic field signal is obtained by weighted calculation of multiple initial magnetic field signals, and each initial magnetic field signal is collected from a different spatial location.

[0059] Specifically, the SERF-based triaxial vector sensor comprises multiple sensors deployed at different spatial locations. Each sensor acquires an initial magnetic field signal in each direction at its location. For signals in the same direction, the initial magnetic field signals are weighted to obtain a corresponding magnetic field signal. The weights in the weighting calculation are based on the distance between each triaxial vector sensor and the target in the magnetically shielded room. It can be understood that the weights for the initial magnetic field signals can be the same or different. Furthermore, the distance between each triaxial vector sensor and the target is the minimum distance to the geometric center of the target. Taking magnetoencephalography (MEG) measurement as an example, the geometric center is the center of the subject's head.

[0060] In this embodiment, the SERF-based triaxial vector sensor collects the magnetic field at nine points uniformly divided at the center of the target area in the magnetically shielded room during data acquisition and processing. Taking magnetoencephalography (MEG) as an example, after recording the triaxial magnetic field at each point, a weighted average is calculated on the magnetic field detection values ​​of the nine points (points farther from the head have a smaller weight, and points closer to the head have a larger weight). The result of the weighted average is used as the true value of the spatial magnetic field remanence (the magnetic field signal based on spatial remanence). A triaxial current source is then used for compensation to obtain a near-zero magnetic state in the space. During signal acquisition, the nine magnetic field acquisition points are divided into three acquisition groups according to the spatial arrangement. The input and output ports of the first BP neural network input layer are each connected to one acquisition group. It can be understood that the nine magnetic field acquisition points can be flexibly arranged according to the spatial configuration and surface shape near the target object (e.g., the human brain or chest). When the position is adjusted, the first BP neural network can be obtained in the same way as the second BP neural network training described below. Furthermore, the SERF-based triaxial vector sensor is a SERF atomic magnetometer capable of measuring spatial remanence.

[0061] Regarding the magnetic field compensation device involved in step S20, in one embodiment, to overcome the shortcomings of existing active magnetic field compensation devices in magnetic shielding rooms, a magnetic field compensation device is provided that makes the target area more uniform and the residual magnetism smaller.

[0062] Specifically, the magnetic field compensation device is equipped with a compensation coil designed using the target field method, which has a large uniform region triaxial static magnetic field compensation coil. Compared with ordinary Helmholtz coils, it has a larger uniform region, thereby improving the compensation capability of the entire system.

[0063] See Figure 3 The first BP neural network is a fully trained BP neural network control model, specifically obtained by learning and training from the second BP neural network. In one embodiment, the learning and training includes:

[0064] Step S100: Set the training error threshold;

[0065] Step S200: The second BP neural network learns and trains on at least a portion of the sample dataset to obtain the optimal weight matrix and the optimal threshold matrix.

[0066] Step S300: The second BP neural network updates the weight matrix and threshold matrix using the gradient descent method based on the optimal weight matrix and the optimal threshold matrix;

[0067] In step S400, if the training error reaches the training error threshold, then stop learning and training to obtain the first BP neural network.

[0068] The first and second BP neural networks represent BP neural network (backpropagation) models under different time states. The second BP neural network is used when the BP neural network is not fully trained, and the first BP neural network is used after training. In this embodiment, the sample dataset is obtained by the second BP neural network during dynamic operation according to the active magnetic compensation method described in various embodiments of this application. For example, signals from the input and output layers of the second BP neural network are continuously collected 50 times, including magnetic field signals from each input port and control signals, to construct the sample dataset. In other embodiments, the sample dataset includes magnetic field signals and current signals output by the current source. It is understood that since the control signals are used to adjust the current signals output by the current source, and the current signals output by the current source are easier to obtain, it is preferable to use the current signals output by the current source as part of the sample dataset. The specific parameters of the BP neural network are optimized to obtain a fully trained first BP neural network.

[0069] In one embodiment, after obtaining the first BP neural network, the method further includes testing and evaluating the first BP neural network using at least a portion of the sample dataset. In this embodiment, the sample dataset is divided into a training set and a test set, which are used to train the second BP neural network and test the first BP neural network, respectively. It is understood that testing allows for adjustments to the number and spatial arrangement of sensors to achieve better results.

[0070] See Figure 3 and Figure 4 In one embodiment, the process of obtaining the first BP neural network is described in detail.

[0071] The BP neural network model established in this embodiment consists of an input layer, hidden layers, and an output layer. The analog signal obtained from the SERF atomic magnetometer is converted into a digital signal using an AD module (analog-to-digital converter). Specifically, the acquired magnetic field signal is converted into a voltage signal u, which serves as the input layer unit of the BP neural network, where u... jThis represents the input of the j-th node in the input layer, j = 1, ..., M, where M is three times the size of the SERF atomic magnetometer. Each input node is divided into three categories: Bx, By, and Bz (three-axis orthogonal digital signals) representing the voltage signals converted from the acquired magnetic field signals; o k This represents the output of the k-th node in the input layer, where k = 1, ..., N, and N is the number of current sources, i.e., the number of control signals output by the control system.

[0072] In the hidden layer, assuming ω i,j θ represents the weight matrix between the i-th node in the hidden layer and the j-th node in the input layer; i φ represents the threshold of the i-th node in the hidden layer; φ represents the activation function of the hidden layer; ω k,i α represents the weight matrix between the k-th node in the output layer and the i-th node in the hidden layer, i = 1, ..., q; k Let ψ represent the threshold of the k-th node in the output layer, k = 1, ..., L; ψ represents the activation function of the output layer. The activation functions of the hidden layers and the output layer are the tansig function and the purelin function, respectively.

[0073] See Figure 5 First, extensive experiments were conducted to determine how to adjust the control current of the triaxial compensation coil to achieve the best results in terms of magnetic field uniformity and remanence within the target area, under the conditions of information collected by various AD modules. The magnitude of the control current of the triaxial coil was recorded, and the experiment was repeated 50 times due to magnetic field fluctuations. Since the collected AD values ​​are relatively large, and the effective range of tansig is between 0 and 1, the collected training data was first normalized. This was done by finding the maximum and minimum values ​​in the dataset for normalization (normalizing the magnetic field signal and the signal output from the current source, using the first 80% as the training set and the last 20% as the test set). The specific method is as follows, where n is the size of the dataset:

[0074]

[0075] In the formula, x min Let x be the smallest number in the data sequence. max The maximum number in the data sequence.

[0076] After conducting numerous experiments, the ideal current output dataset T can be obtained. k k = 1, ..., N. The algorithm process of a BP neural network is roughly as follows:

[0077] (1) Forward propagation process of the signal: the input net of the kth node of the output layer k Get as The output of the kth node in the output layer kGet as

[0078] (2) Backpropagation of error: For each sample p, the quadratic error criterion function Ep is... The system's total error criterion function for P training samples is: The correction amount Δω of the output layer weight matrix is ​​successively adjusted according to the gradient descent method. ki The correction amount Δα of the output layer threshold matrix k The correction amount Δω of the hidden layer weight matrix ij The correction amount Δθ of the hidden layer threshold matrix i .

[0079] Finally, four correction values ​​are obtained as follows, where η is the learning rate of the neural network, typically set to 0.01. The formulas for adjusting the weight matrix and threshold matrix of the gradient descent method are as follows:

[0080]

[0081]

[0082]

[0083]

[0084] To address the uncertainty of the optimal learning rate, this embodiment introduces an adaptive learning rate algorithm combined with a BP neural network to compensate for the residual magnetism of the magnetically shielded room. The adaptive learning criterion is to check whether the weight matrix truly reduces the error function. If so, it indicates that the selected learning rate is too small and can be appropriately increased; otherwise, it should be decreased. The adaptive learning rate adjustment formula used in this embodiment is: where E(k) is the sum of squared errors at the k-th step, and the initial learning rate η(0) can be arbitrarily chosen from 0 to 1.

[0085]

[0086] After the neural network model has been trained and iterated, it is tested using a test set. If the error meets the requirements, it is considered to have formed the first BP neural network; otherwise, it will be retrained.

[0087] See Figure 6 In one embodiment, the learning and training are optimized using a particle swarm optimization algorithm. While backpropagation (BP) neural networks are non-linear optimizations with high fitting accuracy, they also suffer from insufficient generalization ability, a tendency to get trapped in local optima, and prolonged training time with slow convergence.

[0088] Regarding step S200, in one embodiment, the second BP neural network is trained on at least a portion of the sample dataset to obtain the optimal weight matrix and the optimal threshold matrix, specifically including:

[0089] Step S210: Set the initial weight matrix and initial threshold matrix of the second BP neural network;

[0090] Step S220: Use the initial weight matrix and initial threshold matrix as position parameters in the particle swarm algorithm;

[0091] Step S230: Iterative calculations are performed using the particle swarm optimization algorithm to update the position and velocity parameters of the particles;

[0092] Step S240: Based on the position and velocity parameters at the time the iterative calculation stops, obtain the global optimal position parameters of the particle, namely the optimal weight matrix and the optimal threshold matrix.

[0093] The PSO (Particle Swarm Optimization) algorithm is a globally optimal search algorithm with high efficiency, strong generalization ability, and is beneficial for obtaining optimal solutions in multi-objective contexts. It also boasts good versatility and faster convergence speed. Therefore, using the PSO algorithm to optimize a BP neural network can leverage the nonlinear optimization capabilities of the BP neural network while compensating for its weak generalization ability and tendency to get trapped in local optima. This improves the compensation accuracy of active magnetic compensation and suppresses magnetic field disturbance signals.

[0094] This embodiment combines the PSO algorithm to optimize the initial weight matrix between neurons and the threshold matrix corresponding to the neurons in the BP neural network; the optimized weight matrix is ​​further optimized using the gradient descent method to obtain the best neural network model; finally, the PSO-BP neural network (the BP neural network optimized by the PSO algorithm) is used to compensate for the residual magnetism in the target area of ​​a large zero-magnetic space.

[0095] This embodiment utilizes the PSO algorithm to optimize a BP neural network to establish an active magnetic compensation control model. By maximizing the nonlinear fitting capability of the BP neural network and combining the global optimization search advantages and better generalization ability of the PSO algorithm, it significantly improves the active compensation accuracy of remanence in large zero-magnetic spaces and its resistance to magnetic disturbances. This enhances the reliability and feasibility for cardiac and cerebral magnetometry and the verification of cutting-edge physical theories. The PSO-BP neural network active magnetic compensation method is also applicable to different magnetically shielded spaces and has high practical value in engineering applications.

[0096] See Figure 7 In one embodiment, a method for obtaining a first BP neural network based on PSO optimization of the second BP neural network is explained in detail, specifically including the following steps:

[0097] Step S1: Collect, save, and normalize the output signals of the SERF atomic magnetometer and the standard current source to establish the training and test sets required for the second BP neural network.

[0098] Specifically, in step S1, the data acquisition uses the value of the SERF atomic magnetometer as the true value of the magnetic field space. The current source is manually adjusted to zero along its axis, and the current source reading is recorded as the standard output. Both the magnetic field and current values ​​are normalized, with 80% used as the training set and 20% as the test set. It should be noted that the percentages for training and test sets are merely examples. Those skilled in the art can adjust them adaptively based on training effects and test results.

[0099] Step S2: Pre-set the number of layers in the second BP neural network, the number of neurons in the input layer, hidden layer, and output layer, as well as the initial weight matrix and threshold. Use the initial weight matrix and threshold matrix as the particle position parameters, and randomly initialize the position and velocity parameters. Set the learning factor, velocity inertia weight, maximum number of iterations, fitness function, number of particles, etc. required in the PSO algorithm.

[0100] Specifically, in step S2, the second BP neural network is structured as follows: the input layer has 27 nodes, corresponding to the SERF atomic magnetometer collecting 9 values ​​in three-dimensional orthogonal directions (X-axis, Y-axis, Z-axis); the hidden layer has two layers with 30 and 10 nodes respectively; and the output layer has 3 nodes, corresponding to the three sets of current source signals controlling the three-axis coils. The second BP neural network is set to iterate 1000 times, learn at a rate of 0.1, and train target of 0.00001. The activation functions for the hidden and output layers are set to the tansig and purelin functions, respectively. The initial weight matrix and threshold matrix are used as the particle position parameters, and the position and velocity parameters are randomly initialized. The learning factors c1 and c2 required in the PSO algorithm are set to 1.5 and 2.5 respectively, the velocity inertia weight w is 0.5, the maximum number of iterations is 1000, and the fitness function and the number of particles are 50. It should be noted that the relevant nodes, the second BP neural network, and the algorithm parameters mentioned in the above embodiments are merely examples, and those skilled in the art can adapt them according to different environmental conditions.

[0101] Step S3: Calculate the optimal fitness p of the individual using the fitness function. best and the global optimal fitness g bestIndividual optimal fitness is the minimum fitness calculated across all positions of a single particle, while global optimal fitness is the minimum fitness calculated across all positions of the entire population. The fitness value Fit[i] of each particle is calculated. For the i-th particle, its fitness value Fit[i] and p are used to determine its fitness. best (i) Compare the results and take the smaller one as p. best (i), then use its fitness value Fit[i] and g best (i) Compare and take the smaller one as g. best (i). The fitness function in steps S2 and S3 is the sum of the absolute values ​​of the errors between the output calculated by the second BP neural network forward propagation of multiple input samples and the actual standard output of the samples: Where y m For the actual standard output of the sample, The output is calculated for the second BP neural network, where m = 1, 2, ..., L, and L is the number of output samples.

[0102] Step S4: Update the velocity and position of the particles according to the velocity and position update formula of the particle swarm algorithm, and increment the iteration count by one;

[0103] Specifically, the update formula is:

[0104] v id =ω*v id +c1r1(p id -x id )+c2r2(p gd -x id )

[0105] x id =x id +v id

[0106] Where ω is the velocity inertia weight, c1 and c2 are learning factors, r1 and r2 are uniformly random numbers in the range [0, 1], and p id This represents the individual optimal fitness position of the particle.

[0107] Step S5: Determine whether the number of iterations is greater than the maximum number of iterations and whether the global optimal fitness is less than a set value. If the number of iterations is greater than the maximum number or the global optimal fitness is less than the set value, proceed to step S6; otherwise, continue to proceed from step S3 to step S5.

[0108] Step S6: Output the global optimal position of the particle, which corresponds to the optimal initial weight matrix and threshold matrix parameters of the second BP neural network.

[0109] Step S7: The initial threshold matrix and weight matrix of PSO optimization are continuously updated by gradient descent method of error backpropagation. When the training error reaches the set value, the training of the second BP neural network is stopped, and the BP neural network control model for controlling the coil current is obtained, that is, the first BP neural network described in the embodiments of this application.

[0110] It should be understood that, although Figure 1 , Figure 3 , Figure 5 , Figure 6 and Figure 7 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 , Figure 3 , Figure 5 , Figure 6 and Figure 7 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0111] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements an active magnetic compensation method based on a BP neural network. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0112] Those skilled in the art will understand that Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present application and does 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 those shown in the figure, or combine certain components, or have different component arrangements.

[0113] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0114] Step S10: Obtain the magnetic field signal based on spatial remanence. The magnetic field signal is obtained by detecting spatial remanence using a vector sensor, and the magnetic field signal is divided into multiple paths according to vector information.

[0115] Step S20: Receive multiple magnetic field signals, process the multiple magnetic field signals using the first BP neural network, and output corresponding control signals. The control signals are used to drive the magnetic field compensation device to perform negative feedback adjustment of the spatial residual magnetism.

[0116] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0117] Step S10: Obtain the magnetic field signal based on spatial remanence. The magnetic field signal is obtained by detecting spatial remanence using a vector sensor, and the magnetic field signal is divided into multiple paths according to vector information.

[0118] Step S20: Receive multiple magnetic field signals, process the multiple magnetic field signals using the first BP neural network, and output corresponding control signals. The control signals are used to drive the magnetic field compensation device to perform negative feedback adjustment of the spatial residual magnetism.

[0119] Those skilled in the art will understand that all or part of the processes in the methods of 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, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0120] In one embodiment, a computer program product is provided, including computer instructions that, when executed by a processor, perform the following steps:

[0121] Step S10: Obtain the magnetic field signal based on spatial remanence. The magnetic field signal is obtained by detecting spatial remanence using a vector sensor, and the magnetic field signal is divided into multiple paths according to vector information.

[0122] Step S20: Receive multiple magnetic field signals, process the multiple magnetic field signals using the first BP neural network, and output corresponding control signals. The control signals are used to drive the magnetic field compensation device to perform negative feedback adjustment of the spatial residual magnetism.

[0123] In this embodiment, the computer program product includes a program code portion for performing the steps of the active magnetic compensation method described in the embodiments of this application when the computer program product is executed by one or more computing devices. The computer program product may be stored on a computer-readable recording medium. It may also be provided for download via a data network (e.g., via a RAN, via the Internet, and / or via an RBS). Alternatively or additionally, the method may be encoded in a field-programmable gate array (FPGA) and / or an application-specific integrated circuit (ASIC), or its functionality may be provided for download by means of a hardware description language.

[0124] In one embodiment, based on both a software environment and a hardware environment, an active magnetic compensation system based on a BP neural network is also provided. The system includes a detection device, a computer device, and a magnetic field compensation device, wherein:

[0125] The detection device detects the residual magnetism in the space of the magnetically shielded room and outputs multiple magnetic field signals, which are divided into multiple channels based on vector information.

[0126] The computer device receives multiple magnetic field signals, processes the multiple magnetic field signals using a first BP neural network, and outputs corresponding control signals.

[0127] The magnetic field compensation device receives the control signal and generates a compensation magnetic field accordingly to perform negative feedback adjustment on the residual magnetism in the shielded room.

[0128] In this embodiment, the detection device is the magnetic field vector sensor described in the above embodiments. For specific limitations regarding the methods involved in the BP neural network-based active magnetic compensation system, please refer to the explanation and limitations of the BP neural network-based active magnetic compensation method above, which will not be repeated here.

[0129] In existing technologies, using commercial instruments (such as NI boards or ZI commercial instruments) to implement the active magnetic compensation method based on BP neural networks described in the embodiments of this application results in slow processing speed. Specifically, magnetically shielded rooms are highly complex environments. Traditionally, NI boards (such as NI-9264) or ZI lock-in amplifiers are used for AD and DA acquisition and output. These boards acquire magnetic field signals and generate corresponding control signals for the first BP neural network. However, NI boards have a universal range, which can generate significant voltage noise, resulting in significant magnetic field noise. Due to the inherent limitations of magnetically shielded rooms compared to magnetically shielded barrels, using only NI boards or ZI commercial instruments results in very limited control methods, slow processing speed, and poor bandwidth and dynamic performance.

[0130] To address the technical problems arising from the use of commercial instruments, one embodiment describes the active magnetic compensation method and active magnetic compensation system based on BP neural networks described in the above embodiments.

[0131] like Figure 9 As shown in the figure, this embodiment further describes the active magnetic compensation system based on a BP neural network in detail. The active magnetic compensation system includes: a triaxial magnetic field sensing network module 9, an AD module (not shown in the figure), a DSP system 4, a triaxial current source module 10, a DA module (not shown in the figure), and a triaxial compensation coil module 8. Among them, the triaxial magnetic field sensing network module 9 includes a Bx sensing network 1, a By sensing network 2, and a Bz sensing network 3, and the triaxial current source module 10 includes a Bx current source 5, a Bx current source 6, and a Bx current source 7.

[0132] In the initial operating state (before the compensation magnetic field is generated), assuming the residual magnetism in the space of the magnetically shielded room is... (11) Spatial residual magnetism is acquired by the triaxial magnetic field sensor network 9. The magnetic field signal is connected to the DSP system 4 via the AD module. The magnetic field value is directly analyzed and calculated using the capture port of the DSP system 4. The DSP system 4 outputs corresponding triaxial control signals through digital signals and the first BP neural network that has been fully trained. This controls the triaxial low-noise current source 10 to output corresponding current. The DA module outputs control voltage and controls the triaxial compensation coil 8 to generate corresponding compensation magnetic field. Remaining after compensation A closed-loop control system is formed, and the system reaches dynamic equilibrium when the residual magnetism reaches the required level.

[0133] Specifically, the triaxial magnetic field sensor network 9 includes several magnetic field vector sensors. Each magnetic field vector sensor collects magnetic field signals in the vector direction of each test point from a large zero-magnetic space. The thresholds and weights corresponding to each test point form the weight matrix and threshold matrix at different stages in the above embodiments. The vector directions are the X-axis, Y-axis, and Z-axis directions that are perpendicular to each other. The signals are converted into electrical signals by the AD module. After being passed through the first BP neural network embedded in the DSP control system, a current source control signal is obtained to control the target area to reach a near-zero magnetic state. The DA module then performs inverse normalization to obtain the output control voltage, completing the negative feedback regulation described in the methods of the various embodiments of this application. Further explanation is provided in conjunction with the specific software and hardware environments.

[0134] The triaxial magnetic field sensing network module 9 includes a triaxial SERF atomic magnetometer as its magnetic field vector sensor. Specifically, the triaxial SERF atomic magnetometer represents an optimization of the SERF atomic magnetometer, meaning that the SERF atomic magnetometer undergoes fine magnetic compensation along all three axes internally to achieve high-precision, low-noise detection.

[0135] The AD module includes the AD7768 chip. The AD7768 is a 20-bit high-precision eight-channel AD chip. To improve the system's anti-interference capability, a noise matching circuit is added to the AD module. The AD7768 is an 8-channel 24-bit synchronous sampling ADC with power consumption adjustment. Each channel has a maximum ADC output data rate of 256Ksps, suitable for high-precision medical electroencephalography (EEG) and electrocardiography (ECG). The ADA4896-2 is a unity-gain, stable, low-noise, rail-to-rail output, high-speed voltage feedback amplifier with a quiescent current of 3mA and a 1 / f noise of 2.4nV / √Hz. It is used as the preamplifier for the AD7768 acquisition circuit. The ADR444 is an ultra-low noise 4.096kJ reference voltage source, and the LDO with current sinking and source current capabilities serves as the reference voltage for the AD circuit. The entire circuit acts as a high-precision magnetic field sensor acquisition device. After integration with the Yanxu DSP development board, the noise level, after conversion, is found to be below the noise floor of the magnetic field sensor.

[0136] DSP system 4 uses a TMS320F28335 chip as its processor. The TMS320F28335 chip can quickly implement relatively complex control algorithms, meeting the real-time requirements of active magnetic compensation in large zero-magnetic spaces.

[0137] The triaxial current source module 10 adopts an MCS-type multi-channel low-noise current source. Specifically, the MCS-type multi-channel low-noise current source from DMT is selected, which has an ultra-low noise level of 10pA / √Hz. It can also achieve an output range of 320mA through parallel connection of channels, which meets the usage requirements.

[0138] The DA module uses the high-precision, low-noise single-channel chip AD5791. The AD5791 is a 20-bit, unbuffered voltage output digital-to-analog converter with 1ppm relative accuracy and 1LSB DNL. It also provides 0.05ppm / ℃ temperature drift, 0.1ppm p-p noise, and long-term stability better than 1ppm, with a noise spectral density of up to 7.5nV / √Hz.

[0139] To improve the system's anti-interference capability, a precision amplifier was added to the DA module. The voltage source for the output stage of the DA chip is the LTZ1000. The LTZ1000 is an ultra-stable, temperature-controlled reference voltage source. The ADA4077 is a high-precision, low-noise operational amplifier with ultra-low offset voltage and extremely low input bias current. The combination of the LTZ1000 and ADA4077 provides a standard base voltage of ±10V. The AD8676 is a precision rail-to-rail operational amplifier with ultra-low offset, drift, and voltage noise, and its input bias current is very low throughout the entire operating temperature range; it serves as the output stage of the DA chip.

[0140] The DSP system 4 communicates with the PC 14. For ease of monitoring and adjustment, the DSP system 4 has an RS232 interface. This interface allows communication between the DSP and the PC 14 (computer). The RS232 interface connects to the computer monitoring the three-axis magnetic field components. The PC 14 enables online modification of control parameters, monitoring of the magnetic bearing's operating status, residual magnetism monitoring, and adjustment of compensation magnetic field parameters. Furthermore, this embodiment provides two types of interfaces. One type of interface acquires the magnetic field signal sensed by a high-precision three-axis vector magnetic field sensor and transmits it to the DSP for digital signal processing via the SPI interface. The DSP's embedded BP neural network program processes the digital signal to obtain the corresponding control signal, which is then transmitted to the corresponding current source via the second type of interface, the DA interface, to generate a compensation magnetic field signal. This forms negative feedback for the entire system, thereby reducing residual magnetism and increasing uniformity within the target area.

[0141] Regarding the hardware environment, this embodiment uses integrated circuits to replace commercial NI boards (the device selection is as described in this embodiment). It includes DSP chips and high-precision AD5791 and AD7768 to build a complete circuit system. This embodiment realizes the integrated design of digital controller and acquisition and control system, meets the requirements of maximum integration of active magnetic compensation system, and makes this embodiment small in size and light in weight, reducing cost and reducing the introduction of magnetic field noise.

[0142] In this embodiment, the original experimental data was used to model a BP neural network using the Matlab Neural Network Toolbox to obtain the weight distribution of the neural network. The data was then rewritten into a general programming language and embedded into the chip of the DSP system 4, thereby improving the compensation accuracy.

[0143] Specifically, during the training process to obtain the first BP neural network, the threshold matrix and weight matrix of the BP neural network can be adjusted using the MATLAB toolbox for parameter identification, which can greatly improve computational efficiency. During the learning and training process, the training of the neural network is stopped when the training error reaches a set value, resulting in a neural network control model for controlling the coil current, i.e., the first BP neural network. Finally, the fully trained neural network model is described in C language and written as a DSP program, which is then embedded into the hardware environment of the control circuit using CCS6.0, thus achieving high-precision active magnetic compensation.

[0144] This embodiment details the hardware resources and software algorithm steps, considering both software and hardware environments. Users of the BP neural network-based active magnetic compensation method and system can modify the software to update the algorithm according to their specific application areas, thus flexibly and conveniently implementing its functions. This embodiment uses a DSP chip as the processor, embedding a BP neural network control algorithm to control the magnetic field. This solves the problem of complex leakage and residual magnetic fields, where ordinary control methods cannot achieve good control. The fully trained first BP neural network can handle complex magnetic field environments, resulting in excellent system performance. The active magnetic field compensation system described in the embodiments of this application mainly includes a high-performance magnetic shielding room, a DSP system, an interface circuit, a high-precision magnetic field sensor network, and a magnetic compensation coil module. The DSP obtains AD conversion data of the environmental static magnetic triaxial components Bx, By, and Bz from the magnetic field sensors through the interface circuit. Real-time compensation is performed by the fully trained BP neural network control algorithm. A high-precision DA circuit and a small-range, low-noise current source output corresponding current to the compensation coil, generating a target magnetic field to compensate for the static magnetic field in the space, thereby providing a near-zero magnetic environment for cardiac and cerebral magnetic field detection, etc.

[0145] The active magnetic compensation method based on a BP neural network described in this application effectively improves the accuracy of magnetic field compensation, avoids magnetic field disturbance interference, and enhances dynamic performance, thereby improving the overall system performance. The active magnetic compensation system described in the various embodiments of this application can be used, but is not limited to, to compensate for the static magnetic component in large zero-magnetic spaces, and is particularly suitable for magnetic resonance imaging of the heart and brain, and for verifying cutting-edge physical theories.

[0146] The active magnetic field compensation device described in the various embodiments of this application realizes the integrated design of large-scale zero-magnetic space active magnetic compensation facilities, and is improved by combining it with BP neural network control algorithm, which greatly improves the accuracy and dynamic performance of the compensation system, reduces the noise characteristics introduced by cascading commercial instruments, and improves the performance of the entire system.

[0147] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered to be within the scope of this specification. When technical features of different embodiments are embodied in the same drawing, it can be regarded as the drawing also disclosing examples of combinations of the various embodiments involved.

[0148] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An active magnetic compensation method based on BP neural network for compensating for residual magnetism in a magnetically shielded room, characterized in that, The active magnetic compensation method includes: A magnetic field signal based on spatial remanence is acquired. The magnetic field signal is obtained by detecting spatial remanence using a magnetic field vector sensor, and the magnetic field signal is divided into multiple paths according to vector information. The system receives multiple magnetic field signals, processes them using a first backpropagation (BP) neural network, and outputs corresponding control signals. These control signals drive a magnetic field compensation device to perform negative feedback adjustment of the spatial residual magnetism. The first BP neural network is obtained through training from a second BP neural network. The training process includes: Set a training error threshold; The second BP neural network learns and trains on at least a portion of the sample dataset to obtain the optimal weight matrix and the optimal threshold matrix. Specifically, this includes: setting the initial weight matrix and the initial threshold matrix of the second BP neural network; using the initial weight matrix and the initial threshold matrix as position parameters in the particle swarm optimization algorithm; performing iterative calculations using the particle swarm optimization algorithm to update the position parameters and velocity parameters of the particles; and obtaining the global optimal position parameters of the particles, i.e., the optimal weight matrix and the optimal threshold matrix, based on the position parameters and velocity parameters at the end of the iterative calculation. The second BP neural network uses gradient descent to update the weight matrix and threshold matrix based on the optimal weight matrix and the optimal threshold matrix; If the training error reaches the training error threshold, training stops, and the first BP neural network is obtained.

2. The active magnetic compensation method according to claim 1, characterized in that, Each magnetic field signal is obtained by weighting multiple initial magnetic field signals, each of which is collected from a different spatial location.

3. The active magnetic compensation method according to claim 1, characterized in that, The magnetic field vector sensor is a three-axis vector sensor based on the SERF principle. The sensitive axes of the three-axis vector sensor are arranged in a spatially perpendicular manner, including the X, Y, and Z directions, with each direction corresponding to one magnetic field signal.

4. The active magnetic compensation method according to claim 3, characterized in that, The triaxial vector sensor includes multiple sensors and is deployed at different spatial locations. Each of the triaxial vector sensors acquires the initial magnetic field signal in each direction at its location. Each initial magnetic field signal in the same direction is weighted to obtain a corresponding magnetic field signal. The weights used in the weighting operation are based on the distance between each three-axis vector sensor and the target to be detected in the magnetically shielded room.

5. The active magnetic compensation method according to claim 1, characterized in that, Based on each magnetic field signal, the output layer of the first BP neural network outputs a corresponding control signal, and each control signal drives the magnetic field compensation device according to the vector information related to the magnetic field signal.

6. An active magnetic compensation system based on a BP neural network, characterized in that, include: The detection device detects the residual magnetism in the space of the magnetically shielded room and outputs multiple magnetic field signals, which are divided into multiple channels based on vector information. A computer device receives multiple magnetic field signals, processes these signals using a first backpropagation (BP) neural network, and outputs corresponding control signals. The first BP neural network is trained from a second BP neural network, and the training includes: Set a training error threshold; The second BP neural network learns and trains on at least a portion of the sample dataset to obtain the optimal weight matrix and the optimal threshold matrix. Specifically, this includes: setting the initial weight matrix and the initial threshold matrix of the second BP neural network; using the initial weight matrix and the initial threshold matrix as position parameters in the particle swarm optimization algorithm; performing iterative calculations using the particle swarm optimization algorithm to update the position parameters and velocity parameters of the particles; and obtaining the global optimal position parameters of the particles, i.e., the optimal weight matrix and the optimal threshold matrix, based on the position parameters and velocity parameters at the end of the iterative calculation. The second BP neural network uses gradient descent to update the weight matrix and threshold matrix based on the optimal weight matrix and the optimal threshold matrix; If the training error reaches the training error threshold, then learning and training are stopped, and the first BP neural network is obtained. The magnetic field compensation device receives the control signal and generates a compensation magnetic field accordingly to perform negative feedback adjustment on the residual magnetism in the shielded room.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the active magnetic compensation method according to any one of claims 1 to 5.

8. 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 steps of the active magnetic compensation method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Composite environmental disturbance magnetic field shielding system

    CN110958830A

  • Method and system for compensating dynamic hysteresis based on recurrent neural network

    CN111505543A