Quantum system weak magnetic field measurement method based on CTK-Net hybrid architecture
Through the deep learning method of CTK-Net hybrid architecture, combined with the diamond NV color-center quantum system, the problems of low computational efficiency, insufficient characteristic characterization ability and poor noise robustness in weak magnetic field detection are solved, and high-precision and fast weak magnetic field measurement are achieved, which is suitable for detection needs in industrial sites.
Patent Information
- Application Number
- CN202510415934.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-22
AI Technical Summary
The prior art does not match the real-time requirements in weak magnetic field detection, has limited feature characterization capabilities, and insufficient noise robustness, resulting in a performance gap between the laboratory environment and the industrial site.
Using a deep learning method based on CTK-Net hybrid architecture, combined with diamond NV color-centric quantum system, a deep learning database is built by building an ODMR data acquisition device, and a multi-scale convolution feature extraction module, a Transformer global modeling module and a dual-path GeLU-KAN fusion module are used to optimize network parameters and introduce actual noise simulation interference during the training process to improve the robustness of the model.
It significantly improves the accuracy and efficiency of weak magnetic field measurement, enhances anti-interference ability, and has strong adaptability, and is suitable for continuous or batch inspection at industrial sites.
Smart Images

Figure CN120352815A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum precision measurement, and specifically relates to a method for measuring weak magnetic fields in a quantum system based on a CTK-Net hybrid architecture. Background Technique
[0002] The diamond nitrogen-vacancy (NV) color center is a point defect structure composed of adjacent nitrogen atoms and vacancies in the diamond lattice. Its unique electron spin characteristics make it an important research object in the field of quantum sensing. Under the action of an external magnetic field, the ground-state spin energy levels of the NV color center will undergo Zeeman splitting, and the splitting width is linearly related to the magnetic field strength, which constitutes the physical basis of the optically detected magnetic resonance (ODMR) magnetic measurement technology. Through laser pumping and microwave excitation, the ODMR technology can achieve a nanoscale spatial resolution and a magnetic field sensitivity of the order of pT / √Hz, which shows unique advantages in frontier fields such as single-molecule magnetic resonance imaging and magnetocardiogram and magnetoencephalogram detection.
[0003] However, when the external magnetic field strength is lower than 10 Gs, the splitting characteristics of the ODMR spectral lines tend to become blurred. This is mainly due to two physical limitations: First, the Zeeman energy level splitting ΔE caused by the weak magnetic field is significantly reduced compared with the spin-orbit coupling energy, resulting in increased spectral line overlap; Second, the statistical distribution of the crystal axis orientations of each NV center in the diamond lattice will cause a multi-peak superposition effect. The traditional Lorentz fitting method in this scenario needs to rely on a complex deconvolution algorithm, and the solution process is extremely sensitive to noise. More seriously, existing laboratory-level ODMR systems often need to be equipped with auxiliary devices such as cryostats (<4K) and high-voltage electrostatic fields (>100 V / mm) to achieve weak magnetic detection, which greatly limits the engineering application of this technology.
[0004] Currently, the industrial community's demand for rapid weak magnetic field detection is becoming increasingly urgent. For example, in semiconductor manufacturing, the detection accuracy of the residual magnetic field on the wafer surface directly affects the yield of integrated circuits; in the field of biomedicine, the detection of weak magnetic fields (10 -6 -10 -8 Gs) generated by neuron activities requires a non-invasive and highly sensitive probe. Therefore, the development of a new ODMR solution method suitable for weak magnetic scenarios has become a key breakthrough for the practical application of quantum sensing technology.
[0005] In response to the above problems, the existing technologies have proposed solutions such as affecting the zero-field splitting parameter, enhancing the sensitivity of the NV color center, and offsetting the magnetic field magnitude of the bias magnetic field. However, there are limitations such as a harsh test environment and low precision. With the advent of the era of artificial intelligence, the research on combining machine learning and statistical methods to deeply explore the potential patterns in measurement data has emerged, providing solutions to problems that are difficult to fit with traditional physical models. As a branch of machine learning, deep learning technology does not rely on the fitting of experimental data and physical models and has broad development prospects in the field of quantum magnetic measurement.
[0006] In response to the technical challenges of ODMR weak magnetic detection, the existing research mainly focuses on two directions: the physical model-driven method and the traditional machine learning method:
[0007] Among them, the physical model-driven method is to construct an ODMR response model based on the basic principles of quantum mechanics. Typical representatives include: the Bloch equation solution method and the Bayesian optimization inversion method. However, the Bloch equation solution method requires iterative calculation of the time evolution of the density matrix and is difficult to meet the real-time detection requirements. Although the Bayesian optimization inversion method performs well when the signal-to-noise ratio (SNR>20dB), its computational complexity is as high as O(n 3 ), and it is sensitive to the selection of the initial value and is prone to falling into a local optimal solution.
[0008] To improve the computational efficiency, some researchers have tried to use traditional machine learning methods for feature extraction: support vector regression (SVR) and random forest (Random Forest). The support vector regression (SVR) method achieves a prediction error of 0.8 Gs in the range of 5-15 Gs, but its performance drops sharply to 2.5 Gs in the weak magnetic region (<5 Gs). Although the random forest (Random Forest) performs stably in a noisy environment, its feature engineering process depends on expert experience and cannot effectively capture the non-linear frequency shift characteristics of the spectral line.
[0009] In summary, the existing methods face three major bottlenecks in the weak magnetic detection scenario: (1) the computational efficiency of the physical model does not match the real-time requirements; (2) the feature representation ability of traditional machine learning methods is limited; (3) the lack of noise robustness leads to a performance gap between the laboratory environment and the industrial site. Summary of the Invention
[0010] To solve the above technical problems, the present invention provides a method for measuring weak magnetic fields in a quantum system based on a CTK-Net hybrid architecture, which combines the unique advantages of deep learning technology and the diamond NV color center quantum system, and develops a method for detecting weak magnetic fields based on the diamond NV color center quantum system. This method can automatically, efficiently and accurately predict the intensity of the magnetic field received by weak magnetic materials. This method has significant practical application value for improving the accuracy and efficiency of weak magnetic field detection, thus opening up new research directions and application prospects in the field of weak magnetic detection.
[0011] To achieve the above object, the present invention is realized through the following technical solutions:
[0012] The present invention is a method for measuring weak magnetic fields in a quantum system based on a CTK-Net hybrid architecture, which specifically includes the following steps:
[0013] Step 1: Build a weak magnetic field optically detected magnetic resonance (ODMR) data acquisition device, obtain the ODMR spectral line sequence of the diamond NV color center after crystal axis orientation under a weak magnetic field, that is, a magnetic field with an intensity of 0-10 Gs. Calibrate the current value of the ODMR spectral line sequence through a Helmholtz coil, initially construct a deep learning database, perform preprocessing of normalization and noise reduction on the ODMR spectral line sequence data, and construct an initial data set;
[0014] Step 2: Analyze the ODMR spectral line sequence data collected under a weak magnetic field, initially construct a CTK-Net deep learning network architecture that can effectively extract the features of the ODMR spectral line sequence, train the CTK-Net deep learning network architecture multiple times, optimize the CTK-Net deep learning network architecture, and select the optimal network parameters;
[0015] Step 3: For the external interference that will occur during weak magnetic field detection, apply a certain amount of noise to the collected ODMR spectral line sequence data, compare the performance of the CTK-Net deep learning network architecture at this time, and save the CTK-Net deep learning network architecture with the most stable performance and its parameters;
[0016] Step 4: Use the diamond NV color center sensor after crystal axis orientation to collect the ODMR spectral sequence on an unknown weak magnetic material, preprocess the ODMR spectral sequence collected on the unknown weak magnetic material according to the normalization and noise reduction methods in Step 1, and input the preprocessed ODMR spectral sequence collected on the unknown weak magnetic material into the CTK-Net deep learning network architecture in Step 3 for weak magnetic field measurement.
[0017] A further improvement of the present application is that: Step 1 specifically includes the following steps:
[0018] Step 1.1: Set up a weak magnetic field optically detected magnetic resonance (ODMR) data acquisition device. During data acquisition, use a three-dimensional Helmholtz coil to generate a magnetic field. The axial direction of the current-carrying coil is Z. Place the diamond NV color center probe with the crystal axis oriented at the center of the three-dimensional Helmholtz coil. Place a microwave antenna directly below the diamond NV color center sensor probe and adjust the position of the microwave antenna so that the point of the strongest microwave field strength of the microwave antenna is as close as possible to the diamond NV color center sensor probe. Use the Labview program to control the current source to continuously increase the current magnitude and collect the ODMR spectral line sequence data at different current values. The entire data acquisition process is completed inside a magnetic shielding barrel;
[0019] Step 1.2: Convert each current value in the dataset to a magnetic induction intensity value, and use the magnetic induction intensity value as the label value to construct a deep learning database;
[0020] Step 1.3: To improve the generalization ability of the model and ensure the comparability between different data groups, perform normalization processing on the ODMR spectral line sequence data group in each magnetic field case, that is, divide each ODMR spectral line sequence value in the ODMR spectral line sequence data by the maximum ODMR value in the ODMR spectral line sequence data group. To avoid the influence of the external environment, perform wavelet denoising processing on the collected ODMR spectral line sequence. Construct the initial dataset.
[0021] A further improvement of this application is that in Step 2, the CTK-Net deep learning network architecture includes an input layer, a multi-scale convolutional feature extraction module, a Transformer global modeling module, a dual-path GeLU-KAN fusion module, and an output layer, where:
[0022] The multi-scale convolutional feature extraction module is responsible for extracting spatial local features and uses a hierarchical stacked one-dimensional convolutional structure, including batch normalization, LeakyReLU activation function, and max pooling layer. Among them, the convolutional kernel size of the first convolutional structure is 5, the convolutional kernel size of the second convolutional structure is 7, the convolutional kernel size of the third convolutional structure is 9, the convolutional kernel size of the fourth convolutional structure is 11, the convolutional kernel size of the fifth convolutional structure is 13, and the convolutional kernel size of the sixth convolutional structure is 15;
[0023] In the feature modeling stage, CTK-Net uses a four-layer Transformer encoder for feature processing. The Transformer global modeling module sequentially includes 4 stacked Transformer encoders. Each Transformer encoder includes a 16-head attention mechanism, an 8-fold feed-forward network expansion, LayerNorm normalization, and Dropout(0.1). Each Transformer encoder contains a Dynamic Sparse Attention layer, a Windowed Local Enhancement module, and a Relative Position Encoding module;
[0024] The dual-path GeLU-KAN fusion module includes a dual-path GeLU-KAN backbone and a CAS-ViT convolutional addition self-attention module. The dual-path GeLU-KAN backbone is responsible for deeply processing the input features. It adopts a dual-path structure that combines the GeLU and ReLU sparse activation mechanisms, that is, it includes a ReLU retention path and a GeLU introduction path. The ReLU retention path follows the original ReLU sparse activation characteristics to ensure the advantages of the CTK-Net deep learning network architecture in terms of sparse activation. A Gaussian error gating mechanism (GeLU) is introduced on the GeLU introduction path. By dynamically adjusting the basis function expansion ratio, the non-linear mapping ability for weak features is enhanced. The input dimension of the dual-path GeLU-KAN backbone is set to 128, and the hidden layer dimension is 256, aiming to extract richer non-linear features; The CAS-ViT convolutional addition self-attention module is used to capture global and local dependencies in the feature space and enhance the feature fusion effect through the convolutional addition self-attention mechanism. The basis function is the Gaussian error function used for GeLU activation, and its definition is:
[0025]
[0026] where erf is the Gaussian error function.
[0027] A further improvement of this application is that in step 2, the CTK-Net deep learning network architecture is trained multiple times to optimize the CTK-Net deep learning network architecture, and the optimal network parameters are selected. The specific steps are as follows:
[0028] Step 2.1, The CTK-Net deep learning network architecture uses RMSE as the loss function, and RMSE is defined as:
[0029]
[0030] where n is the number of samples, y q and They are the actual value and the predicted value of sample q respectively;
[0031] Step 2.2: Train the constructed CTK-Net deep learning network architecture multiple times in the dataset, and save the network parameters with the minimum RMSE of the CTK-Net deep learning network architecture.
[0032] A further improvement of this application lies in that: Step 3 specifically includes the following steps:
[0033] Step 3.1: In the data acquisition stage, apply Gaussian noise to the ODMR spectral line sequence to simulate the random interference that may be encountered during the data acquisition process. At the same time, set a shielding barrel outside the data acquisition to isolate the external field noise and ensure the signal quality. Consciously introduce noisy data into the initial dataset constructed in Step 1 to construct a more abundant and realistic high-quality dataset, and enhance the adaptability of the CTK-Net deep learning network architecture to complex environments from the source;
[0034] Step 3.2: Adopt a dynamic noise injection strategy during the training process, that is, gradually linearly increase the noise intensity from the initial σ = 0.01 to σ = 0.1, and ensure that when the signal-to-noise ratio (SNR) reaches 20 dB, the error volatility (ΔRMSE) of the CTK-Net deep learning network architecture is stably controlled within 12%, thereby enhancing the robustness of the CTK-Net deep learning network architecture to different signal-to-noise levels. At the same time, through the design of a multi-task loss function, jointly optimize the mean square error (MSE) and the weight regularization term (L2 Norm) to ensure that the predicted magnetic field distribution of the CTK-Net deep learning network architecture is highly consistent with the true value in terms of topological structure, and effectively improve the physical interpretability;
[0035] Step 3.3: Use the coefficient of determination R of linear regression 2 and the mean absolute error MAE of the absolute value of the difference between the predicted value and the actual observed value to evaluate the performance of the CTK-Net deep learning network architecture. The coefficient of determination R of linear regression 2 reflects the degree of data variation that the model can explain, that is, the goodness of fit. The value range of the coefficient of determination of linear regression is between 0 and 1. When the coefficient of determination R of linear regression 2 is close to 1, it indicates that the CTK-Net deep learning network architecture can well explain the variation of the dependent variable, that is, the straight line fitted by the CTK-Net deep learning network architecture can better approximate the data points; its formula is as follows,
[0036]
[0037] where, is the average value of the predicted value y q , n is the number of samples, yq and are the actual value and predicted value of sample q respectively. When the predicted value is exactly the same as the actual value, it equals 0, which is the perfect CTK-Net deep learning network architecture. The greater the error, the larger the MAE value. The smaller the MAE value, the better the accuracy of the predicted CTK-Net deep learning network architecture. The MAE formula is as follows:
[0038]
[0039] Step 3.4: Train the CTK-Net deep learning network architecture multiple times in the latest dataset constructed in Step 3.1, and save the CTK-Net deep learning network architecture and its parameters, namely the learning rate lr, batch size batch_size, and weight decay weight_decay, with the MAE closest to 0 and R 2 closest to 1.
[0040] A further improvement of this application is that Step 4 specifically includes the following steps:
[0041] Step 4.1: Place the diamond NV color center sensor probe with crystal axis orientation used in Step 1 on the surface of the unknown weakly magnetic material;
[0042] Step 4.2: Obtain the ODMR spectral line sequence data on the surface of the weakly magnetic material through the pre-installed acquisition device;
[0043] Step 4.3: Adopt the CTK-Net deep learning network architecture, transmit the ODMR spectral line sequence data to the computer equipped with the CTK-Net deep learning network architecture in Step 3.4, and use the constructed CTK-Net deep learning network architecture to real-time identify the magnetic field magnitude corresponding to the ODMR spectral line sequence, and display the magnetic field prediction value using a display to complete real-time magnetic field detection.
[0044] The beneficial effects of the present invention are:
[0045] The present invention significantly improves the measurement accuracy: By combining the quantum effect of the diamond NV color center and the CTK-Net deep learning network architecture, the present invention significantly improves the accuracy of weak magnetic field measurement. The extremely high sensitivity of the diamond NV color center to the magnetic field, combined with the in-depth analysis of the CTK-Net deep learning network architecture on the ODMR spectral line data, enables accurate measurement of the magnetic field intensity even under extremely weak magnetic field conditions. This breakthrough improvement in accuracy provides more reliable data support for scientific research and technical applications.
[0046] The present invention improves the detection efficiency and convenience: By applying the CTK-Net deep learning network architecture, the present invention significantly improves the efficiency of weak magnetic field detection. Compared with traditional methods, the CTK-Net deep learning network architecture can quickly extract information from ODMR spectral lines and predict the magnetic field strength, significantly shortening the data processing time. In addition, the operation process of this method is simple, reducing the manual operation steps and making the magnetic field detection more convenient, especially suitable for application scenarios that require continuous or batch detection.
[0047] The present invention for efficient feature extraction and model training: The CTK-Net adopted by the present invention can efficiently extract key features from ODMR spectral lines and optimize the model through multiple iterative trainings. This feature extraction and model training process ensure that even in a complex magnetic field environment, the magnetic field strength can be accurately predicted, improving the robustness and generalization ability of the detection.
[0048] The present invention enhances the anti-interference ability and adaptability: By introducing various noises into the training data to simulate the interference in actual measurements, the method of the present invention effectively enhances the anti-interference ability of the model. This enables the model to maintain stable performance in different measurement environments and conditions, greatly improving the adaptability and reliability in practical applications and providing a more solid scientific basis for weak magnetic field measurement. Brief Description of the Drawings
[0049] Figure 1 It is the overall design flow chart of the method of the present invention.
[0050] Figure 2 It is a schematic diagram of the optimized ODMR spectral sequence in the data set under an externally applied 10 Gs magnetic field in the embodiment of the present invention.
[0051] Figure 3 It is a schematic diagram of the structure of the CTK-Net neural network in the embodiment of the present invention.
[0052] Figure 4 It is a bar chart of the mean absolute percentage error of the embodiment of the present invention on the training set and the test set.
[0053] Figure 5 It is a bar chart of the coefficient of determination of the model after applying a certain amount of noise in the embodiment of the present invention.
[0054] Figure 6 It is a schematic diagram of the non-contact weak magnetic field measurement method of the diamond NV color center quantum system based on the CTK-Net hybrid architecture in the embodiment of the present invention.
[0055] Figure 7 It is to show the original ODMR spectral lines and the ODMR spectral lines predicted by the model after inverse normalization at 0 Gs, 5 Gs, and 9 Gs in the embodiment of the present invention.
[0056] Figure 8 This is the magnetic field prediction scatter plot in the embodiment of the present invention. Detailed implementation manners
[0057] The embodiments of the present invention will be disclosed below with reference to the drawings. For the sake of clarity, many practical details will be described together in the following description. However, it should be understood that these practical details are not used to limit the present invention. That is to say, in some embodiments of the present invention, these practical details are not necessary.
[0058] As Figure 1 shown, the present application is a method for measuring weak magnetic fields in a quantum system based on a CTK-Net hybrid architecture, specifically including the following steps:
[0059] Step 1: Build a weak magnetic field optically detected magnetic resonance (ODMR) data acquisition device. In a weak magnetic field, obtain the ODMR spectral line sequence of diamond NV centers after crystal axis orientation under the action of a weak magnetic field, that is, a magnetic field intensity of 0 - 10 Gs. Calibrate the current value of the ODMR spectral line sequence through a Helmholtz coil, initially construct a deep learning database, perform preprocessing of normalization and noise reduction on the ODMR spectral line sequence data, and convert the current tag value into a magnetic field intensity value to improve the quality of the data set and construct an initial data set. Specifically, it includes the following steps:
[0060] Step 1.1: Build a weak magnetic field optically detected magnetic resonance (ODMR) data acquisition device. As Figure 2 shown, a three-dimensional Helmholtz coil is used to generate a magnetic field during data acquisition. A current is passed through the coil, and its axial orientation is the Z-axis. Place the diamond NV center probe after crystal axis orientation at the center of the three-dimensional Helmholtz coil. Place a microwave antenna directly below the diamond NV center sensor probe and adjust the position of the microwave antenna so that the point with the strongest microwave field strength of the microwave antenna is as close as possible to the diamond NV center sensor probe. Use the Labview program to control the current source, gradually increase the current intensity, continuously increase the magnitude of the current, and collect the ODMR spectral line sequence data at different current values. The entire data acquisition process is completed in a magnetic shielding barrel. The NV center weak magnetic calibration device based on a three-axis Helmholtz coil is as Figure 3 shown.
[0061] For a small segment of the circular current, since its length is short, it can be regarded as a straight wire, and thus the magnetic field vector B generated by this current segment at the sample point can be calculated. Considering the contribution of each segment of current in the two circular currents, the sample point is located at the midpoint of the central vertical line between the two current loop planes. Based on the principles of electromagnetism, a simplified formula for the magnetic field distribution at the probe position is derived:
[0062]
[0063] Among them, B is the magnetic field induction intensity; μ0 is the vacuum magnetic permeability, with a value of 4π×10 -7 ·NA -2 ; I is the current, and its magnitude is controlled by the power supply; a is the coil radius; d is the distance between the sample point and the center of the ring. After calculation, the conversion value of current and magnetic induction intensity during the data acquisition process is 0.0106 GS·mA -1 . According to this, each current value in the conversion dataset is converted into a magnetic induction intensity value, and the magnetic induction intensity value is used as the label value to construct a deep learning database;
[0064] Step 1.3: To enhance the generalization ability of the model and ensure the comparability between different data groups, the ODMR spectral line sequence data groups in each magnetic field condition are normalized, that is, each ODMR spectral line sequence value in the ODMR spectral line sequence data is divided by the maximum ODMR value in the ODMR spectral line sequence data group. To avoid the influence of the external environment, wavelet denoising processing is performed on the collected ODMR spectral line sequence to construct an initial dataset. The optimized ODMR spectral sequence (one) is as Figure 2 shown.
[0065] The initial ODMR spectral line sequence data after normalization and wavelet denoising processing in Step 1.3 is used as the input feature of the network, and the magnetic field magnitude corresponding to the ODMR spectral line sequence is used as the target to establish multiple deep learning datasets; the initial dataset is randomly divided into a training dataset, a validation dataset, and a test dataset, which are used for learning and optimization of model parameters, hyperparameter tuning and early stopping monitoring, and final performance evaluation respectively.
[0066] Step 2: Analyze the collected ODMR spectral line sequence data under weak magnetic fields, initially construct a CTK-Net deep learning network architecture that can effectively extract the features of the ODMR spectral line sequence, train the CTK-Net deep learning network architecture multiple times, optimize the CTK-Net deep learning network architecture, and select the optimal network parameters. The ODMR technology relies on the splitting of electron spin energy levels caused by the interaction between the magnetic field and electron spins: when an external magnetic field is introduced, this splitting will intensify and be manifested as frequency shift or splitting in the spectral line, showing the "eight-peak splitting" characteristic. However, if the external magnetic field intensity is very weak, the ODMR spectral line is not sufficient to show the splitting characteristics and may not necessarily show obvious changes. Therefore, to ensure the network recognition accuracy, the network needs to effectively and comprehensively extract the features of the sequence.
[0067] As Figure 5 shown, the CTK-Net deep learning network architecture in this application includes an input layer, a multi-scale convolutional feature extraction module, a Transformer global modeling module, a dual-path GeLU-KAN fusion module, and an output layer, where:
[0068] The multi-scale convolutional feature extraction module is responsible for extracting spatial local features. It adopts a hierarchical stacked one-dimensional convolutional structure, including batch normalization, LeakyReLU activation function, and max pooling layer. Among them, the convolutional kernel size of the first convolutional structure is 5, the convolutional kernel size of the second convolutional structure is 7, the convolutional kernel size of the third convolutional structure is 9, the convolutional kernel size of the fourth convolutional structure is 11, the convolutional kernel size of the fifth convolutional structure is 13, and the convolutional kernel size of the sixth convolutional structure is 15. The CTK-Net deep learning network architecture in this method integrates the advantages of CNN, Transformer, and the improved ReLU-KAN, constructs a complete feature extraction, data analysis and processing, and fusion process, and significantly improves the performance of sequence signal analysis. In the feature extraction stage, CNN adopts a hierarchical stacked one-dimensional convolutional structure. The first few layers use smaller convolutional kernels (sizes 5 and 7) to automatically capture the local details of the ODMR spectrum, and gradually introduce larger-sized convolutional kernels (9, 11, 13, and 15) in the subsequent layers to extract deeper information. At the same time, combined with batch normalization and LeakyReLU activation function, it accelerates network convergence and enhances the non-linear expression ability. In addition, the max pooling layer effectively reduces the feature dimension, retains key information while reducing the computational complexity, and realizes efficient information compression and screening.
[0069] In the feature modeling stage, CTK-Net uses four layers of Transformer encoders for feature processing. The Transformer global modeling module sequentially includes 4 layers of stacked Transformer encoders. Each layer of Transformer encoder includes 16-head attention mechanism, 8 times the feed-forward network expansion, LayerNorm normalization, and Dropout (0.1). Each layer of Transformer encoder includes a dynamic sparse attention layer, a windowed local enhancement module, and a relative position encoding module. Compared with the computational bottleneck brought by the traditional Transformer relying on the global attention mechanism, the dual-path GeLU-KAN fusion module of this application introduces dynamic sparse attention to replace the traditional multi-head self-attention, and reduces the Q-K similarity calculation complexity from O(n 2It is reduced to O(n), significantly improving the computational efficiency. At the same time, combined with Windowed Local Enhancement, it accurately captures the long-range frequency correlation of the ODMR spectrum line. In addition, the dual-path GeLU-KAN fusion module adopts a relative position encoding module to generate a direction-sensitive encoding matrix to effectively characterize the spatial topological structure of the spectrum line. The introduction of LayerNorm, Dropout, and mixed-precision training techniques not only stabilizes the training process but also significantly improves the computational efficiency, enabling the local features extracted by the CNN to be transformed into a high-dimensional feature representation with global context awareness.
[0070] The dual-path GeLU-KAN fusion module includes a dual-path GeLU-KAN backbone and a CAS-ViT convolutional addition self-attention module. The dual-path GeLU-KAN backbone is responsible for deeply processing the input features and adopts a dual-path structure that combines the GeLU and ReLU sparse activation mechanisms, that is, it includes a ReLU retention path and a GeLU introduction path. The ReLU retention path follows the original ReLU sparse activation characteristics to ensure the advantages of the CTK-Net deep learning network architecture in sparse activation. A Gaussian error gating mechanism (GeLU) is introduced on the GeLU introduction path to enhance the non-linear mapping ability of weak features by dynamically adjusting the basis function expansion ratio. The input dimension of the dual-path GeLU-KAN backbone is set to 128, and the hidden layer dimension is 256, aiming to extract richer non-linear features. The CAS-ViT convolutional addition self-attention module is used to capture global and local dependencies in the feature space and enhance the feature fusion effect through the convolutional addition self-attention mechanism.
[0071] In the feature fusion stage, the dual-path GeLU-KAN fusion module improves ReLU-KAN by adopting a dual-path GeLU-KAN structure. While retaining the ReLU sparse activation characteristics, it introduces a Gaussian error gating mechanism. In addition, it integrates the convolutional addition self-attention mechanism of CAS-ViT to optimize the feature space distribution. Finally, it is gradually reduced to the final output layer by a five-layer fully connected network, and combined with the LeakyReLU activation and Dropout mechanisms to effectively prevent overfitting. The CTK-Net deep learning network architecture realizes end-to-end collaborative optimization in local feature extraction, global dependency modeling, and lightweight non-linear enhancement, effectively overcoming the limitations of traditional single models such as CNN or Transformer in sequence signal processing. It shows good efficiency, robustness, and scalability in fields such as optically detected magnetic resonance (ODMR) and biological signal processing, fully reflecting its innovative breakthrough in cascade feature extraction and fusion technology.
[0072] The basis function is the Gaussian error function for GeLU activation, which is defined as:
[0073]
[0074] where erf is the Gaussian error function.
[0075] Since the LeakyReLU function can avoid the "dead ReLU" problem while retaining non-linear features and can accelerate the model training speed, LeakyReLU is selected as the activation function; the root mean square error (RMSE) function curve is continuous and differentiable everywhere, which is convenient for optimizing the CTK-Net deep learning network architecture using the gradient descent algorithm. The CTK-Net deep learning network architecture uses RMSE as the loss function, and RMSE is defined as:
[0076]
[0077] where n is the number of samples, y q and are the actual value and the predicted value of sample q, respectively;
[0078] The CTK-Net deep learning network architecture constructed is trained multiple times in the dataset, and the network parameters with the minimum RMSE of the CTK-Net deep learning network architecture are saved.
[0079] Step 3: For the external interference that occurs during weak magnetic field detection, a certain amount of noise is applied to the collected ODMR spectral line sequence data, and the performance of the CTK-Net deep learning network architecture at this time is compared, and the CTK-Net deep learning network architecture with the most stable performance and its parameters are saved.
[0080] During the process of performing magnetic field measurement, the following several potential interference factors are expected: First, during the data acquisition stage of the ODMR spectral line sequence, the movement of the detection device may cause noise; second, when using the sensor probe to obtain the ODMR spectral line sequence signal, the influence of the external environment of the laboratory, including temperature changes and electromagnetic interference, will also have an adverse impact on the measurement accuracy. To ensure the true reflection of the ODMR spectral line sequence data and the robustness of the CTK-Net hybrid architecture in practical applications, this application innovatively introduces a series of data enhancement and training optimization strategies to effectively improve the generalization ability and anti-interference ability of the model. First, during the data acquisition stage, Gaussian noise is applied to the ODMR spectral line sequence to simulate the random interference that may be encountered during the data acquisition process. At the same time, a shielding barrel is set outside the data acquisition to isolate the external field noise and ensure the signal quality. Noisy data is consciously introduced into the initial dataset constructed in Step 1 to construct a more abundant and realistic high-quality dataset, enhancing the adaptability of the CTK-Net deep learning network architecture to complex environments from the source;
[0081] Furthermore, a dynamic noise injection strategy is adopted during the training process, that is, the noise intensity is gradually linearly increased from the initial σ = 0.01 to σ = 0.1, ensuring that when the signal-to-noise ratio (SNR) reaches 20 dB, the error volatility (ΔRMSE) of the CTK-Net deep learning network architecture is stably controlled within 12%, thereby enhancing the robustness of the CTK-Net deep learning network architecture to different signal-to-noise levels. At the same time, through the design of a multi-task loss function, the mean square error (MSE) and the weight regularization term (L2 Norm) are jointly optimized to ensure that the magnetic field distribution predicted by the CTK-Net deep learning network architecture is highly consistent with the true value in terms of topology, effectively improving the physical interpretability;
[0082] In addition, this method develops a data augmentation strategy based on physical constraints, injecting Gaussian white noise σ ∈ [0.01, 0.1] that conforms to the experimental conditions and baseline drift with an amplitude less than 5% on the basis of the original data. Finally, the scale of the training set is expanded to 40,000 groups, greatly improving the generalization ability of the CTK-Net deep learning network architecture, enabling it to maintain stable prediction performance in different experimental environments. The comprehensive application of these innovative measures not only improves the diversity and representativeness of the dataset, but also provides a strong guarantee for the stability and high-precision magnetic field prediction of the CTK-Net deep learning network architecture in complex actual scenarios, laying a solid foundation for high-precision ODMR signal analysis.
[0083] The coefficient of determination R of linear regression is used 2 and the mean absolute error MAE of the absolute value of the difference between the predicted value and the actual observed value to evaluate the performance of the CTK-Net deep learning network architecture. The coefficient of determination R of linear regression 2 reflects the degree of data variation that the model can explain, that is, the goodness of fit. The value range of the coefficient of determination of linear regression is between 0 and 1. When the coefficient of determination R of linear regression 2 is close to 1, it indicates that the CTK-Net deep learning network architecture can well explain the variation of the dependent variable, that is, the straight line fitted by the CTK-Net deep learning network architecture can better approximate the data points; its formula is as follows,
[0084]
[0085] where, is the average value of the predicted value y q= , n is the number of samples, y q and They are the actual value and the predicted value of sample q, which equals 0 when the predicted value perfectly matches the actual value, i.e., the perfect CTK-Net deep learning network architecture. The greater the error, the larger the MAE value. The smaller the MAE value, the better the accuracy of the predicted CTK-Net deep learning network architecture. The MAE formula is as follows.
[0086]
[0087] The CTK-Net deep learning network architecture is trained multiple times in the newly constructed dataset, and the CTK-Net deep learning network architecture and its parameters with the MAE closest to 0 and R 2 closest to 1, namely the learning rate lr, the batch size batch_size, and the weight decay weight_decay, are saved.
[0088] Figure 4 This is the bar chart of the mean absolute percentage error of the embodiments of the present invention on the training set, the validation set, and the test set. Figure 3 This is the bar chart of the coefficient of determination of the model after applying noises of σ = 0, σ = 0.01, σ = 0.05, and σ = 0.1 in the embodiments of the present invention. The abscissas in both charts are some hyperparameters corresponding to the network during training. As can be seen from the figure, the MAE value of the fifth group of data is the smallest and the linear regression coefficient of determination R 2 is closest to 1. At this time, the network learning rate lr = 0.00005, the batch size batch_size = 32, and the weight decay weight_decay = 0.05, and all network parameters at this time are saved.
[0089] Step 4: Use the diamond NV color center sensor after crystal axis orientation to collect the ODMR spectrum sequence on the unknown weak magnetic material, preprocess the ODMR spectrum sequence collected on the unknown weak magnetic material according to the normalization and noise reduction methods in Step 1, and input the preprocessed ODMR spectrum sequence collected on the unknown weak magnetic material into the CTK-Net deep learning network architecture in Step 3 for weak magnetic field measurement.
[0090] Specifically, it includes the following steps:
[0091] Step 4.1: Place the diamond NV color center sensor probe after crystal axis orientation used in Step 1 on the surface of the unknown weak magnetic material.
[0092] Step 4.2: Obtain the ODMR spectral line sequence data on the surface of the weak magnetic material through the pre-installed acquisition device.
[0093] Step 4.3: Adopt the CTK-Net deep learning network architecture, transmit the ODMR spectral line sequence data to the computer equipped with the CTK-Net deep learning network architecture in Step 3.4, identify the magnetic field magnitude corresponding to the ODMR spectral line sequence in real time through the constructed CTK-Net deep learning network architecture, and use a display to show the magnetic field prediction value to complete real-time magnetic field detection.
[0094] Schematic diagram of the non-contact weak magnetic field measurement method for the diamond NV color center quantum system based on the CTK-Net deep learning network architecture in this embodiment. The overall measurement device is as Figure 6 shown, mainly consisting of four parts: an optical fiber diamond probe 1, an optical module 2, a quantum measurement and control module 3, and a deep learning server 4.
[0095] The optical fiber diamond probe consists of a micron-sized diamond NV color center crystal fixed to the end of the optical fiber. The role of the optical fiber is to transmit the excited green light and collect the red fluorescence emitted by the NV color center. By using a tapered optical fiber, the matching of the optical fiber light collection mode and the light output mode of the diamond NV color center can be achieved, which can greatly improve the fluorescence collection efficiency.
[0096] The optical module includes parts such as a laser, an objective lens, a dichroic mirror, a filter, and a photodetector. In this study, a green laser with high stability and pulse modulation is used as the light source, and its wavelength can be selected as 532 or 520 nm, with good intensity stability and low noise.
[0097] In the design of the optical module, a compact optical path design can make the optical path more stable and facilitate the plugging and unplugging of the optical fiber. After being controlled by an external laser switch to generate a pulse, the photodetector can output a corresponding pulsed fluorescence voltage signal, which will be input into the quantum measurement and control module for further signal processing. In the optical module, the laser emitted by the laser passes through the mirror M1, is reflected by a 45-degree dichroic mirror, and is focused and coupled into the optical fiber by the objective lens L1, and finally reaches the diamond NV color center crystal at the end of the optical fiber. Part of the fluorescence signal is collected by the optical fiber, returns through the objective lens L1, is transmitted through the dichroic mirror, is filtered by the filter F1, and is focused on the target surface of the photodetector APD by the lens L2. The numerical aperture of the objective lens is similar to that of the optical fiber, and the working wavelength range is 400 - 800 nm to ensure the maximization of the fluorescence signal collection and the lens focusing effect.
[0098] The software used in the quantum measurement and control module mainly includes LabVIEW (Laboratory Virtual Instrument Engineering Workbench) and MATLAB (Matrix Laboratory). The biggest feature of LabVIEW compared with other programming software is that it uses a graphical way for programming, and has very excellent efficiency and compatibility in hardware control, making it more suitable for engineers or scientists to solve engineering problems. As the name implies, MATLAB is a matrix factory and has unique applications in matrix operations, numerical analysis, system modeling, application simulation, etc. In the experiment, we use LabVIEW to control various devices such as arbitrary sequence pulse generators, microwave signal sources, spectrum analysis instruments, pulsed lasers, displacement platforms and other hardware devices. The arbitrary sequence pulse generator generates pulse signals to synchronize the components in the system and synchronously acquire signals.
[0099] The quantum measurement and control module includes a pulse generator, a low-noise amplifier, an ADC, a digital signal processing circuit, and a programmable control software. Controlled by the program, the operation and readout of the quantum state are completed through optoelectronic pulse control and optoelectronic detector signal processing. In the quantum measurement and control module, the pulse generator generates two paths of pulses, which respectively control the laser and the microwave switch, and the laser and the microwave switch alternate in time. The optoelectronic signal processing circuit amplifies, filters and digitally processes the voltage signal output by the optoelectronic detector. Finally, the programmable control software outputs the optically detected magnetic resonance spectrum of the NV color center under a series of microwave action times, that is, the ODMR spectral line.
[0100] Input the ODMR spectral line into the deep learning server to visually verify this method: such as Figure 5 Show the original ODMR spectral line and the ODMR spectral line predicted by the model (after inverse normalization) under 0 Gs, 5 Gs, and 9 Gs. It can be seen that the results are basically consistent; Figure 8 Compare the predicted output value of the deep learning server with the original measured value. The blue line is the true magnetic field value, and the red line is the predicted magnetic field value.
[0101] This combined model can not only capture global and local features simultaneously, overcome the limitations of other models, but also show excellent application potential in magnetic field prediction imaging, providing a new technical path for the field of weak magnetic detection and imaging, and having broad application prospects in many fields such as chip flaw detection, magnetic flux leakage detection, geomagnetic measurement, and brain magnetic detection.
[0102] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0103] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0104] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0105] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0106] The above description is only for the embodiments of the present invention and is not intended to limit the present invention. For those skilled in the art, various changes and modifications can be made to the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for measuring weak magnetic fields in a quantum system based on a CTK-Net hybrid architecture, characterized in that: The method for measuring weak magnetic field of the quantum system specifically includes the following steps: Step 1: Build a weak magnetic field optically detected magnetic resonance (ODMR) data acquisition device, obtain the ODMR spectral line sequence of the diamond NV center after crystal axis orientation under a weak magnetic field, i.e., a magnetic field with a strength of 0 - 10 Gs. Calibrate the current value of the ODMR spectral line sequence through a Helmholtz coil, preliminarily construct a deep learning database, perform preprocessing of normalization and noise reduction on the ODMR spectral line sequence data, and construct an initial data set; Step 2: Analyze the ODMR spectral line sequence data collected under a weak magnetic field, preliminarily construct a CTK-Net deep learning network architecture for extracting the features of the ODMR spectral line sequence, train the CTK-Net deep learning network architecture multiple times, optimize the CTK-Net deep learning network architecture, and select the optimal network parameters; Step 3: For the external interference that occurs during weak magnetic field detection, apply noise to the collected ODMR spectral line sequence data, compare the performance of the CTK-Net deep learning network architecture at this time, and save the CTK-Net deep learning network architecture with the most stable performance and its parameters; Step 4: Use the diamond NV center sensor after crystal axis orientation to collect the ODMR spectral sequence on an unknown weak magnetic material, preprocess the ODMR spectral sequence collected on the unknown weak magnetic material according to the normalization and noise reduction methods in Step 1, and input the preprocessed ODMR spectral sequence collected on the unknown weak magnetic material into the CTK-Net deep learning network architecture in Step 3 for weak magnetic field measurement.
2. The method for measuring weak magnetic field of a quantum system based on the CTK-Net hybrid architecture according to claim 1, wherein: The specific content of Step 1 includes the following steps: Step 1.1: Build a weak magnetic field optically detected magnetic resonance (ODMR) data acquisition device. Use a three-dimensional Helmholtz coil to generate a magnetic field during data acquisition. The axial direction of the current-carrying coil is Z. Place the diamond NV center probe after crystal axis orientation at the center of the three-dimensional Helmholtz coil. Place a microwave antenna directly below the diamond NV center sensor probe and adjust the position of the microwave antenna so that the point with the strongest microwave field strength of the microwave antenna is close to the diamond NV center sensor probe. Collect the ODMR spectral line sequence data at different current values. The data acquisition process is completed in a magnetic shielding barrel; Step 1.2: Convert each current value in the data set into a magnetic induction intensity value, and use the magnetic induction intensity value as the label value to construct a deep learning database; Step 1.3: Perform normalization processing on each group of ODMR spectral line sequence data in each magnetic field situation, that is, divide each ODMR spectral line sequence value in the ODMR spectral line sequence data by the maximum ODMR value in the ODMR spectral line sequence data group, and perform wavelet noise reduction processing on the collected ODMR spectral line sequence data to construct an initial data set.
3. The method for measuring weak magnetic field of quantum system based on CTK-Net hybrid architecture according to claim 1, characterized in that: In Step 2, the CTK-Net deep learning network architecture includes an input layer, a multi-scale convolutional feature extraction module, a Transformer global modeling module, a dual-path GeLU-KAN fusion module, and an output layer, where: The multi-scale convolutional feature extraction module is responsible for extracting local spatial features. It adopts a hierarchical stacked one-dimensional convolutional structure, including batch normalization, LeakyReLU activation function, and max pooling layer. Among them, the convolutional kernel size of the first convolutional structure is 5, the second is 7, the third is 9, the fourth is 11, the fifth is 13, and the sixth is 15; The Transformer global modeling module sequentially includes 4 stacked Transformer encoders. Each Transformer encoder includes 16-head attention mechanism, 8-fold feed-forward network expansion, LayerNorm normalization, and Dropout. Each Transformer encoder contains a dynamic sparse attention layer, a windowed local enhancement module, and a relative position encoding module; The dual-path GeLU-KAN fusion module includes a dual-path GeLU-KAN backbone and a CAS-ViT convolutional addition self-attention module. The dual-path GeLU-KAN backbone is responsible for deeply processing the input features. It adopts a dual-path structure that combines GeLU and ReLU sparse activation mechanisms, that is, it includes a ReLU retention path and a GeLU introduction path. The ReLU retention path follows the original ReLU sparse activation characteristics. A Gaussian error gating mechanism is introduced on the GeLU introduction path to enhance the non-linear mapping ability of weak features by dynamically adjusting the basis function expansion ratio. The input dimension of the dual-path GeLU-KAN backbone is set to 128, and the hidden layer dimension is 256; The CAS-ViT convolutional addition self-attention module is used to capture global and local dependencies in the feature space and enhance the feature fusion effect through the convolutional addition self-attention mechanism.
4. The weak magnetic field measurement method for a quantum system based on the CTK-Net hybrid architecture according to claim 3, characterized in that: In step 2, the CTK-Net deep learning network architecture is trained multiple times to optimize the CTK-Net deep learning network architecture, and the optimal network parameters are selected. The specific steps are as follows: Step 2.1, The CTK-Net deep learning network architecture uses RMSE as the loss function, and RMSE is defined as: where n is the number of samples, and y q and are the actual value and the predicted value of sample q, respectively; Step 2.2, The constructed CTK-Net deep learning network architecture is trained multiple times in the dataset, and the network parameters with the minimum RMSE of the CTK-Net deep learning network architecture are saved.
5. The weak magnetic field measurement method for quantum systems based on the CTK-Net hybrid architecture according to claim 1, characterized in that: The specific steps of step 3 are as follows: Step 3.
1. During the data acquisition stage, Gaussian noise is applied to the ODMR spectral line sequence to simulate the random interference encountered during the data acquisition process. At the same time, a shielding barrel is set outside the data acquisition to isolate the external field noise, ensuring the signal quality. Noisy data is introduced into the initial dataset constructed in Step 1 to construct a rich and realistic dataset, enhancing the adaptability of the CTK-Net deep learning network architecture to complex environments; Step 3.
2. During the training process, a dynamic noise injection strategy is adopted, that is, the noise intensity is gradually linearly increased from the initial σ = 0.01 to σ = 0.
1. σ represents the standard deviation of the noise distribution, that is, the amplitude of the Gaussian noise. At the same time, through the design of a multi-task loss function, the mean square error and the weight regularization term are jointly optimized to ensure that the magnetic field distribution predicted by the CTK-Net deep learning network architecture is topologically consistent with the true value, effectively improving the physical interpretability; Step 3.3: Use the coefficient of determination R of linear regression 2 and the mean absolute error (MAE) of the difference between the predicted value and the actual observed value to evaluate the performance of the CTK-Net deep learning network architecture. The coefficient of determination R of linear regression 2 reflects the degree of data variation that the model can explain, that is, the goodness of fit. The value range of the coefficient of determination of linear regression is between 0 and 1. When the coefficient of determination R of linear regression 2 is close to 1, it indicates that the CTK-Net deep learning network architecture can explain the variation of the dependent variable, that is, the straight line fitted by the CTK-Net deep learning network architecture can approximate the data points; The formula is as follows: Among them, is the average value of the predicted value y q , n is the number of samples, y q and are the actual value and the predicted value of sample q respectively, and it is equal to 0 when the predicted value is exactly the same as the actual value, that is, the perfect CTK-Net deep learning network architecture; The greater the error, the greater the MAE value. The smaller the MAE value, the better the accuracy of the predicted CTK-Net deep learning network architecture. The MAE formula is as follows: Step 3.4: Train the CTK-Net deep learning network architecture multiple times on the latest dataset constructed in Step 3.1, and save the CTK-Net deep learning network architecture and its parameters with the MAE closest to 0 and the R 2 closest to 1.
6. The weak magnetic field measurement method for a quantum system based on the CTK-Net hybrid architecture according to claim 1, characterized in that: The specific steps of Step 4 are as follows: Step 4.
1. Place the diamond NV color center sensor probe oriented along the crystal axis used in Step 1 on the surface of the unknown weakly magnetic material; Step 4.
2. Through the pre-installed acquisition device, obtain the ODMR spectral line sequence data on the surface of the weakly magnetic material; Step 4.
3. Adopt the CTK-Net deep learning network architecture, transmit the ODMR spectral line sequence data to the computer equipped with the CTK-Net deep learning network architecture in Step 3.4, and use the constructed CTK-Net deep learning network architecture to real-time identify the magnitude of the magnetic field corresponding to the ODMR spectral line sequence, and use the display to show the magnetic field prediction value to complete the real-time magnetic field detection.