Neural network-aided optimisation of a radio-frequency atomic magnetometer

: Efficient unsupervised optimisation of atomic magnetometers is a requirement in many applications, where direct intervention of an operator is not feasible. The efficient extraction of the optimal operating conditions from a small sample of experimental data requires a robust automated regression of the available data. Here we address this issue and propose the use of general regression neural networks as a tool for the optimisation of atomic magnetometers which does not require human supervision and is efficient, as it is ideally suited to operating with a small sample of data as input. As a case study, we specifically demonstrate the optimisation of an unshielded radio-frequency atomic magnetometer by using a general regression neural network which establishes a mapping between three input variables, the cell temperature, the pump beam power and the probe beam power, and one output variable, the AC sensitivity. The optimisation results into an AC sensitivity of 44 fT/ √ Hz at 26 kHz.


Introduction
Atomic magnetometers (AMs) [1] have emerged as a key technology for a wide range of applications, from low-field nuclear magnetic resonance [2] to nuclear quadrupole resonance detection [3] and electromagnetic induction detection [4][5][6] and imaging [7][8][9].Extreme sensitivity, room-temperature operation and potential for miniaturization are some of the distinguishing features of atomic magnetometers which allow them to successfully compete with rival technologies such as superconducting quantum interference device magnetometers.Sub-fT/ √ Hz sensitivities were reported for atomic magnetometers in shielded environment [3,10,11].Ongoing progress in the operation of AMs in unshielded environment has already led to sensitivities better than few tens fT/ √ Hz in the presence of magnetic noise [12,13].Commercial AMs have reached a miniaturization level which allows their deployment in large arrays, with application in magnetocardiography [14] and magnetoencephalography [15].
High-sensitivity detection with atomic magnetometers requires careful optimisation of the operating parameters, such as the lasers intensities and detunings and the atomic vapour temperature.Such an optimisation is a lengthy process which may prevent the use of atomic magnetometers without human supervision, especially when re-tuning due to changes of e.g.operating frequency is required.There is thus a need for procedures which allow for efficient automated optimisation of atomic magnetometers not requiring human supervision.Previous work [16] demonstrated the use of uniform design (UD) techniques to efficiently map the parameter space of an atomic magnetometer, so to minimise the cost of data acquisition in an automated optimisation procedure.In the same spirit, efficient calibration of the triaxial coils in atomic magnetometers was achieved using particle swarm optimisation algorithms [17].While the work on UD techniques [16] successfully defined a strategy for optimal mapping of the parameters space, automated optimisation of atomic magnetometers requires also a robust approach to the extraction of the optimal operating parameters from a small set of measurements.Here we address this issue and demonstrate the use of general regression neural networks (GRNNs) [18,19] to derive from a small set of data the optimal parameters for the high-sensitivity operation of an atomic magnetometer.The general regression neural network offers an accurate and efficient mapping of data of small sample size, thus ideally suited to the problem at hand.We also considered widely used Back Propagation (BP) and Radial Basis Function (RBF) neural networks [20].However, due to BP fixed learning rate, its convergence is slow and a longer training time is required.GRNN, as a variant of RBF, was preferred for its strong nonlinear mapping and fast learning capabilities.
In this work, GRNN was used to build a mapping model between three input variables, the cell temperature, the pump beam power and the probe beam power, and one output variable, the AC sensitivity.This will form the basis of an unsupervised optimisation of atomic magnetometers.
As a specific case study, we consider in this work the optimisation of an unshielded radiofrequency atomic magnetometer (RF-AM) at a low frequency of 26 kHz, as appropriate for electromagnetic induction imaging applications which require penetration through barriers, such as in security and surveillance [21].However, the presented approach is general and allows for an efficient optimisation through the entire operational range of the atomic magnetometer.It is also applicable to different types of atomic magnetometers, for an appropriate choice of the input parameters.

Experimental setup
The RF-AM [22] considered in this work is based on a counter-propagating pump beam and a double-pass probe configuration.The experimental set-up is essentially the same as the one described in our previous work [13], and only the main features will be reported here, together with the modifications introduced with respect to the previous set-up.The sensing unit in this RF-AM is a 25 × 25 × 25 mm 3 quartz vapour cell filled with isotopically enriched 87 Rb and 40 Torr of N 2 as buffer and quenching gas.The cell can be heated so to reach a higher atomic density, with the help of six heating pads.The AC heater has a modulation frequency of 51 kHz and is turned off during the measurement so to prevent generation of additional stray magnetic field noise.
Figure 1 shows the optical set-up.The atomic sample is polarized by the application of a 13 mm diameter circularly polarized pump beam propagating along the z-axis, locked to the 87 Rb D1 line F = 1 → F ′ = 2 and amplified by a tapered amplifier (TA).An acousto-optical modulator (AOM) is used for control of beam intensity.The pump-beam is reflected back with the help of a flat mirror so to improve the uniformity of the atomic polarisation [3,23].This is important as a high density of the atomic vapor is required to achieve high sensitivity.However, the large density of the atomic vapor leads to strong absorption of the pump beam and generates a gradient of the atomic polarization, which degrades the sensor's sensitivity.In our experiment this is counteracted by adopting a counter-propagating pump configuration.The atomic precession is driven by a RF field provided by a pair of Helmholtz coils symmetrically located with respect to the cell and having their axis aligned to the y-axis.The spin precession is readout by a linearly polarized probe beam approximately 4 GHz blue detuned from the F = 2 → F ′ = 3 87 Rb D2 line transition.We note that the probe light frequency is not included as a variable factor in the modelling because the probe detuning can only assume four discrete values in the current setup, hence the detuning is pre-set to its optimal value.The probe beam is sent back to the cell a second time by a mirror positioned close to the cell and the probe beam size is decreased to 9 mm diameter to prevent clipping on the heater window.The optical rotation is monitored by a balanced photodiode and demodulated by a lock-in amplifier (LIA).Neutral density filters are added in front of the polarimeter to avoid saturation of the photodetector.
Active stabilisation along the directions of the bias and probe beams was performed on the unshielded RF-AM.Two fluxgate magnetometers (Stefan-Meyer, FLC3-70), symmetrically displaced along the y axis (the RF field direction) with respect to the atomic vapour cell, are used to monitor the ambient magnetic field.The distance between each fluxgate center and the cell center is 97.5 mm.For a given axis, the average value of the magnetic fields measured by the two fluxgates is taken as an approximation of the magnetic field at the centre of the cell, and used for the stabilisation loop.Compensation of the y-axis ambient magnetic field was performed by manually varying the current in the relevant Helmholtz coil pair so to minimise the magnetic resonance frequency.Three anti-Helmholtz coil pairs were used to cancel magnetic field gradients by minimising the magnetic resonance linewidth.

GRNN methodology for optimisation of an RF-AM
The general regression neural network considered in this work establishes a relationship between input and output variables by calculating the output value with the greatest probability given the input variables [18,19].This approach does not require a prior knowledge of the functional relationship between input and output variables, and the probability density required for the computation can be determined from a sample of observation.We recall here the basic principles of the GRNN methodology before applying it to the specific case of interest.
We assume X i and Y i to be the observed values of the random variables x and y, with n the number of sample observations, p is the dimension of the vector variable x and w is the width of the sample probability, usually named as the smoothing parameter.Then the probability estimator f (X, y) of the sample data set {X i , Y i } n i=1 can be obtained via the Parzen Window estimation technique [24].The probability distribution then leads to the estimator where Ŷ(X) is the weighted average of all of the observed values Y i , each weighted exponentially according to the Euclidean distance between X and X i .
As shown in Fig. 2, the structure of GRNN consists of four parts, the input layer, the pattern layer, the summation layer and the output layer [18].The sample set X = [x 1 , x 2 , . . ., x p ] T is input to the network and the set Y = [y 1 , y 2 , . . ., y k ] T is the network output.In the input layer of GRNN, the number of neurons is equal to the dimension of the input variable x.The input variables are directly transferred to the pattern layer by neurons.In this paper, three input variables were considered: the cell temperature, the probe power and the pump power.For a given geometry, i.e. for given sizes of the beams, these three variables determine the performances of the magnetometer, and specifically its sensitivity.The network consists of four layers: the input layer, the pattern layer, the summation layer and the output layer.The GRNN establishes a mapping between three input variables, the cell temperature, the pump beam power and the probe beam power, and one output variable, the SNR.
The number of neurons in the pattern layer P i = e −D i , (i = 1, 2, . . ., n) is n, which is equal to the number of samples used for training.
The summation layer calculates the sum of inputs from the previous layer, both with and without the weighting ratio: Finally in the output layer, the number of neurons equals the dimension of the output set Y. In this work, different networks were built for different output response variable: the signal-to-noise ratio (SNR), the DC sensitivity, and the half width at half maximum (HWHM) of the magnetic resonance.The transfer function of the output layer is: The function mapminmax in MATLAB was used before building the network to normalise input values to be within the range of [−1, 1], so to avoid large network prediction error due to the large magnitude difference between input and output variables.All neurons in the hidden layer of GRNN adopt the same smoothing factor, so the establishment of network model only needs to determine w that generates the best prediction.We scanned the values of w between 0.1 and 2 with a step size of 0.1 and built the network using the MATLAB function newgrnn.Then the output data of the network were converted back into the unnormalized units by the function postmnmx.The suitable w is chosen based on the mean square error of each network.

Results of optimisation via GRNN
As discussed before, we consider the GRNN optimisation of the RF-AM sensitivity at 26 kHz.The AC sensitivity is defined as: where B RF is the RF field applied for calibration purposes and RBW is the resolution bandwidth.
Then the RF level (B RF ) was fixed at 18.7 nT rms .This value of the amplitude of the RF field was determined by minimizing the ratio between the magnetic resonance linewidth and the magnitude of the signal [25,26].We used the SNR to examine the AC sensitivity (δB AC ) as in any optimisation B RF and resolution bandwidth RBW would be fixed for each operating frequency.The signal-to-noise ratio is SNR=S/N, where S is the square root of the maximum value of the power spectrum density (PSD) measured with RF field on and N is the square root of the mean value of the noise power spectrum density with the RF field turned off.Typical noise spectra are reported in Fig. 3.The search space contains five temperature points from 60 to 120 • C, five probe power points from 0.255 to 0.618 mW, 17 pump power points from 3.043 to 77.1 mW.For a given parameter, data points are equally spaced in the considered interval.Some additional measurements were taken at the temperature of 130 • C, and at the probe power of 4.618 mW to explore the temperature which was seldom used in this RF-AM.The full sample contains 434 data, 6/7 of which were randomly selected and used for training and the remaining constituted the blind data set used to assess the goodness of the network, by first predicting the SNR and then comparing the obtained value with the real results.
Several different measures of goodness of GRNNs have been used in different contexts [27,28].In the present work, we consider both the passing rate Q10 and the average error rate E r , as described below.The passing rate Q10 is the fraction of data in the test sample satisfying a certain constraint condition.Here a data is considered as passed when the relative error E r i between the prediction and the actual value is not greater than 10%.The other measure we used to quantify the goodness of the network is the average error rate E r , which is the relative error E r i between the prediction and the actual value averaged over the test sample.
We built two neural networks of different temperature ranges (from 60 to 120 • C and from 60 to 130 • C).Their passing rates and average error rates are shown in Table 1.Though the target of optimisation is the AC sensitivity, or equivalently the SNR, the passing rates of HWHM and DC sensitivity are also listed for comparison.By analyzing the passing rates in Table 1, we observe that building networks for output response variables separately were generally better than for all of them together in the same network.
The GRNN corresponding to the second row, highlighted in boldface, of Table 1 was selected to perform the optimisation of the atomic magnetometer for its high passing rate.Figure 4 compares the measured SNR and the predicted SNR obtained from the selected neural network over the blind data set at three different temperatures.The agreement is excellent over the entire blind data set.Our approach does not rely on any pre-selection of the starting point of the optimisation.Instead, the entire parameter space is examined by the procedure.The selected network is used to predict 41 3 points of SNR in the full range of the search space with finer steps to find the optimum under the attainable experimental conditions.The predicted value for the optimum SNR is reported in Table 2 together with the corresponding values of the input parameters.We then performed measurements of the SNR using the parameters corresponding to the prediction of the best SNR.The value for the measured SNR, also reported in Table 2, is in good agreement with the predicted value.This validated our approach.Further confirmation was obtained by taking additional measurements at temperature slightly lower and higher (116 and 120 • C respectively) than the optimum value, with worse SNR as expected.Table 2 also reports the measured value of the AC sensitivity, at the settings produced by the optimisation procedure.This is the desired outcome of the procedure.An AC sensitivity of 44 fT/

√
Hz at 26 kHz is achieved.This represents an improvement with respect to our past developments [8,29,30] which resulted into an AC sensitivity of around 100 fT/
Previous work [16] has shown that the sensitivity is well described by a nonlinear function of the input variables.Standard nonlinear regression models of SNR were also derived from the same training set of data of the temperature range from 60 to 120 • C, which included different orders (linear, quadratic and cubic) of the involved independent variables.Terms of high order independent input variables and all their combinations were generated manually and input into regression procedures.Specifically, backward stepwise multifactor linear, quadratic or cubic regression models were produced using the software Statistical Product and Service Solutions (SPSS), where manually generated quadratic and cubic terms were used as independent variables along with the original linear terms in a linear regression [16].The adjusted R 2 , the passing rates and the average error rates obtained with standard regression of the same blind data set used for the test of the neural networks, are listed in Table 3.The last column represents the SNR predicted by the corresponding regression model at the same conditions of Table 2.These values are for comparison with the goodness of the neural network.Table 3 shows that a nonlinear model of at least order 2 is required for a good fit to the data, with the one of order 3 offering best performance.This is at variance with the GRNN approach, which shows a more satisfactory passing rate without requiring nonlinear input terms.

Conclusions
This work validates the use of general regression neural networks for the optimisation of atomic magnetometers.The approach is suitable for unsupervised operation of atomic magnetometers due to reduced size of the sample required for the optimisation, and the simplicity and robustness of the procedure which can be fully automated after the training phase of the network.
As a specific case, we considered the optimisation of unshielded radio-frequency atomic magnetometers at low frequency.Low frequency operation is of particular relevance for security and surveillance applications, as well as for industrial monitoring and non-destructive applications due to the increase penetration through barriers in this regime.Previous developments of our group led to an improvement of the AC sensitivity of the RF-AM reaching around 100 fT/

√
Hz at 100 kHz.This work reports further improvement reaching 44 fT/

√
Hz at 26 kHz.The GRNN approach adopted here could be further expanded to include additional parameter variables, e.g. the currents determining the gradient compensation.It is interesting to compare the performance of our optimisation protocol with alternative machine-learning optimisation techniques [31].Reference [31] adopts a closed-loop optimisation protocol, while our GRNNbased optimisation is open-loop, and the sample space only needs to be gone through once to complete the optimisation.Our procedure has thus a significant advantage in terms of optimisation speed, which is crucial in applications where a frequent re-tuning is needed (such as in magnetic induction tomography, with the frequency controlling the penetration depth and thus requiring frequent variations).

2 Fig. 2 .
Fig.2.Structure of GRNN.The network consists of four layers: the input layer, the pattern layer, the summation layer and the output layer.The GRNN establishes a mapping between three input variables, the cell temperature, the pump beam power and the probe beam power, and one output variable, the SNR.

Fig. 3 .
Fig. 3. Signal amplitude spectrum (right scale) and noise amplitude spectral density (left scale) at the optimised point measured at the conditions in Table2.The signal spectrum was measured with RF field turned on while the noise spectrum was measured with the RF field off.

Fig. 4 .
Fig. 4. Comparison of the measured (blue circle) and predicted (red +) SNR from the selected neural network over the blind data set.Temperature was fixed at 60 • C in (a), 90 • C in (b) and 120 • C in (c), separately.