Machine learning assisted vector atomic magnetometry

Domain: earth_science
Published: 2023-09-29
Editorial outcome: minor_revision

Abstract
Multiparameter sensing such as vector magnetometry often involves complex setups due to various external fields needed in explicitly connecting one measured signal to one parameter. Here, we propose a paradigm of indirect encoding for vector atomic magnetometry based on machine learning. We encode the three-dimensional magnetic-field information in the set of four simultaneously acquired signals associated with the optical rotation of a laser beam traversing the atomic sample. The map between the recorded signals and the vectorial field information is established through a pre-trained deep neural network. We demonstrate experimentally a single-shot all optical vector atomic magnetometer, with a simple scalar-magnetometer design employing only one elliptically-polarized laser beam and no additional coils. Magnetic field amplitudes sensitivities of about 100 fT/\sqrt{Hz} and angular sensitivities of about 100∼200 μrad/\sqrt{Hz} (for a magnetic field of around 140 nT) are derived from the neural network. Our approach can reduce the complexity of the architecture of vector magnetometers, and may shed light on the general design of multiparameter sensing.

Introduction
Developing atomic sensors with high sensitivity and compact configuration is a topic of great interest in quantum science and technologies. Prominent measurement devices including atomic clocks1,2, atom interferometers3, magnetometers4 and microwave sensors5 etc., are under active pursuit and play important roles in both fundamental research and real-life applications ranging from new physics search6 to navigation and medical diagnosis7,8. While in most scenarios the sensing process can be described by a single parameter estimation problem, multiparameter estimation9,10 has recently attracted attention both theoretically and experimentally. Notable examples are measurements of a multi-dimensional field, identification of a spatial structure11 or multi-frequency signals12. In general, multiparameter measurement requires a more involved sensor architecture, such as applying several electromagnetic fields along different directions to interact with the atoms, or performing successive interrogations under varied conditions. Furthermore, the relation between the observable readings and the parameters can be complex and decoding may require model fitting or elaborate data analysis techniques13–15.

Machine learning (ML), as a part of artificial intelligence, involves model-building based on sample data, or training data, to “learn" and then to make predictions without an explicit programme. ML is used widely for instance in speech recognition16, computer vision17, social network filtering18, medical diagnosis19,20 etc. Recently, ML has been applied in many fields of physics, to name a few, ultrafast laser science21,22, ultracold atoms23, many-body physics24, classification of quantum phases25, and quantum error correction26. Some works have also demonstrated its use in atomic sensors12,27, where it was shown that ML can perform better than a physics model. However, in these proof-of-principle experiments on atomic sensors, ML is merely used in analyzing the signal’s time trace to extract several frequency components. The potential of ML in atomic sensors, especially in multiparameter estimation, is yet to be unveiled. How to obtain the measurement sensitivity from the ML, and whether incorporating ML can significantly reduce the complexity in the sensor’s hardware remains elusive.

As an example of multiparameter atomic sensor, the vector magnetometer undergoes intense investigations for it provides more complete information than its scalar counterpart and has applications in biosciences, geophysics etc. To attain the magnetic field’s orientation, the sensor needs to incorporate certain axial references, for example field compensation coils28, radio frequency fields29–31, multiple crossing laser beams32–36, which all inevitably complicates the setup. Also, in many schemes the three-dimensional information is obtained successively29,37, or through sweeping the atomic resonance spectra38–40, which may not be suitable for relatively fast or real-time field measurement36. Simultaneous acquisition of the three-dimensional information can be achieved by modulating bias magnetic fields in three perpendicular directions at different frequencies41–43, thus discerning the three orthogonal magnetic field components. An all optical version of this method has been demonstrated by replacing the bias magnetic fields with orthogonally propagating laser fields imposing AC-stark shifts to the atoms44. However, in scenarios requiring miniaturization and high density packing of the sensors, all optical single-beam single-shot (within the sensor’s response time) vector magnetometry is desired, whereas to the best of our knowledge has not been reported.

Here, we propose a paradigm for vector magnetometry based on machine learning, which enables a single-shot single-beam all optical vector magnetometer. The information is encoded in the AC components of the optical rotation signal, where the complicated and non-linear relation between the set of four simultaneously recorded signals and the three parameters of the B field is established via machine learning. Removing the demand of the correspondence between one signal and one parameter as needed in most existing designs allows great simplification of the sensor structure, empowering vector magnetometry with a scalar magnetometer architecture. We further develop techniques for extracting sensitivities and frequency response of the ML-based magnetometer. The achieved sensitivities are about 100 fT/\sqrt{Hz} for the field magnitude, and about 100∼200 μrad/\sqrt{Hz} for the field direction, in a room temperature Rb vapor cell. This magnetometer approach may provide insight in designing compact sensors with multiple measurement capabilities.

Results
Principle
Our magnetometer scheme is based on the well known nonlinear magneto-optical rotation (NMOR) process45–48. An elliptically polarized and frequency modulated laser beam serves as both the pump and probe field. The ellipticity of the light is optimized for balanced sensitivities of the magnetic field along different directions49 (see Supplementary Note 3). The modulation frequency ωm is set near the Larmor frequency of the atom ΩL = γB where B is the amplitude of the total magnetic field to be measured and γ is the gyromagnetic ratio. With the direction of B set as the quantization axis, the atomic levels then couple with the σ+, σ− and π polarization components whose amplitudes and phases depend on the orientation of the magnetic field with respect to the wave vector of the laser38. These optical fields and their frequency sidebands form multiple sets of Λ-type electromagnetically-induced-transparency (EIT) interactions that interfere with each other, as shown in Fig. 1a, giving rise to optical rotation effects. Since the NMOR resonance occurs when ΩL and ωm coincide, the phases and intensities of the transmitted sidebands naturally encode both the amplitude and the orientation of B. The AC components of the polarization rotation signals, i.e., the Stokes component Sy, are acquired by phase-sensitive detection through frequency demodulation, where the in-phase and quadrature signals at the first and second harmonics of ωm, denoted as X1,2 and Y1,2, are recorded. Simultaneous recording of these four signals allows for single-shot vector magnetometry, lifting the requirement of sweeping the EIT spectrum as in refs. 38–40.

To extract the vectorial information of the magnetic field from the rotation signals, we adopt an artificial Neural Network (ANN) which is a typical algorithm of ML. By mimicking the way biological neural network learns from experience, the ANN establishes a map between input signals and output results using pre-collected data, and can thus give predictions on unknown parameters, for example, here, on the direction and magnitude of an unknown B. The network weights (parameters) are updated using the gradient descent algorithm50 to minimize the defined loss function over the training dataset. Each time when the NN goes through the whole training dataset and returns new weights in the network is called an epoch. The loss decreases as the epoch number increases and the map is eventually established. In our scheme, the demodulated optical rotation signals X1,2 and Y1,2 are first collected for a range of field amplitudes and directions, and then are used to train the NN. In the end, an accurate map is established between the signal set (X1, Y1, X2, Y2) and the parameter set (B, θ, φ), i.e., the three-dimensional field information. Here θ is normally defined as the angle between B and the wave vector k of the laser, and φ is the azimuthal angle in the plane perpendicular to the wave vector with φ=0 being the horizontal x direction associated with the polarization axis of the optics (Fig. 1).

Experimental setup
As shown in Fig. 1b, the light beam from an external cavity diode laser (ECDL) is near resonant with the 87Rb D1 line F=2 → F'=1 transition with 200 MHz red detuning to maximize the NMOR resonance amplitude51,52. The laser is frequency modulated (FM) at ωm = 997 Hz with a modulation range of 400 MHz (or modulation amplitude of 200 MHz), and its center frequency is locked via the dichroic atomic vapor laser lock53. The laser beam (about 2 mm in diameter) has its power (about 20 μW) stabilized in order to suppress the residual amplitude modulation. We adjust the laser polarization from linear to elliptical through two wave plates, before a cylindrical atomic vapor cell (2 cm in diameter and 7.1 cm in length) filled with enriched 87Rb at room temperature (~22 °C).

The alkene coating54 on the inner wall of the vapor cell ensures that atoms undergo thousands of wall collisions with little destruction of their internal quantum states. The cell resides within a four-layer μ-metal magnetic shield (residual field inhomogeneity in the cell is about 1 nT), together with three orthogonal sets of well-calibrated Helmholtz coils to generate the to-be-measured field B, with a fractional magnetic field inhomogeneity of 8/1000 within the cell. The NMOR resonance used for the magnetometer has an extracted zero-power linewidth (full width at half maximum, FWHM) of about 1 Hz, and a power broadened FWHM of about 16 Hz at the magnetometer’s operational laser power 20 μW.

The Stokes component Sy of the transmitted laser beam, after traversing a half-wave plate and a polarization beam splitter, is detected by a balanced photodetector in a homodyne configuration, whose output is sent to a lock-in amplifier for demodulation at frequencies ωm and 2ωm.

Experiment results
Before collecting data for NN training, it is necessary to calibrate the residual magnetic field within the shields and the three sets of coils, in order to generate a field B with arbitrary direction. For a single set of coil, one can observe a good linear relation between the current applied and the magnetic field generated, but for the vector compositions of the magnetic field, the small non-orthogonality between the coils can’t be neglected. Thanks to the fact that the NMOR resonance appears when the Larmor frequency ΩL equals the modulation frequency ωm or 1/2 ωm46, these imperfections can be well calibrated. The details of the calibration process are described in Methods and Supplementary Note 2.

First, we show the observed AC optical rotation signals in the form of NMOR resonance spectra at a tilted magnetic field direction. For instance, at θ=60°, φ=60°, when we scan the magnitude of B, as shown in Fig. 2a, both the first harmonic and second harmonic NMOR signals exhibit resonance at ΩL = 0, ωm and 1/2 ωm. The resonance center can be found precisely by fitting the curves with a generalized Lorentzian function, which is the key in coil calibration. For vector magnetometry, we choose the resonance at ΩL = ωm, since more EIT channels take part in the interferences than the ΩL = 1/2 ωm resonance, as can be seen from Fig. 1a, allowing more information to be encoded.

Figure 2b shows the spectrum calculated by the 8-level theoretical model using the master equation. Despite of the qualitative agreement, the experimental spectra deviate from the theory results because it is impractical to include in the model the accurate information of the following experimental complications which affect both the resonance lineshape and the absolute signal values: (a) demodulation phases are unknown in the phase sensitive detection due to phase delays in the electronics. (b) the input light polarization is slightly altered by the cell window. (c) there is a wide pedestal for the narrow NMOR resonance, characteristic of the coated cell and related to the thermal motion of the atoms55–58. We emphasize that due to motional averaging57, the field inhomogeneities of the coil causes negligible line broadening, as evidenced in our experiment by the zero-power resonance linewidth55 of 1 Hz for both the resonances at ΩL = ωm and ΩL = 1/2 ωm, which is likely dominated by spin exchange. Because of the above reasons, relying on the master equation theory model in establishing the relation between the signals and the B field parameters is generally not suitable, while the NN can provide a better solution.

Then we train the the NN using NMOR signals for a large range of field amplitudes and orientations. The structure of the fully connected NN is shown in Fig. 3a. There is one input layer receiving the four-dimensional NMOR signal and one output layer releasing the field information. Between the input and output layer there are 8 hidden layers each containing 128 neurons and the L2 regularization59 is used to prevent over-fitting. The activation function in the hidden layer is a ReLU (rectified linear unit) function60. The dataset is divided into the training set and verification set in the proportion of 8 to 2 and the mean square error is defined as the loss. The training set is used for learning, i.e., to determine the weights in the NN, while the validation set is used to assess the performance of the already trained NN. In practice, the NMOR data at the input layer for training is generated by a reverse-NN11 with a similar structure. After using the (B, θ, φ) set as the input and the corresponding experimental data (X1, Y1, X2, Y2) as the output for training, this reverse-NN can be employed to produce optical rotation data which is denser and more robust against noise than the measured. We then use these denser NMOR data to train the NN as shown in Fig. 3a with an Adam optimizer61, and the training and validation error is plotted in Fig. 3b. The trained NN can reproduce the full vectorial information of the magnetic field accurately as shown in Fig. 3c, where the solid lines are data generated from the reverse NN and the scattered points are from the prediction of the NN. In our data set, we have chosen the range for θ and φ to be [10°, 170°], because the NMOR signals are insensitive to the variation of φ ("dead zone") when B is nearly aligned with the propagation direction of the light k (θ ≈ 0° and 180°). One other issue is the signal degeneracy for φ and φ+π, but we propose an angled multi-pass configuration to lift this degeneracy and also to remove the “dead zone" for φ (see Supplementary Note 6).

Finally, we examine the sensitivities of the three polar components B, θ, φ given by our NN scheme. The normal way to obtain the magnetometer sensitivity is to convert the fluctuations on the measured signal δS to that on the magnetic field δB through a measured slope dS/dB. Here, an analogous “slope" is provided by the trained NN which establishes a map between the optical rotation signals and magnetic field parameters. We continuously record the signal set of optical rotations (X1, Y1, X2, Y2) for about one minute at a sampling rate of 900 per second for each fixed B, and the signal set at each time point is fed to the NN which then outputs the predicted parameter (B, θ, φ). Consequently, the four time traces of the signals X1(t), Y1(t), X2(t), Y2(t) are converted into three time traces B(t), θ(t), φ(t). We then perform fast-Fourier-transform (FFT) on B(t), θ(t), φ(t) respectively, and obtain the sensitivities, where the frequency response has also been considered and was obtained experimentally with the aid of the NN (see Supplementary Note 4) using a similar approach as described here.

Shown in Fig. 4a are the sensitivities at low frequencies for an exemplary B field direction of θ=63.435°, φ=60° with an amplitude of about 140 nT, while we found that in other field orientations the sensitivity is at a similar scale (see Supplementary Note 5). Due to the relatively small bandwidth of our magnetometer (associated with the narrow linewidth ~16 Hz of NMOR resonance), sensitivities are better at lower frequency. The best sensitivities are observed in the range of 10–20 Hz, where the sensitivity of field magnitude is about 100 fT/\sqrt{Hz}, and the angular sensitivity has the order of 100 μrad/\sqrt{Hz}. The extra noise at low-frequency near DC is mainly from the magnetic field itself, as well as 1/f noises. In order to confirm the sensitivities given by the NN, we examined whether a small change at these sensitivity levels in the magnetic field can be detected. We applied a small AC magnetic field at 11 Hz to slightly vary (B, θ, φ), and the NN is trained for the AC field in the parameter space near B ≈ 140 nT (ΩL ≈ 997 Hz), θ=63.435°, φ=60°. The test field change has an interval of (140 fT, 0.02°, 0.02°). The predicted changes in the vector components of B are consistent with the true values, as shown in Fig. 4b where the sizes of the error bars (standard deviations) indicate the sensitivities, which agree with those given by the NN-aided noise analysis shown in Fig. 4a. These results prove that ML-assisted approach for vector magnetometry can give the correct sensitivity levels.

Methods
Theoretical model
Our numerical calculation used the eight-level atomic system as shown in Fig. 1 in the main text. However, since our simulations showed that the four-level model gave qualitatively similar results as the eight-level model, to gain intuition on the key physics, we here describe a simplified four-level system, as shown in Fig. S1, where the ground states have three Zeeman levels which couple to one excited state by σ+, π, σ− polarized light fields respectively. The atom-light interaction Hamiltonian H can be derived with the rotating wave approximation (RWA), and the atomic coherences can be found from the density matrix ρ by solving the master equation:

∂ρ/∂t = -i/\hbar [H, ρ] + Γrel + Γrep ρ, (1)

where Γrel describes the decoherences including the spontaneous decay and dephasing etc., and Γrep describes the repopulation of the ground states63. Due to the periodicity of the system under frequency modulation, the coefficients of a Fourier expansion of the density matrix can be identified using the Floquet technique where ρ(t) is expanded in harmonics of the modulation frequency ωm:

ρ(t) = Σn=-∞^∞ ρ(n) einωmt (2)

Then the polarization rotation signal of the light we measure can be derived from the atomic coherences, which is found to contain the full vectorial information of the magnetic field. More details are in the Supplementary Note 1.

Calibration of magnetic field
In the experiment, the magnetic field to-be-measured is provided mainly by the three sets of orthogonal Helmholtz coils within the shields, where precise calibration is required in order to generate a magnetic field along any direction as we intend. In the calibration process, we obtain the amplitude of the total magnetic field (produced by the coils and background magnetic field in the shields) by identifying the resonance locations of the NMOR spectrum obtained through slowly sweeping the laser modulation frequency ωm. As shown in Fig. S2, the spectra exhibit resonance when the Larmor frequency ΩL equals ωm (or 1/2 ωm, not shown). The resonance center is found by fitting the experiment curve with a linear superposition of a Lorentzian absorption and dispersion function. For a single set of Helmholtz coil, the relation between the current applied and the generated magnetic field is linear. However, for the vector synthesis of a magnetic field generated by three sets of coils, imperfection in the orthogonality of the coils should be considered. Furthermore, the residual background magnetic field in the magnetic shields couldn’t be neglected.

The strategy we used for calibration is similar to that used in reference64. We consider a coil system with imperfect orthogonality among the three sets of coil which yield magnetic fields BcX, BcY, BcZ along X, Y, Z axis respectively, as shown in Fig. S3. First, for each set of coil we obtain the relation between the field amplitude and the current through the NMOR spectra with only this coil in operation. Then, without losing generality, we can set small angles ξ, η, ζ (see Fig. S3) to describe the deviation of (Xc, Yc, Zc) from a normal orthogonal coordinate system (X, Y, Z), and we have:

[BXc; BYc; BZc] = [cosξ sinηcosζ 0; 0 cosηcosζ 0; sinξ sinζ 1] [BcX; BcY; BcZ] (3)

The total magnetic field is B = B X + B Y + B Z + B_residual, which can be written as:

BcX cosξ + BcY sinηcosζ + B0X = Bsinθcosφ
BcY cosηcosζ + B0Y = Bsinθsinφ
BcX sinξ + BcY sinζ + BcZ + B0Z = Bcosθ (4)

or:

(BcX cosξ + BcY sinηcosζ + B0X)^2 + (BcY cosηcosζ + B0Y)^2 + (BcX sinξ + BcY sinζ + BcZ + B0Z)^2 = B^2 (5)

Here B, θ, φ are respectively the amplitude, altitude angle and azimuth angle of the total magnetic field we intend to measure. B0X, B0Y, B0Z are the components of the residual magnetic field along X, Y, Z respectively. The total magnetic field’s amplitude B as expressed by Eq. (5) can be measured from the NMOR spectra. By traversing the currents in the three coils and measuring the total field amplitude B for each set of (BcX, BcY, BcZ), we can determine parameters (ξ, η, ζ, B0X, B0Y, B0Z) using Eq. (5) through non-linear least squares fitting. To set a total magnetic field with parameters B, θ, φ as we intend, we can solve Eq. (4) to find what magnetic field should be generated in each coil, i.e., (BcX, BcY, BcZ).

Implementation of neural network
Neural Network (NN) is an artificial intelligence (AI) method based on the connectivism which imitates the connection between neurons. Our model is a simple fully connected Neural Network, and we proceed as follows to mimic the function of the biological neural network. First, data are collected in pairs of feature (input) and label (output). Commonly, the larger the amount of data, the better the performance of the NN. Second, we build the structure of the NN with a complexity determined by the scale of the problem to be solved. Similar to the growth of cognitive ability of human, the NN receives large amount of collected data with features and corresponding labels which change the weights of neurons. The NN updates its parameters via back-propagation using gradient descent algorithm aimed to reduce the loss function we choose. This is the training process of the NN. In our experiment mean-square error is chosen to be the loss function. After training, parameters in the NN are fixed and new data of features can be sent to the input port of the NN and it will output the predictions.

Our Neural Network is implemented using the framework of Keras, a high-level API (Application Programming Interface) of Tensorflow written in python. In Keras, a model is understood as a sequence or diagram composed of independent and fully configurable modules. These modules can be assembled together with as few restrictions as possible. In particular, modules such as Neural Network layer, loss function, optimizer, initialization method, activation function, and regularization method, can be combined to build new models.

The input layer of our NN receives the four-dimensional NMOR signal (X1, X2, Y1, Y2) and the NN predicts the three-dimensional magnetic field information (B, θ, φ) as the output. Between them are 8 hidden layers each containing 128 neurons. The transmission between layers is implemented via matrix operation and in each neuron there should be a non-linear activation function. ReLU activation function is used in each neuron. Mean-squared error is chosen to be the loss function, and additional term is added to the loss function to prevent overfitting. By calling the Keras API for L2 regularization in the hidden layers, quadratic sum of all the parameters in the hidden layers are recorded and added to the loss function. This procedure guarantees the generalization ability of the model, i.e., it will prevent overfitting which often means a complicated NN that adjusts the input and output relation only for the training dataset. As for the training process, the adaptive moment estimation method65 is applied.

Peer review rounds
[{"round": 1, "reviewer_comments": {"reviewer_1": "I have read the manuscript entitled \"Machine Learning Assisted Vector Atomic Magnetometry\", submitted to Nature Communications with the code NCOMMS-23-00060.\nThe work describes an optical magnetometer in which the output signal is analyzed by means of neural network methodology to obtain a vectorial response thanks to a machine learning approach.\nThe subject is definitely attractive and innovative for its inherent multidisciplinary content, however I have severe doubts about the general interest of the work to a broad community and/or the particular interest of a narrower audience, which would not find sufficiently deep details to improve their knowledge. I also noticed some important weaknesses, that should be highlighted more clearly and that probably make the results not as promising as expressed in the introduction.\nFor these reasons I do not consider this manuscript worthy of being considered for publication in a general journal such as Nat. Comm., and, at the same time I encourage the Authors to publish their results in a more specialized journal, after having completed it with important information that is presently missing.\nMy point is that the reader is here informed about interesting achievements obtained by the convergence of mature disciplines, but he will not gain additional know-how with the necessary details to reproduce or to continue this research. Actually the OPM apparatus consists in a standard setup, and the ML approach is implemented with standard techniques: the message is that this convergence is successful, but the reader cannot find sufficient information to reproduce the experiment or to learn original approaches/ concepts to be applied in his own (similar) apparatus.\nIn any case, I wish to list some remarks aimed to improve the readability. These remarks are in addition to the more profound criticism expressed above, which indeed requires an important expansion with details about the ML and NN implementation.\nPage 1\n*Which may not be suitable for real-time field measurement*\nstrictly speaking, real time does not mean \"nearly instantaneous\" but \"responding with an assigned delay\": in this sense, the single-shot (thus very fast) response is precluded, while a real-time one could be possible.\nPage 3\n*principle*\nSummarizing, spherical co-ordinates are used, with the polar axis oriented along the k direction. There is a missing information about the azimuthal angle origin: how is the phi=0 defined?\n*experiment setup*\n(I would expect \"experimentAL setup\") is really the observed linewidth as narrow as 0.5Hz? What is the theoretically expected value, taking into consideration residual field inhomogeneities and the various relaxation processes? Isn't this half Hz linewidth in relation with the 16Hz reported in page 5, 2nd column?\nPage 4\n*caption of fig.2*\na) range->depth (?)\nb) 200MHz red detuned: how is this value selected/determined? Why?\nc) X is the in-phase quadrature and Y is the out-of-phase quadrature : with the usual terminology\nthis should be probably reworded as:\n\"X is the in-phase signal and Y is the quadrature signal.\"\nd) \"...curve corresponds to the red (blue) y-axis\":\nthis should probably be reworded as \"to the X (Y) = in phase (in\nquadrature) signals\"\n*Therefore, relying on the master equation theory model in\nestablishing the relation between the signals and the B field\nparameters is generally not suitable, while the NN can provide a\nbetter solution.*\nThis sentence clarifies and puts in evidence a crucial weakness of the\nproposed methodology. If I understand correctly, this means that the\nML approach enables measurements despite the field imperfections,\nbecause the system is trained with a set of magnetic field values\nhaving the same inhomogeneities that will characterize the fields to\nbe measured. If so, such a device could only measure fields applied\n(inside the shield) by the same coils used to generate at the training\nstage. In this sense, it will not be a magnetometer, but an amp-meter\nmeasuring the current flowing in those coils.\nrelu (ReLU): the acronym should be defined\nPage 5\n*the NMOR signals are insensitive to the variation of phi, making the\nNN difficult to converge.*\nthis issue is real, it is set by the physical nature of the system:\nthe \"difficulty to converge\" is actually due to information that is\nnot contained in the acquired data. This implies that, under some\ngeometries (B and k nearly aligned), the actual instrumental\nresolution is much worse than what is declared (e.g. in the 2nd\ncolumn), and this is not dependent on the approach used to analyze the\nmagnetometric signal.\nThe paragraph in the first half of the second column is unclear or\nvery hard to understand. It likely requires a complete reformulation.\nPage 6\n*We applied a small AC magnetic field at 11 Hz to slightly vary (B,\ntheta, phi)*\n11Hz is not << the 16Hz bandwidth mentioned in page 5, thus one\nexpects that the system response is no longer that measured under DC\ncondition at the training stage: either the training should be made\nalso under dynamic conditions, or the frequency range in which the DC\ntraining is assumed to be valid should be defined better.\n*DISCUSSIONS* -> *DISCUSSION*\nThis section seems more a \"conclusion\" than a \"discussion\".\nQuantitative assessments would be expected in a discussion: as an\nexample, the sentence \"...the neural network, and achieve good\nsensitivities on field amplitude...\" should be made quantitative,\nreplacing \"good\" with a number.\n*The bandwidth of the magnetometer can be increased by broadening the\nresonance with higher laser power.*\nOne would expect that after increasing the signal by means of cell\nheating, the spin exchange would make the resonance broader with no\nneed of using power broadening. And noticeably this will rapidly lead\nto increase the signal amplitude, but not to enhance the sensitivity.\nAs a general remark, such \"technical\" improvements should be made\nbefore collecting data for publication: I strongly suggest to apply\nNN and ML to already optimized magnetometric signals.\nIn ref.7,the name Munoz requires a tilde.", "reviewer_2": "The manuscript reports on an atomic vector magnetometer in a single optical beam geometry that\nuses an artificial neural network (NN) to map four simultaneous NMOR resonance signals, namely\nthe in-phase and out-of-phase quadrature components at the modulated frequency and second-\nharmonic, to the magnetic field strength and direction with 100 fT/rt[Hz] and 100 uRad/rt[Hz]\nsensitivities. The authors demonstrate these results with a 140 nT field generated by a calibrated\n3D coil system. This work is noteworthy because the vector information is acquired simultaneously\nin a single shot with a single beam geometry, which simplifies the sensor architecture compared to\ncurrent vector magnetometers.\nThe quality of the data presented here is excellent and support the reported results. The paper is\nwell-written, except for minor comments below, and previous work is properly cited. Together\nwith the supplementary material, this manuscript gives all the necessary experimental and theoretical\ndetails. The vector sensitivities reported are near the state of the art but are not notable by\nthemselves. In addition, the NMOR techniques are also standard and the NMOR signals used in this\nwork have been historically reported by Budker’s group to be useful for vector magnetometry. The\nmain innovative step in this work is to apply a NN to properly map these NMOR signals to the\nmagnetic field vector parameter space.\nBy using ML to effectively simplify the sensor’s architecture, this work will surely impact the field of\natomic magnetometry. For vector magnetometers a simpler architecture means the sensor is less\nprone to drifts and can be more compactly designed. This work may also be of interest to other\ndisciplines outside of magnetometry that require multi-parameter sensing.\nIn view of the above, I recommend this paper for publication with some minor comments and\nsuggestions below:\n- I suggest that the font size in the figures should be increased for better readability. This is\nespecially true for the plot axes in Figures 2,3,4\n- In Sec. II, second paragraph “..weights updated using [the] gradient descent algorithm…”\n- The “relu” function in Sec. IV paragraph three is often written as “ReLU”.\n- Often there is a missing “the” before “NN”. E.g. in last paragraph of sec. IV “… is in good\nagreement with those given by [the] NN method”.\n- In Fig. 4 b1, I suggest writing something like dB instead of just B since it is a change of the\nmagnetic field value that you are plotting here.\n- Revise grammar and wording in the sentence “The predicted vector…method” of the last\nparagraph of section IV."}, "author_response": "Dear editor,\nThank you for your great patience in handling our manuscript \"Machine Learning Assisted\nVector Atomic Magnetometry\" with code NCOMMS-23-00060.\nWe thank both referees for carefully reading the manuscript and providing critical and helpful\ncomments. Below please find our point-to-point response (in blue) to all the questions and\nsuggestions.\nSincerely,\nThe authors.\nReferee#1\n----------------------------------------------------------------------------------------------------------------------\nI have read the manuscript entitled \"Machine Learning Assisted Vector Atomic Magnetometry\",\nsubmitted to Nature Communications with the code NCOMMS-23-00060.\nThe work describes an optical magnetometer in which the output signal is analyzed by means\nof neural network methodology to obtain a vectorial response thanks to a machine learning\napproach.\nThe subject is definitely attractive and innovative for its inherent multidisciplinary content,\nhowever I have severe doubts about the general interest of the work to a broad community\nand/or the particular interest of a narrower audience, which would not find sufficiently deep\ndetails to improve their knowledge. I also noticed some important weaknesses, that should be\nhighlighted more clearly and that probably make the results not as promising as expressed in\nthe introduction.\nResponse:\nWe thank the referee for recognizing the “innovative” feature and the “inherent multidisciplinary\ncontent” of the subject of this study.\nThe general interest of this work can be summarized as the following, quoting referee #2’s\nreport : “By using ML to effectively simplify the sensor’s architecture, this work will surely impact\nthe field of atomic magnetometry. For vector magnetometers a simpler architecture means the\nsensor is less prone to drifts and can be more compactly designed. This work may also be of\ninterest to other disciplines outside of magnetometry that require multi-parameter sensing.”\nAs suggested by the referee, to help the audience “improve their knowledge” and apply our\nmethod in their experiments, in the revised manuscript we have supplied more details. In\nparticular, a new section on ML is added in the supplementary material, and a “recipe-like”\ndescription of how to apply our methodology in other sensors is added in the last paragraph of\nthe main text. Various other details about the experiment have also been added in the revised\nmain text.\nWe have also responded to the two weak aspects pointed out by the referee, (a) Regarding the\ninsensitivity to \\phi when B is nearly along k: in the revised manuscript, we have proposed ways\nto eliminate this “dead zone” problem. (b) Regarding that the trained NN may not work for fields\nproduced by sources different than our test coils: we explain that this is a misunderstanding,\nand gave a list of factors contributing to the difference in the master equation simulation and\nthe experiment, using new experiment data, simulation results and references as evidence.\nPlease see the details in our point-to-point response below.\nFor these reasons I do not consider this manuscript worthy of being considered for publication\nin a general journal such as Nat. Comm., and, at the same time I encourage the Authors to\npublish their results in a more specialized journal, after having completed it with important\ninformation that is presently missing.\nMy point is that the reader is here informed about interesting achievements obtained by the\nconvergence of mature disciplines, but he will not gain additional know-how with the necessary\ndetails to reproduce or to continue this research. Actually the OPM apparatus consists in a\nstandard setup, and the ML approach is implemented with standard techniques: the message\nis that this convergence is successful, but the reader cannot find sufficient information to\nreproduce the experiment or to learn original approaches/ concepts to be applied in his own\n(similar) apparatus.\nResponse:\nWe thank the referee for carefully reading our manuscript, and for pointing out issues in the\npresentation, such as lack of various details. In the revised version, we have added more\ninformation as suggested.\nOur experiment apparatus is a standard one used in a NMOR magnetometer, and we have\ngiven all the experiment details including the experimental parameters such as laser power,\ndetuning, modulation parameters, laser polarization and detection techniques. With the\ninformation in our manuscript, we believe that our experiment can be reproduced by an\ninterested reader. Regarding the details of the ML, we have added more information in the\nsupplementary material. As for how to apply our approach in other multiparameter sensing\nexperiments, we have added a “recipe-like” description in the last paragraph of the main text.\nMoreover, we are happy to share our code upon request.\nAs pointed out by the referee#2 in the report, “Together with the supplementary material, this\nmanuscript gives all the necessary experimental and theoretical details.” Now, with the\nadditionally provided details in the revised manuscript, we believe that a general reader can\nlearn how to use our proposed methodology in his/her own experiment design.\nIn any case, I wish to list some remarks aimed to improve the readability. These remarks are\nin addition to the more profound criticism expressed above, which indeed requires an important\nexpansion with details about the ML and NN implementation.\nResponse: In the revised manuscript, we have added a section in the supplementary material\nwith details of our ML and NN implementations\nPage 1\n*Which may not be suitable for real-time field measurement*\nstrictly speaking, real time does not mean \"nearly instantaneous\" but \"responding with an\nassigned delay\": in this sense, the single-shot (thus very fast) response is precluded, while a\nreal-time one could be possible.\nResponse: We thank the referee for the comment. It is true that “single-shot” may indicate a\nvery fast response, and indeed any atomic sensor’s response is limited by the dynamics of the\natom-light interaction. In the schemes requiring a sweep of the spectrum, the to-be-measured\nfield needs to be constant during the sweep time, which is approximately equal to the optical\npumping time (the time it takes for the atomic system to reach steady state) MULTIPLIED BY\nthe number of points in the sweep. In our case, the field only needs to be nearly constant within\nthe optical pumping time.\nAs a response to this concern from the referee, we have rephrased the relevant sentences. We\nchanged the sentence “Which may not be suitable for real-time field measurement” to “Which\nmay not be suitable for relatively fast or real-time field measurement”. Also, when the word\n“single-shot” first appears in the manuscript, we added a note “within the sensor's response\ntime”.\nPage 3\n*principle*\nSummarizing, spherical co-ordinates are used, with the polar axis oriented along the k direction.\nThere is a missing information about the azimuthal angle origin: how is the phi=0 defined?\nResponse: We thank the referee for pointing this out. We have added the definition of phi = 0\nin our revised manuscript. It is defined by the test coils along the x direction, which is also the\npolarization-beam-splitter’s horizontal axis.\n*experiment setup*\n(I would expect \"experimental setup\") is really the observed linewidth as narrow as 0.5Hz?\nWhat is the theoretically expected value, taking into consideration residual field\ninhomogeneities and the various relaxation processes? Isn't this half Hz linewidth in relation\nwith the 16Hz reported in page 5, 2nd column?\nResponse:\nThe linewidth of the NMOR resonance is the sum of two parts: one part is the intrinsic linewidth\ndetermined by the ground state coherence decay, such as dephasing due to the magnetic field\ninhomogeneity, atom-wall collisions and atom-atom collisions; and the other part is the power-\nbroadened width, proportional to the laser power. Here, 0.5Hz is the zero-laser-power EIT\nlinewidth (this is half-width at half maximum, we now change it to full-width at half maximum,\n1Hz, for consistency with the 16Hz power broadened full-width), extracted from a linewidth\nversus laser-power measurement shown in the figure below.\nFig.R1 Zero-power linewidth (full width at half maximum) extraction of the NMOR resonance. Left: resonance\nnear zero-magnetic-field. Right: resonance near 70nT (blue lower curve) and 140nT (red upper curve). These\nresonances have different width for the same (nonzero) laser power because different polarization components\nparticipate the resonances.\nIt can be seen that, the 70nT and 140nT resonances have nearly the same zero-power\nresonance of about 1Hz (full width at half maximum), which indicates that the 1Hz is not\ndominated by field inhomogeneity from the coils (otherwise the 140nT resonance’s zero-power\nwidth would be about twice that of the 70nT resonance), but dominated by spin exchange at\nroom temperature [In literature, Phys. Rev. Lett. 81, 5788 (1998), a similar measurement was\nmade for 85Rb]. We note that, the zero-field resonance has a larger zero-power linewidth,\nbecause it is dominated by field inhomogeneity from the ambient field whose effect is greatly\nreduced when there is a much larger field (for instance for the 70nT and 140nT case). It has\nbeen established in literature that, the existence of a relatively large field can suppress the\ndephasing effect due to ambient field inhomogeneities [for example, see Phys. Rev. A 72,\n023401 (2005); Phys. Rev. A 79, 043815 (2009)].\nWe emphasize that, here motional averaging in wall-coated cell has played an important role\nin mitigating the line broadening effect due to magnetic field inhomogeneities of the ambient\nand the coils. Using a commercial fluxgate magnetometer, we measured the ambient field\ninhomogeneity inside the shields within the vapor cell volume, and found it to be about 1nT.\nMoreover, our test coils are carefully designed and the fractional inhomogeneities within the\ncell is calculated to be about 8/1000, which means that for a 140nT field, the inhomogeneity is\nabout 1nT. According to the g factor of 87Rb, field inhomogeneity of 1nT within the cell should\ncorrespond to 14 Hz of broadening (full width) in our NMOR zero-power width if there is no\nmotional averaging, but experimentally we extracted a zero-laser-power FWHM (full width at\nhalf maximum) of 1Hz (non-zero-field resonance) and 2Hz (zero-field resonance), indicating\nthe effect of motional averaging. The quality of the alkene coating determines the extent of\nmotional averaging of the inhomogeneous magnetic field. The coating’s quality varies from cell\nto cell because of the somewhat uncontrollable chemical process, so the associated line\nbroadening can only be measured and there is no theoretical value available. The 16Hz\nreported in page 5, 2nd column is the FWHM (full width at half maximum) of the EIT resonance\nat 20\\mu w input laser power, i.e., this is a power-broadened linewidth.\nIn the revised manuscript, we have added a sentence about power broadened width of 16Hz\nwhere the 0.5Hz (now 1Hz full-width at half maximum) width was first mentioned. We also\nadded some information about the ambient field, coil field and motional averaging.\nPage 4\n*caption of fig.2*\na) range->depth (?)\nResponse: Here 400MHz is not the modulation depth but twice the frequency modulation\namplitude, i.e., 400MHz is the range through which the laser frequency is swept during the\nfrequency modulation. In the revised manuscript, we added a note “or, modulation amplitude of\n200MHz”.\nb) 200MHz red detuned: how is this value selected/determined? Why?\nResponse: The center frequency of the laser is optimized for the NMOR signal. It is red detuned\nto partially avoid the influence the 87Rb D1 |F =2〉→|F' =2〉transition, whose dark state (a\nlinear superposition of the ground states) is orthogonal to that of, or is the bright state for, the\n87Rb D1 |F =2〉→|F' =1〉transition due to different signs in the C-G coefficients. In the\nrevised manuscript, we have added two references [Phys. Rev. A 73, 053404 (2006); Appl.\nPhys. Lett. 119, 054001 (2021)] where such optimization of laser detuning has been applied\ntoo. The value of the optimized detuning depends on laser power, Doppler broadening etc.\nc) X is the in-phase quadrature and Y is the out-of-phase quadrature: with the usual terminology\nthis should be probably reworded as:\n\"X is the in-phase signal and Y is the quadrature signal.\"\nResponse: We thank the referee for pointing this out. We have adopted the suggested\nterminology in the revised manuscript.\nd) \"...curve corresponds to the red (blue) y-axis\":\nthis should probably be reworded as \"to the X (Y) = in phase (in quadrature) signals\"\nResponse: We thank the referee for pointing this out. We have made the change as suggested.\n*Therefore, relying on the master equation theory model in establishing the relation between\nthe signals and the B field parameters is generally not suitable, while the NN can provide a\nbetter solution.*\nThis sentence clarifies and puts in evidence a crucial weakness of the proposed methodology.\nIf I understand correctly, this means that the ML approach enables measurements despite the\nfield imperfections, because the system is trained with a set of magnetic field values\nhaving the same inhomogeneities that will characterize the fields to be measured. If so, such a\ndevice could only measure fields applied (inside the shield) by the same coils used to generate\nat the training stage. In this sense, it will not be a magnetometer, but an amp-meter measuring\nthe current flowing in those coils.\nResponse: We understand this concern, but we think there is a misunderstanding here, mainly\ndue to the lack of details in our previous manuscript. Below we give an in-depth description of\nthe major factors accounting for the discrepancy between the master equation simulation and\nthe experiment. These factors have also been listed in the revised manuscript.\nFirst of all, we emphasize that, due to motional averaging in our wall-coated vapor cell, the\ninhomogeneities in the field from both the coil and the ambient cause negligible line broadening,\nin particular, less than 1Hz for the resonance near 140 nT which we use for the magnetometer\ndemonstration. As evidence, we obtained the same zero-power width of 1Hz for the 70nT and\n140nT resonance (Fig.R1 above), which indicates that field inhomogeneities from the coils are\nnot a concern for the magnetometer demonstrated here. Detailed analysis and the figures on\nthe zero-power linewidth is in our response (surrounding Fig.R1) to the referee comment on\nthis regard.\nSecondly, we point out that it is the following three factors that mainly account for the\ndiscrepancy between the computed and the measured NMOR spectra.\n(1) Demodulation phases in the phase sensitive detection. In our experiment, there is phase\nlag between the signal driving the laser’s frequency modulation (through the laser’s PZT,\ni.e., Piezoelectric Transducer) and the output optical rotation signals’ oscillation; also, our\nlock-in amplifier uses the PZT’s driving signal as the external reference and the default\ndemodulation phase is set to be zero. Therefore, the theoretical demodulation phase is\nunknown, and is adjusted in the model to best match the measured lineshapes. Because\nthe lineshape is also affected by other factors (see below (2) and (3)), the demodulation\nphase cannot be accurately identified. We show below both experimentally and\ntheoretically that a change in the demodulation phase can alter the lineshape of the in-\nphase and quadrature signals\nFig.R2 Experimental comparison between resonance lineshapes at two demodulation phases with 60o difference.\nFig.R3 Theoretical comparison between resonance lineshapes at two demodulation phases with 60o difference.\n(2) Polarization imperfection of the input light. Since the NOMR lineshape is the result of the\ninterference of many Lambda-type EIT as shown in Fig.1 of the main text, both the phases\nand amplitudes of the σ+ , σ− and π polarization components matter. The front glass\nwindow of the vapor cell can cause a small unknown polarization change to the input light,\nso using the polarization state measured before the cell in the simulation can lead to\ndiscrepancy with the experiment result. We show both experimentally and theoretically that\na small change in light polarization does lead to lineshape change.\nFig.R4 Experimental comparison between resonance lineshapes when the input laser’s polarization direction is\naltered by 3 degrees (a rotation of 6 degrees about the z-axis on the Poincare sphere).\nFig.R5 Theoretical comparison between resonance lineshapes when the input laser’s polarization direction is\naltered by 3 degrees (a rotation of 6 degrees about the z-axis on the Poincare sphere).\nFig.R6 Modified simulation results compared to the experiment results in Fig.2 of the main text. In contrast to the\ntheory plots in Fig.2, here a combined adjustment of demodulation phase (about 20 degrees) and light polarization\n(ellipticity change, 4 degrees rotation on the Poincare sphere) has been done. It can be seen that the resonance on the\nright has an improved match between theory and experiment, compared to that in Fig.2.\n(3) The dual-structured resonance lineshape characteristic to wall-coated cells. This alters the\nNMOR resonance (used for magnetometry) lineshape and makes the absolute values of\noptical rotations hard to compute precisely. As extensively investigated in literature, in\ncoated cells the EIT or NMOR resonance lineshape [References: Laser Photonics Rev. 6,\n333 (2012); Phys. Rev. Lett. 81, 5788 (1998)] has a narrow structure on top of a broad\npedestal, where the linewidth of the latter is transit broadened and the former is determined\nby the multiple-pass interactions when atoms cross the laser beam multiple times with\nretained atomic coherence upon wall collisions. The pedestal level is determined by the\nrandom trajectories of all the atoms (which is unknown due to the unknown distribution of\nthe coating on the wall) and can be only semi-quantitatively described with simplified model\nor Monte-Carlo simulations [References: Nat. Phys. 12, 1139 (2016); Chin. Phys. B 22,\n033202 (2013)]. Also, upon each wall collision, the change in both the external (such as the\nvelocity) and internal state (such as the ground state spin) of the atoms is hard to accurately\nmodel.\nHere we show the dual-structured EIT and NMOR spectra from literature, as well as the\nNMOR spectra from our experiment. It can be seen that the NMOR spectra’s tilted broad\npedestal can change the lineshape of the narrow structure part, especially the resonance\non the side which is used for magnetometry here. The NMOR spectra from our master\nequation simulation do not have the pedestal because the atomic motion and wall collisions\nare not considered.\nFig.R7 Dual-structured lineshapes in coated cells from literature. Left: EIT spectrum in a paraffin coated\ncylindrical cell with 2.5 cm in diameter and 7.5 cm in length [Ref: Chin. Phys. B 22, 033202 (2013)]. Right: NMOR\nspectrum in a paraffin coated spherical cell with diameter of 10 cm [Ref：Phys. Rev. Lett. 81, 5788 (1998)]. Note:\nfor a similar coating quality, the larger the cell, the smaller the linewidth of the narrow-structure, which can be\nexplained by a Ramsey-narrowing model [Ref: Optics Express 16, 14128 (2008)]. Also, the alkene wall-coating [Ref:\nPhys. Rev. Lett. 105, 070801 (2010)] used here has a better relaxation-preserving capacity than the paraffin coating.\nFig.R8 Our measured NMOR spectra. The five peaks in the upper four-figure set are all the narrow structures, and\nthe tilted base is part of the broad pedestal (see the lower four-figure set) which is not detected in full due to the\nlimited current range of our low-noise current supply. There are five peaks because the laser frequency is being\nmodulated here, and the laser sideband frequency component can form Lambda configuration with the central\nfrequency peak, as shown in Fig.1 in the main text. In the lower four-figure set, the five narrow resonances in the\nmiddle do not show properly due to limited points in the sweeping magnetic field.\nFinally, we would like to make a general remark on the test coil. Here, the coils surrounding the\natomic vapor cell are TEST coils which are used to produce the “to-be-measured” B fields and\nalso to characterize the response of the magnetometer; They are widely used in the field of\nmagnetometry in a similar way to us: the response of the atomic sensor to known magnetic\nfields produced by the coils is measured as a calibration, and then an unknown field from these\ncoils is measured to check the efficacy and sensitivity of the magnetometer. We have added\ncitations to some representative works from leading groups who used test coils in this way [Appl.\nPhys. Lett. 85, 4808 (2004); Nature 422, 596 (2003); Phys. Rev. A 65, 055403 (2002); Appl.\nPhys. Express 14 066002 (2021)]. In our experiment, establishing the map between the optical\nrotation signals and the B field parameters can be viewed as a generalized version of\nmeasuring the response of the magnetometer, which is analogous to the “slope” measurement\nin a single-parameter sensing problem. Thanks to the motional averaging enabled by the alkene\nwall-coating, the coil fields’ inhomogeneity has been averaged out in our experiment system.\nHowever, in normal vapor cells without wall coatings, to avoid the “amp meter issue” raised by\nthe referee, one should use either a smaller vapor cell or larger test coils, so that the fields\nproduced by the test coils, as well as by unknown targets, are all uniform across the volume of\nthe cell. Such a practice of applying uniform field for testing should apply to magnetometers\nbased on ANY scheme.\nIn conclusion, it is generally the case that, in vapor cell experiments, the master equation\nsimulation cannot be used to establish a precise quantitative relation between the observable\nsignals and the target parameters, due to various complicated conditions hard to characterize\nprecisely in a real experiment, thus cannot be included precisely in a simulation. Even without\nany field inhomogeneities, the difference between the calculated and the measured optical\nrotation spectrum can still exist because of reasons listed above. Therefore, the ML and NN is\nneeded to establish the precise map between the observable set and the parameter set,\nespecially in a multiparameter sensing scenario with compact design where the one-to-one\ncorrespondence between a signal and a parameter (i.e., direct encoding) may not be available.\nIt is precisely the innovative contribution of this work to propose that, one can use ML to\nestablish the complex observables-parameters relation in compact multiparameter sensing,\nand we believe that our methodology can inspire researchers to simply their sensing experiment\nby adopting indirect encoding with the aid of ML and NN.\nIn the revised manuscript, we have given a more comprehensive list of reasons that contribute\nto the discrepancy between the spectra measured and calculated by master equation. We have\nalso provided information on field inhomogeneities from the ambient and the coils.\nrelu (ReLU): the acronym should be defined\nResponse: We have defined the acronym in our revised manuscript. ReLU means “rectified\nlinear unit”.\nPage 5\n*the NMOR signals are insensitive to the variation of phi, making the NN difficult to converge.*\nthis issue is real, it is set by the physical nature of the system: the \"difficulty to converge\" is\nactually due to information that is not contained in the acquired data. This implies that, under\nsome geometries (B and k nearly aligned), the actual instrumental resolution is much worse\nthan what is declared (e.g. in the 2nd column), and this is not dependent on the approach used\nto analyze the magnetometric signal.\nResponse: We agree with the referee on this point. When B⃗ and k⃗ are nearly aligned, our\nmagnetometer scheme is not sensitive to the variation of \\phi. We have thus revised this\nsentence to “the NMOR signals are insensitive to the variation of \\phi when B is nearly aligned\nwith k”。\nHowever, in the revised manuscript, we propose to use a three-pass single-beam configuration\nto solve this problem. We have added this proposal and numerical calculations with plots in the\nsupplementary material. This idea can be implemented in future experiments using vapor cells\nwith internal reflection mirrors.\nThe paragraph in the first half of the second column is unclear or very hard to understand. It\nlikely requires a complete reformulation.\nResponse: This paragraph describes the process about how we get the sensitivity of vector\nmagnetometer from NN. Essentially, the time traces of the optical rotation\nsignal (X (t),Y(t),X (t),Y(t)) is collected at a sampling rate of 900/s and is converted into\n1 1 2 2\ntime traces of predicted parameter (B(t),θ(t),φ(t)) via the NN. By fast-Fourier-transformation\n(FFT) of the predicted parameter time traces (B(t),θ(t),φ(t)), one can obtain the sensitivity\nfor each polar component of the magnetic field.\nWe have rewritten this paragraph as the following: “We continuously record the signal set of\noptical rotations (X ,Y,X ,Y) for about one minute at a sampling rate of 900 per second for\n1 1 2 2\neach fixed B⃗ , and the signal set at each time point is fed to the NN which then outputs the\npredicted parameter (B,θ,φ) . Consequently, the four time traces of the signals\n(X (t),Y(t),X (t),Y(t)) are converted into the three time traces (B(t),θ(t),φ(t)). We then\n1 1 2 2\nperform fast-Fourier-transform (FFT) on B(t),θ(t),φ(t) respectively, and obtain their\nsensitivities, where the frequency response of the magnetometer has also been considered\nand was acquired from the experiment with the aid of a NN [54] using a similar approach as\ndescribed here.”\nPage 6\n*We applied a small AC magnetic field at 11 Hz to slightly vary (B, theta, phi)*\n11Hz is not << the 16Hz bandwidth mentioned in page 5, thus one expects that the system\nresponse is no longer that measured under DC condition at the training stage: either the training\nshould be made also under dynamic conditions, or the frequency range in which the DC training\nis assumed to be valid should be defined better.\nResponse: We thank the referee for pointing out this omission. As we have mentioned in our\nmanuscript “We applied a small AC magnetic field at 11Hz to slightly vary (B,θ,φ), and NN is\ntrained in the parameter space near B ≈140nT ……”. Indeed, we made the training under\ndynamic conditions. We have rewritten this sentence to make it clearer: “We applied a small\nAC magnetic field at 11Hz to slightly vary (B,θ,φ), and NN is trained for the AC field in the\nparameter space near B ≈140nT……”.\n*DISCUSSIONS* -> *DISCUSSION*\nThis section seems more a \"conclusion\" than a \"discussion\".\nQuantitative assessments would be expected in a discussion: as an example, the sentence\n\"...the neural network, and achieve good sensitivities on field amplitude...\" should be made\nquantitative, replacing \"good\" with a number.\nResponse: We have heavily revised this section. We replaced “good” with numbers. In addition,\nwe have added a full paragraph as general remarks on how to apply machine learning in other\ntypes of multi-parameter magnetometers and atomic sensors: “Our strategy of using machine\nlearning to simplify the structure of vector NMOR-magnetometers can be extended to other\ntypes of atomic magnetometers, as well as multiparameter sensors in general, using the\nfollowing procedure: (1) Identify a set of observables which are sensitive to the target\nparameters and can be simultaneously, if possible, recorded in the experiment. The rich\ndegrees of freedom in the interrogating laser or broadly the electromagnetic field, for example\nthe amplitude, polarization, spatial modes, frequency spectra etc., can be all used for encoding\nthe information indirectly and compressively. (2) Stabilize the experiment system as a\nprerequisite for a robust map between the observable set and the parameter set. (3)\nExperimentally collect data within a suitable range of target parameters and perform the neural\nnetwork training to build the map between signal set and parameter set. The NN structure is\nchosen according to the complexity level of the problem, and overfitting should be avoided. (4)\nConduct real measurements using the trained NN.\n”\n*The bandwidth of the magnetometer can be increased by broadening the\nresonance with higher laser power.*\nOne would expect that after increasing the signal by means of cell heating, the spin exchange\nwould make the resonance broader with no need of using power broadening. And noticeably\nthis will rapidly lead to increase the signal amplitude, but not to enhance the sensitivity. As a\ngeneral remark, such \"technical\" improvements should be made before collecting data for\npublication: I strongly suggest to apply NN and ML to already optimized magnetometric signals.\nResponse: In fact, our magnetometer results reported in the manuscript have already been\noptimized for our physical system, in terms of the sensitivities and balanced performance along\nthree orthogonal directions, where the optimization parameters include the laser power, laser\nfrequency detuning, laser modulation parameters, laser polarization, and in addition, we have\nused laser frequency lock and laser intensity lock to stabilize the system. As pointed out by\nreferee #2,“The vector sensitivities reported are near the state of the art but are not notable by\nthemselves.”\nWe agree with the referee that broadening the resonance by power broadening or spin\nexchange may increase the signal but not the sensitivities. Currently, our magnetometer is\noptimized for sensitivities, not for bandwidth. In fact, at higher laser power, although the\nbandwidth of the magnetometer is increased, we observed worse sensitivities because the\ndecrease in the resonance slope (due to power broadening) overwhelms the increase in the\nsignal amplitude. Regarding cell heating, our vapor cell cannot be heated because the alkene\nwall-coating melts near 30 degrees. Therefore, our present experimental system is more\nsuitable for relatively low frequency field measurements.\nIn the revised manuscript, we have removed the sentence “The bandwidth of the magnetometer\ncan be increased by broadening the resonance with higher laser power” and instead we now\nrefer to other physical systems that can have higher bandwidth (with spin exchange and high\ntemperatures), since different systems have different strength and it is not the focus of this work\nto realize an all-purpose magnetometer.\nIn ref.7,the name Munoz requires a tilde.\nResponse: Thanks for pointing this out. We have corrected it in the revised manuscript.\nReferee#2\n----------------------------------------------------------------------------------------------------------------------\nThe manuscript reports on an atomic vector magnetometer in a single optical beam geometry\nthat uses an artificial neural network (NN) to map four simultaneous NMOR resonance signals,\nnamely the in-phase and out-of-phase quadrature components at the modulated frequency and\nsecond-harmonic, to the magnetic field strength and direction with 100 fT/rt[Hz] and 100\nuRad/rt[Hz] sensitivities. The authors demonstrate these results with a 140 nT field generated\nby a calibrated 3D coil system. This work is noteworthy because the vector information is\nacquired simultaneously in a single shot with a single beam geometry, which simplifies the\nsensor architecture compared to current vector magnetometers.\nThe quality of the data presented here is excellent and support the reported results. The paper\nis well-written, except for minor comments below, and previous work is properly cited. Together\nwith the supplementary material, this manuscript gives all the necessary experimental and\ntheoretical details. The vector sensitivities reported are near the state of the art but are not\nnotable by themselves. In addition, the NMOR techniques are also standard and the NMOR\nsignals used in this work have been historically reported by Budker’s group to be useful for\nvector magnetometry. The main innovative step in this work is to apply a NN to properly map\nthese NMOR signals to the magnetic field vector parameter space.\nBy using ML to effectively simplify the sensor’s architecture, this work will surely impact the field\nof atomic magnetometry. For vector magnetometers a simpler architecture means the sensor\nis less prone to drifts and can be more compactly designed. This work may also be of interest\nto other disciplines outside of magnetometry that require multi-parameter sensing.\nIn view of the above, I recommend this paper for publication with some minor comments and\nsuggestions below:\nResponse: We thank the referee for an overall positive assessment of this work.\n- I suggest that the font size in the figures should be increased for better readability. This is\nespecially true for the plot axes in Figures 2,3,4\nResponse: We thank the referee for pointing out this problem. We have fixed it in the revised\nmanuscript.\n- In Sec. II, second paragraph “..weights updated using [the] gradient descent algorithm…”\nResponse: We have added “the” in this sentence.\n- The “relu” function in Sec. IV paragraph three is often written as “ReLU”.\nResponse: We have changed “relu” to “ReLU”.\n- Often there is a missing “the” before “NN”. E.g. in last paragraph of sec. IV “… is in good\nagreement with those given by [the] NN method”.\nResponse: We have added “the” in front of all “NN” in the manuscript as needed.\n- In Fig. 4 b1, I suggest writing something like dB instead of just B since it is a change of the\nmagnetic field value that you are plotting here.\nResponse: In the revised manuscript, we have made the suggested change in Fig.4 b1.\n- Revise grammar and wording in the sentence “The predicted vector…method” of the last\nparagraph of section IV.\nResponse: We have revised the original sentence “The predicted vector components of B⃗\nare consistent with the true values and the size of the error bars (standard deviations) indicates\nthe sensitivity which is in good agreement with those given by NN method.”\nIt now reads “The predicted changes in the vector components of B⃗ are consistent with\nthe true values, as shown in Fig.4b where the sizes of the error bars (standard deviations)\nindicate the sensitivities, which agree with those given by the NN-aided noise analysis shown\nin Fig.4a.”"}, {"round": 2, "reviewer_comments": {"reviewer_1": "I have read the revised version of the manuscript entitled \"Machine Learning Assisted Vector Atomic Magnetometry\" by Xin Meng et al.\nI confirm my opinion expressed at the first round review, about the rather specialistic content and\nabout the scarce innovativity in terms of scientific knowledge. On the other hand, I do understand\nthe opinion expressed by the Rev.2, which is used by Authors to demostrate the innovativity of\ntheir work and the possible existence of a broad readeship interested in the technical approaches\npresented in the paper. The different (opposite) conclusions are actually a rather subjective matter\nthat seems quite related to the general editorial policy.\nIn this sense, if the work will be considered worth of being published thanks to the techniques\nproposed and presented, despite the lack of evident scientific innovativity, I would consider such a\ndecision consistent and correct.\nIn such a case, I wish just to point out a few residual adjustments aimed to improve the paper\nquality, most of which are of editorial relevance.\na) The title of sec.III should likely be \"Experimental setup\"\nb) The title of sec.V should likely by \"Discussion\" (singular)\nc) There are minor typos, e.g. a an anomalous font for a \"(\" 8 lines after Fig.4, several instances of\nanomalous quote symbols in the Supplemental material: the initial and final \" use different fonts.\nd) The equation 2 in the supplemental material requires to be enlarged and probably split, because\nin the current version it is barely readable."}, "author_response": "Dear editor ,\nWe would like to thank you and the referees for the hard work on reviewing our manuscript, and for the\nsupport of publishing this work. We have made all the necessary changes in the manuscript, including the\neditorial ones and those suggested by the referee.\nSincerely,\nYanhong Xiao\n-------Below please find our point-by-point reply (in blue) to the referee report----\nReviewer #1 (Remarks to the Author):\nI have read the revised version of the manuscript entitled \"Machine Learning Assisted Vector Atomic\nMagnetometry\" by Xin Meng et al.\nI confirm my opinion expressed at the first round review, about the rather specialistic content and about the\nscarce innovativity in terms of scientific knowledge. On the other hand, I do understand the opinion expressed\nby the Rev.2, which is used by Authors to demostrate the innovativity of their work and the possible existence\nof a broad readeship interested in the technical approaches presented in the paper. The different (opposite)\nconclusions are actually a rather subjective matter that seems quite related to the general editorial policy.\nIn this sense, if the work will be considered worth of being published thanks to the techniques proposed and\npresented, despite the lack of evident scientific innovativity, I would consider such a decision consistent and\ncorrect.\nIn such a case, I wish just to point out a few residual adjustments aimed to improve the paper quality, most\nof which are of editorial relevance.\nReply: We thank the referee for supporting publishing the work. The presentation of the paper has been\ngreatly improved thanks to all the comments by the referee.\na) The title of sec.III should likely be \"Experimental setup\"\nReply: The title has been changed to “Experimental setup” as suggested.\nb) The title of sec.V should likely by \"Discussion\" (singular)\nReply: The title has been changed to “Discussion” as suggested.\nc) There are minor typos, e.g. a an anomalous font for a \"(\" 8 lines after Fig.4, several instances of anomalous\nquote symbols in the Supplemental material: the initial and final \" use different fonts.\nReply: We thank the referee for pointing out these typos. We have fixed them.\nd) The equation 2 in the supplemental material requires to be enlarged and probably split, because in the\ncurrent version it is barely readable.\nReply: We thank the referee for pointing out this problem. We have rewritten this equation and it is now of\nnormal size."}]

Decision letter