Training method, magnetic field reconstruction method, electronic device, and storage medium

By using a magnetic field reconstruction model based on conditional generative adversarial networks, the problem of high hardware resource and time consumption in existing magnetic field reconstruction methods is solved. This achieves efficient and accurate magnetic field reconstruction, which is applicable to magnetic imaging at various scales and can extract information about the distance between the detector and the sample.

CN116151330BActive Publication Date: 2026-03-27UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing magnetic field reconstruction methods suffer from a sharp increase in hardware resources and time consumption during the solution process. They also cannot effectively combine the information of the detector itself, leading to unavoidable errors in the magnetic field reconstruction process. Furthermore, prior information such as the distance between the sample and the detector is required.

Method used

A magnetic field reconstruction model based on conditional generative adversarial networks is adopted. By acquiring real magnetic moment data, the generator and discriminator are trained using a training sample set to generate simulated magnetic moment data and determine its authenticity, thereby realizing end-to-end mapping from magnetic field to magnetic moment. Magnetic field reconstruction is then performed by combining the detector's own information.

Benefits of technology

It achieves efficient and accurate magnetic field reconstruction without relying on prior information, and is applicable to magnetic image reconstruction at different scales, including microscopic and macroscopic magnetic imaging, and can extract distance information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116151330B_ABST
    Figure CN116151330B_ABST
Patent Text Reader

Abstract

The present disclosure provides a training method of a magnetic field reconstruction model based on a conditional generative adversarial network, a magnetic field reconstruction method, an electronic device, a computer readable storage medium and a computer program product. The training method comprises: obtaining real magnetic moment data; obtaining magnetic field data corresponding to the real magnetic moment data according to the real magnetic moment data; obtaining a training sample set according to the magnetic field data and the real magnetic moment data; training a to-be-trained magnetic field reconstruction model using the training sample set to obtain a trained magnetic field reconstruction model; and wherein the training of the to-be-trained magnetic field reconstruction model using the training sample set comprises: inputting the magnetic field data into a generator of a conditional generative adversarial network to enable the generator to generate simulated magnetic moment data, and inputting the real magnetic moment data and the simulated magnetic moment data into a discriminator of the conditional generative adversarial network to enable the discriminator to discriminate the authenticity of the simulated magnetic moment data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of magnetism, in particular to the field of magnetic field reconstruction, and more particularly to a training method, a magnetic field reconstruction method, an electronic device and a storage medium. BACKGROUND

[0002] Magnetic field is an important physical quantity, which can be applied in geology, earth science, brain science and material science. At present, high-sensitivity magnetic field detection methods include superconducting quantum interference device, magnetic field detection method based on nitrogen vacancy defect color center, atomic gas magnetometer, giant magnetoimpedance sensor, etc. Through high-sensitivity magnetic field detection methods, very weak magnetic field signals can be detected to analyze the magnetism of the sample to be measured. Since the magnetic field cannot fully reflect the distribution information of the magnetic moment of the sample in space, effective magnetic field reconstruction is also an important research direction in the field of magnetism.

[0003] Magnetic field reconstruction methods include real space method and Fourier space method. The real space method directly depends on the correspondence between the magnetic moment and the magnetic field in the real space, and the integral relationship is discretized and processed into a linear equation, and then an effective least square method algorithm is used for numerical solution. The real space method can reconstruct the effective magnetic moment distribution, but the dimension of the solution is N 2 , which leads to a sharp increase in hardware resources and time consumption with the increase of the reconstruction area. The Fourier space method makes Fourier transform on the correspondence between the magnetic moment and the magnetic field to obtain the relationship between the magnetic field and the magnetic moment in the Fourier space, and then combines the regularization method to reconstruct the magnetic moment distribution corresponding to the magnetic field. The Fourier space method is efficient, but can only solve part of the problem, and the regularization will lose information. The real space method and the Fourier space method are idealized solving methods, which cannot combine the information of the detector itself in actual application, leading to inevitable errors in the process of magnetic field reconstruction. At the same time, the above methods also need to know the prior information such as the distance between the sample to be measured and the detector, which cannot be applied to all magnetic field detection methods. SUMMARY

[0004] Therefore, the main purpose of the present disclosure is to provide a training method of a magnetic field reconstruction model based on a conditional generative adversarial network, a magnetic field reconstruction method, an electronic device, a computer readable storage medium and a computer program product, so as to at least partially solve at least one of the above-mentioned technical problems.

[0005] In order to achieve the above-mentioned purpose, as an aspect of the present disclosure, an embodiment of a training method of a magnetic field reconstruction model based on a conditional generative adversarial network is provided, comprising: obtaining real magnetic moment data; obtaining magnetic field data corresponding to the real magnetic moment data according to the real magnetic moment data; obtaining a training sample set according to the magnetic field data and the real magnetic moment data; training a to-be-trained magnetic field reconstruction model using the training sample set to obtain a trained magnetic field reconstruction model; and wherein training the to-be-trained magnetic field reconstruction model using the training sample set comprises: inputting the magnetic field data into a generator of the conditional generative adversarial network to enable the generator to generate simulated magnetic moment data, and inputting the real magnetic moment data and the simulated magnetic moment data into a discriminator of the conditional generative adversarial network to enable the discriminator to determine the authenticity of the simulated magnetic moment data.

[0006] According to an embodiment of the present disclosure, wherein obtaining the real magnetic moment data comprises: obtaining original data; and pre-processing the original data to obtain the real magnetic moment data.

[0007] According to an embodiment of the present disclosure, wherein obtaining the magnetic field data corresponding to the real magnetic moment data according to the real magnetic moment data comprises: obtaining detection magnetic field data according to the physical principle of the detection method and combining the detector self-information; and fitting the detection magnetic field data and combining the implicit parameters to obtain the magnetic field data corresponding to the real magnetic moment data.

[0008] According to an embodiment of the present disclosure, wherein the value of the implicit parameter satisfies a preset parameter range, and the preset parameter range is the position range of the sample to be measured and the detector in the detection process.

[0009] According to an embodiment of the present disclosure, wherein training the to-be-trained magnetic field reconstruction model using the training sample set to obtain the trained magnetic field reconstruction model comprises: data conversion of the training sample set to obtain an RGB format training sample set, wherein the RGB format training sample set comprises real magnetic moment data in RGB format and magnetic field data in RGB format; and training the to-be-trained magnetic field reconstruction model using the RGB format training set to obtain the magnetic field reconstruction model.

[0010] According to an embodiment of the present disclosure, wherein the loss function of the magnetic field reconstruction model comprises a first loss function and a second loss function, the first loss function is a loss function of the conditional generative adversarial network, and the second loss function is a loss function of feature extraction of the conditional generative adversarial network, the loss function of feature extraction is obtained by taking the norm of the first probability and the second probability; and wherein the first probability is the probability that the real magnetic moment data input into each layer of the feature extractor of the discriminator is real magnetic moment data, and the second probability is the probability that the feature extractor determines that the input simulated magnetic moment data is real magnetic moment data.

[0011] As an embodiment of another aspect of the present disclosure, a magnetic field reconstruction method based on a conditional generative adversarial network is also provided, including: obtaining to-be-tested magnetic field data; inputting the to-be-tested magnetic field data into a magnetic field reconstruction model to output reconstructed magnetic moment data, wherein the magnetic field reconstruction model is trained by the training method of the magnetic field reconstruction model according to an embodiment of the present disclosure.

[0012] As an embodiment of another aspect of the present disclosure, an electronic device is also provided, including: one or more processors; a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method according to an embodiment of the present disclosure.

[0013] As an embodiment of another aspect of the present disclosure, a computer-readable storage medium is also provided, having stored executable instructions, which, when executed by a processor, cause the processor to implement the method according to an embodiment of the present disclosure.

[0014] As an embodiment of another aspect of the present disclosure, a computer program product is also provided, including computer executable instructions, which, when executed, implement the method according to an embodiment of the present disclosure.

[0015] The training method of the magnetic field reconstruction model based on the conditional generative adversarial network, the magnetic field reconstruction method provided by the above embodiments of the present disclosure can train the magnetic field reconstruction model. The magnetic field reconstruction method can obtain the reconstructed magnetic moment data by inputting the to-be-tested magnetic field data into the magnetic field reconstruction model. The magnetic field reconstruction method based on the conditional generative adversarial network proposed by the present disclosure can apply the image generation technology to the process of magnetic field reconstruction, learn the mapping relationship from the magnetic field to the magnetic moment by using the neural network, and realize the magnetic field reconstruction including various physical factors in the measurement process, such as the size of the sensor, the diffusion of the signal, the distance between the signal source and the sensor, and the like, in an end-to-end manner. In addition, the magnetic field reconstruction method proposed by the present disclosure can also perform magnetic field reconstruction on magnetic images of different scales, including microscopic magnetic imaging such as tissue magnetic imaging from the micron scale, to macroscopic imaging such as cosmic magnetic images. BRIEF DESCRIPTION OF DRAWINGS

[0016] For a more complete understanding of the present disclosure and its advantages, reference is now made to the following description taken in conjunction with the accompanying drawings, in which:

[0017] Figure 1 A flowchart of the training method of the magnetic field reconstruction model according to an embodiment of the present disclosure is schematically shown;

[0018] Figure 2 A flowchart of the training method of the magnetic field reconstruction model according to an embodiment of the present disclosure is schematically shown; Figure 1 A flowchart of the training method of the magnetic field reconstruction model according to an embodiment of the present disclosure is schematically shown;

[0019] Figure 3 schematically shows Figure 1 schematically shows a method for obtaining magnetic field data corresponding to real magnetic moment data;

[0020] Figure 4 schematically shows a comparison diagram of a magnetic field reconstruction result and a training sample set;

[0021] Figure 5 schematically shows a hidden parameter training effect diagram of a magnetic field reconstruction model;

[0022] Figure 6 schematically shows a flowchart for obtaining a magnetic field reconstruction result according to a magnetic field reconstruction model;

[0023] Figure 7 schematically shows a block diagram of an electronic device suitable for implementing the magnetic field reconstruction method described above according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] To make the objects, technical solutions, and advantages of the present application clearer, the present application is further described in detail below with reference to specific embodiments and drawings.

[0025] However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In addition, in the following description, descriptions of well-known structures and techniques are omitted to avoid unnecessary confusion of the concepts of the present application.

[0026] According to the general concept of one aspect of the present disclosure, a training method of a magnetic field reconstruction model based on a conditional generative adversarial network is provided, including: obtaining real magnetic moment data; obtaining magnetic field data corresponding to the real magnetic moment data according to the real magnetic moment data; obtaining a training sample set according to the magnetic field data and the real magnetic moment data; training a to-be-trained magnetic field reconstruction model using the training sample set to obtain a trained magnetic field reconstruction model; and wherein training the to-be-trained magnetic field reconstruction model using the training sample set includes: inputting the magnetic field data into a generator of the conditional generative adversarial network to enable the generator to generate simulated magnetic moment data, and inputting the real magnetic moment data and the simulated magnetic moment data into a discriminator of the conditional generative adversarial network to enable the discriminator to determine the authenticity of the simulated magnetic moment data.

[0027] The core inventive idea of the embodiments of the present disclosure is to learn the mapping relationship from magnetic moment to magnetic field by using a conditional generative adversarial network, to use the image generation technology in the process of magnetic field reconstruction, to realize end-to-end based magnetic field reconstruction; and the reconstruction process from magnetic field to magnetic moment also contains the influence of the real measurement process, taking into account the information of the measurement method and the measuring instrument, to realize real and reliable magnetic field reconstruction.

[0028] Figure 1A flowchart of a training method of a magnetic field reconstruction model according to an embodiment of the present disclosure is shown schematically. As shown in Figure 1 The method includes operations S101-S104.

[0029] In operation S101, real magnetic moment data is obtained.

[0030] According to an embodiment of the present disclosure, obtaining the real magnetic moment data includes directly obtaining existing real magnetic moment data, where the existing real magnetic moment data can include real magnetic moment data obtained through experiments and real magnetic moment data constructed through computer simulation.

[0031] In operation S102, magnetic field data corresponding to the real magnetic moment data is obtained according to the real magnetic moment data.

[0032] According to an embodiment of the present disclosure, since a magnetic moment is a “source” of a magnetic field, there is a one-to-one mapping relationship from the magnetic moment to the magnetic field, and according to the mapping relationship from the magnetic moment to the magnetic field, the magnetic field data corresponding to the magnetic moment data can be obtained.

[0033] In operation S103, a training sample set is obtained according to the magnetic field data and the real magnetic moment data.

[0034] According to an embodiment of the present disclosure, the obtained magnetic field data is data corresponding to the real magnetic moment data, and therefore the real magnetic moment data and the magnetic field data corresponding to the real magnetic moment data can be a pair of data, and a plurality of pairs of data constitute the training sample set, and the conditional generative adversarial network can be trained according to the training sample set.

[0035] In operation S104, the training sample set is used to train a magnetic field reconstruction model to be trained, and a trained magnetic field reconstruction model is obtained.

[0036] According to an embodiment of the present disclosure, the magnetic field reconstruction model is formed based on a conditional generative adversarial network. The conditional generative adversarial network includes a generator and a discriminator, and the generator and the discriminator are trained respectively using the training sample set. The magnetic field data is input into the generator of the conditional generative adversarial network, and the generator is trained to generate simulated magnetic moment data. The generator can generate simulated magnetic moment data by adding noise to the input magnetic field data as a condition; the real magnetic moment data and the simulated magnetic moment data generated by the generator are input into the discriminator, and the discriminator is trained to distinguish the authenticity of the input real magnetic moment data and the simulated magnetic moment data, so that the discriminator can distinguish the authenticity of the input simulated magnetic moment data.

[0037] According to an embodiment of the present disclosure, obtaining the real magnetic moment data further includes obtaining original data, pre-processing the original data, and obtaining the real magnetic moment data.

[0038] Figure 2 A flowchart of a training method of a magnetic field reconstruction model according to an embodiment of the present disclosure is shown schematically. As shown in Figure 1The flowchart for obtaining the real magnetic moment data is shown. As shown in Figure 2 The method includes operations S201-S202.

[0039] In operation S201, the original data is obtained.

[0040] According to an embodiment of the present disclosure, the original data can include data obtained through experiments and data constructed through computer simulation. For example, 442 natural random distribution fluorescence images are selected, which can represent the real magnetic moment distribution.

[0041] In operation S202, the original data is preprocessed to obtain the real magnetic moment data.

[0042] The preprocessing can include adjusting and normalizing the original data, including adjusting the parameters of the original data to obtain real clear original data. The normalization of the original data includes normalizing the original data using programming software, eliminating image distortion, and obtaining the original data. For example, the natural random distribution fluorescence images described above can be adjusted and normalized to obtain real magnetic moment data with consistent formats.

[0043] According to an embodiment of the present disclosure, obtaining magnetic field data corresponding to the real magnetic moment data according to the real magnetic moment data includes: obtaining detection magnetic field data according to the physical principle of the detection method and combining the detector itself information; fitting the detection magnetic field data and combining the hidden parameters to obtain the magnetic field data corresponding to the real magnetic moment data.

[0044] Figure 3 The method for obtaining the magnetic field data corresponding to the real magnetic moment data is shown schematically. Figure 1 The method for obtaining the magnetic field data corresponding to the real magnetic moment data is shown schematically.

[0045] As an embodiment, as shown in Figure 3 The detection method using diamond nitrogen-vacancy center (NV color center) as quantum sensor is used to obtain the magnetic field data according to the real magnetic moment data.

[0046] Specifically, as shown in Figure 3 The sample to be measured contains natural random distribution of magnetic moment distribution, and the magnetic moment data can be detected by the NV color center of the diamond, and the NV color center of the diamond will generate corresponding fluorescence images. The magnetic field data can be obtained by Lorentz fitting of the fluorescence images. The fluorescence image is the detection magnetic field image.

[0047] Specifically, based on the detection method of the diamond NV color center, the diamond NV color center can generate a fluorescence image, and after the fluorescence image is detected by the detector, a fluorescence image containing the detector itself information is generated. By Lorenz fitting of the detected fluorescence image, combined with the implicit parameter, the magnetic field data corresponding to the true magnetic moment data is obtained. According to the above detection method, the physical principle of the fluorescence generated by the diamond NV color center satisfies:

[0048] (1)

[0049] Wherein, c0 is the count rate of the diamond NV color center, f is the microwave frequency applied in the process of detecting the magnetic field by using the diamond NV color center, x, y are the coordinates of the diamond NV color center in the xy plane of the sample to be measured, is the coordinate of the i th diamond NV color center on the z axis, is the external magnetic field intensity felt by the i th NV color center, C is the contrast of the magnetic resonance spectrum line, w is the half width of the magnetic resonance spectrum line, N is the number of NV in the z direction, is the electronic gyromagnetic ratio of the diamond, is the fluorescence intensity emitted by the NV color center at the position of the sample to be measured under the microwave frequency of f.

[0050] According to the optical system information of the detector, the fluorescence intensity detected by the detector satisfies:

[0051] (2)

[0052] Wherein, is the fluorescence intensity actually detected by the detector, is the fluorescence intensity generated by the diamond NV color center, is the point spread function of the optical system of the detector.

[0053] The detector itself information includes the size of the sensor, the density of the NV color center, the diffusion of the signal, the distance between the signal source and the sensor and other information. The point spread function of the optical system of the detector is related to the camera pixel size and the magnification of the optical system in the detection process.

[0054] Lorenz fitting is performed on the above detection magnetic field data containing the detector itself information, and combined with the implicit parameter, the magnetic field data corresponding to the true magnetic moment data can be obtained, and for each true magnetic moment data containing the implicit parameter, a unique magnetic field data can be obtained.

[0055] ​According to an embodiment of the present disclosure, the value of the implicit parameter satisfies a preset parameter range, and the preset parameter range is a position range of the sample to be detected and the detector in the detection process. Specifically, for the detection method based on the NV center of diamond, the preset parameter range is the distance between the sample to be detected and the NV center of diamond in the detection process.

[0056] According to an embodiment of the present disclosure, the test set is input into the trained conditional generative adversarial network to obtain the magnetic moment data reconstructed by the magnetic field, and the implicit parameter can be calculated through the magnetic moment data, and the calculation formula satisfies:

[0057] (3)

[0058] wherein, is the implicit parameter, is the magnetic field data input into the generator, is the simulated magnetic moment data output by the generator after inputting the magnetic field data B, is the magnetic field data calculated according to the simulated magnetic moment data generated by the generator.

[0059] According to an embodiment of the present disclosure, the training sample set is used to train the magnetic field reconstruction model to be trained to obtain the trained magnetic field reconstruction model, including: converting the formats of the real magnetic moment data and the magnetic field data in the training sample set into RGB format, inputting the magnetic field data in RGB format into the generator to obtain the simulated magnetic moment data in RGB format; inputting the simulated magnetic moment data in RGB format and the real magnetic moment data in RGB format into the discriminator, iteratively training the conditional generative adversarial network to obtain the magnetic field reconstruction model.

[0060] According to an embodiment of the present disclosure, the loss function of the magnetic field reconstruction model includes a first loss function and a second loss function, and the first loss function is the loss function of the conditional generative adversarial network, and satisfies:

[0061] (4)

[0062] wherein, is the loss function of the entire conditional generative adversarial network, is the kth discriminator, G is the generator, B is the input magnetic field data, and m is the real magnetic moment data, is the simulated magnetic moment data output by the generator, is the probability that the kth discriminator discriminates that the input real magnetic moment data is true, is the probability that the kth discriminator discriminates that the input simulated magnetic moment data is true.

[0063] The second loss function is a feature extraction loss function of the conditional generative adversarial network. The feature extraction loss function is obtained by taking the norm of the first probability and the second probability. The first probability is a probability that the real magnetic moment data input to each layer of the feature extractor of the discriminator is real magnetic moment data. The second probability is a probability that the simulated magnetic moment data input to the feature extractor is real magnetic moment data. Specifically, the second loss function satisfies:

[0064] (5)

[0065] wherein, is the feature extraction loss function, is the kth discriminator, G is the generator, B is the input magnetic field data, and m is the real magnetic moment data. is the simulated magnetic moment data output by the generator, is a probability that the real magnetic moment data input to the i-th layer of the kth discriminator is real, is a probability that the simulated magnetic moment data input to the i-th layer of the kth discriminator is real, is the common T-layer feature extractor, is the i-th layer feature extractor with an adjustment dimension of N.

[0066] Therefore, the objective function of the conditional generative adversarial network of the present disclosure is:

[0067] (6)

[0068] wherein, λ is a weight factor, is the loss function of the conditional generative adversarial network, is the feature extraction loss function. Based on the loss function of the conditional generative adversarial network, the present disclosure further adds the feature extraction loss function, which can improve the accuracy and fineness of the simulated magnetic moment network generated by the magnetic field reconstruction model.

[0069] According to the specific embodiments of the present disclosure, the detection method of the diamond-based NV color center obtains 442 natural random distribution fluorescence images, and obtains 442 real magnetic moment data after preprocessing. The preset parameter range satisfied by the implicit parameter is from 0.7 μm to 2.0 μm, with an interval of 0.1 μm. After detection and fitting, 6188 magnetic field data containing the set detector information are obtained, and 6188 data pairs are generated accordingly, which constitute a training sample set with a size of 6188. The specific parameters are set as follows: the distance between the NV color centers of the diamond is 20 nm, and the density of the NV color centers is obtained according to the distance between the NV color centers of the diamond; the contrast of the continuous spectrum of the diamond is 2%, and the full width at half maximum is 10 MHz; the point spread function parameter setting of the optical system is that the optical magnification is 20 times, the numerical aperture is 0.7, the resolution is 0.77 μm, and the minimum pixel of the camera is 6.5 μm.

[0070] The magnetic field is converted into 16-bit jet RGB format magnetic field data in the range of ±35 μT, and the magnetic moment is converted into 16-bit jet RGB format magnetic moment data in the range of 0-6.45e-13 emu / pixel. 80% of the training sample set is selected as the training set to train the conditional generative adversarial network, and 20% of the training sample set is selected as the test set to test the trained conditional generative adversarial network. pix2pixHD can be used for testing.

[0071] Table 1 is a training parameter table, including the data size of the training sample set, the weight factor λ, the learning rate, the number of discriminators, the number of training times, dropout (which refers to temporarily discarding a neural network unit from the network according to a certain probability during the training process of a deep learning network), the size of the training set, BatchSize (the number of samples selected for training at a time), the normalization function and the hardware parameters.

[0072] Table 1

[0073]

[0074] According to the training parameters in Table 1, the hardware uses a graphics processing unit (GPU), the InstanceNorm is a normalization function, and the weight parameters in the conditional generative adversarial network are initialized according to a Gaussian distribution with a mean of 0 and a standard deviation of 0.02. The conditional generative adversarial network is trained for 400 times, wherein the learning rate remains unchanged for the first 200 times, and linearly decays to 0 for the last 200 times.

[0075] The generator includes a global generator and a local generator. kAnBsC represents that the size of the convolution kernel is AxA, the number of the convolution kernel is B, and the stride is C. For example, k7n128s1 represents that the size of the convolution kernel is 7x7, the number of the convolution kernel is 128, and the stride is 1. The magnetic field data is input into the generator, and the size of the magnetic field data is 512x512x3. The input magnetic field data is first down-sampled k3n3s2 to obtain intermediate magnetic field data with a size of 256x256x3. The intermediate magnetic field data with a size of 256x256x3 is input into the local generator, and a matrix with a size of 256x256x128 is obtained through convolution and normalization. The matrix with a size of 256x256x128 is further down-sampled k3n*s2 for four times to obtain data with a size of 32x32x1024. After seven Residual Blocks, the data with a size of 256x256x128 is obtained through three up-sampling k3n*s2 in reverse. Meanwhile, the magnetic field data with a size of 512x512x3 is input into the global generator, and a matrix with a size of 512x512x64 is obtained through convolution and normalization. The matrix with a size of 512x512x64 is further down-sampled k3n128s2 to obtain a matrix with a size of 256x256x128. The matrix with a size of 256x256x128 generated by the global generator is added to the matrix with a size of 256x256x128 generated by the local generator pixel by pixel to obtain a total matrix. After three Residual Blocks, the total matrix is further up-sampled k3n64s2 and subjected to convolution k7n3s1 normalization operation to obtain a matrix with a size of 512x512x3, i.e., simulated magnetic moment data.

[0076] The discriminator includes three different discriminators, which can evaluate the simulated magnetic moment data generated by the generator from different scales and receptive fields. The discriminators with different scales have the same network structure, except that the initial processing of the training data is different. The simulated magnetic moment data generated by the generator and the real magnetic moment data are concatenated into a matrix with a size of 512x512x6. According to the different receptive fields of the discriminators, different discriminators (1x, 2x, 4x) are used to down-sample k3n6s2 the matrix to different degrees to obtain a preliminary processed matrix. The preliminary processed matrix is input into the discriminator, and a matrix with a size of nxnxl is obtained through four down-sampling k3n*s2 and one convolution k4n1s1 normalization operation. The size of n depends on the dimension of the initial data. For example, when the discriminator 1x is used, the initial down-sampling is not performed on the matrix, and the preliminary processed matrix is still 512x512x6. The matrix is input into the discriminator, and the processed matrix is 32x32x1. When the discriminator 2x is used, the matrix is down-sampled k3n6s2 once to obtain a preliminary processed matrix. The preliminary processed matrix is input into the discriminator, and the processed matrix is 16x16x1. When the discriminator 4x is used, the matrix is down-sampled k3n6s2 twice to obtain a preliminary processed matrix. The preliminary processed matrix is input into the discriminator, and the processed matrix is 8x8x1.

[0077] After the magnetic field reconstruction model is obtained by training the conditional generative adversarial network with the training sample set, the magnetic field reconstruction results of the training set and the test set are compared with the real magnetic moment data. The image similarity and peak signal-to-noise ratio are analyzed, and the implicit parameters of the magnetic field reconstruction results obtained by the test set are calculated to judge the effect of the magnetic field reconstruction model. Table 2 shows the test results of the training sample set.

[0078] Table 2

[0079]

[0080] The image similarity of the magnetic field reconstruction results obtained by the training set and the real magnetic moment data is 0.940, and the floating range is not more than 0.034. The image similarity of the magnetic field reconstruction results obtained by the test set and the real magnetic moment data is stable at 0.933, and the floating range is not more than 0.037. The image similarity of the magnetic field reconstruction results obtained by the magnetic field reconstruction model and the real magnetic moment data is very close to 1; the peak signal-to-noise ratio of the simulated magnetic moment data obtained by the training set and the test set and the real magnetic moment data is also greater than 30dB, indicating that the simulated magnetic moment data constructed by the magnetic field reconstruction model has high authenticity. The implicit parameters of the simulated magnetic field data obtained by the test set are calculated, and the standard deviation is obtained according to the implicit parameters of the real magnetic moment data and the implicit parameters calculated from the simulated magnetic moment data. The standard deviation is much smaller than 1, indicating that the magnetic field reconstruction model also has good simulation effect on the implicit parameters that have not been trained, and has the ability to reconstruct the magnetic field distribution without knowing the actual distance between the sample to be tested and the detector. Moreover, the magnetic field reconstruction result can also show that the magnetic field reconstruction method can excavate the distance information.

[0081] Figure 4 Fig. 1 schematically shows the comparison between the magnetic field reconstruction result and the training sample set, Figure 5 Fig. 2 schematically shows the implicit parameter training effect diagram of the magnetic field reconstruction model.

[0082] As shown in Figure 4 , (a) in Figure 4 is the obtained real magnetic moment data, and (b) in Figure 4 is calculated according to the real magnetic moment data, which represents the magnetic field data corresponding to the real magnetic moment data; after the magnetic field data is input into the magnetic field reconstruction model, (c) in Figure 4 is obtained, which represents the simulated magnetic moment data, and (d) in Figure 4 is calculated according to the simulated magnetic moment data, which represents the magnetic field data corresponding to the simulated magnetic moment data. Figure 4 (e) in Figure 4 is the image data obtained by subtracting the real magnetic moment data of (a) in Figure 4 from the simulated magnetic moment data of (c) in Figure 4 (f) in is the image data obtained by subtracting the real magnetic moment data of (a) in from the simulated magnetic moment data of (c) inFigure 4 The magnetic field data corresponding to the actual magnetic moment data in (b) are... Figure 4 The image data obtained by subtracting the magnetic field data corresponding to the simulated magnetic moment data from (d) in the image. Based on... Figure 4 (e) and Figure 5 As shown in (f), the difference between the real magnetic moment data and the simulated magnetic moment data is very small, and the difference between the real magnetic field data and the simulated magnetic field data is also very small, indicating that the magnetic field reconstruction model can reconstruct the magnetic field from the magnetic moment very well. Figure 4 As shown, the horizontal axis represents the distance between the sample and the NV color center of the diamond, and the vertical axis represents the image data obtained by subtracting the true magnetic field data and the true magnetic moment data. Figure 4 The absolute value of the square of (f) in the equation. The error curve is based on the implicit parameter (distance between the sample and the NV color center) obtained from each simulated magnetic moment data and the corresponding... Figure 4 The curve formed by connecting the absolute squares of (f) in the model; the corresponding magnetic field data is obtained based on the real magnetic moment data and implicit parameters, and this magnetic field data is input into the magnetic field reconstruction model to obtain the simulated magnetic moment data. The real curve is the implicit parameter used to obtain this magnetic field data. Figure 6 As shown, the minimum value of the error curve corresponds to an abscissa of 1.3 μm, which is the same as the implicit input parameter. Combined with Table 2, it is further shown that the magnetic field reconstruction model can reconstruct the magnetic field distribution without knowing the actual distance between the sample and the detector, and the magnetic field reconstruction method can extract distance information.

[0083] As another embodiment of this disclosure, a magnetic field reconstruction method based on a conditional generative adversarial network is also provided, comprising: acquiring magnetic field data to be measured; inputting the magnetic field data to be measured into a magnetic field reconstruction model, and outputting reconstructed magnetic moment data, wherein the magnetic field reconstruction model is trained by a training method for a magnetic field reconstruction model according to an embodiment of this disclosure.

[0084] Figure 6 The flowchart illustrating the process of obtaining magnetic field reconstruction results based on the magnetic field reconstruction model is shown.

[0085] like Figure 7 As shown, in operation S601, the magnetic field data to be measured is acquired. This acquisition includes magnetic field data obtained from computer simulations and magnetic field data obtained from actual experiments.

[0086] In operation S602, the magnetic field data to be measured is input into the magnetic field reconstruction model, which outputs the reconstructed magnetic moment data. The magnetic field data requiring reconstruction is input into the pre-trained magnetic field reconstruction model, which outputs the corresponding magnetic moment data, thus obtaining reliable reconstructed magnetic moment data.

[0087] The training method of the magnetic field reconstruction model based on the conditional generative adversarial network and the magnetic field reconstruction method provided by the above embodiments of the present disclosure can train the magnetic field reconstruction model. The magnetic field reconstruction method can obtain reconstructed magnetic moment data by inputting the to-be-measured magnetic field data into the magnetic field reconstruction model. The magnetic field reconstruction method based on the conditional generative adversarial network provided by the present disclosure can apply the image generation technology to the magnetic field reconstruction process, learn the mapping relationship from the magnetic field to the magnetic moment by using the neural network, and realize the magnetic field reconstruction based on an end-to-end manner, including various physical factors in the measurement process, such as the size of the detector, the diffusion of the signal, the distance between the signal source and the sensor, and the like. In addition, the magnetic field reconstruction method provided by the present disclosure can also reconstruct the magnetic field of the magnetic image of different scales, including microscopic magnetic imaging such as tissue magnetic imaging from the micron scale, to macroscopic imaging such as cosmic magnetic image from the super large scale.

[0088] Figure 6 A block diagram of an electronic device suitable for implementing the magnetic field reconstruction method described above according to an embodiment of the present disclosure is schematically shown. Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.

[0089] As shown in ​ The electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 702 or loaded into a random access memory (RAM) 703 from a storage portion 708. The processor 701 can include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor, and / or a related chipset, and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), and the like. The processor 701 can also include an on-board memory for cache use. The processor 701 can include a single processing unit or a plurality of processing units for performing different actions of the method processes according to embodiments of the present disclosure.

[0090] In the RAM 703, various programs and data required for the operation of the electronic device 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method processes according to embodiments of the present disclosure by executing the programs in the ROM 702 and / or the RAM 703. It should be noted that the programs can also be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 can also perform various operations of the method processes according to embodiments of the present disclosure by executing the programs stored in the one or more memories.

[0091] According to an embodiment of the present disclosure, the electronic device 700 can further include an input / output (I / O) interface 705 also connected to the bus 704. The electronic device 700 can further include one or more of the following components connected to the I / O interface 705: an input part 706 including, for example, a keyboard and a mouse; an output part 707 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage part 708 including, for example, a hard disk; and a communication part 709 including, for example, a LAN card, a modem, and the like. The communication part 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as necessary. A removable medium 711 such as a magnetic disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 710 as necessary, so that a computer program read therefrom is installed into the storage part 708 as necessary.

[0092] According to an embodiment of the present disclosure, a method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product including a computer program carried on a computer-readable storage medium, the computer program containing program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network by the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-described functions defined in the system, device, apparatus, module, unit, and the like of an embodiment of the present disclosure are performed. According to an embodiment of the present disclosure, the system, device, apparatus, module, unit, and the like described above can be implemented by computer program modules.

[0093] The present disclosure also provides a computer-readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, which when executed, implement the methods according to the embodiments of the present disclosure.

[0094] According to an embodiment of the present disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. For example, it can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains, or stores a program for use by or in connection with an instruction execution system, apparatus, or device.

[0095] For example, according to an embodiment of the present disclosure, the computer-readable storage medium can include one or more memories other than the ROM 702 and / or the RAM 703 and / or the ROM 702 and the RAM 703 described above.

[0096] Embodiments of the present disclosure also include a computer program product, which includes a computer program containing program codes for executing the method provided by the embodiments of the present disclosure, and when the computer program product is run on an electronic device, the program codes are used to make the electronic device implement the training method of the magnetic field reconstruction model provided by the embodiments of the present disclosure.

[0097] When the computer program is executed by the processor 701, the above-mentioned functions defined in the system / apparatus of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the system, apparatus, module, unit, etc. described above can be implemented by computer program modules.

[0098] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal via a network medium, and be downloaded and installed through the communication part 709, and / or be installed from the detachable medium 711. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination of the above.

[0099] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages, and specifically, these computer programs can be implemented by using a high-level procedural and / or object-oriented programming language, and / or an assembly / machine language. The programming language includes but is not limited to, for example, Java, C++, python, “C” language, or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, connected to the Internet through an Internet service provider).

[0100] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not expressly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0101] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for training a magnetic field reconstruction model based on a conditional generative adversarial network, comprising: obtaining real magnetic moment data; obtaining magnetic field data corresponding to the real magnetic moment data according to the real magnetic moment data; obtaining a training sample set according to the magnetic field data and the real magnetic moment data; training a to-be-trained magnetic field reconstruction model using the training sample set to obtain a trained magnetic field reconstruction model; and wherein the training of the to-be-trained magnetic field reconstruction model using the training sample set comprises: inputting the magnetic field data into a generator of a conditional generative adversarial network to enable the generator to generate simulated magnetic moment data, inputting the real magnetic moment data and the simulated magnetic moment data into a discriminator of the conditional generative adversarial network to enable the discriminator to determine the authenticity of the simulated magnetic moment data. The obtaining of the real magnetic moment data comprises:

2. The method of claim 1, wherein, obtaining original data; preprocessing the original data to obtain the real magnetic moment data. The obtaining of the magnetic field data corresponding to the real magnetic moment data according to the real magnetic moment data comprises:

3. The method of claim 1, wherein, obtaining detection magnetic field data according to the physical principle of a detection method and the information of a detector, fitting the detection magnetic field data to obtain the magnetic field data corresponding to the real magnetic moment data in combination with implicit parameters. The values of the implicit parameters satisfy a preset parameter range, and the preset parameter range is the position range of a sample to be detected and the detector in a detection process.

4. The method of claim 3, wherein, The training of the to-be-trained magnetic field reconstruction model using the training sample set to obtain the trained magnetic field reconstruction model comprises:

5. The method of claim 1, wherein, performing data conversion on the training sample set to obtain a training sample set in RGB format, wherein the training sample set in RGB format comprises real magnetic moment data in RGB format and magnetic field data in RGB format; training the to-be-trained magnetic field reconstruction model using the training sample set in RGB format to obtain the magnetic field reconstruction model. The loss function of the magnetic field reconstruction model comprises a first loss function and a second loss function, the first loss function is a loss function of the conditional generative adversarial network, the second loss function is a loss function of feature extraction of the conditional generative adversarial network, and the loss function of feature extraction is obtained by taking norms of first and second probabilities; and 6. The method of claim 1, wherein, wherein the first probability is the probability that each layer of a feature extractor of the discriminator determines that input real magnetic moment data is real magnetic moment data, and the second probability is the probability that the feature extractor determines that input simulated magnetic moment data is real magnetic moment data.

7. A magnetic field reconstruction method based on a conditional generative adversarial network, comprising: obtaining to-be-detected magnetic field data; inputting the to-be-detected magnetic field data into the magnetic field reconstruction model to output reconstructed magnetic moment data, wherein the magnetic field reconstruction model is trained by the magnetic field reconstruction model training method of any one of claims 1-6.

8. An electronic device, comprising: one or more processors; a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-7. ​ 9. A computer-readable storage medium having stored thereon executable instructions that, as a result of being executed by a processor, cause the processor to implement the method as claimed in any one of claims 1 to 7.

10. A computer program product comprising computer executable instructions that, when executed, implement the method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Three-dimensional magnetic flux leakage detection defect reconstruction method based on generative adversarial network

    CN110992363A

  • Satellite magnetic moment distribution method and device

    CN113071713A