N Gilet

E De Leon

R Gallé

X Vallières

J-L Rauch

K Jegou

L Bucciantini

V Savreux

P Décréau

P Henri

Automatic detection of the thermal electron density from the WHISPER experiment onboard CLUSTER-II mission with neural networks

We have applied self-learning methods to predict the key plasma regions crossed by the 10 CLUSTER-II spacecraft in the Earth magnetosphere using the WHISPER instrument

11

• The extraction of the thermal electron density from WHISPER active (sounding mode) 12 and natural (passive mode) electric field spectra is automatically done in the free so-13 lar wind, in the magnetosheath region and in the plasmasphere 14 • Such automatic procedure could be used for future data processing of electric field ex-15 periments onboard space missions (for instance AM 2 P onboard BepiColombo or MIME

Introduction

The CLUSTER-II mission has been successfully monitoring the plasma bulk properties of the Earth magnetosphere for more than twenty years [START_REF] Escoubet | Cluster -Science and Mission Overview[END_REF]. Launched in July and August 2000, this ESA mission is the first to study the ionized medium in near-Earth space in three dimensions, thanks to a tetrahedral configuration of four identical spacecraft [START_REF] Escoubet | Recent highlights from Cluster, the first 3-D magnetospheric mission[END_REF]. Each spacecraft follows polar orbits around the Earth, with a ∼57 h period. The elliptic orbits have been changed throughout the operations, from a closest perigee at 250 km to a farthest apogee at 120,000 km, which, together with the local time drift of the orbit plane throughout a year allows the spacecraft to cross the different plasma regions of the Earth magnetosphere. The payload is identical for each satellite, consisting of 11 experiments dedicated to the measurements of the surrounding plasma, including five instruments from the Wave Experiment Consortium (WEC, [START_REF] Lefeuvre | The Wave Experiment Consortium. Cluster: Mission, Payload, and Supporting Activities[END_REF]), among which the WHISPER (Waves of HIgh frequency and Sounder for Probing Electron density by Relaxation; [START_REF] Décréau | Whisper, a Resonance Sounder and Wave Analyser: Performances and Perspectives for the Cluster Mission[END_REF])

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics instrument. The WHISPER instrument makes use of the two far double sphere electric antennas either in active (sounding) mode or in passive (natural) mode to characterize the plasma bulk properties such as the thermal electron density, the magnetic field amplitude as well as to provide useful information about the electron velocity distribution function (evdf) [START_REF] Trotignon | How to determine the thermal electron density and the magnetic field strength from the Cluster/Whisper observations around the Earth[END_REF]. In sounding mode, an active spectrum is built on-board by local excitation of the surrounding plasma at a frequency sweeping the 3.5-82 kHz range. In passive mode, the transmitter is switched off and the (electric) antennas are left at floating potential. The instrument becomes a natural wave receiver and spectrum analyser, delivering spectrograms over the 2-80 kHz frequency range [START_REF] Décréau | Whisper, a Resonance Sounder and Wave Analyser: Performances and Perspectives for the Cluster Mission[END_REF]. The plasma bulk properties can be extracted, under certain conditions, from the active and natural electric field spectrograms measured by the WHISPER experiments. In particular, the thermal electron density can be deduced from the characteristics of natural waves in natural mode and from the plasma resonances triggered in active mode [START_REF] Trotignon | Ac-ter/whisper experiment[END_REF]. The thermal electron density is one of the key datasets provided by the WHISPER experiment which is used for scientific interest [START_REF] Canu | Identification of natural plasma emissions observed close to the plasmapause by the Cluster-Whisper relaxation sounder[END_REF][START_REF] Darrouzet | Statistical analysis of plasmaspheric plumes with Cluster/WHISPER observations[END_REF][START_REF] Mazouz | Wave emissions at half electron gyroharmonics in the equatorial plasmasphere region: Cluster observations and statistics[END_REF][START_REF] Kougblénou | Lower hybrid resonances stimulated by the four CLUSTER relaxation sounders deep inside the plasmasphere: observations and inferred plasma characteristics[END_REF][START_REF] Sandhu | A statistical study of magnetospheric electron density using the Cluster spacecraft[END_REF] and is the main driver of the calibration of the particles experiments [START_REF] Johnstone | Peace: a Plasma Electron and Current Experi-ment[END_REF][START_REF] Trotignon | The WHISPER Relaxation Sounder and the CLUS-TER Active Archive[END_REF]. However, the extraction of the electron density requires a careful analysis of active and/or natural spectra and can be tricky in some plasma regions [START_REF] Trotignon | How to determine the thermal electron density and the magnetic field strength from the Cluster/Whisper observations around the Earth[END_REF]. Indeed, the location of plasma resonances in the electric field spectrograms, related to the plasma parameters, strongly depends on the plasma conditions such as the magnetic field or the evdf (Gilet et al., 2017). The presence and frequency position of plasma resonances are documented in theoretical works [START_REF] Bernstein | Waves in a Plasma in a Magnetic Field[END_REF]. They are also revealed by numerical modeling of the experimental responses [START_REF] Chasseriaux | Electron density and temperature measurements in the lower ionosphere as deduced from the warm plasma theory of the h.f. quadrupole probe †[END_REF][START_REF] Wattieaux | RPC-MIP observations at comet 67P/Churyumov-Gerasimenko explained by a model including a sheath and two populations of electrons[END_REF].

However, a study of the resonances patterns of both active and natural spectra measured by the experiment is required [START_REF] Trotignon | Automatic determination of the electron density measured by the relaxation sounder on board ISEE 1[END_REF][START_REF] Trotignon | How to determine the thermal electron density and the magnetic field strength from the Cluster/Whisper observations around the Earth[END_REF]. In the case of the WHISPER instrument, the thermal electron density is extracted via a semi-automatic pipeline, and sometimes fully manually, e.g. for cross-calibration purposes or detailed scientific analysis [START_REF] Trotignon | The WHISPER Relaxation Sounder and the CLUS-TER Active Archive[END_REF].

Fully-automatic algorithms, based on Machine Learning and Deep Learning methods, are developing quickly and some are already implemented in order to simplify data processing of space experiments. For instance, such algorithms have been implemented to detect space weather events (e.g. space weather forecasting, [START_REF] Camporeale | Machine learning techniques for space weather[END_REF]), to extract plasma parameters from space experiments [START_REF] Zhelavskaya | Automated determination of electron density from electric field measurements on the Van Allen Probes spacecraft[END_REF] or to predict the plasma regions

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics in near-Earth regions [START_REF] Nguyen | Automatic detection of the earth bow shock and magnetopause from in-situ data with machine learning[END_REF][START_REF] Breuillard | Automatic classification of plasma regions in near-Earth space with supervised machine learning: application to Magnetospheric Multi Scale 2016-2019 observation[END_REF]. In order to automate the extraction of the thermal electron density from the electric field spectra measured by the WHIS-PER experiment, we propose to implement neural network methods [START_REF] Lecun | Deep learning[END_REF][START_REF] Goodfellow | Deep learning[END_REF]. As explained above, the detection of the thermal electron density strongly depends on the plasma regime, mainly driven by the magnetic field strength [START_REF] Trotignon | The WHISPER Relaxation Sounder and the CLUS-TER Active Archive[END_REF]. Therefore, the implemented pipeline proceeds in two steps. The first one is to determine the plasma region to separate (i) regions where the electron plasma frequency is the only resonance in the frequency bands (i.e. electron cyclotron frequency is neglected), typically corresponding to the solar wind and the magnetosheath, and (ii) regions where the electron plasma frequency is of the order of the electron cyclotron frequency, typically corresponding to the plasmasphere. To this purpose, we have implemented a fully-connected (dense) neural network classifying WHISPER spectra into three classes: free solar wind, magnetosheath and other plasma regions, including the plasmasphere, the tail and the cusp. The prediction accuracy can reach up to 98% for some plasma regimes. The second step is to automatically extract the thermal electron density from WHISPER electric field spectra using neural networks specifically implemented for each plasma region or group of plasma regions. In the free solar wind and the magnetosheath regions, we chose a recurrent (GRU) neural network architecture [START_REF] Cho | Learning phrase representations using RNN encoderdecoder for statistical machine translation[END_REF] to predict the electron plasma frequency from which the thermal electron density is derived. The prediction accuracy reaches up to 95% with a tolerance of one frequency bin (i.e.

162.8 Hz, the difference between two scanned frequencies). For the plasmasphere region, the upper hybrid frequency, which is more easily detected in active spectra than the plasma frequency, is predicted, then the thermal electron density is derived using the electron cyclotron frequency (obtained from the magnetic field measurement). The corresponding self-learning model is a fully-connected (dense) neural network. The prediction accuracy reaches up to 75% with a tolerance of one frequency bin.

A pipeline based on the self-learning algorithms detailed in this study is currently under development, to deliver the thermal electron density from the free solar wind and the magnetosheath region to the Cluster Science Archive [START_REF] Laakso | Cluster Active Archive: Overview[END_REF]. The efficiency of the automatic detection of the thermal electron density shows that such automated methods could be used to extract the plasma bulk properties from future experiments such as mutual impedance experiments onboard BepiColombo (PWI/AM 2 P) [START_REF] Trotignon | Active measurement of the thermal electron density and temperature on the Mercury Magnetospheric Orbiter of the BepiColombo mission[END_REF] and JUICE (RPWI/MIME) missions [START_REF] Grasset | JUpiter ICy moons Explorer (JUICE): An ESA mission to orbit Ganymede and to characterise the Jupiter system[END_REF].

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics This paper is organized as follows. First, the WHISPER experiment and its corresponding dataset are described in Sect 2. Secondly, we give a high-level description of the neural networks in Sect. 3. Thirdly, we detail the methods used to predict the plasma region encountered by the spacecraft from WHISPER spectra and we explain the results given by the best neural network in Sect. 4. In Sect. 5, we describe the predictions of thermal electron density applied in different plasma regimes. In Sect 6, we discuss the applicability of such methods in the data processing of the WHISPER instrument and future electric field experiments such as PWI/AM 2 P and the RPWI/MIME onboard respectively BepiColombo and JUICE missions.

Finally, we conclude our study in Sect 7.

Instrumentation and data

In this section, we first summarize the main characteristics of the WHISPER instrument (Sect 2.1). Then, we introduce its key datasets mainly composed of active and natural electric field spectra and of the thermal electron density (Sect 2.2). Finally, we give an overview of the semi-automatic algorithms currently used to extract the thermal electron density from the WHISPER spectra (Sect 2.3).

WHISPER instrument

As part of the Wave Experiment Consortium (WEC, [START_REF] Lefeuvre | The Wave Experiment Consortium. Cluster: Mission, Payload, and Supporting Activities[END_REF]), the Waves of HIgh frequency and Sounder for Probing Electron density by Relaxation (WHISPER) instrument is a relaxation sounder that monitors the in situ space plasma bulk properties such as the thermal electron density [START_REF] Décréau | Whisper, a Resonance Sounder and Wave Analyser: Performances and Perspectives for the Cluster Mission[END_REF]. Such instruments have been previously deployed in several space missions which operated in various ionized environments such as near Earth (GEOS-1 & 2, ISEE-1, Viking) or in the interplanetary medium (Ulysses) [START_REF] Décréau | Electron density and temperature, as measured by the mutual impedance experiment on board GEOS-1[END_REF][START_REF] Harvey | Early Results from the ISEE Electron Density Experiment[END_REF][START_REF] Bahnsen | First VIKING results: High frequency waves[END_REF][START_REF] Stone | The Unified Radio and Plasma wave investigation[END_REF]. The WHISPER principle is based on electric coupling between pairs of electric dipole antennas embedded in the surrounding plasma. This specific experiment consists of a pair of receivers and transmitters associated with parts of two WEC instruments: the sensors of the Electric Field and Wave (EFW, [START_REF] Gustafsson | The Electric Field and Wave Experiment for the Cluster Mission[END_REF]) experiment and the data processing capability of the Digital Wave Processing (DWP, [START_REF] Woolliscroft | The Digital Wave-Processing Experiment on Cluster[END_REF]) experiment. Figure 1 shows the WHISPER experiment configuration, which consists of four orthogonal wire booms carrying spherical sensors (8 cm in diameter) at the tips and deployed around the spacecraft. The electric antennas have sphere-to-sphere separations of 88 m. Further information on the WHISPER electron- Two operational modes are used alternatively.

First, in sounding (active) mode, transmitters emit a sinusoidal signal from one antenna pair, at a given time t and frequency f , during a short time duration (∼1 ms). Each train pulse covers a frequency band of 976.6 Hz centered on the given frequency f . Next, the signal is received on the EFW probes of a receiving pair (R 1 R 2 or R 3 R 4 ) at t+δt. Using onboard Fourier analysis of the instrument response around the transmitted frequency and by sweeping the transmitted frequency over the 3.5-82 kHz frequency range, a 162.8 Hz frequency resolution (512 bins) E-field spectrum is constructed on-board.

Secondly, in passive (natural) mode, transmitters are switched off. The WHISPER experiment becomes a simple electric receiver and perfoms a Fourier analysis to acquire a natural spectrum in the 2 to 80 kHz frequency range, with a frequency resolution of 162.8 Hz, corresponding to 512 bins [START_REF] Décréau | Whisper, a Resonance Sounder and Wave Analyser: Performances and Perspectives for the Cluster Mission[END_REF].

The sounding mode is operated alternately with the natural wave mode, with all four spacecraft following the same timeline. The WHISPER instrument is highly configurable and a number of operational parameters can be set by telecommand from ground. The resulting time resolution, depending on these parameters, varies from 0.3 to 3.4 s in natural mode and is generally of 1.5 s in active mode. The typical operational pattern includes 3 s of active mode, followed by 49 s of natural mode.

The relaxation sounder is based on the resonance principle of the propagation of plasma eigenmodes [START_REF] Krall | Principles of plasma physics[END_REF]. Basically, the plasma characteristic frequencies of

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics the surrounding medium are triggered when these frequencies are in the emitted frequency range.

When the transmitted pulse frequency is close to some plasma characteristic frequencies, very intense echoes are received. These stimulated signals are called plasma resonances. The WHIS-PER experiment operates close to the plasma characteristic frequencies which are typically found in the radio frequency (RF) range in Earth magnetospheric plasma. This effect allows the extraction of characteristic frequencies, which are directly related to the plasma bulk properties.

In natural mode, only the natural electric emissions are monitored. Plasma bulk properties can thus be inferred from the analysis of active and natural spectra, among which:

The electron plasma frequency, noted f pe , which is directly related to the thermal electron density as follows:

f pe = 1 2π n e e 2 ε 0 m e , (1)
where n e is the thermal electron density, e is the electric charge, ε 0 is the vacuum permittivity and m e the electron mass. The formula can be simplified as follows:

f pe [kHz] ∼ 9 n e [cm -3 ].
The electron cyclotron frequency and its harmonics, noted n f ce , reads:

f ce = 1 2π eB 0 m e , (2)
where B 0 is the magnetic field amplitude. The formula can be simplified as follows:

f ce [kHz]
∼ 0.028 B 0 [nT]. Note that the electron cyclotron frequency can be extracted using the measurement of the magnetic field amplitude given by the magnetometer onboard the CLUSTER-II spacecraft [START_REF] Balogh | The Cluster Magnetic Field Investigation[END_REF].

The upper hybrid frequency f uh , related to f ce and f pe , and defined as follows:

f uh = f 2 pe + f 2 ce , (3)
Bernstein frequencies: in magnetized plasma, Bernstein frequencies, noted f qn , can occasionally be measured by the WHISPER experiment. They satisfy the following conditions: f qn > 2 f ce and n f ce < f qn < (n+1) f ce [START_REF] Bernstein | Waves in a Plasma in a Magnetic Field[END_REF]. The frequency location of Bernstein modes has been tabulated in the Hamelin diagram for a plasma at thermal equilibrium [START_REF] Hamelin | Contributionà l'étude des ondes électrostatiques et électromagnétiques au voisinage de la fréquence hybride basse dans le plasma ionosphérique[END_REF][START_REF] Trotignon | How to determine the thermal electron density and the magnetic field strength from the Cluster/Whisper observations around the Earth[END_REF]. A shift between the tabulated frequency and the observed f qn can reveal the presence of a non-maxwellian evdf, e.g. two-electron-temperature plasma [START_REF] Belmont | Characteristic frequencies of a non-maxwellian plasma: A method for localizing the exact frequencies of magnetospheric intense natural waves near ; pe[END_REF]. Note that the lower hybrid frequency can be observed in specific cases (e.g. deep plasmasphere, [START_REF] Kougblénou | Lower hybrid resonances stimulated by the four CLUSTER relaxation sounders deep inside the plasmasphere: observations and inferred plasma characteristics[END_REF]). This characteristic frequency is mainly driven by the motion coupling of ions and electrons which allows to constrain the plasma ion composition.

-7-

Accepted Article

This article is protected by copyright. All rights reserved. f pe (here from ∼20 kHz to ∼30 kHz). Then, the spacecraft entered the inner magnetosphere region in the cusp region (around 00:10 UT). Note that f pe was not extracted using ad hoc methods due to a low signal-to-noise ratio. Finally, C3 spacecraft crossed the plasmasphere (characterized by higher f ce values) a few minutes later.

Figure 3 shows typical active (black curves) and natural (red dotted curves) electric field individual spectra measured by the WHISPER experiment in the key plasma regions with their corresponding plasma resonances extracted by ad hoc methods (see Sect. 2.3). The spectra have been expressed in dB and normalized between 0 and 1. First and second panels show the active and natural spectra measured in situ respectively in the free solar wind and in the magnetosheath regime. In this regime, the electron temperature and the magnetic field amplitude are low, leading to the excitation of only one resonance usually triggered at, or close to, the electron plasma frequency f pe (shown by blue vertical dotted bars), from which the thermal electron density is derived. For instance, in the free solar wind (resp. magnetosheath regime), f pe ∼ 21.1 kHz, (resp. f pe ∼ 48.2 kHz) corresponding to n e ∼ 5.51 cm -3 (resp. n e ∼ 28.76 cm -3 ).

Third panel shows the spectra measured by WHISPER in the plasmasphere regime. In this region, the electron cyclotron frequency f ce (∼ 5.5 kHz) and its harmonics (green) can be measured by the WHISPER instrument as well as Bernstein resonances (magenta) and the upper hybrid frequency f uh (∼ 29.4 kHz) (yellow). f pe is then derived from f uh and f ce (∼ 28.9 kHz).

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

The WHISPER dataset used for the self-learning algorithms presented in this paper consist of active/natural electric field spectra which have been processed by ad hoc methods to extract the thermal electron density. We briefly discuss this pipeline in the following section.

Ad hoc methods

In order to provide scientific analysis support and dissemination of high-level data, several semi-automatic algorithms have been developped to extract the thermal electron density [START_REF] Trotignon | The WHISPER Relaxation Sounder and the CLUS-TER Active Archive[END_REF]. They are based on a manual analysis of the plasma region (a resonance pattern) based on WHISPER active and natural spectra, EFW spacecraft potential measurements and FGM magentic field measurements, coupled with an automatic extraction of spectral features (resonance, low cutoff, . . . ) from WHISPER active and/or natural spectra. The algorithms are specific to (i) the plasma region and (ii) the operational mode (active and natural). In the free solar wind and the magnetosheath, the extraction of the electron plasma frequency is usually performed by (i) identifying the frequency position at maximum amplitude for active spectra or, (ii) identifying the low frequency cut-off for natural spectra. When natural signatures are unclear, a proxy can also be derived, obtained from the cross-calibration of the EFW spacecraft potential and the electron plasma frequency obtained from WHISPER active spectra analysis. In the plasmasphere, the thermal electron density is extracted by (i) the location of the upper hybrid frequency or by (ii) manual analysis. For each plasma regime, the extraction process includes a manual selection of the frequency band which contains the desired characteristic frequencies, with the risk of a bad selection.

This study aims to a fully-automatic electron density production on the easiest regions to analyze (i.e. solar wind and magnetosheath regimes) in order to deliver data faster and reduce manpower and subjectivity due to the manual operations. For this purpose, we have implemented automatic routines based on neural networks. First, the region determination is the key to apply the appropriate algorithm for density calculation. Therefore, we have implemented a neural network which predicts the plasma regime. Secondly, we have applied a specific neural network to determine the thermal electron density for the solar wind/magnetosheath region (for production tool) and for the plasmasphere region (for specific events). We detail the main stages of neural network process in the next section.

In this section, we provide a general description of neural networks of direct interest to this study. Such methods are derived from a simplified model of the neural system based on the dynamical electrochemical properties of biological neurons and their inter-connections [START_REF] Mcculloch | A logical calculus of ideas immanent in nervous activity[END_REF]. [START_REF] Rosenblatt | The perceptron, a perceiving and recognizing automaton project para[END_REF] was the first to implement such a biological architecture, called Perceptron, to solve simple linear problems dealing with two classes of signals. This model was composed of a single layer of artificial neurons which is fully-connected to the input and the output layers. Each modern neural network is based on this model [START_REF] Lecun | Convolutional networks for images, speech and time series[END_REF][START_REF] Goodfellow | Deep learning[END_REF]. We provide a functional description of an artificial neuron in Sect 3.1. Then, we give the basic aspects of the architecture of the neural network based on a stack of artificial neuron layers (Sect. 3.2). Finally, we introduce the implementation of such tools in Sect 3.3.

Artificial neuron

An artificial neuron is an information-processing unit that produces an output y from an input signal x [START_REF] Haykin | Neural networks: A comprehensive foundation[END_REF]. The neuron is the basic unit component of any neural network method. The input signal is typically expressed by a vector:

x = (x 1 , . . . , x m ) ∈ R m
The signal x of dimension m is connected to the neuron k by a set of synapses characterized by the synaptic weight, also expressed by a vector of dimension m:

w k = (w k,1 , . . . , w k,m ) ∈ R m
The signal x is multiplied by the synaptic weights which is represented in mathematical terms by a scalar product between the vectors x and w k , called u k :

u k = m j=1 w k, j x j
Note that a bias, called b k , can be added to u k . This bias allows the scalar product u k to deviate from 0, that can lead to a better updates of the synaptic weights during the learning phase.

Then, an operation to u k is performed by an activation function called ϕ. This function allows to (i) limit the amplitude range of the output signal and to (ii) introduce a non-linearity leading to a more complex transformation of the input data. The popular activation functions used on artificial neurons are (i) the hyperbolic tangent function, that is differentiable, continuous which is not differentiable at 0 but fast to compute, and (iii) the sigmoïd function defined as

ϕ(x) = 1/(1 + exp(-x))
for which the output value ranges from 0 to 1 and the derivative is non-null which allows the neural network to make some progress at every step. The output y k of the artificial neuron is then expressed by:

y k = ϕ(u k + b k )
Figure 4 summarizes the architecture of such artificial neuron with an m-dimensional signal input and m synaptic weights. Note that artificial neurons can be more elaborated, such as for recurrent neural network [START_REF] Hochreiter | Long short-term memory[END_REF][START_REF] Cho | Learning phrase representations using RNN encoderdecoder for statistical machine translation[END_REF] from which the output y k depends on the previous state of the neuron, or for convolutional network [START_REF] Lecun | Deep learning[END_REF] where each neuron performs a filtering operation (i.e. discrete convolution) on a specific part of the data. We discuss the architecture of the artificial neural network composed of several neuron layers in the following section.

Artificial Neural Networks

The main idea of neural networks is to extract linear combinations of input data as derived features, and then model the output as a nonlinear function of these features. These supervised methods are mainly used for classification and/or regression tasks [START_REF] Goodfellow | Deep learning[END_REF]. As illustrated in Figure 5, a neural network is composed of several layers of artificial neurons that are interconnected with neurons from the previous and the following layer. The classical layers from literature [START_REF] Lecun | Deep learning[END_REF] are:

Input layer: This layer is composed of the content of the input dataset. In term of mathematical representation, each component of the dataset, called X i , is expressed as a vector of the size of the data (here m) and the entire dataset composed of n data, is expressed by a matrix X:

X = (X 1 , . . . , X m ) ∈ R m,n
Hidden layers: The intermediate layers are called hidden layers and are composed of a set of artificial neurons (see Sect 3.1). These layers allow the neural network to learn complex tasks by extracting progressively more meaningful features from the input dataset.

-11-

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics Output layer: Neural networks produce a predicted output for a given input X i defined by a vector called y * i as follows:

y * i = (y 1 , . . . , y N )
The output y * i can be expressed as a function depending on the input X i and the free parameters (i.e. synaptic weights + additional parameters) as follows:

y * i = f (X i ; W)
where W is the whole synaptic weights w i, j . f can be seen as a combination of functions of the following form:

f (x) = f (d) (. . . f (i) (. . . (f (2) (f (1) (x))) . . .) . . .)
where d is the number of hidden layers and

f (i) = ( f (i) 1 , f (i) 2 , . . . , f (i) w )
, where f (i) w is the activation function ϕ w,i associated to the i th -artificial neuron on the w th hidden layer. Usually, for a single classification task, the sigmoïd function is chosen as the activation function of the last layer. Then, the predicted coordinates y i of the output y * i are expressed between 0 and 1 and their sum equals to 1. Therefore, the output y * i can be seen as a probability of belonging to a class. Moreover, the corresponding classifier of the input data X i is defined as

C(X i ) = argmax(y * i ).
Neural networks are defined in a way that each neuron is structured and connected to each other. This architecture (i.e. structure) strongly depends on the problem to solve. In litterature, there exist several categories of neural network architectures. In a first category, the connection between artificial neurons can flow only in one direction from the input layer to the output layer. Note that the neurons can be fully or partially interconnected. This architecture, called multilayer feedforward network, is the simplest neural network architecture. The hidden layers are seen as feature extractions of the input dataset. In a second category, the recurrent neural network differs from the feedforward neural network in that neurons can have backward pointing connections that can be understood as a form of memory. This architecture is useful when the input data are related in time. Such methods are commonly used for the data processing of temporal series. In this study, we have implemented both architectures.

To predict the class of the input data, the neural network needs to be trained, i.e. the synap-

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics function is defined as follows:

J(θ) = m i y i,true log( f (X i ; W))
Then, we need to update the free parameters of the neural network to model the prediction on the training outputs. For that, the loss function J is minimized by a gradient descent method (called optimizer) using the backpropagation technique [START_REF] Rosenblatt | The perceptron, a perceiving and recognizing automaton project para[END_REF]. This technique uses the fact that the derivative of J with respect to the synaptic weights can be expressed as the prediction error. Note that the derivative of J is only compared to a limited part of the synaptic weights, chosen randomly, which is the main idea of the Stochastic Gradient Descent (SGD). Therefore, we choose new free parameters that reduce the loss function:

W new = W old -∇ W J(X, W old )
where is the step of the descent which is commonly called the learning rate. Note that some optimizers add a more complex step or/and descent direction in order to speed up the convergence of the gradient descent (see ADAM method [START_REF] Kingma | Adam: A method for stochastic optimization[END_REF], Adagrad method [START_REF] Duchi | Adaptive subgradient methods for online learning and stochastic optimization[END_REF] or RMSprop method [START_REF] Tieleman | Lecture 6.5-RmsProp: Divide the gradient by a running average of its recent magnitude[END_REF]). The update is performed iteratively for a fixed number of times called epochs.

Usually, the input and the output data are split into three different sub-datasets: (i) a training dataset, (ii) a validation dataset and, (iii) a test dataset. The training dataset is fed to the neural network which tunes the free parameters to make correct predictions on the dataset itself. Therefore, this dataset need to be representative of the global problem. The validation and the test dataset are used to know how well the neural network will generalize to new cases.

If the model performs well on the training data, but it does not generalize, we say that the model overfits the training data, i.e. learning features are too specific to the training dataset. This overfitting can be reduced by using a regularization technique called dropout [START_REF] Srivastava | Dropout: A simple way to prevent neural networks from overfitting[END_REF].

Basically, this technique ensures that every neuron has a probability p of being temporarily ignored during one training step. The hyperparameter p is called the dropout rate.

To evaluate the performance on the different datasets, we compute an accuracy score such as, for a classification task, the ratio of correct predictions, which is defined as:

acc = 1 N N i 1 C i =C i,true
where C i,true is the true class of the data X i . We have used this accuracy score in the following to evaluate the performance of the tested self-learning methods.

Note that the accuracy score does not take into account the class distribution (some classes could appear much more frequently than others) and does not give information about the num-

Accepted Article

This article is protected by copyright. All rights reserved. Neural network performances can be described by the following metrics: (i) the accuracy of the positive precisions among all predicted positives, called precision and computed as TP/(TP+FP), and (ii) the ratio of positive instances, called recall and computed as TP/(TP+FN), that are correctly detected by the method. As FP and FN are quite similar in this study, the performance is simply illustrated by the accuracy score.

Implementation and ressources

Nowadays, neural network methods are largely and actively used in space science, especially in space weather applications for the data processing and the automatic detection of space weather events [START_REF] Camporeale | Machine learning techniques for space weather[END_REF]. [START_REF] Zhelavskaya | Automated determination of electron density from electric field measurements on the Van Allen Probes spacecraft[END_REF] applied neural networks to automatically determine the electron density from an electric field experiment onboard Van Allen Probes mission [START_REF] Mauk | Science Objectives and Rationale for the Radiation Belt Storm Probes Mission[END_REF]. For that, they used the measured electric field spectra and some geomagnetic conditions such as magnetic field line or the geometric index. For this study, we chose to apply two separated neural networks to (i) determine the plasma region encountered by the spacecrafts (Sect. 4) and to (ii) extract the thermal electron density (Sect. 5), using only the WHISPER spectra, therefore ignoring external conditions.

Several other automatic methods have been tested to process the WHISPER dataset. It must be noted that a large number of sub-operational modes exist, leading to different frequency bandwidth (hence several frequency steps). Unsupervised methods (i.e. unlabeled algorithms) such as KMEANS [START_REF] Arthur | k-means++: the advantages of careful seeding[END_REF] or DBSCAN [START_REF] Ester | A density-based algorithm for discovering clusters in large spatial databases with noise[END_REF] are sensitive to these modes, i.e. the results are driven by operational mode and not plasma regimes.

Neural networks have been retained because they can overcome this issue. Moreover, they do not require feature extraction (i.e. data representation) to improve the accuracy of the prediction, in contrary to the majority of self-learning algorithms. Indeed, the hidden layers of the neural networks (see Sect. 3.2) allow the extraction of different features from the data (which are unknown and possibly difficult to interpret).

Neural networks have been implemented using Python libraries Scikit-Learn [START_REF] Pedregosa | Scikit-learn: Machine learning in python[END_REF] and Keras [START_REF] Chollet | Keras[END_REF]. They have been run on a workstation featured with an AMD Threadripper 2990 WX (32 cores at 3.4 GHz) and a GPU card Nvidia Geforce 1660 GTX (6 Go DDR5 with 1406 CUDA cores).

Hereafter, we detail the neural networks used to predict the plasma regions (resp. the thermal electron density) in Section 4 (resp. in Sect. 5).

In this section, we describe the implementation of several neural networks to predict the plasma region into three classes: solar wind, magnetosheath and other plasma regions (plasmasphere, tail, cusp, . . . ). First, we detail the input data and the output (i.e. labels) of the neural networks (Sect. 4.1). Secondly, we compare the performance of the neural networks (Sect. 4.2).

Finally, we apply the best neural network to more WHISPER data (Sect. 4.3).

Data and labels

To predict the plasma region crossed by CLUSTER-II at a specific time, we have used the WHISPER data format defined for the Cluster Science Archive [START_REF] Trotignon | The WHISPER Relaxation Sounder and the CLUS-TER Active Archive[END_REF].

Each active spectrum contains 480 frequency bins covering the 3.5-81.5 kHz band. Note that for the sub-operational modes measured at different frequency bandwidth (see Sect. 2.1), the missing values are replaced by 0. Each natural spectrum contains 470 frequency bins covering the 3.5-79.9 kHz band. Moreover, all spectra have been expressed in decibels (20log 10 )

and individually normalized between 0 (amplitude min.) and 1 (amplitude max.). Therefore, each input data can be expressed as:

X i = (act 1 , . . . , act 480 , nat 1 , . . . , nat 470 )
where act i (resp. nat i ) is the i th value of the active spectrum (resp. natural spectrum).

The spectra X i are classified as three different plasma regimes: (i) free solar wind, (ii) magnetosheath region and, (iii) a class containing various ionized medium (plasmasphere, tail, cusp, . . .). Therefore the output y * can be seen as a vector of three dimensions containing the estimated probability for each class. The plasma region C i is chosen as argmax(y * ).

In order to train the neural network and validate its ouputs, the region labels have been identified manually for a substantial set of data randomly chosen during the mission lifetime.

We ensured that the training and the test datasets were sufficiently representative of the entirety of WHISPER spectra by verifying that selected data distributions in terms of (i) value of thermal electron density and (ii) the maximum amplitude in dB were consistent/representative with the overall same distributions. Finally, the total number of spectra are the following: 113,829 spectra from the free solar wind, 118,632 spectra from the magnetosheath and 113,551 spectra from other plasma regions and from an additionnal specific dataset composed of 40,762 spectra mesured in the plasmasphere. From this dataset, we randomly took 67% of the spectra from each plasma region to build the training (95%) and the validation dataset (5%). The

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics testing dataset is composed of the remaining 33%. In order to classify WHISPER spectra according to the plasma region encountered by the CLUSTER-II spacecraft, we have tested several neural networks and we have optimized the neural network characteristics (number of hidden layers, number of neurons, learning rate, . . . ) using GridSearch method [START_REF] Géron | Hands-on machine learning with scikit-learn, keras, and tensorflow: Concepts, tools, and techniques to build intelligent systems[END_REF].

A comparison between some architectures is presented in the following section.

Comparison of several architectures

We have compared two neural networks architectures: (i) a fully-connected (DENSE) neural network (see Sect. 3.2) and (ii) a recurrent (GRU) neural network [START_REF] Cho | Learning phrase representations using RNN encoderdecoder for statistical machine translation[END_REF].

Each architecture has been tested with three different input datasets contening respectively: (i)

only the active spectra (A), (ii) the active and natural spectra (A+N) and, (iii) only the natural spectra (N).

To compare the performance of these models, we have first computed the variation of the accuracy on each input dataset during the training task. Results are shown in Figure 6. First, each model converged after four iterations (i.e. epochs). Secondly, we see that the neural networks which only learnt with the natural spectra (green and yellow curves) have the poorest accuracy (from 0.84 to 0.91) whatever the architecture (dense or recurrent). This observation is consistent with the fact that the plasma resonances are not actively excited in passive mode (see Fig. 3). Therefore, the plasma signatures are generally less visible in the natural spectra.

Finally, the best accuracy is obtained with the fully-connected (DENSE) architecture with the active and natural spectrum combination (purple curve). The accuracy goes up to 97.5% at the last epoch. We see that the recurrent (GRU) architecture gives a lower accuracy than the fullyconnected network, whatever the input data.

Secondly, we have applied these neural networks to the test dataset composed by 24,324 spectra measured in the free solar wind, 25,562 spectra measured in the magnetosheath region and 51,406 in other plasma regions (including the plasmasphere). We have computed the accuracy and the output probability given by these models. These parameters are presented in Table 1. On one hand, we can see that the dense neural network trained with only the active spectrum (DENSE A) gives the best accuracy for the solar wind and the magnetosheath (resp.

97.9 and 96.4%). However, the recurrent neural network trained with only the active spectra (GRU A) gives the best accuracy for the other plasma regions (98.5%). On the other hand, we have computed (i) the mean probability associated to the predicted plasma region Ci given by the neural network (fourth column), (ii) the mean probability associated to the predicted

Accepted Article

This article is protected by copyright. All rights reserved. We see that GRU A model has the highest mean probability for correct prediction (0.98) and DENSE A model has the lowest mean probability for wrong predictions (0.66). Therefore, if we choose to impose a threshold on the probability to delete the wrong predictions, more correct predictions will be kept with both models. In the following, we chose to apply the DENSE A model to predict the plasma regime.

Table 2 summarizes the characteristics of this neural network, which is used to predict the plasma regime. The training part needs about 1 hours for 200,000 active spectra and the prediction (i.e. testing) part takes around 5 seconds for 50,000 active spectra. We have applied the model to more WHISPER spectra. We discuss the results in the following section.

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Application of the best model

We have applied the model presented in and other (blue). We see that the plasma region boundaries are quite well defined. For instance, we note that the model predicted a solar wind region from the beginning to 17 Feb 2007 at ∼17 h corresponding to the bow shock crossing (see Fig. 3). Then, the model predicted a magnetosheath region until 19 Feb 2007 at ∼00:00 corresponding to the penetration of the satellite into the magnetopause. Finally, the model predicted, as expected, a magnetosphere regime.

Resulting predictions are consistent with the shape of the spectra. First, only one strong resonance is observed on the active spectra (upper panel). Then, the magnetosheath region corresponds to a lower maximum amplitude leading to a low signal-to-noise ratio. Finally, the plasmasphere is well defined by the presence of several plasma resonances, especially the harmonics of the electron cyclotron frequency, which depend on the magnetic field amplitude.

Note that the magnetic field amplitude could provide a direct way to distinguish the plasma regimes. However, we only used the WHISPER dataset in order to set up an electron density pipeline independent from the other CLUSTER-II instruments, that is mainly motivated by operational considerations.

We observe that wrong predictions can be observed inside the boundaries. For instance, some spectra are labeled as magnetosheath whereas they seem to belong to the plasmasphere or the tail. In particular, in the free solar wind, the model sometimes predicted a magnetosheath regime. This can be due to (i) instrumental artefact such as a low signal-to-noise ratio or the presence of interferences potentially affecting the noise level or (ii) the fact that the prediction is only based on WHISPER observations. Indeed, WHISPER spectra acquired in the free solar wind and in the magnetosheath regions usually exhibit the same features, leading to an ambiguous prediction. Similar observations have been done with unsupervised and supervised methods (e.g. decision tree). In the other plasma regimes, including the plasmasphere, the wrong predictions are mainly due to (i) a high amplitude of the magnetic field (leading to an electron cyclotron frequency above the WHISPER frequency range) and, (ii) a poor signal-to-noise ratio.

Let us analyse the prediction of the plasma region compared to external parameters such as the magnetic field amplitude and the spacecraft position. Figure 8 shows the predicted plasma

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics region for one orbit (from 4 Jan 2013 at 00:00 UT to 6 Jan 2013 at 4:00 UT) with respect to the electron cyclotron frequency (expressed in kHz in logarithmic scale) and the X gse coordinate [START_REF] Russell | Geophysical coordinate transformations[END_REF], normalized by the Earth radius. As expected, the solar wind region is associated with a large distance from Earth (higher than 10 Earth radii) on the Sun side and a low electron cyclotron frequency (i.e. low magnetic field). Moreover, the magnetosheath region is associated with a large Earth distance range (from 2.5 to 10 Earth radii) and intermediate electron cyclotron frequencies (from 0.1 to 1 kHz). The other plasma regions are predicted close to Earth, especially the plasmasphere regime, where the plasma region is driven by a high magnetic field amplitude (i.e. high electron cyclotron frequency). Therefore, we can conclude that the predicted plasma regions are mainly driven by the spacecraft location and the magnetic field, despite the fact that the prediction is only implemented with WHISPER spectra.

In both case studies (Fig. 7 and8), an interference or less likely other signatures (e.g. lower hybrid frequency) can be incorrectly interpreted as the unique plasma resonance leading to a classification in the magnetosheath or solar wind regime. In order to correct these wrong predictions and avoid such isolated detections, plasma regions time/space continuity could be taken into account. To this end, we have implemented another step in the predicted plasma region process: the k-nearest neighbors algorithm (Cover & Hart, 1967;[START_REF] Géron | Hands-on machine learning with scikit-learn, keras, and tensorflow: Concepts, tools, and techniques to build intelligent systems[END_REF]. This method is generally applied for data classification tasks using pre-labeled data as input. For each unlabeled data (or test data), the method identifies the k-nearest neighbors taken from the labeled data and determines the most contributing class. If we consider a uniform contribution between the k-nearest neighbors, the most contributing class is then equivalent to the most frequent class among the k-nearest neighbors. The resulting class is then assigned to the test data.

We have applied this method to the spatial domain around the Earth. In this context, the input data are the points along the spacecraft orbit (defined by their GSE coordinates) and previously labeled by the neural network. For each grid point defining a volume around the Earth (corresponding to an unlabeled test data), the algorithm determines the k-nearest neighbors and the resulting class. Finally, we have decided to take advantage of this large-scale labelling process to correct the region associated with each point of the orbit by imposing the label (i.e.

plasma region) of the closest volume point.

Figure 9 shows the results for one complete orbit of C1 spacecraft in the XY gse frame, normalized by Earth radius, from 4 Jan 2013 at 00:00 UT to 6 Jan 2013 at 4:00 UT. The plasma

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics regions predicted by the neural network are given by the color points (yellow: solar wind, red: magnetosheath and blue: other) along the orbit. The background color represents the plasma regions predicted by the k-nearest neighbors algorithm from the neural network predictions as inputs. We see that wrong detections made by the neural network can be corrected by the large-scale classification given by the k-nearest neighbors algorithm, as the plasma region boundaries are now well defined. Note that using this method with a high value for k, the plasma region is less sensitive to wrong predictions (not shown here) but cannot account for fast multiple boundary crossings (e.g. when skimming the bow shock).

As explained in Sect. 2.2, the detection of the thermal electron density depends on the plasma regime. The automatic prediction of the plasma region is then used as an input of the extraction of the thermal electron density. We present the automatic model and the results of the prediction of the thermal electron density in the following section.

Prediction of the thermal electron density

In this study, we chose to define two separated neural networks which apply in different plasma regimes. First, in the solar wind/magnetosheath regime, a self-learning algorithm is implemented in order to fully automate the extraction of the thermal electron density. We describe the method and the results in Sect. 5.1. Secondly, we focused on the plasmasphere region from which the extraction of the thermal electron density is more intricate, and ad hoc methods require a manual intervention. We present the neural network and the given predictions in Sect. 5.2.

5.1

In the solar wind/magnetosheath regime

Data and labels

As explained in Sect. 2.2, the two plasma regions considered now (solar wind and magnetosheath, respectively) are characterized by the presence of a main resonance on spectra located at, or close to, the electron plasma frequency. Therefore, the thermal electron density can be directly derived from the predicted electron plasma frequency, and is obtained in the 0.15 to 82.37 cm -3 range (corresponding to the 3.5-82 kHz frequency range). Note that ad hoc methods can provide an electron plasma frequency which could be not aligned on the emitted frequency bins of the active mode. In that case, the electron plasma frequency has been translated onto the nearest active frequency bin. Therefore, the frequencies have been rescaled

-21-

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics on the emitted frequency bins of the active mode. Thus, the output of the model can be seen as a vector of 480 classes corresponding to the emitted frequencies defined in the 3.5-82 kHz bandwidth with a 162.8 Hz resolution. For the input data, we have used the active spectra and the time-closest natural spectra measured by WHISPER where the thermal electron density has been extracted from ad hoc methods adapted to the solar wind and the magnetosheath regimes.

Note that we have chosen not to consider a class corresponding to the case where ad hoc methods were not able to extract the electron plasma frequency, that means that spectra without associated plasma frequency were discarded from the analysis. The prediction of such models are sensitive to the presence of this class (not shown here), in particular because the extraction of the electron plasma frequency from ad hoc methods is mainly based on natural spectra and then assigned to the closest active spectrum in time. Therefore, two similar active spectra will not necessarily lead to the same plasma frequency estimations. Actually, the training part can be strongly affected by such a case, when the model learning is based on active spectra.

The labels (i.e. the electron plasma frequencies) have been identified manually for a substential set of data selected during the entire mission lifetime. We ensured that the data is representative of the entire WHISPER dataset, in particular with respect to the distribution of the electron plasma frequency for each plasma regime. The total numbers of spectra are the following: 73,709 spectra for the solar wind and 77,458 spectra for the magnetosheath regime.

From this dataset, we randomly took 67% of the spectra from each plasma region to build the training and the validation dataset. The testing dataset is composed of the remaining 33%.

Comparison of several architectures

Like in Sect. 4, we have tested several neural network architectures to predict the thermal electron density in the solar wind and in the magnetosheath regime. We have implemented two architectures: (i) a fully-connected (DENSE) neural network and, (ii) a recurrent (GRU) neural network. Each architecture has been trained and tested with the same dataset composed of three sub-datasets with (i) only active spectra (A), (ii) with active and natural spectra (A+N) and, (iii) only natural spectra (N).

Figure 10 shows the evolution of the accuracy of the two neural network architectures separately trained with the three sub-datasets. First, we see that the two architectures tested with only the natural spectra give the worst accuracy (between 0.1 to 0.2), probably due to lower signal-to-noise ratio. As explained in Sect. 4, in passive mode, the signal-to-noise ratio is lower

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics than the sounding (active) mode. Therefore, the determination of the plasma frequency is more tricky for this operational mode. Secondly, the best accuracy is obtained by the recurrent neural network (GRU) tested with only the active spectra. The accuracy reaches up to 0.7 at the last epoch whereas the accuracy of the other neural networks do not exceed 0.6. Thus, we chose to apply the GRU architecture with only the active spectrum to predict the electron plasma frequency in the free solar wind and in the magnetosheath regime. Table 3 summarizes the main parameters of the retained neural network. The training part needs about 2 hours for 200,000

active spectra and the prediction (i.e. testing) part takes around 40 seconds for 50,000 active spectra. We have applied the model to more WHISPER spectra. We discuss the results of this model on the WHISPER dataset in the following section.

Results

In this section, we comment on the results of the thermal electron density automated detection in the solar wind/magnetosheath region using the best neural network chosen in the previous section.

First, we have tested the recurrent neural network presented in section 5.1 on 24,323 (resp.

25,561) active spectra acquired in the free solar wind (resp. in the magnetosheath regime). We have computed the difference between the predicted electron plasma frequency ( f pe,pred ) and the electron plasma frequency given by ad hoc methods ( f pe,adhoc ), considered as ground truth.

Figure 11 shows the percentage of correct predictions within a tolerance interval (expressed in kHz) for different neural network architectures. We can see that the recurrent (GRU) neural network with active spectra as input (represented by the red line) gives the best absolute accuracy (70%). By increasing the tolerance interval by one frequency bin (± 0.182 Hz) for each predicted electron plasma frequency, we see that recurrent and dense models are give quite similar accuracy (95%). This large increase of the precision is mainly due to the fact that the electron plasma frequency, extracted by ad hoc methods, is given as a real value and the predicted electron plasma frequency is expressed into the 480 frequency bins of the active mode.

Moreover, the detection of the electron plasma frequency by ad hoc methods, sometimes, can be done with only the natural spectrum. Therefore, in the active spectrum, the predicted plasma frequency can be different by one or several bins compared to the plasma frequency given by ad hoc methods.

Secondly, we have run the neural network on active spectra measured by WHISPER on C1 on 13 Feb 2012 between 00:02 and 13:21 UT. At this time, the spacecraft were in the free

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics solar wind region characterized by a single plasma signature observed on active spectra. Fig-

ure 12 shows the prediction of the electron plasma frequency f pe , expressed in frequency bins (red points) and the electron plasma frequency given by ad hoc methods (black points).

For this case study, we have computed the relative error made by the self-learning algorithm compared to the thermal electron density n e derived from the electron plasma frequency f pe , extracted using ad hoc methods. The distribution of the electron density relative error is shown in Figure 13 (upper panel). We see that the relative error is low. Notably, the mean of the relative error is around 0.01. The bottom panel shows the scatter plot of the predicted thermal electron density n e versus the density extracted by ad hoc methods. We see that the predictions follow the electron density given by ad hoc methods. However, there exist wrong predictions for which the model gave n e ∼ 2-5cm -3 and ad hoc methods, n e ∼12 cm -3 . Taking into account the probability y i corresponding to the predicted class given by the model (colorbar), we see that the probability is low (from 0.2 to 0.4). Therefore, it could be possible to delete these wrong predictions by imposing a reasonable threshold on the probability y i .

We also predicted the thermal electron density in the solar wind and the magnetosphere regions for a larger amount of data. We have applied the self-learning method to 29,735 WHIS-PER data measured onboard C1 in 2012. Figure 14 shows three scatter plots of the thermal electron density showing the predicted electron density versus the density detected by ad hoc methods. The first panel shows all the data. The middle panel shows the data where the probability is higher than 0.2. The amount of data has decreased to 28,094. The right panel shows the data where the probability is higher than 0.5. The amount of data has decreased to 21,386.

We see that the number of wrong predictions also decreases. Therefore, if we want to automatically extract the thermal electron density, it is possible to impose a probability threshold in order to minimize the wrong predictions.

5.2 In the plasmasphere regime

Data and labels

The prediction of the thermal electron density in the plasmasphere is more tricky than in the solar wind and the magnetosheath regions. In active spectra, the resonance corresponding to the electron plasma frequency is less visible, when it is, than the resonance located at the upper hybrid frequency (see Figure 3). Therefore, we have chosen to identify the upper hybrid frequency in a first step, and then, knowing the electron cyclotron frequency from the -25-

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics measurement of the magnetic field amplitude of FGM, to derive the electron plasma frequency.

This automatic pipeline is shown in figure 15.

We have used active spectra and the closest natural spectrum measured by WHISPER for which the thermal electron density has been extracted using ad hoc methods. We only kept spectra (i) that are not labeled in the solar wind and magnetosheath region and (ii) spectra where the electron cyclotron frequency (derived from the magnetometer) is higher than 1.5 kHz. Then, we deleted 16% of the dataset (∼ 58,000 spectra) by applying thresholds on several characteristics of active spectra. In particular, for each active spectrum, we have computed the number of resonances that are not located close to the electron cyclotron frequency or to its harmonics. A high value of this number (i.e. higher than 5) means that the key plasma resonances, especially the resonance associated with the upper hybrid frequency, if measured, are not welldescribed in the spectrum. Moreover, we have modified the threshold to be less restrictive using the mean amplitude at low and high frequencies in order to limit the impact of the noise at such frequencies. A combination of the two descriptors allows to delete different kinds of active spectra which are considered as not suitable for detection of the electron plasma frequency or the upper hybrid frequency.

On the selected active spectra, a top-hat filter [START_REF] Serra | Image analysis and mathematical morphology[END_REF] has been applied in order to amplify the plasma resonances. Moreover, the spectra have been normalized in dB between 0 and 1. The output of the model can be seen as a vector of 480 classes corresponding to the emitted frequencies defined on the 3.5-81.5 kHz bandwidth with a precision of 162.8 Hz. Note that the electron plasma frequency can be lower than 3.5 kHz. 360,607 spectra measured in the plasmasphere have been used. A careful study of this dataset has been performed in order to adopt a well representative dataset of the WHISPER instrument in the plasmasphere.

In particular, we ensured that in both datasets, the distribution of the upper hybrid frequency, compared to the electron cyclotron frequency and its harmonics or Bernstein waves, was similar to the entire measurements of the WHISPER experiment. From the entire dataset, we randomly took 66.7% of the spectra to build the training and the validation datasets. The testing dataset is composed of the remaining 33.3%.

Table 4 summarizes the characteristics of the best neural network used in the plasmasphere to predict the upper hybrid frequency. Note that the model uses a hybrid activation function composed of an Exponential Linear Unit (ELU) and a hyperbolic tangent function (Clevert et al., 2016;[START_REF] Manessi | Learning combinations of activation functions[END_REF]. We apply the Nesterov Accelerated Gradient method [START_REF] Nesterov | A method for solving the convex programming problem with convergence rate o(1/k 2 )[END_REF]. This method measures the gradient of the cost function not at the local po-

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

WHISPER data processing

In this study, we have applied self-learning algorithms to predict the thermal electron density on specific data or events. We could apply these methods to the complete WHISPER dataset, present and future, and replace ad hoc methods (see Sect. First, the model used in the tool predicts the plasma region for each spectrum. Using the time stamp and the probabilities provided by the model, large intervals are automatically selected. This step allows to automatically delete the spurious predictions, in particular the predictions of dynamic plasma regions that varies a lot in a short time period. Secondly, the electron plasma frequency is extracted from the selected spectra. Combined with a probability threshold, a contrast formula, that gives information about the resonance-to-noise ratio, is computed in order to select only the best predictions. The interface allows manual selection of the electron plasma frequency in order to delete the bad predictions. Finally, the thermal electron density is computed and saved in a file.

FP JEDAI could allow to deliver density files with human intervention reduced up to 10 times for WHISPER active spectra (compared to the ad hoc methods) and only limited to a validation step (as opposed as a preprocessing step and a validation step for the currently used ad hoc methods). For instance, the processing of one month of data for the four spacecraft requires approximatively 4h of manual intervention whereas the ad hoc methods required around 40h. In order to limit ambiguous predictions, we imposed a severe threshold (around 0.4) on the probability associated to each density estimate. This can lead to a 20%-loss in the number of electron densities given by neural networks as compared to ad hoc methods.

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Future electric field experiments

Self-learning algorithms could be used for future space missions such as BepiColombo [START_REF] Benkhoff | BepiColombo: Comprehensive exploration of Mercury: Mission overview and science goals[END_REF] or JUICE [START_REF] Grasset | JUpiter ICy moons Explorer (JUICE): An ESA mission to orbit Ganymede and to characterise the Jupiter system[END_REF] which include electric field experiments such as mutual impedance experiments [START_REF] Trotignon | Active measurement of the thermal electron density and temperature on the Mercury Magnetospheric Orbiter of the BepiColombo mission[END_REF] or quasi-thermal noise spectroscopy [START_REF] Moncuquet | The radio waves and thermal electrostatic noise spectroscopy (SORBET) experiment on BEPICOLOMBO/MMO/PWI: Scientific objectives and performance[END_REF].

For instance, the Active Measurement of Mercury's Plasma (AM 2 P, [START_REF] Trotignon | Active measurement of the thermal electron density and temperature on the Mercury Magnetospheric Orbiter of the BepiColombo mission[END_REF])) experiment is one element of the Plasma Wave Investigation (PWI, [START_REF] Kasaba | Plasma Wave Investigation (PWI) Aboard BepiColombo Mio on the Trip to the First Measurement of Electric Fields, Electromagnetic Waves, and Radio Waves Around Mercury[END_REF])

consortium onboard the Mercury Magnetospheric Orbiter (Mio/MMO) of the BepiColombo mission, successfully launched in October 2018. From March 2026, the mutual impedance experiment aims to determine the thermal electron density in the Hermean magnetosphere for plasma frequencies in the 0.7-120 kHz band. The Mio/MMO spacecraft will fly along an elliptic polar orbit of 400×11, 824 km with a 9.3 h period [START_REF] Benkhoff | BepiColombo: Comprehensive exploration of Mercury: Mission overview and science goals[END_REF], so that the spacecraft will cross several plasma regions [START_REF] Yagi | Global Structure and Sodium Ion Dynamics in Mercury's Magnetosphere With the Offset Dipole[END_REF][START_REF] Kasaba | Plasma Wave Investigation (PWI) Aboard BepiColombo Mio on the Trip to the First Measurement of Electric Fields, Electromagnetic Waves, and Radio Waves Around Mercury[END_REF] such as the free solar wind, where the electron cyclotron frequency is expected to be much smaller than the electron plasma frequency, and the Hermean plasmasphere, where the electron cyclotron frequency and its harmonics will be much larger than the electron plasma frequency. Therefore, the electric field spectrogram should present similarities, in terms of frequency position of plasma signatures, with the Earth magnetospheric observations made by the WHISPER instrument. Prediction of the plasma region will also be highly desirable to automatically extract the plasma bulk properties from the AM 2 P measurements. In contrast with the WHIS-PER experiment which has been operating for more than twenty years, the mutual impedance experiment should monitor the Hermean plasma environment for two and a half terrestrial years at most (including a planned one terrestrial year extension). Moreover, the AM 2 P measurement cadence will be lower than the one of WHISPER instrument, with active measurements planned to be performed every 160-200 s in the Hermean magnetosphere and every 320-400 s in the free solar wind. Therefore, the amount of AM 2 P active spectra will be substantially lower than those of the WHISPER dataset. In order to characterize the capability to implement a neural network to predict the plasma regime, we have studied the influence of the amount of spectra needed for an efficient prediction of the plasma regime.

Figure 18 shows the accuracy of the neural network on a test dataset with respect to the number of active spectra in the training dataset from 10 to 10,000 spectra. The corresponding time period to measure such number of spectra with the AM 2 P instrument is given by the colored verticals bars from 1 day (blue) to 4 months (red). The training dataset is built with

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics spectra randomly chosen. In order to be independent of this random part, we have run the model several times with different training datasets. The overall accuracy score is then given with an error bar (shown in vertical black lines) for each case. We see that the accuracy goes up from 0.5 to 0.95, meaning that an automatic pipeline to predict the plasma region will be efficient after 4 months of operations. Note that this estimation is based on the assumption that all spectra are exploitable, especially in the solar wind and the magnetosheath regions where a clear single signature is expected to be observed. Therefore, the number of spectra actually needed in the training dataset could be higher in real operational conditions.

However, in order to increase the size of the training dataset, it could be possible to model the electric field experiments. Indeed, modeling of the experimental response has been performed in several plasma conditions such as in interplanetary plasma or planetary plasma [START_REF] Béghin | Series expansion of electrostatic potential radiated by a point source in isotropic Maxwellian plasma[END_REF]Gilet et al., 2017;[START_REF] Wattieaux | RPC-MIP observations at comet 67P/Churyumov-Gerasimenko explained by a model including a sheath and two populations of electrons[END_REF][START_REF] Gilet | Mutual impedance probe in collisionless unmagnetized plasmas with suprathermal electrons -Application to BepiColombo[END_REF]. Recent studies show that modeling of the experiment taking into account the effect of a vacuum sheath around the experiment and the spacecraft, are close to in situ observations [START_REF] Wattieaux | RPC-MIP observations at comet 67P/Churyumov-Gerasimenko explained by a model including a sheath and two populations of electrons[END_REF]. Moreover, thanks to a comparison between the observations and the dataset of modeled spectra, it is possible to characterize the surrounding plasma. [START_REF] Wattieaux | Plasma characterization at comet 67p between 2 and 4 a.u. from the sun with the rpc-mip instrument[END_REF] provided a characterization of two-electron-temperature-plasma in the ionosphere of 67P/Churyumov-Gerasimenko using a combination of the observations made by the mutual impedance probe (RPC-MIP, [START_REF] Trotignon | RPC-MIP: the Mutual Impedance Probe of the Rosetta Plasma Consortium[END_REF]) and the modeling of the instrument response. Therefore, it is possible to generate a dataset of modeled electric field spectra in order to train a model to predict the plasma region and, eventually, the thermal electron density. A complementary alternative could be to make use of modelling of the plasma regions in the context of the JUICE mission using ionospheric modeling of Ganymede [START_REF] Leclercq | 3D magnetospheric parallel hybrid multi-grid method applied to planet-plasma interactions[END_REF][START_REF] Leblanc | On the orbital variability of Ganymede's atmosphere[END_REF][START_REF] Carnielli | First 3d test particle model of ganymede's ionosphere[END_REF] from which the plasma bulk properties can be extracted to model the instrumental responses of mutual impedance experiments (Gilet et al., 2017;[START_REF] Wattieaux | RPC-MIP observations at comet 67P/Churyumov-Gerasimenko explained by a model including a sheath and two populations of electrons[END_REF].

Conclusion

In this study, we have implemented several automated pipelines based on neural network methods to extract the thermal electron density from the electric field spectra measured by WHIS-PER instrument onboard the four CLUSTER-II spacecraft. We have seen that the determination of the thermal electron density mainly depends on the plasma regime, which is driven by the magnetic field amplitude and the solar activity. In the electric field spectrogram, the ef-

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics fect of the magnetic field leads to the presence of multiple plasma resonances, thus complicating the determination of the electron plasma frequency.

Therefore, we first predicted the plasma region encountered by the WHISPER instrument from the active and natural spectra. We have used a fully-connected (dense) neural network composed of three hidden layers with additional dropout. We have shown that the model reaches an accuracy score close to 97% for the three plasma regimes. Then, we have implemented two neural networks in the solar wind/magnetosheath region (i.e. low magnetic field) and in the plasmasphere (i.e. high magnetic field).

In the low magnetic field regime, the main resonance is close to the electron plasma frequency, that is directly related to the thermal electron density. Therefore, we chose to predict the electron plasma frequency, defined in the frequency range of the WHISPER instrument.

We have used a recurrent neural network based on Gated Recurrent Unit (GRU) built with three hidden layers of 1024 neurons with additional dropout (30%). In the free solar wind and in the magnetosheath regimes, the prediction accuracy score reaches up to 95%. A fully-automatic pipeline is currently under development (FP JEDAI) is order to produce datasets of thermal electron density using outputs of the neural networks (prediction and probability).

For the plasmaspheric region (in practice, for electron cyclotron frequencies higher than 1.5 kHz), the spectral signature at the upper hybrid frequency, related to the electron cyclotron frequency and the electron plasma frequency, is much more simple to detect than the signature at the electron plasma frequency. Therefore, we first chose to predict the upper hybrid frequency. Then, with the cyclotron frequency computed from the magnetic field amplitude measured by the magnetometer, it is possible to automatically determine the thermal electron density. We have shown that active spectra need to be pre-processed in order to increase the accuracy of the upper hybrid frequency prediction. In the plasmasphere regime, the prediction accuracy score reaches up to 75%. For the other plasma regions such as the cusp or the tail where the signal-to-noise ratio is low, the extraction of the thermal electron density is more tricky. A specific automatic method is currently under development.

Figure 1 .

 1 Figure 1. Illustration of the WHISPER relaxation sounder configuration, identical for the four CLUSTER-II spacecraft, using the EFW electric field antennas as transmitters and two of the four spherical booms R i (8 cm in diameter) at the end of each antenna as receivers. The electric antennas have sphere-to-sphere separations of 88 m.

  tic weights W need to be updated. The training step of the neural network can be seen as an optimisation problem. First, the free parameters W are randomly initialized and a computation of current y * is realized. Then, the accuracy of the prediction is computed by measuring the difference between the current estimated class C i and the true training class C i,true . For that, we compute an objective function (i.e. a loss function), such as the categorical crossentropy-12-

  manuscript submitted to JGR: Space Physics ber of True Positive (TP), True Negative (TN), False Positive (FP), and False Negative (FN).

  2.3), currently in use, by the self-learning methods shown in this study. However, the high cadence of WHISPER spectra measurements requires an optimization of the manual intervention, especially for deleting wrong detections. In order to minimize this intervention, we have implemented a new pipeline that evaluates the self-learning algorithms in the solar wind and the magnetosheath regime. This tool, named FP JEDAI (Judging Electron Density by Artificial Intelligence), allows to plot, visualize and validate the predictions made by the neural networks. It is developed with the main objective of reducing the tedious and time-consuming electron density manual determination or ad hoc methods selection. FP JEDAI combines two models described in this study: the region classification model and the f pe determination model only applied in the solar wind and the magnetosheath regimes.

Finally, we have

  shown that automatic methods could be applied for future data processing of electric field experiments such as mutual impedance experiments onboard BepiColombo (Hermean environment) and JUICE (jovian environment) missions with constraints related to the size of the dataset. The efficiency of the automatic process strongly depends on the quality and the representativeness of the training dataset. We have shown that in the context of Bepi-Colombo, a self-learning predictive model of PWI/AM 2 P instrumental response in the Her-

Table 1 .

 1 Accuracy and mean probability of several neural networks implemented to predict the plasma region (Solar Wind, Magnetosheath and Other): GRU with active + natural spectrum in input (GRU A+N), GRU with only the active spectrum (GRU A), GRU with only natural spectrum, fully-connected NN with active + natural (DENSE A+N), fully-connected NN active (DENSE A) and fully-connected with only natural spectrum (DENSE N).

	Model	Solar Wind	Magnetosheath	Other		Mean Proba.
					Total	Correct Pred.	Wrong Pred.
	GRU A+N	94.9	93.0	94.2	0.95	0.96	0.77
	GRU A	95.6	92.8	98.5	0.97	0.98	0.75
	GRU N	75.8	76.6	87.2	0.89	0.92	0.77
	DENSE A+N	94.3	94.6	95.0	0.96	0.97	0.77
	DENSE A	97.9	96.4	96.9	0.95	0.96	0.66
	DENSE N	75.2	83.5	87.8	0.92	0.94	0.81

manuscript submitted to JGR: Space Physics plasma region (i.e. maximum probability for each spectrum) when the model predicted the correct class and, (iii) the mean probability associated to the predicted plasma region (i.e. maximum probability for each spectrum) when the model predicted a wrong class.

Table 2 .

 2 Characteristics of the best neural network model used to predict the plasma regime.

	Model	Plasma Regime
	Input	Active spectrum
	# of spectra	305,480
	Pre-processing	normalized dB
	Architecture	Dense
	# hidden layers	3
	# neurons	1024+1024+1024
	Activation function	ReLU/Sigmoïd
	Dropout	30%
	Loss function	Categorical Crossentropy
	Optimizer	Adam
	Metrics	Accuracy
	Number of parameters	3,076,099
	Output	3 classes (SW,MS,Other)

Table 2

 2

	to WHISPER measurements presented

Table 3 .

 3 Summary of the neural network used to determine the thermal electron density in the Solar Wind

	and Magnetosheath region
	Model	SW/MS
	Input	Active spectrum
	# of spectra	151,167
	Pre-processing	normalized dB
	Architecture	Recurrent (GRU)
	# hidden layers	3
	# neurons	1024+1024+1024
	Activation function	ReLU/Sigmoïd
	Dropout	30%
	Loss function	Categorical Crossentropy
	Optimizer	Adam

Table 4 .

 4 Characteristics of the best neural network used to determine the upper hybrid frequency in the plasmasphere regime. The hybrid activation function is a combination of an Exponential Linear Unit (ELU) and a hyperbolic tangent function.

	Model	Plasmasphere
	Input	Active + Natural spectrum
	# of spectra	360,607
	Pre-processing	normalized dB
		+ additionnal processing (top hat)
	Architecture	Dense
	# hidden layers	2
	# neurons	512+480
	Activation function	Hybrid function *
	Dropout	5%
	Loss function	Categorical Crossentropy
	Optimizer	Nesterov
	Metrics	Accuracy
	Number of parameters	964,032
	Output	f uh on 480 freq. bins (3.5 to 81.5 kHz)

Metrics Accuracy Number of parameters 17,215,491 Output f pe on 480 freq. bins (3.5 to 81.5 kHz) -24-

Accepted Article Acknowledgments The CLUSTER-II WHISPER electric field spectra and the thermal electron densities used in this study are publicly available to the world-wide science community on the ESA Cluster Science Archive (CSA, Laakso et al. (2010)) at https://csa.esac.esa.int. Some of the results presented in this paper have been obtained through the use of a high-performance workstation funded by the French Alternative Energies and Atomic Energy Commission (CEA). The workstation has been designed and maintained by Matthieu Garnung and Sebastien Celestin at LPC2E. We acknowledge CNES fundings through APR.

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics sition but slightly ahead in the direction of the momentum vector that points generally in the right direction. Note that the low dropout rate (5%), considered as a hyperparameter of the model, has been obtained using a grid search method [START_REF] Bergstra | Random search for hyper-parameter optimization[END_REF]. We applied this neural network to the WHISPER dataset. The results are shown in the following section.

Results

Figure 16 shows an almost perfect case of active spectrogram in the plasmasphere measured on C1 (RUMBA) on 5 August 2002 between 17:00 and 20:40 UT. It shows several plasma resonances corresponding to the electron cyclotron frequency f ce and its harmonics, the upper hybrid frequency f uh , and Bernstein frequencies. The corresponding frequency bins of the electron plasma frequency f pe , when obtained with ad hoc methods, are shown in the bottom panel as black points, while those predicted by the automatic pipeline are shown in red.

We have computed the relative error of the predicted thermal electron density derived from the predicted f pe for this case study. The distribution of the relative error is shown in Figure 17 (upper panel). The mean relative error is around 0.09, thus larger than in the solar wind/magnetosheath regime. We have also computed the scatter plot of the predicted thermal electron density versus the density given by ad hoc methods (Fig. 17, lower panel). We can observe that the model seems sometimes perturbed by other resonances, as illustrated by vertical lines formed by the points on the scatter plot for this case study. The probability y i of each prediction is represented by the colorbar. In contrast with the solar wind or the magnetosheath region results, the model gives a lower probability of correct predictions (around 0.2). This low probability is mainly due to the fact that the active spectra shown in this case study are of exceptional quality, with all of the key plasma resonances well-described. This kind of spectra is rare and thus poorly represented in the training dataset, then leading to a low probability value for the prediction.

For most of spectra measured in the plasmasphere, the probability of correct predictions is quite similar to the probability given in the solar wind/magnetosheath regime.

Future data processing

In this section, we first describe the applicability of self-learning methods for the data processing of WHISPER spectra (section 6.1). Secondly, we discuss the applicability of such automatic data processing for the future active electric field experiments onboard spacecraft such as BepiColombo/Mio or JUICE (section 6.2).

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics mean environment should only be effective after 4 months of operations around Mercury. However, modeling of the instrumental responses (Gilet et al., 2017;[START_REF] Wattieaux | RPC-MIP observations at comet 67P/Churyumov-Gerasimenko explained by a model including a sheath and two populations of electrons[END_REF] could be used to feed the training dataset and shorten this period.

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics from https://books.google.fr/books?id=HHetDwAAQBAJ Gilet, N., Henri, P., Wattieaux, G., Cilibrasi, M., & Béghin, C. (2017). Electrostatic potential radiated by a pulsating charge in a two-electron temperature plasma.

Radio Science,

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Accepted Article

This article is protected by copyright. All rights reserved.

manuscript submitted to JGR: Space Physics

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved. given by ad hoc methods (black points) and predicted by neural network (red points). Note that the size of red points has been decreased for the sake of clarity.

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved.

Accepted Article

This article is protected by copyright. All rights reserved.