Magnetic field detection device design method based on transfer learning

The magnetic field detection method, which combines transfer learning with micromagnetic simulation and experimental data training, solves the problems of accuracy and anti-interference in traditional magnetic field detection, and achieves high-precision magnetic field detection, which is suitable for real-time monitoring in environments with scarce data.

CN120911260AInactive Publication Date: 2025-11-07HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511000595.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional magnetic field detection methods suffer from low detection accuracy, susceptibility to external interference, high cost, and complex operation, making it particularly difficult to effectively train deep learning networks in environments with scarce data.

Method used

By employing transfer learning techniques, a deep learning network is trained using magnetic domain configuration data generated through micromagnetic simulation, and then fine-tuned using small-scale manually captured data to achieve a high-precision mapping between magnetic field distribution maps and magnetic field magnitudes.

Benefits of technology

It significantly improves the accuracy and anti-interference ability of magnetic field detection, enables real-time detection in extreme environments, and reduces the dependence on a large amount of labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120911260A_ABST
    Figure CN120911260A_ABST
Patent Text Reader

Abstract

The invention provides a transfer learning-based magnetic field detection device design method, which comprises the following steps of: obtaining magnetic domain configuration data of a soft magnetic material under different magnetic field sizes, and constructing a simulation data set; establishing a deep learning network architecture (source domain network), and setting a proper loss function and a model performance evaluation index; the network model is pre-trained for multiple times in the simulation data set, and optimal network parameters are analyzed and stored; capturing magnetic field distribution diagrams of the electromagnet under different magnetic field sizes by using shooting equipment, and constructing an experimental data set; freezing the first three layers of convolution (target domain network) in the deep learning network architecture; model parameters obtained in the source domain network serve as initialization parameters of the target domain network, and parameters of other layers of the network are finely adjusted through an experimental data set; training of a small number of experimental data sets is assisted through a transfer learning method, the accuracy and generalization ability of the model on magnetic field size prediction are improved, and then design of a novel high-performance magnetic field detection device is completed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of magnetic field detection, in particular to a magnetic field detection device design method based on transfer learning. BACKGROUND

[0002] With the rapid development of modern science and technology, magnetic field detection technology is widely used in industrial automation, address survey, medical diagnosis, transportation and other fields. However, the traditional magnetic field detection method currently used has some limitations. For example, the magnetic field detection device based on the Hall effect converts the magnetic signal into an electrical signal by measuring the magnetic field change around the magnetic material, thereby realizing magnetic field detection. However, the voltage value in the Hall effect is usually small, and it is easily disturbed by external conditions during measurement, which affects the detection performance. On the other hand, the nuclear magnetic resonance magnetometer based on the principle of nuclear magnetic resonance measures the magnetic field strength using the resonance phenomenon of the magnetic moment of the atomic nucleus in the magnetic field. This method can achieve high measurement accuracy and is suitable for detecting static and dynamic magnetic fields. However, its detection principle is complicated, the detection device structure is complex, professional personnel are needed for operation, and the cost is very high, making it difficult to apply in special scenarios.

[0003] We know that the magnetic field distribution around an object is closely related to the magnetic field strength, and when the magnetic field changes, the magnetic field distribution around the object will also change to varying degrees. For an electromagnet, when the input voltage changes, according to Ampere's loop law, the generated magnetic field strength will also change accordingly. If we can capture the corresponding magnetic field distribution map under different magnetic fields and find the correlation between the magnetic field strength and the picture, we can obtain the current magnetic field strength in real time. Currently, deep learning architecture has shown excellent performance in automatic extraction of image features and identification of small changes. However, the training of deep learning networks often needs to rely on a large amount of labeled data. In the process of collecting magnetic field distribution images, it is usually difficult to meet the data quantity required for network training by manually taking pictures of magnetic field distribution under different magnetic field strengths. It is worth mentioning that small changes in magnetic field strength not only affect the magnetic field distribution outside the magnet, but also cause corresponding changes in the microstructure of the magnetic domain inside the magnet. Fortunately, the micromagnetic simulation method can quickly generate a mapping relationship dataset of magnetic domain configuration and magnetic field strength. Based on this, we can first use the magnetic domain configuration data generated by micromagnetic simulation to train the deep learning network. Then, fine-tune the trained model parameters on small-scale, manually taken real magnetic field distribution data. Through this training strategy combining simulation data and experimental data, the network is expected to accurately predict the mapping relationship between the magnetic field distribution map and the magnetic field size, realizing high-precision magnetic field detection. SUMMARY

[0004] The purpose of the present application is to overcome the shortcomings of the existing magnetic field detection method, and provide a magnetic field detection device design method based on transfer learning.

[0005] The technical scheme adopted by the present application is a magnetic field detection device design method based on transfer learning, comprising the following steps:

[0006] Step 1: Obtain the magnetic domain configuration diagram data of soft magnetic material under different magnetic field sizes, and construct an analog data set;

[0007] Step 2: Create a deep learning network architecture as a source domain network, set appropriate loss function and model performance evaluation index; train the network model for multiple times, analyze and save the optimal network parameters;

[0008] Step 3: Obtain the magnetic field distribution diagram of electromagnet under different magnetic field sizes, and construct an experimental data set;

[0009] Step 4: Freeze the first three convolutional layers of the deep learning network architecture as the target domain network, and use the model parameters saved in step 2 as the initialization parameters of the target domain network; then, fine-tune the remaining layers of the network using the experimental data set; by means of transfer learning method, a small amount of images captured in the experiment are used for network training, so as to improve the accuracy of identifying the magnetic field size corresponding to the sampling image, thereby realizing accurate real-time monitoring of magnetic field.

[0010] Further, in step 1, it can be specifically divided into the following steps:

[0011] Step 1-1: Obtain the magnetic domain configuration of soft magnetic material under the action of different magnetic fields by using micromagnetic simulation calculation method;

[0012] Step 1-2: Establish an analog data set using the magnetic domain configuration obtained in step 1-1; wherein the magnetic domain configuration is used as a feature, and the magnetic field size corresponding to different pictures is used as a label.

[0013] Further, in step 2, it can be specifically divided into the following steps:

[0014] Step 2-1: The magnetic domain configuration and magnetic field distribution diagram of magnetic material have complex and unstructured characteristics, and when the magnetic field changes slightly, the magnetic domain configuration and magnetic field distribution of the material are difficult to change significantly, which may be impossible to distinguish by artificial means; therefore, a deep learning network architecture capable of effectively and comprehensively extracting image features is needed as a target domain network to ensure the recognition accuracy;

[0015] Step 2-2: To meet the high-precision requirements of Step 2-1, multiple layers of convolution and pooling need to be constructed in the deep learning network architecture; the convolution layer can effectively extract the features of the input data, and the pooling layer can reduce the dimension of these features, making the model more efficient in learning and inference, while also speeding up the calculation;

[0016] Step 2-3: After the convolution and pooling layers, a fully connected network is constructed, and since only one prediction target is needed, the number of neurons in the output layer is set to 1; at the same time, a ReLu activation function is set between each hidden layer to increase the network's nonlinear fitting ability and alleviate the gradient vanishing problem;

[0017] Step 2-4: Set the appropriate loss function: the mean square error (MSE) function curve is smooth, continuous, and everywhere derivable, making it easy to use gradient descent algorithm; moreover, as the error decreases, the gradient also decreases, which is conducive to convergence, so the mean square error is used as the loss function for model training; the mean square error (MSE) is defined as

[0018]

[0019] where n is the number of samples, f(x i ) and y i represent the predicted value and true value of the i-th sample, respectively; the mean absolute error (MAE) function is less sensitive to outliers because it only calculates the average of the absolute difference between the predicted value and the true value, and is not affected by large errors. The mean absolute error (MAE) is used to evaluate the performance of the model during the model testing phase, and is defined as

[0020]

[0021] Step 2-5: The source domain network saves a set of optimal model parameters through multiple rounds of training iterations on a large-scale magnetic domain configuration dataset.

[0022] Further, in Step 3, it can be specifically divided into the following steps:

[0023] Step 3-1: Through the shooting device, under the condition of different voltages output by the direct current stabilized power supply, the magnetic field distribution image presented when the magnetic field change generated by the electromagnet acts on the magnetic pole observation sheet is captured;

[0024] Step 3-2: Use the magnetic field distribution image obtained in Step 3-1 to establish an experimental data set; where the magnetic field distribution image is used as a feature, and the magnetic field size corresponding to different pictures is used as a label.

[0025] Further, in Step 4, it can be specifically divided into the following steps:

[0026] Step 4-1: freeze the first three layers of the deep learning network as the target domain network;

[0027] Step 4-2: use the model parameters obtained in step 2-5 as initialization parameters, and fine-tune the parameters of the remaining layers of the network using the experimental data set;

[0028] Step 4-3: using the transfer learning technology, first pre-train the deep learning network through the simulation data set, and then apply the optimal training parameters to the experimental data set with limited data volume.

[0029] The method of the present application can significantly improve the accuracy of the network in predicting the size of the magnetic field under a limited data set, and help complete the design of a new type of high-performance non-contact magnetic field detection device.

[0030] The beneficial effects of the present application are:

[0031] The present application proposes a magnetic field detection device design method based on transfer learning. By using the transfer learning method, the model parameters pre-trained on a large data set are transferred to a small sample data set (artificially collected limited experimental data) for fine-tuning training. This transfer learning strategy effectively solves the problem of model training difficulty in small sample conditions for traditional deep learning methods, significantly improves the prediction accuracy of the network and greatly shortens the model convergence time. At the same time, the magnetic field detection device designed by the present application has high accuracy, strong adaptability, strong anti-interference ability, and can realize real-time detection function, and is expected to be widely used in extreme working environment.

[0032] In the embodiment of the present application, the micromagnetic simulation is used to simulate Fe 65 Co 35The magnetic domain configuration of the polycrystal under different magnetic fields is taken as the simulation data set. The applied magnetic field ranges from 0 to 12 mT, with a step size of 0.001 mT, and a total of 12001 images. To achieve the mapping learning of the magnetic field and the magnetic domain configuration, a deep learning network containing 8 convolutional layers and 4 max-pooling layers is constructed as the source domain network, and the model is trained using the simulation data set described above. The training results show that the best mean absolute error (MAE) of the deep learning network model on the training set and the test set reaches 0.0016 mT, and the optimal parameters of the model are saved accordingly. For the target domain task, a shooting device is built to capture the magnetic field distribution images of the observation sheet under the action of electromagnets under different magnetic fields. The output voltage of the DC stabilized power supply is adjusted to change the magnetic field strength, and the applied magnetic field ranges from 5.4 to 40 mT, with a step size of 0.2 mT, and a total of 174 magnetic field distribution images are collected. The target domain model is trained using the transfer learning strategy: the optimal parameters obtained by the source domain network are used as the initial parameters of the target domain network, the first three layers of the network are frozen, and the remaining layers are fine-tuned based on the experimental data. The results show that after using the transfer learning, the MAE of the network on the training set and the test set is 0.0575 mT and 0.0915 mT respectively, which is significantly lower than the results without using transfer learning (0.2464 mT, 0.2173 mT). It is shown that when the size of the data set is small, the accuracy and generalization ability of the network can be improved by using the transfer learning method. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 is the overall design flowchart of the present application;

[0034] Figure 2 is the deep neural network structure schematic diagram in the embodiment of the present application;

[0035] Figure 3 is the comparison diagram of the prediction results and the actual results of the source domain network on the training set and the test set in the embodiment of the present application;

[0036] Figure 4 is the transfer learning architecture schematic diagram in the embodiment of the present application;

[0037] Figure 5 is the comparison diagram of the prediction results and the actual results of the transfer learning and non-transfer learning on the training set and the test set in the embodiment of the present application;

[0038] Figure 6 is the magnetic field detection device schematic diagram based on the transfer learning in the embodiment of the present application;

[0039] The reference signs in the figure are as follows: 1, base; 2, electromagnet; 3, shooting device; 4, pole observation sheet; 5, DC stabilized power supply; 6, deep learning server. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and examples. The following examples will help those skilled in the art to further understand the present application, but do not limit the present application in any form.

[0041] In this embodiment, the method is specifically used for quickly and accurately identifying the magnetic field size corresponding to different magnetic field distribution maps, and the overall design process is as shown in Figure 1 The specific operation steps are as follows:

[0042] Step 1: Obtain the magnetic domain configuration map data of the soft magnetic material under different magnetic field sizes, and construct an analog data set;

[0043] In step 1, the following steps are specifically divided:

[0044] Step 1-1: Obtain the saturation magnetization, exchange stiffness coefficient and anisotropy constant of the material. In addition, a Fe 3 Co 65 thin film model with a size of 1024x1024x2nm 35 is constructed, and the grid size is 2x2x2nm 3 . At the same time, a Fe 65 Co 35 polycrystal with a grain size of 40nm is established by the Voronoi method, wherein the exchange coupling between the grains is reduced by 10%;

[0045] Step 1-2: Simulate the external field response of the polycrystalline material in the real situation by using the parameters set in step 1-1, and further solve the Landau-Lifshitz-Gibert (LLG) equation in the simulation process. The evolution process of the internal magnetic domain of the Fe 65 Co 35 polycrystalline material with different magnetic field sizes is simulated.

[0046] Step 1-3: Establish an analog data set by the magnetic domain configuration simulated in step 1-2. The magnetic field size corresponding to different magnetic domains is taken as a label, and the magnetic domain configuration simulated under different magnetic field sizes is taken as a source domain network input.

[0047] Step 2: Create a deep learning network architecture as a source domain network, set appropriate loss functions and model performance evaluation indexes, train the network model for multiple times, analyze and save the optimal network parameters;

[0048] In step 2, the following steps are specifically divided:

[0049] Step 2-1: In the present application, a Figure 2The deep learning network shown as the source domain network has eight convolutional layers and four max-pooling layers. The first convolutional layer we constructed consists of 8 filters, each of which contains three 3x3 convolutional kernels. After the first convolutional layer, we added another convolutional layer to increase the network's nonlinear fitting capacity. At the same time, to prevent the loss of image edge features, we added a certain number of 0s around the image during convolution, i.e., set padding = 1. After every two consecutive convolutional layers, a 2x2 max-pooling layer is added to further extract domain configuration features;

[0050] Step 2-2: A fully connected network is set at the last layer of the network architecture to combine the features captured by the previous layers for final prediction and output of the magnetic field size. In the fully connected network, we set the ReLu function as the activation function to prevent the problem of gradient disappearance. At the same time, we choose the Adam algorithm with adaptive learning rate as the parameter optimizer of the deep learning network;

[0051] Step 2-3: The mean square error (MSE) function curve is smooth, continuous, and derivable everywhere, which is convenient for using the gradient descent algorithm. Moreover, as the error decreases, the gradient also decreases, which is conducive to convergence, so the model uses the mean square error as the loss function for model training; the mean square error (MSE) is defined as

[0052]

[0053] where n is the number of samples, f(x i ) and y i represent the predicted value and the true value of the i-th sample, respectively; the mean absolute error (MAE) function is less sensitive to outliers because it only calculates the average of the absolute difference between the predicted value and the true value, and is not affected by large errors. The mean absolute error (MAE) is used to evaluate the performance of the model during the model testing phase, and is defined as

[0054]

[0055] Step 2-4: The source domain network saves a set of optimal model parameters through multiple rounds of pre-training iterations on a large-scale domain configuration dataset by analysis and comparison; in the embodiment, the comparison chart of the predicted results and the actual results of the source domain network on the training set and the test set is as shown in Figure 3

[0056] Step 3: Obtain the magnetic field distribution map of the electromagnet under different magnetic field sizes to construct an experimental dataset;

[0057] In step 3, the following steps are included:

[0058] ​Step 3-1: Change the magnetic field strength by adjusting the output voltage of the stabilized DC power supply applied to the electromagnet, and accurately measure the magnetic field size using a gauss meter. As the magnetic field strength changes, the magnetic field distribution acting on the magnetic pole observation sheet will change accordingly, and this process is recorded in real time by the shooting device built.

[0059] Step 3-2: Use the magnetic field distribution map obtained in step 3-1 to establish an experimental data set; use the magnetic field distribution map under different magnetic field sizes as the input of the target domain network, and use the corresponding magnetic field size of different pictures as the label.

[0060] Step 4: Freeze the first three layers of the deep learning network architecture as the target domain network, and use the model parameters saved in step 2 as the initialization parameters of the target domain network; then, fine-tune the remaining layers of the network using the experimental data set; use the small amount of images captured in the experiment to train the network through transfer learning, improve the accuracy of recognizing the magnetic field size corresponding to the sampled image, and thus realize real-time monitoring of the magnetic field.

[0061] In step 4, it is specifically divided into the following steps:

[0062] Step 4-1: Freeze the first three layers of the deep learning network as the target domain network; the transfer learning architecture in the embodiment is shown in Figure 4 ;

[0063] Step 4-2: Use the model parameters obtained by training in step 2-4 in the large-scale simulation data as the initialization parameters, and fine-tune the parameters of the remaining layers of the network using the experimental data set; the comparison chart of the prediction results and actual results of the transfer learning and non-transfer learning in the training set and test set in the embodiment is shown in Figure 5 ;

[0064] Step 4-3: Figure 6 The schematic diagram of the magnetic field detection device based on transfer learning in the embodiment is shown in the figure, which includes a base 1, an electromagnet 2, a shooting device 3, a magnetic pole observation sheet 4, a DC stabilized power supply 5, and a deep learning server 6; the electromagnet 2 is placed on the base 1, and different voltages are applied through the DC stabilized power supply 5 to visualize different magnetic field distributions formed by the electromagnet 2 on the magnetic pole observation sheet 4;

[0065] Step 4-4: Input the model parameters obtained in step 2-4 and the picture information obtained in step 4-3 into the deep learning server 6; improve the accuracy of recognizing the magnetic field size corresponding to the picture through the constructed network, and display the current magnetic field strength in real time on the display screen of the deep learning server 6.

[0066] The above examples are only to illustrate the technical solutions of the present application but not to limit it, and although the present application has been described in detail with reference to the above examples, it should be understood by those skilled in the art that the specific embodiments of the present application can be modified or equivalently replaced, and any modification or equivalent replacement that is not departing from the spirit and scope of the present application should be covered within the protection scope of the claims of the present application.

Claims

1. A method for designing a magnetic field detection device based on transfer learning, characterized in that, Comprise the following steps: Step 1: obtain the magnetic domain configuration map data of soft magnetic material under different magnetic field sizes, and construct the simulation data set; Step 2: create a deep learning network architecture as the source domain network, set the loss function and model performance evaluation index; pretrain the network model for multiple times, analyze and save the optimal network parameters; Step 3: obtain the magnetic field distribution map of the electromagnet under different magnetic field sizes, and construct the experimental data set; Step 4: freeze the first three layers of convolution of the deep learning network architecture as the target domain network, and use the model parameters saved in step 2 as the initialization parameters of the target domain network; then, fine-tune the remaining layers of the network using the experimental data set; With the help of transfer learning method, the small amount of images captured in the experiment are used for network training to improve the accuracy of identifying the magnetic field size corresponding to the sampling image, so as to realize accurate real-time monitoring of the magnetic field.

2. The method of claim 1, wherein: In step 1, the following steps are specifically divided: Step 1-1: use micromagnetic simulation calculation method to obtain the magnetic domain configuration of soft magnetic material under the action of different magnetic fields; Step 1-2: use the magnetic domain configuration obtained in step 1-1 to establish the experimental data set; wherein the magnetic domain configuration map is taken as the feature, and the magnetic field size corresponding to different pictures is taken as the label.

3. The method of claim 2, wherein: In step 2, the following steps are specifically divided: Step 2-1: the magnetic domain configuration and magnetic field distribution map of the magnetic material have complex and unstructured characteristics, and when the magnetic field changes slightly, the magnetic domain configuration and magnetic field distribution of the material are difficult to change significantly, which cannot be distinguished by artificial; create a deep learning network architecture that can effectively and comprehensively extract image features as the target domain network, so as to ensure the recognition accuracy; Step 2-2: in order to meet the high accuracy requirement of step 2-1, multiple layers of convolution and pooling need to be constructed in the deep learning network architecture; wherein the convolution layer effectively extracts the features of the input data, the pooling layer reduces the dimension of these features, so that the model can learn and reason more efficiently, and the calculation speed is also accelerated; Step 2-3: a fully connected network is constructed after the convolution and pooling layers, and since only one prediction target is needed, the number of neurons in the output layer is set to 1; a ReLu activation function is set between each hidden layer, which aims to increase the nonlinear fitting ability of the network, so as to alleviate the gradient vanishing problem; Step 2-4: set the loss function: the mean square error MSE function curve is smooth and continuous, and is derivable everywhere, which is convenient for using gradient descent algorithm; as the error decreases, the gradient also decreases, which is conducive to convergence, and the mean square error MSE is used as the loss function of model training; the mean square error MSE is defined as where n is the number of samples, f(x i ) and y i represent the predicted and true values of the i-th sample, respectively; the mean absolute error (MAE) function is less sensitive to outliers because it simply computes the average of the absolute differences between the predicted and true values, and is not affected by large errors; the mean absolute error (MAE) is used to evaluate the model performance during the model testing phase, and is defined as Step 2-5: the source domain network is trained and iterated on a large-scale magnetic domain configuration data set, and finally a set of optimal model parameters is analyzed and saved.

4. The method of claim 3, wherein: In step 3, the following steps are specifically divided: Step 3-1: through the shooting device, under the condition that the direct current stabilized power supply outputs different voltages, capture the magnetic field distribution image presented when the magnetic field change generated by the electromagnet acts on the magnetic pole observation sheet; Step 3-2: Establish the experimental data set using the magnetic field distribution obtained in step 3-1; use the magnetic field distribution as the feature and the magnetic field size corresponding to different pictures as the label.

5. The method of claim 4, wherein: In the step 4, it is specifically divided into the following steps: Step 4-1: Freeze the first three layers of the deep learning network as the target domain network; Step 4-2: Use the model parameters obtained in step 2-5 as the initialization parameters, and fine-tune the parameters of the remaining layers of the network using the experimental data set; Step 4-3: Use the transfer learning technology, first train the deep learning network through the simulation data set, and then apply the optimal training parameters to the experimental data set with limited data volume.