Quentin Vacher

Philippe Owezarski

A controversial study on Random Forest Accuracy for Attack Detection

Keywords: Attack detection, Machine learning, Random Forest, adversarial learning, training, controversial thoughts

Machine learning based anomaly and attack detection is a topic under the spotlights for more than one decade. It is raising a significant research effort worldwide. The reasons of this interest lie in the ability of machine learning to introduce a large part of autonomy in the attacks detection process compared to the classical signature based approach, and then reduces the management cost of networks for NetOps, provides rapid and efficient results, and is prone to detect 0d attacks. This paper confirms this efficiency showing that using the simple Random Forest (RF) algorithms together with features selection allows detection ratio greater than 99%. However, despite a large set of attempts on the training stage for improving this detection ratio, RF never detects 100% of attacks. It especially always misses some attacks in the traffic, especially under-represented ones in the training dataset. False Negatives are certainly the most dramatic events for network security. In addition, it makes adversarial learning very easy to perform. This paper then presents a controversial study on machine learning based attack detection (using the significantly illustrative RF example), and its trustworthiness limits. This paper is then trying to break the current dogma that machine learning is THE solution for future cyber-security systems.

Introduction

Given the large variety of usages in the Internet, its traffic is characterized by a significant variety of its features: variety of applications, variable traffic, etc. This variability often exceeds some thresholds and disturbs the way the traffic is flowing in the network. These are called traffic anomalies. Such anomalies can have multiple forms. They can be benign due for instance to large flows transmissions, flash crowds, or even misconfigurations of some equipments. At the other side of the spectrum of anomalies are malicious anomalies as attacks and notably Denial of Service (DoS) attacks. In all cases, these anomalies require the network operators (NetOps) to trigger countermeasures or actions to mitigate them, and recovering an acceptable service for the flowing traffic. Anomaly detection at run-time is then an essential requirement nowadays, and is raising a large effort since several years.

The first approach was inspired from the security enforcement solutions as signature based detection. It consists in extracting from each encountered anomaly a signature based on traffic features and values due to the anomaly, to add them to an anomaly signatures database, that serves to detect any further anomaly of the same kind. However, this approach is very time-consuming as analysis of anomalies for producing signatures is mostly hand-made, costly, and most importantly, it does not allow the detection of unknown anomalies (called 0day or 0d anomalies).

To cope with 0d anomalies detection, current research focuses on statistical approaches. It consists in designing a statistical model on traffic features able to characterize normal traffic. Any variation of the traffic characteristics from this model then raises an alarm. Among these approaches, the ones based on machine learning (ML) are currently under the spotlights and raising the huge majority of research efforts. Their interest lies in their ability in building the traffic and anomalies models during a training phase (supervised learning) 1 . Indeed, the main problematic deals with both detecting and classifying traffic anomalies to allow NetOps to trigger appropriate countermeasures. Detection and classification are specifically two functionalities that machine learning algorithms have been designed for. ML algorithms exhibit high accuracy for detecting anomalies. The literature on the topic generally shows detection ratios higher than 95%, often reaching 98 or 99%. However, none of them reaches the perfect detection ratio of 100% [START_REF] Elmrabit | Evaluation of Machine Learning Algorithms for Anomaly Detection[END_REF]. And more surprisingly, none of previous paper investigated why ML algorithms do not allow a perfect detection. Papers on anomaly detection continuously propose new ML based detection algorithms built by combining existing ML techniques. These algorithms are becoming more and more complex, but do not leverage on clear and exhaustive analysis of the lacks of previously published algorithms, and are then unmotivated. They just target higher detection ratios, without learning from the mistakes of previous algorithms. In addition, it is obvious that there are biases in the assessment of all these detection algorithms, the used dataset being certainly the most important one: Datasets are mandatorily limited in terms of traffic and anomalies kinds, and they mandatorily influence the design of the detection algorithms. Therefore, proudly publishing the results of one algorithm because its detection ratio is few tens of percent, or event 1 or 2% higher than related algorithms is nonsense. The results could be inverted if the algorithms were assessed on another dataset. The only conclusion that comes from all these ML based detection papers is that ML based detection algorithms are very good, but not perfect.

That is why the work presented in this paper tries to understand how the ML algorithms work, and more specifically how training impacts the detection performance. This paper then proposes a black box based methodology on ML algorithms that adopts NetOps point of view and their need of trustworthy ML, for analyzing the way training influences the capabilities of ML algorithms to detect specific anomalies, especially targeting an explanation of the decision made by the RF algorithm. This methodology mainly focuses on adapting at each stage the training dataset according to the anomalies that remained undetected on the previous stages. For illustration purpose, the Random Forest (RF) ML algorithm has been selected, as it is generally proved to be one of the best ranked algorithm for anomaly detection in the existing literature of this domain, and it is certainly the simplest.

The rest of this paper is as follows: section 2 presents an illustrative state of the art on existing works on the use of machine learning for anomaly detection. Section 3 describes the dataset used for this work, especially focusing on the anomalies it contains. Section 4 addresses the problem of RF hyper parameters optimization with an empirical and pragmatic approach, in order to work in the best possible conditions for anomaly detection. This is an important part of the methodology as several alternative approaches could have been chosen. The best one has then been pragmatically exhibited. Section 5 is devoted to the analysis of the impact of training on ML detection ratio. Based on these results, section 6 continues this work by trying to explain the RF decision making. Finally section 7 provides a final discussion on the impact of the results presented in the paper.

Related Works

Machine learning for cyber-security is raising a lot of effort since at least two decades. Historically, the first machine learning algorithm -K-mean [START_REF] Jain | Data Clustering: 50 Years Beyond K-Means[END_REF] -was designed more than 50 years ago. Since then, many other machine learning algorithms were designed: DB-SCAN, Random Forest, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), to quote a few. Since two decades, they have been used as a support for detecting and classifying network anomalies and attacks, exhibiting good but still imperfect performances [3] [4] Ṁathematicians are still designing new machine learning algorithms, especially based on Neural Networks (NN), and that belong to the family of Deep Learning algorithms (DL). These algorithms are raising the interest of researchers and engineers in cyber-security; as soon as they appear, cyber-security scientists test them. This is the case of Long Short Term Memory (LSTM) [START_REF] Laghrissi | Intrusion Detection Systems Using Long Short-Term Memory (LSTM)[END_REF] for instance.

The way scientists in cyber-security proceed with all these learning algorithm lacks motivation and methodology. Most (all?) papers in machine learning based attack detection select one machine learning algorithm without indicating why this choice is made, and evaluate its performance on a labeled dataset. This is always performed with a black box point of view of the machine learning algorithm. More recently, scientists combine several machine learning techniques. The complexity of the attack detection systems then increases, for a gain that is generally very limited: few percents of accuracy in the best cases, more often only few tens of percent, and this on lab experiments with very reduced traffic datasets that are far from representing the variety of existing traffic and attacks types [START_REF] Alsulaiman | Performance Evaluation of Machine Learning Techniques for DoS Detection[END_REF]. But none of these attack detection algorithms is able to detect all attacks without any false alarms [START_REF] Elmrabit | Evaluation of Machine Learning Algorithms for Anomaly Detection[END_REF].

Then, the question that is legitimate to ask is: does it worth continuing working this way, i.e. continuing designing more and more complex attack de-tection systems just to gain few tens of percent of accuracy compared to other systems? NetOps requirements give the answer. It is essential for them to rely on trustworthy attack detection system. For that, NetOps need to understand why the machine learning algorithm detected and classified one flow as benign or malicious. They then require explainable learning algorithms.

This paper then deals with a study of the RF algorithm trying to understand how it works and how it is making its detection decision. RF has been selected as it appears as one of the best algorithms for attack detection, with a detection accuracy often evaluated over 99% [START_REF] Alves Resende | A Survey of Random Forest Based Methods for Intrusion Detection Systems[END_REF] [8].

The CIC-IDS-2017 Dataset

As introduced in section 1, this paper aims at analyzing the limits of machine learning algorithms for anomaly detection in Internet traffic, taking Random Forest as an illustrative example. This work considers the Random forest based anomaly detection tool as a blackbox, and then requires a labeled dataset to compare the RF based detection results with the exact labels of the input dataset. The CIC-IDS-2017 dataset has been selected for this purpose [START_REF] Sharafaldin | Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization[END_REF]. It nowadays appears as the new reference dataset for security tool assessment. It more or less replaces the ancient KDD'99 dataset that has been the reference for more than 20 years. This dataset has been created by the Canadian Institute for Cybersecurity with the purpose of giving researchers an open source Dataset for designing and evaluating network intrusion detection systems. The CIC-IDS-2017 dataset consists of eight .csv files. It represents a total of five days of traffic. Each gathered day contains one attack or more that were specifically generated. Table 1 indicates the list of attacks contained in the different files of the CIC-IDS-2017 dataset.

Each of the .csv files is the result of the network traffic analysis performed with CICFlowMeter, an open source tool that re-constructs bidirectional flows from the gathered packet pcap files, and extracts the specific features of these flows. In bidirectional flows, the first packet determines the forward (source to destination) and backward (destination to source) directions. Hence the statistical time-related features can be calculated separately in the forward and backward directions. CIC-IDS-2017 comes with 78 features. Some of these features are indicated in Table 2 as examples.

For using this dataset we had to merge all the files into one single .csv file. We then cleaned the dataset by taking off the rows with NaN, infinite or missing values. We also noticed that there were 8 features that had a variance of 0. We then took these features off the dataset. Finally we added a binary label column. The dataset is given with types of attack as labels, but we chose to add the option of using binary class with "1" to indicate an attack, and "0" for benign traffic.

After this preprocessing stage, the final dataset consists of 2 827 876 samples with 70 features and two label columns: a MultiClass label (which is the attack 4 Random Forest Hyper-parameters optimization

RF Hyper-parameters

The goal of this paper is to analyze why ML algorithms for anomaly detection do not reach the 100% detection ratio, even when applied to well-known reference datasets with perfectly identified anomalies and attacks. The algorithms are however evaluated in their best possible configuration. Indeed, in such controlled condition it is possible to optimize the configuration parameters of the ML algorithm -here RF -for optimizing its detection performance. For that, it is possible to run the RF algorithm several times on the recorded dataset with different values for the configuration hyper-parameters, so as to empirically discover the ones providing the best results. This is what this section aims to exhibit. This is obviously not representative of the way ML based detection algorithms are used in operational conditions as NetOps cannot afford recording the flowing traffic and running the detection algorithms several times on it. This would forbid any real-time detection of the anomalies and attacks.

For finding out the optimal parameters when testing Random Forest on the CIC-IDS-2017 dataset, we selected the RandomForestClassifier [10] function from Python Scikit-Learn. Indeed, it appears as a widely used RF implementation according to current papers dealing with RF based anomaly detection. The hyper-parameters to be optimized are:

n estimators: the number of estimators, i.e. the number of decision trees max depth: the maximum depth of the trees inside the RF max features: the maximum number of features Random Forest is allowed to consider in individual trees when looking for the best split.

In this paper, two different evaluations will be presented: the first one deals with the classical labels of the CIC-IDS-2017 dataset that indicate the kind of anomaly/attack for each entry of the dataset files. We call it evaluation with multiclass labels (considering several classes of attacks). The second one uses the extra labels that we added to the CIC-IDS-2017 files, and that just indicates whether the entry is an attack or benign traffic. We called it evaluation with binary labels.

Each experiment will then be run in both multi classes vs. binary labels. Determining the optimal hyper-parameters will then be done for the two multiclass and binary labels approaches.

The methodology for finding out the 3 optimal RF hyper-parameters follows a 5-fold Cross-Validation approach. For each parameter, several runs with a wide range of values are performed, the other hyper-parameters being fixed to the best values previously determined. For the scoring of each run, we use the function score() of Scikit-learn which gives the accuracy of the detection. The accuracy is defined as the number of correctly identified samples over the total number of samples.

Results

The results of the determination of the 3 RF hyper-parameters optimal values are depicted in Table 4, where each cell of the table is the evaluation curve of the accuracy of the RF detection for one hyper-parameter. It especially shows the results obtained over both the train-set and the test-set, as a function of the value of the hyper-parameter being tested.

Based on these results we selected for each hyper-parameter the following values:

n estimators: we decided to fix the value to 80, because it is a maximum for the multiclass label, and that we need the same value for the binary label model in order to compare both binary and multiclass labels performances. max depth : we chose to fix the value to 15, because for higher values, for both binary and multiclass models, the train and test scores stop increasing significantly.

max features : we selected 15 as the best value because it gives a maximum score for both binary and multiclass models.

Analysis

Since the same resources are allocated to both binary and multiclass Classifiers, we can compare their results as achieved in the exact same situation. It clearly appears on the figures in table 4 that the use of binary labels gives better results than multiclass labels. Focusing only on binary classification results, Figure 1 shows several traditional evaluation parameters obtained with RF on the full CIC-IDS-2017 dataset.

Recall i = number of samples correctly assigned to class i number of samples belonging to class i

F1-Score = 2 • (Precision • Recall) (Precision + Recall) (2)
The accuracy line displays first the Scikit-Learn model.score and the number of samples. The model score is defined by: Model.Score = number of samples correctly assigned to their class total number of samples (4)

Finally, Figure 1 exhibits a very high accuracy score. This explains why Random Forest is so often praised for its intrusion detection capabilities.

To go deeper in the analysis of the capabilities of RF to detect attacks, Table 5 shows the detection performance for each of the 14 different attacks contained in the CIC-IDS-2017 dataset. Table 5 (FN) per attack kind, together with the number of samples of each attack present in the dataset.

displays the percentage of False Negative

It clearly appears with Table 5 that despite a very low global FN rate, some attacks remain mostly undetected by RF based anomaly detection (some attacks as SQL web attacks are always missed by the RF detector). It also appears that the attacks that are not well detected are the ones with the fewest samples in the dataset. A possible explanation to this problem is precisely the fact that these attacks are underrepresented in the dataset.

Analyzing the impact of training on RF detection performance

Results presented in Table 5 might exhibit a link between the detection ratio of some attacks with the number of their instances in the training dataset. Indeed, a low number of samples of an attack in the training dataset might cause a poor detection ratio for this kind of attack. In this section, it is then proposed to act on the training dataset to balance highly and poorly represented attacks. Three different approaches will be used:

-Undersampling: It consists in taking samples of the most represented class off the dataset. -OverSampling: It consists in creating new samples of a kind to increase its number of instances. For that, RandomOverSampler [13] is used. Rando-mOverSampler can create new samples with the features distribution of any attack type. -Class Weighting: Contrary to the two previous approaches, this method does not change the dataset. It consists in only changing the weight the RF algorithm assigns to each class in the Gini index calculation.

Undersampling

Undersampling consists in taking some samples of traffic classes highly represented off the training-set. The dataset is split as usual: 80% go to the training and 20% are used as a test-set. Since the RF detection has to be assessed in realistic conditions, as much as possible, the balance of the test-set is not changed. Indeed, in real conditions, NIDSs face a large majority of benign traffic. In the following, the balance is defined as the number of benign samples over the number of attack samples.

To assess the RF detection performance, different balances will be considered from 4 to 0.1 by taking off progressively some samples of benign traffic, so as to increase the related ratio of attacks with few samples. For each modified train set, RF detection is applied on the unchanged test set. Figure 2 presents the obtained detection scores.

The best score is obtained with the training set balance set to 0.7. The related RF detection accuracy is 0.9989. This is a small increase of the global detection ratio with RF. The details of the detection ratio per attack kinds are presented in section 5.3. However, changing the balance that is originally of 5 in CIC-IDS-2017 to 0.7 is a huge transformation. In addition, this balance of 0.7 is not necessarily a constant value that can be applied to any dataset captured on any network and at any time. Last, with undersampling, it still remains a significant difference of the number of samples in the training dataset corresponding to the different attacks.

Oversampling

The oversampling method consists in creating new samples of under-represented classes of traffic and injecting them in the already collected dataset. Here, we will focus on how to create new instances of under-represented attacks. Since it is barely impossible to reproduce the actual conditions of the network system in which the dataset was created, we are duplicating existing samples. The RandomOverSampler function from the Python Imbalanced Learn library [START_REF]RandomOverSampler Imbalanced Learn[END_REF] is used for that purpose. Of course, the idea of randomly picking some samples of under-represented classes of attacks, and exactly repeating them in the dataset is clearly prone to heavy statistical biases, as we will have many strictly identical samples in both the training and testing datasets. However, the shrinkage floating parameter of the RandomOverSampler function can add a distortion to the samples to be duplicated. Since the distortion is proportional to the samples' class's features standard deviations, we have to OverSample by attack types.

Random Forest with binary labels has been trained on the oversampled dataset, and its detection accuracy has then been tested on the original one. Results are reported in Figure 3.

It exhibits an accuracy performance when the training is done on an oversampled dataset very similar to the one when the training is done on an undersampled training set: 0.9987 vs. 0.9989 respectively. It is also very close from the detection accuracy obtained without under-or oversampling: 0.9986 (Figure 1).

Class weight

Given the poor improvement levels when training RF on under-or oversampled datasets, we finally tested another solution based on the "class weight" entry parameter of the RandomForestClassifier function. This parameter allows the user to assign a weight to the different classes considered. This weight is aimed at changing the calculation of the Gini index. At each node split, when a tree is being built, the algorithm tries to find a feature and a threshold that minimize the Gini impurity. The Gini index (impurity index) for a node can be defined as:

I g = i f i × (1 -f i ) = 1 - i f 2 i (5)
where f i is defined according to the weight applied to the class i by the formula :

f i = w i .n i i w i .n i (6)
where w i is the weight applied to class i and n i the number of samples belonging to class i Then, if a weight of 2 is put on a class of samples (and 1 on the others), we expect the Gini index to give the same results as if these samples were appearing twice in the considered node. We expect this method to artificially multiply by 2 the weight of the related classes, and this without any risk of bias, at the opposite of what arises in the oversampling case. Indeed, these samples are in the dataset only once, and the algorithm simply counts them as twice more important.

The principle of class weighting has been tried with several different balances between the weights of benign vs. attack classes. In the following, the weight on the benign class is always set to 1, moving only the weights of the attack classes. Figure 4 shows the accuracy score as a function of the weights ratio between the benign and attack classes (in this first experiment, the same weight is set for all attack classes). Figure 4 exhibits that the best result is obtained for a weight ratio of 0.2, which means a weight of 1 for benign samples and 5 for attack samples. Given that there are originally five times more benign samples than attack samples in the dataset, the use of these weights somewhat brings us back to a balanced situation. The best accuracy obtained with this method is 0.9989 (similar to the first under-sampled approach). This "weight" based method nevertheless appears better than the under-sampled one, as with under-sampling, a lot of information are lost, as many benign samples are thrown away. Another advantage of the weight-based method appears when looking at the detection performance of individual classes of attacks, as shown on Figure 5.

With the weighed-based training approach, the detection rate of all attack types has been reduced. This is particularly the case for under-represented attack classes. For example, the Bot attack FN rate has been decreased from 63 to 5%. The Infiltration attack FN has been decreased from 80 to 40%. And more importantly, some attack types have seen all their samples detected as the Patator attacks. Globally, the total number of FN has been reduced to 52. Going further with the weighted-based training method, let us apply different weights on the different attack classes. In the preceding experiment a weight of 1 has been set to the benign class and a weight of 5 has been set to all attack class. Let us now change the weight of the Web SQL Injection attack from 5 to 10, the weights of the other attacks remaining the same. Figure 6 then shows that the FN rate for SQL Injection attack is reduced from 42 to 28%. On the other side, the detection ratio of bot attack is raising from 5 to 7%, and the one of Infiltration attack from 40 to 60%. This type of results appeared for each attack type. When its weight has been increased with regard to the other attacks, the FN ratio has been decreased for this specific attack, but it is increased for many others. Differently changing the weight of attacks then creates some troubles in the way the training is done with RF. It is clear that using a black box approach is limiting the possibility of analyzing the decision making process of RF, and then its trustworthy nature. Thanks to the Scikit-Learn library [START_REF]Understanding the decision tree structure Scikit Learn[END_REF], more information is available, especially on the trees inside the RF (here 80 trees), and for each tree, much information on the nodes and leaves are provided, as the features and thresholds considered. Given the material at disposal, this part would require another 20 pages paper. Because of space limit, this section will just briefly present two of the objectives of the study and the related conclusions.

The first study deals with evaluating the RF performances in detecting 0d attacks. For that, RF is trained with the same 80% of the dataset, as usual, minus the samples from the chosen attack class. Then the performance of RF is tested on the same test-set as usual, therefore containing an attack type it has not been trained on. It then appears that RF is not good at detecting attacks. It detects a 0d attack only when it has in its dataset attacks that have very similar shapes, and even in that favorable case, results are not very good. Only some DoS and Web attacks are well detected. For unique types of attack, like PortScan or Bot, the results are close to 100% of missed samples. The results also show that using binary labels provide better results, as it leads to a generalized forest model compared to a multiclass of attacks approach.

A second study deals with analyzing what features are taken as essential for each detection tree in the forest. The impurity score of Scikit-Learn library allows us to rank features from the most to the least important as considered by the RF algorithm. The real impact of all these features on the detection of attacks was then tested. The process consists in taking off features from the dataset and retraining RF to evaluate its new accuracy in detecting attacks. By taking off features from the dataset, starting from the most important ones, it appears that these important features are not so essential in the decision making. Indeed, taking any of them off lowers the accuracy scores by only 0.01. Similarly, taking 20 features off the dataset sometimes does not imply any significant changes on the accuracy score. It is then very difficult to understand how RF makes its decision for classifying some slices of traffic as benign or malicious. A finer classification of attacks according to the multiclass approach is then very fuzzy, and the alarms not easy to understand for NetOps, that cannot trust them.

Concluding discussion

This paper provides a significant analysis of the RF algorithm for attack detection. RF has been configured in order to provide the best possible results. Then, the training dataset has been transformed in order to analyze its ability to detect specifically any kind of attacks contained in the dataset. This exhibits that improving the detection of one type of attacks can decrease the ability of detecting other kinds. A perfect detection has never been obtained. It is especially shown in the paper that it is impossible to explain how RF makes its detection decision. We argue that this conclusion can be extended to any machine learning algorithm for attack detection. They all can provide very good results higher than 99% of accuracy, but none of them is able to ensure a perfect detection of attacks without false alarms, and to provide explainable and trustworthy results.

This paper also exhibits that the proposed method in the related works are not necessarily usable with the expected level of accuracy in the actual network. Indeed, continuous training, or continuous algorithms parameters configuration are quite impossible to perform. However, these are essential stages for ensuring a high level of detection accuracy. Identifying the packets or flows constituting an attack is also difficult, very few algorithms being able of this identification necessary to trigger the appropriate countermeasures afterwards (in general only the ones with a solid pre-processing stage on the traffic and applying machine learning algorithms on some slices of the traffic can do it). In addition, the evaluation metrics as accuracy, F1-score, recall, etc. do not indicate what influences their results. As machine learning algorithms they are not easily explainable. This paper then aims at giving notice of the machine learning dogma in cybersecurity. It also points out all biases in the current approaches and methodology. If machine learning is obviously necessary in cyber-security, it has to be combined with other techniques that can explain raised alarms for trustworthy detection results.

Figure 1

 1 exhibits first the confusion matrix. The first line consists of two values: the number of True Negatives (TN) and False Positive (FP). The second line displays the number of False Negative (FN) and of True Positive (TP). The classification report shows a set of detection evaluation metrics (Precision, Recall, and F1-Score) for benign traffic class (line 0) and for attack class (line 1). The last column indicates for both benign traffic and attacks the number of sampled identified as such. Let us recall that the Precision, recall and F1-Score are computed as follows, for a class i : Precision i = number of samples correctly assigned to class i number of samples assigned to class i

Fig. 2 .Fig. 3 .

 23 Fig. 2. Undersampling experiment results

Fig. 4 .

 4 Fig. 4. Evaluation of the RF model for different Ratios of weight applied to classes

Fig. 5 .

 5 Fig. 5. Accuracy Score, Confusion Matrix and FN percentages for the best RF model obtained with Class weighting

Fig. 6 .

 6 Fig. 6. Accuracy Score, Confusion Matrix and FN percentages when favoring the SQLI attack class with the weighted-based training method

Table 1 .

 1 CIC-IDS-2017 files description

	File name	Day	Attacks found
	Monday-	Monday Benign (Normal Ac-
	WorkingHours.csv		tivity)
	Tuesday-	Tuesday Benign,	FTP-
	WorkingHours.csv		Patator,	SSH-
			Patator
	Wednesday-	Wednesday Benign, DoS Golden-
	workingHours.csv		Eye, DoS Hulk, DoS
			Slowhttptest,	DoS
			slowloris, Heartbleed
	Thursday-	Thursday Benign, Web Attack -
	WorkingHours-		Brute Force, Web At-
	Morning-		tack -SQL injection,
	WebAttacks.csv		Web Attack -XSS
	Thursday-	Thursday Benign, Infiltration
	WorkingHours-
	Afternoon-
	Infilteration.csv
	Friday-	Friday Benign, Bot
	WorkingHours-
	Morning.csv
	Friday-	Friday Benign, PortScan
	WorkingHours-
	Afternoon-
	PortScan.csv
	Friday-	Friday Benign, DDoS
	WorkingHours-
	Afternoon-DoS.csv
	type) and a binary label. Table 3 details the repartition of the different attack
	types in the dataset.

Table 2 .

 2 Examples of features from CIC-IDS-2017 dataset

	Feature name	Description of the Fea-
		ture
	Init Win bytes backward The total number of bytes
		sent in initial window in the
		backward direction
	Destination Port	Destination port of the flow
	Bwd Packet Length Min Minimum size of packet in
		backward direction
	Average Packet Size Average size of packet in the
		flow
	Fwd Packet Length Min Minimum size of packet in
		the forward direction

Table 3 .

 3 Distribution of Samples in CIC-IDS-2017

	Attack Type	Number of samples in the dataset
	BENIGN	2271320
	DoS Hulk	230124
	PortScan	158804
	DDoS	128025
	DoS GoldenEye	10293
	FTP-Patator	7935
	SSH-Patator	5897
	DoS slowloris	5796
	DoS Slowhttptest	5499
	Bot	1956
	Web Attack -Brute Force	1507
	Web Attack -XSS	652
	Infiltration	36
	Web Attack -Sql Injection	21
	Heartbleed	11

Table 4 .

 4 Hyper-parameters optimization results Confusion matrix and classification report for binary label RF model

	Binary Label Experiment	MultiClass Label Experiment
	n estimators
	max depth
	max features

Table 5 .

 5 FN rate per attack type for binary and multi class label RF detection

				Percentage Percentage
			Number of unde-	of unde-
			of	tected	tected
	Attack		sam-	samples	samples
	Type		ples	for	the	for	the
			in the	binary	multi-
			dataset label		label
				model	model
	DoS Hulk 230124 0.09%		0.11%
	PortScan 158804 0.02%		0.02%
	DDoS		128025 0.08%		0.11%
	DoS Gold-enEye	10293 1.58%		6.25%
	FTP-Patator		7935 0.06%		0.18%
	SSH-Patator		5897 0.16%		0.08%
	DoS slowloris		5796 1.23%		4.43%
	DoS Slowhttptest 5499 1.66%		5.19%
	Bot		1956 63.01%	63.26%
	Web At-
	tack Brute	-	1507 5.29%		5.96%
	Force
	Web At-tack -XSS	652	4.20%		45.45%
	Infiltration 36	80%		80%
	Web At-
	tack -Sql	21	57.14%	100%
	Injection
	Heartbleed 11	0%		0%

For unsupervised learning, both training and detection phases are joint.


Stéphanie Fabre
email: stephanie-externe.fabre@edf.fr

Céline Cabet
email: bceline.cabet@cea.fr

Laurent Cassayre
email: ccassayre@chimie.ups-tlse.fr

Pierre Chamelot
email: chamelot@chimie.ups-tlse.fr

Jorgen Finne
email: ejorgen.finne@edf.fr

Didier Noël
email: didier.noel@edf.fr

Pierre Taxil
email: gtaxil@chimie.ups-tlse.fr

Jörgen Finne

Electrochemical study of the corrosion of metals in molten fluorides

Keywords: Molten salts, fluorides, nickel alloys, electrochemistry

à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Introduction

Fluoride salts are contemplated for different applications such as heat carrier, electrolyte, solvent for the reprocessing of spent nuclear fuel or fuel in a molten salt reactor. Indeed they show the following characteristics: good stability at high temperatures, resistance to radiations, capacity to dissolve fission products, compatibility with the structural and the moderator materials, low cross section capture of neutrons [START_REF] Grimes | Molten-Salt Reactor Program[END_REF]. The compatibility of the structural materials with the fluoride medium is a key factor for the feasibility of processes which use these molten salts. Metallic materials have especially to resist corrosion by fluoride melts at high temperatures (typically 500-700°C). Research programs have already been completed in the 50-70's in support of the development of a molten salt reactor. Many types of alloys were tested in mixtures of LiF, BeF 2 , NaF, ZrF 4 , ThF 4 etc. Nickel-base alloys were proved to be the most resistant to corrosion. A dedicated alloy, under the brand name Hastelloy-N, was developed by ORNL (Oak Ridge National Laboratory-USA) based on its mechanical as well as corrosion properties (in air and fluoride melts). This nickel-base alloy is strengthened by molybdenum (16wt. %), and contains low chromium and iron percentages (7 and 5wt. %). Tests were carried out in thermal convection and forced-circulation loops. Analysis of salt samples and observation of the corroded alloy specimens evidenced that a mass transfer occurred along the temperature gradient [START_REF] Lane | Fluid Fuel Reactor[END_REF] which was influenced by different parameters: material nature, temperature gradient, level of impurities etc [START_REF] Koger | [END_REF]. Hastelloy N globally showed a good compatibility with highly purified molten fluorides [START_REF] Koger | Molten-Salt Reactor Program[END_REF]. However few studies were published regarding the corrosion mechanisms. The aim of this work is to give an insight on the basis of the corrosion of nickel-base alloys in molten fluoride salts. In a first approach, the corrosion rates of the pure metals, Ni, Mo, W and Fe were estimated in static conditions by electrochemical methods (voltammetry) and the roles of the temperature and of the chemical composition of the melt were investigated.

Experimental

Electrochemical reactor. The experiments were conducted in an electrochemical reactor dedicated to studies of metals in molten fluorides at high temperatures. Fig. 1 presents a scheme of the set-up. The measurements are carried out at temperatures up to 1200°C using a 3-zone resistance-heated furnace (AET Technology). The cell is made of a graphite jacket within which a glassy carbon crucible containing the salt (200g) is placed. The jacket protects the refractory steel container from the aggressive gasses and vapours. The cell is hermetically sealed by means of a water-cooled lid with an O-ring seal. All works are done under a circulating high purity argon atmosphere. The electrode assemblage is dipped into the melt from the top of the reactor and this electrochemical setup is connected to an Autolab PGSTAT 10 potentiostat, with GPES software. Electrode materials. A three-electrode set-up was used. Working electrodes were made of Ag, Ni, Mo, W and Fe 1mm diameter wires. The metals were purchased from Goodfellow with a purity of at least 99.98%. The immersed length was around 1cm (measurement made at the end of the experiment), corresponding to a surface of the working electrode in-between 0.32 and 0.42cm². A 3mm diameter vitreous carbon rod purchased from Goodfellow was used as a counter electrode. The comparison electrode was a 1mm diameter platinum wire with a purity of 99.99% (Goodfellow). A preliminary experiment allowed to determine that the potentials were reproducible for at least 2 weeks. Each electrode was attached to an Inconel 600 conducting rod inserted and bonded into an alumina tube (for electrical insulation).

Molten fluorides. Two different molten salt mixtures were used: LiF-NaF (61/39 mole %) and LiF-AlF 3 (85/15 mole %). These compositions correspond to eutectic points of each binary systems [5] and the liquidus temperatures are 649° and 720°C respectively. LiF was purchased from Merck, with a 99% minimum purity. NaF and AlF 3 were purchased from Alfa Aesar, with a minimum purity of 99.99%.

Humidity and oxygen are the main impurities of the melt and have to be removed so far as possible. The purification of the salt was achieved with a step-by-step heating procedure under vacuum. The mixture was finally melted under an argon atmosphere. The purity of the melt was checked after the melting by cyclic voltammetry (100mV/s) on a silver electrode. The absence of any other redox system than those of the oxidation of Ag and of the formation of the AgLi alloy in the cathodic region validated the purity level. It is assumed that the quantity of impurities (H 2 O and O 2 ) in the melt is below 5ppm and is quite stable.

Electrochemical methods. Experimental measures are done by electrochemical methods in order to indentify the mechanisms controlling corrosion. The Tafel and polarization resistance techniques can be applied in molten fluorides to measure corrosion rates as, commonly, no oxide scale forms [6]. Linear voltammetry was used with a sweep rate of 1 to 10mV/s. Experiments at different sweep rates showed that 1mV/s was the most adapted sweep rate to study the metals and enabled to be at quasi-equilibrium. For each metal, two sets of data were executed at 1mV/s to apply the Tafel method (recording of the variations of I as a function of E from the corrosion potential towards anodic potentials and then from the corrosion potential towards cathodic potentials) and the resistance polarization method (recording of the variations of I as a function of E from the corrosion potential to E corr +40mV and then to E corr -40mV -other ΔE were tested and I=f(E) was still linear for ±40mV hence the choice) [START_REF] Landolt | Presses polytechniques et universitaires romandes[END_REF].

Tafel method. The Tafel method was used to determine the value of the corrosion current density and the Tafel coefficients to be used in the resistance polarization method. The variation of the logarithm of the current density was plotted as a function of the overpotential using the data obtained from the linear voltammetry at 1mV/s. The linear portion of the curves close to a null overpotential could be extrapolated using the Tafel method, with Eq. 1 and Eq. 2 respectively in the anodic and cathodic parts [START_REF] Bard | Electrochimie -Principes, méthodes et applications[END_REF]:

. ln 1 ln ) ln( corr ox corr ox i i RT nF i + = + = η β η α (1) . ln 1 ln ) ln( corr red corr red i i RT nF i + - = + - = η β η α (2)
Where i=current density (A/cm²), α ox and α red =anodic and cathodic charge transfer coefficients, n=number of exchanged electrons, F= Faraday's constant (C/mol), R=ideal gas constant (J/mol.K), T=temperature (K), η=overpotential (V), i corr =corrosion current density (A/cm²) and β ox and β red =anodic and cathodic Tafel coefficients.

Polarization resistance method. The Stern and Geary equation (Eq. 3) established the relationship between the corrosion current density and the polarization resistance R p defined as (∂E/∂i) η=0 [START_REF] Scully | [END_REF]. The linear voltammetry curves with a sweep rate of 1mV/s within 40mV of the corrosion potential showed a linear region from which R p could be calculated. The ohmic drop was not corrected as measurements showed that the value of the resistance was negligible compared to the R p values. 1 .

2.3

ox red corr p ox red i R

β β β β = + (3)
Where R p =polarization resistance (Ω.cm²).

The corrosion rate given by Eq. 4 is obtained from the corrosion current density value: 11 3.15 10 .

corr corr i M v nF μ = × (4)
Where v corr = corrosion rate (mm/year), M=atomic weight (g/mol) and μ=density (kg/m 3 ).

Results and discussion

Thermochemical calculations. Potential-oxoacidity diagrams were established with the pure components database from the HSC software [10]. The stability domains of the metallic species are represented as a function of the potential vs. F -/F 2 (g) (Y axis) and of the co logarithm of the activity of the most stable oxide of the melt, pa(oxide)=-log[oxide] (X axis).

In the case of LiF-NaF, the oxide is Li 2 O. The equilibriums were calculated using the Nernst's equation [START_REF] Bard | Electrochimie -Principes, méthodes et applications[END_REF] with the following assumptions: F -/F 2 (g) was the reference system for potentials, the activities of the solutes were taken equal to 1 and the activity of the salt components was their molar ratio (a(LiF)=0.6 and a(NaF)=0.4). Fig. 2 presents the diagrams of Ni and Fe in LiF-NaF at 1100K. The lower limit corresponds to the reduction of the solvent (NaF) and the upper limit is the oxidation of O 2-ions. Corrosion behaviour of the metals. The pure metals, Ni, Mo, W and Fe, were studied in LiF-NaF at 900°C. Fig. 3 presents the linear voltammograms of those metals.

In the cathodic region the reaction is similar for all four metals: reduction of the solvent. As the linear voltammograms superimposed quite well in this domain, the anodic parts of the voltammograms of each metal can be compared. The sharp increase in the anodic region corresponds to the anodic dissolution of the metals.

Based on their oxidation potentials, the materials can be classified in order of stability as follows: Fe < Ni < Mo < W. Fe corrodes at the lowest potential, then Ni and Mo, while W is the most stable metal. Table 1 reports the Tafel coefficients, β ox and β red , the corrosion current densities from R p and from two interpretations of the Tafel method (Tafel-oxidation being the calculation of i corr using only the anodic equation and Tafel-intersection being the calculation of i corr from the intersection of the anodic and cathodic equations as shown in Fig. 4 b)) and the corrosion rates from Eq. 4. In order to calculate the corrosion rates, the number of exchanged electrons needs to be known. The following assumptions were made based on thermochemical data (most stable species for each metal in LiF-NaF): for Ni, Mo and Fe, n=2 and for W, n=4.

For a same metal, the values of i corr and v corr depend on the method used to make the calculations.

As shown in Fig. 4 b), the two points taken for ln(i corr ) can be somewhat shifted due to the Tafel extrapolation. The difference is small but noticeable for Fe and negligible for Ni, Mo and W. The Tafel methods and the polarization resistance method are interpretation of two different sets of data hence the discrepancy between the methods. Further calculations indicated that the resistance polarization method showed a good agreement between experimental results and theory with respect to the Arrhenius law (Eq. 5). The values of v corr enable to classify the metals towards their resistance to corrosion (based on the R p results): Ni, W < Fe < Mo. Mo being the metal that corrodes the fastest.

It is worth noticing that Fig. 4 shows no occurrence of any pseudo-passivity. So the corrosion corresponds to the pure dissolution of the metals, either directly or with the formation of an intermediate compound.

The comparison of the anodic Tafel coefficients verifies the direct observation of the curves in Fig. 4: Ni, Mo and W may follow a similar corrosion mechanism or have the same number of exchanged electrons whereas Fe behaves differently. Influence of temperature. The metals were tested in LiF-NaF at three temperatures: 900, 1000 and 1100°C. Values of i corr were obtained following the method described above (coupling Tafel coefficients and R p measurements). Fig. 5 presents the evolution of ln(i corr ) with the inverse of the temperature: the curves ln(i corr ) as a function of (-1/T) show a linear variation.

Table 2 presents the corrosion rates at each temperature according to Eq. 4 and the values of the activation energy E a calculated from Fig. 5 and Eq. 5:

exp .

a corr E i i RT - ⎛ ⎞ = ⎜ ⎟ ⎝ ⎠ o (5)
Where i°=pre-factor (A/cm²), E a =activation energy (J/mol), R=ideal gas constant (J/mol.K) and T=temperature (K).

For each metal, the corrosion rate increases with temperature. The more important the value of the activation energy is, the more the corrosion rate increases between two temperatures. It is possible to classify the metal towards their sensitivity to temperature by comparing the values of the activation energies: Ni < Mo < W < Fe. At this state of the study, those values of activation energies cannot be related to any particular mechanism. Influence of the composition of the melt. The metals were characterised in another salt mixture, LiF-AlF 3 . Table 3 reports the corrosion current densities and the corresponding corrosion rates. The values for LiF-NaF were calculated with the methods previously presented, but for LiF-AlF 3 , the values of i corr were estimated by a pure Tafel method (intersection of the extrapolated linear part of the ln(i)=f(η) curve with the ln(i) axis). For a given metal, the corrosion rate appears to increase as follows: LiF-NaF < LiF-AlF 3 . Several hypotheses may be suggested in order to explain this observation. It may be assumed that the mixtures have different fluoroacidities (solvating capability of F -ions) and oxoacidities. For the last named parameter there is a general lack of data and complementary experiments are needed in order to determine free oxide concentration and evaluate its impacts on corrosion rates.

However, concerning fluoroacidity, LiF-AlF 3 is more fluoroacid than LiF-NaF and it can be observed that the corrosion of the metal increases with the fluoroacidity of the melt, which is in good agreement with what is generally assumed.

Conclusion

Electrochemical methods allowed studying the corrosion behaviour of some pure metallic elements of the nickel base alloys that are of interest for nuclear applications using molten fluorides.

Validation of the experimental tools and procedures was based on the high purification levels that were achieved and on the good repeatability of the results. Stability order of the metals was established according to their respective oxidation peaks in LiF-NaF at 900°C. Linear voltammograms evidenced two corrosion behaviours: on the one side Ni, Mo and W and on the other side Fe. The difference could be due to different corrosion mechanisms or a different number of exchanged electrons. In any case, passivation has never occurred in the given test conditions (very low oxide content). Pure Tafel methods showed to be less sensitive than the method based on the coupling of the Tafel representation and the determination of the polarisation resistance to assess i corr . In LiF-NaF at 900°C, nickel and tungsten corrode the less, while molybdenum is the easiest to corrode. The corrosion rate increases with temperature following the Arrhenius law. However, further experiments in LiF-NaF, LiF-AlF 3 and in a third fluoride mixture, LiF-CaF 2 , are needed in order to identify the key parameters that influence the corrosion in these melts. Moreover, binary nickel alloys will be evaluated according to the same methods as the pure metals and the influence of oxides in the melts on the corrosion behaviour of the metals will be studied.

Fig. 1 .

 1 Fig. 1. Schematic of the set-up.

Fig. 2 .

 2 Fig. 2. Potential-oxoacidity diagrams of Ni and Fe in LiF-NaF at 1100K.

Fig. 3 .

 3 Fig. 3. Linear voltammetry of Fe, Ni, Mo and W in LiF-NaF at 900°C (sweep rate: 1mV/s, potential scanning from free potential towards anodic potentials and then from free potential towards cathodic potentials).

Fig. 4 a 4 .

 44 Fig. 4 a) presents linear voltammetry for the four metals in LiF-NaF at 900°C. The logarithm of the current density is plotted as a function of the overpotential. This Tafel representation evidences two different behaviours towards corrosion in the anodic part: Ni, Mo and W show similar linear evolutions, whereas the voltammogram of Fe has a steeper slope. Therefore two hypotheses can be formulated with respect to Eq.1: either the metals have different corrosion mechanisms (different values of the transfer coefficient, α) or they have a different number of exchange electrons.

Fig. 5 .

 5 Fig. 5. Influence of temperature on corrosion of Ni, Mo, W and Fe in LiF-NaF (precision is ±0.1A/cm²).

Table 1 .

 1 Results for Ni, Mo, W and Fe in LiF-NaF at 900°C (no precision is indicated for the values of β because the error is inferior to 5.10 -3 ).

	Metal	β ox	β red	Corrosion rate	Tafel-oxidation i corr [A/cm²] v corr [mm/year]	Tafel-intersection i corr [A/cm²] v corr [mm/year]	R p i corr [A/cm²] v corr [mm/year]
	Ni	0.27	0.12	i corr v corr	(4.6 ± 0.2) 10 -5 0.5 ± 0.01	(4.2 ± 0.3) 10 -5 0.45 ± 0.03	(4.0 ± 0.4) 10 -5 0.43 ± 0.04
	W	0.25	0.13	i corr v corr	(1.1 ± 0.1) 10 -4 0.82 ± 0.01	(1.1 ± 0.1) 10 -4 0.89 ± 0.07	(4.5 ± 0.6) 10 -5 0.43 ± 0.04
	Mo	0.29	0.15	i corr v corr	(9.6 ± 0.04) 10 -5 (9.3 ± 0.6) 10 -5 1.46 ± 0.01 1.42 ± 0.09	(6.7 ± 0.6) 10 -5 1.05 ± 0.09
	Fe	0.05	0.16	i corr v corr	(1.2 ± 0.1) 10 -4 1.41 ± 0.01	(1.7 ± 0.2) 10 -4 1.91 ± 0.22	(7.0 ± 0.7) 10 -5 0.81 ± 0.08

Table 2 .

 2 Values of the corrosion rates at 3 temperatures and of the activation energies of Ni, Mo, W and Fe in LiF-NaF.

	Metal	900°C	v corr [mm/year] 1000°C	1100°C	E a [kJ/mol]
	Ni	0.43 ± 0.04	0.62 ± 0.05	0.85 ± 0.07	42.29 ± 0.04
	W	0.43 ± 0.04	1.04 ± 0.09	2.41 ± 0.2	114.85 ± 0.64
	Fe	0.81 ± 0.08	1.49 ± 0.13	4.28 ± 0.46	110.45 ± 2.49
	Mo	1.05 ± 0.09	2.2 ± 0.2	4.56 ± 0.46	99.14 ± 3.60

Table 3 .

 3 Corrosion current density and corrosion rate of Ni, Mo, W and Fe in two LiF-based salts at 900°C (results calculated with R p for LiF-NaF and Tafel-oxidation for LiF-AlF 3 ).

	Metal	LiF-NaF	i corr [A/cm²]	LiF-AlF 3	v corr [mm/year] LiF-NaF LiF-AlF 3
	Ni	(4.0 ± 0.4) 10 -5	(9.3 ± 0.4) 10 -3	0.43 ± 0.04	99.7 ± 0.1
	W	(4.5 ± 0.6) 10 -5	(4.2 ± 0.1) 10 -2	0.43 ± 0.04	325.6 ± 0.1
	Mo	(6.7 ± 0.6) 10 -5	(5.1 ± 0.2) 10 -3	1.05 ± 0.09	77.4 ± 0.1
	Fe	(7.0 ± 0.7) 10 -5		x	0.81 ± 0.08	x


M Gibilaro

L Massot
email: massot@chimie.ups-tlse.fr

P Chamelot

P Taxil

Study of Neodymium Extraction in Molten Fluorides by Electrochemical Co-Reduction with Aluminium

This work concerns the co-deposition process of Al-Nd alloys in LiF-CaF 2 medium (79-21% mol.) on tungsten electrode at 860 °C using electrochemical techniques: cyclic and square wave voltammetries and potentiostatic electrolyses. Specific peaks of Al-Nd alloys formation were observed in cyclic voltammograms between the reduction waves of Nd(III) and Al(III), in a fluoride melt containing neodymium and aluminium ions. The difference of potential measured between solvent reduction and the alloys formation allows expecting an extraction efficiency of 99.99% by the use of the co-reduction process. The intermetallic compounds (Al 11 Nd 3 , Al 3 Nd, AlNd 2 and AlNd 3 ) were obtained and characterised by Scanning Electron Microscopy with EDS probe. The validity of the process was tested by carrying neodymium extraction in the form of Al-Nd alloy; the extraction efficiency was more than 95%.

INTRODUCTION

This work is dedicated to the simultaneous extraction of a Lanthanide (Ln) and Aluminium, which participates to the pyro-processing of nuclear wastes. Co-reduction of Ln with Al should allow eliminating together fission products and aluminium, providing from a previous treatment of wastes for recovering Actinides by the methodology of reductive extraction. This methodology consists in placing in a molten solution containing the element to be extracted (AnF 3 ) with a liquid metallic phase containing a reductive agent. The solute AnF 3 is reduced and then transferred into the metal.

According to the thermodynamic calculations of Conocar et al. [1], Al is the most promising liquid metal to extract An from the molten solution; the scheme of the extraction is:

( ) (solution) 3 AlF (metal) An metal Al (solution) 3 AnF + → + (1)
Further to the An-Ln separation, the excess of aluminium ions must be eliminated with other species of the waste mixture to recycle the molten solvent. For this purpose the simultaneous presence of these metallic ions in the melt lets up to attempt a co-reduction process which should have the advantage of extracting Al(III) and Ln(III) in a single step, yielding Al-Ln alloys.

Therefore the present work is dedicated to the extraction of both Ln and Al elements from molten fluorides solution. The process we used is the co-reduction of Al and Ln ions yielding an alloy of these two metals.

Neodymium is known to be the most concentrated element in the fission products [2]; so the study will be realised with neodymium as lanthanide.

The work described here comprises three parts:

(

EXPERIMENTAL

-The cell consisted of a vitreous carbon crucible placed in a cylindrical vessel made of refractory steel and closed by a stainless steel lid cooled inside by circulating water. The inner part of the walls was protected against fluoride vapours by a graphite liner containing the experimental crucible. The experiments were performed under an inert argon atmosphere (U-grade: less than 5 ppm O 2 ), previously dehydrated and deoxygenated using a purification cartridge (Air Liquide). The cell was heated using a programmable furnace and the temperature was measured using a chromelalumel thermocouple. A more detailed description of the device can be found in previous papers of our laboratory such as the one referred in [3].

-The electrolytic bath consisted of the eutectic LiF/CaF 2 (SDS 99.99%) mixture (79/21 molar ratio). Before use, it was dehydrated by heating under vacuum (3.10 -2 mbar) from the room temperature up to its melting point (762 °C) for 72 h. For providing aluminium and neodymium ions, aluminium fluoride AlF 3 (SDS 99.95%) and neodymium fluoride (SDS 99.99%) powders were introduced into the bath through a lock chamber under argon gas atmosphere.

-Electrochemical equipment: all electrochemical studies and electrolyses were performed with an Autolab PGSTAT 30 potentiostat/galvanostat controlled by a computer using the research software GPES 4.9.

-Electrochemical techniques: cyclic voltammetry, square wave voltammetry and potentiostatic electrolyses were used for the investigation of the aluminium-neodymium coreduction process.

-Characterisation of reduction products: after electrolysis runs, cathode surface was examined by Scanning Electron Microscopy (LEO 435 VP) equipped with an EDS probe (Oxford INCA 200) for determining the composition of the alloys.

-(I) Analytical setting

For investigations on electrochemical behaviour of the fluoride baths, we used the following cell components: Tungsten wire (1 mm diameter) was used as working electrode. The surface area of the working electrode was determined by measuring its immersion depth in the bath after withdrawing from the cell. The auxiliary electrode was a vitreous carbon rod (3 mm diameter) with a large surface area. Potentials were referred to a platinum wire (0.5 mm diameter) immersed in the molten electrolyte, acting as a quasi-reference electrode Pt/PtO x /O 2- [4]. This reference is reliable when the composition of the electrolyte remains unchanged, like in analytical experiments.

-(II) Extraction setting

Compared with the previous setting, the extraction experiments need specific arrangements:

1-The reference electrode is a nickel 1 mm diameter wire immersed in a mixture of LiF-CaF 2 -NiF 2 (1 mass %), placed in a boron nitride basket. This reference electrode was proved to be reliable in molten fluoride baths [5]. Moreover, the insulation from the electrolytic bath guarantees the invariability of its potential with the change of composition of the electrolyte.

2-The anode made of vitreous carbon was isolated in a graphite compartment containing LiCl-LiF-CaF 2 eutectic mixture. The anodic reaction was the chlorine release; the electrode compartmentalisation avoids gas and fluoride media mixing and reoxidation of Al-Nd compounds catholically formed.

3-The working electrode was a tungsten plate with a large surface area (3 cm²).

RESULTS AND DISCUSSION

Co-Reduction Principle

The simultaneous reduction of two or several ions on an inert cathodic material was widely described by Brenner [START_REF] Brenner | Electrodeposition of alloys[END_REF] and more recently by Taxil et al. [START_REF] Taxil | [END_REF].

In the case of two metallic ions, R n+ and N p+ where R is the more reactive precursor, N the less reactive and R x N y the alloy formed by coreduction, the co-reduction process occurs in three steps:

(1)

xR ne n xR = - + + (2) yN pe p yN = - + + (3) y N x R yN xR = +
The overall process is:

( ) y N x R e p n p yN n xR = - + + + + + (2)
The equilibrium potential of the system R/R x N y can be expressed as:

⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎣ ⎡ + + + = + ) ( ln 0 y N x R in R a n R a nF RT R n R E y N x R n R E (3) [ ] ) ( ln y N x R in R a nF RT R n R E y N x R n R E - + = + (4)
Where R R n E + the equilibrium potential of pure R element, T the absolute temperature in K, n the number of exchanged electron, F the Faraday constant (96 500 C) and a R (in R x N y ) the activity of R in the intermetallic compound R x N y . As a R in R x N y is less than one, it can be deduced that

R n R E y N x R n R E + > + .
So, the co-deposition of R with a more noble metal allows R n+ ions to be reduced at a potential shifted towards more positive values, compared to the pure metal deposition: this "depolarisation effect" is similar to one observed when the reduced element reacts with the cathode material [8]. Nevertheless, the depolarisation effect is significative only if the binary system R-N can form intermetallic compounds.

After showing the results obtained in our laboratory on the respective electrochemical behaviour of Al and Nd in fluoride solutions, we will investigate the behaviour of these elements together in molten fluorides in order to define accurately the potential of formations of intermetallic compounds.

Previous Results on NdF 3 and AlF 3 Reduction Mechanism

Cyclic voltammograms

The NdF 3 electrochemical reduction on inert electrode was investigated in our laboratory by Hamel [9] and Nourry [START_REF] Nourry | Extraction Electrochimique des Lanthanides des Milieux Fluorures Fondus par Formation d'Alliage[END_REF]. Like NdF 3 , AlF 3 electrochemical behaviour was studied by our team in [8]. On the cyclic voltammogram of LiF-CaF 2 -AlF 3 (C 0 = 1.82 10 -4 mol.cm -3 ) presented in Fig. 2, plotted at 860 °C and 100 mV.s -1 , a single peak is observed in the cathodic run at around -1.25 V vs. Pt. This peak is associated with an oxidation peak (stripping peak) at around -1 V vs. Pt. The Al(III) reduction mechanism is assumed to be:

-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 -2.2 -1.7 -1.2 -0.7 -0.2 0.3 0.8 E (V vs. Pt) i (A/cm²) 1
Al 3e Al(III) = - + (6)
Then, the influence of the scan rate on the peak intensity was considered to verify the Berzins Delahaye relationship for a soluble/insoluble system [START_REF] Berzins | [END_REF]:

1/2 v 1/2 D 1/2 RT nF o nFSC 0.61 p I ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ × - = (7)
where S is the electrode area in cm 2 , C o the solute concentration in mol.cm -3 , D the diffusion coefficient in cm 2 .s -1 , F the Faraday constant (96500 C), n the number of exchanged electrons, v the potential scanning rate in V.s -1 and T the temperature in K.

The linearity of Ip versus v 1/2 was proved for both metallic ions so the electrochemical reduction process of Nd(III) and Al(III) is diffusion-controlled. The slope of this linear equation is found to be: -for neodymium ions:

2 - .cm 1/2 - .V 1/2 s A. 0.7866 1/2 v S p I - = × (8)
at T = 860°C and C o = 2×10 -4 mol.cm -3 -for aluminium ions:

2 - .cm 1/2 - .V 1/2 s A. 0.4228 1/2 v S p I - = × (9)
at T = 860 °C and C 0 = 1.82 10 -4 mol.cm -3

Square wave voltammetry

To determine exchanged electron number, we used the square wave voltammetry which is an accurate method for this purpose [12]. In this method, derived from cyclic voltammetry, the scanning of potential proceeds stepwise with superimposition, on each step of the staircase, of two potential pulses, direct and reverse, with equal values. Plotting the differential intensity measured at each step between the successive pulses versus the potential associated to each electrochemical reaction provides a Gaussian shaped peak. In the case of a reversible system, mathematical analysis of the peak yields a simple equation associating the half-width of the peak (W 1/2 ) and the number of electrons exchanged:

nF RT 3.52 1/2 W = (10)
Fig. 3 shows that the square wave voltammogram of NdF 3 in LiF-CaF 2 exhibited a single peak. Accordingly, measuring the half-width of the half peak can perform the calculation of n.

Using this methodology, the average value of W 1/2 is 114 mV; according to Eq. ( 9), the result for n is close to 3 (2.88). This result allows the diffusion coefficient of Nd(III) ions to be calculated, at 860°C so we find D = 1.61 10 -5 cm².s -1 .

-0.14 Measuring W 1/2 (W 1/2: 112mV in this figure) gives as described in Eq. ( 10) an average value for the number of electrons exchanged of 3.06 ± 0.1.

The diffusion coefficient D Al(III) was calculated according previous results and Eq. (9); its value is 5.59 10 -6 cm².s -1 at T = 860 °C.

Investigation of the LiF-CaF 2 -AlF 3 -NdF 3 System

According to Eq.( 4), the equilibrium potential shift of neodymium metal deposition in the anodic sense is expected for the co-reduction of Al and Nd ions into a binary Al-Nd compound where the activity of each element is less than one.

Experiments were carried out on an inert tungsten electrode at 860 °C and with the analytical setting described in (I) of the Experimental part; the electrochemical behaviour of the Al-Nd system was investigated by cyclic voltammetry and square wave voltammetry. The same metallic ions concentrations than in the individual studies above were used: [Al(III)] = 1.8 10 -4 mol.cm -3 and [Nd(III)] = 2 10 -4 mol.cm -3 .

Square wave and Cyclic voltammograms of the mixture is presented in Fig. 5 and6 respectively.

-First, the AlF 3 NdF 3 mixture was studied by square wave voltammetry on W electrode at 860 °C at a signal frequency of 9 Hz; Fig. 5 evidences that in addition to Al(III) peak (2 a) and Nd(III) peak (1 a), new co-reduction peaks (3 and 4 a) observed between (2 a) and (1 a). Furthermore, we notice an increase of the current density is observed on peaks (2 a) and (1 a), corresponding to pure metals deposition, probably due to the superimposition of alloys peaks. -Then, cyclic voltammetry on W electrode at 860 °C and the voltammogram (Fig. 6) confirms the same distribution of peak potentials. Short potentiostatic electrolysis runs during 1200 s were performed on a tungsten electrode to prove that Al-Nd alloys could be produced in LiF-CaF 2 by co-reduction of the respective ions. Just after each run, the alloyed electrode was quenched by a rapid withdrawing from the cell. Then, an EDS analysis, joined to the SEM observation of the sample cross section, allowed us to determine all the composition phases observed on micrographs. E p = -1.33V vs. Pt: this peak (2 a) is at the same potential than the one observed on Fig. 2 for the reduction of Al(III) into Al with only aluminium fluoride in the bath. It can be noted that the peak intensity is higher when both Al and Nd ions are presenting the bath. The product of this electrolysis, presented in Fig. 7, exhibits only one intermetallic compound formed at the cathode, Al 11 Nd 3 , instead of pure Al as expected from Fig. 2. We can first note that the alloy is no adherent to the tungsten electrode. This observation leads us to conclude that at this potential, Al(III) is co-reduced with Nd(III), that explains the higher peak current density peak (2 a) observed in Fig. 5 for similar contents in Al(III). At this potential of pure neodymium deposition observed in Fig. 1, the electrolysis yields in Fig. 8 an intermetallic Al-Nd compound on the tungsten surface. The EDS analysis allows determining that the product is AlNd 3 . Once again, this result explains the increase of the cathodic current density observed in Fig. 5 Through these preliminary observations, it can be concluded that the Al-Nd alloys codeposition can be performed from a molten solution containing the respective metallic ions reduced together at the cathode in a potential range between depositions of each pure metal.

As a general conclusion of these experiments:

(I) the aluminium-neodymium co-reduction on tungsten electrode can yield Al-Nd compounds, non adherent on the substrate and which are thus released in the bath.

(II) The composition of the alloys is depending on the potential of the cathode; we observe that more the electrolysis potential is cathodic, higher is the neodymium content in the intermetallic compound, as expressed in Eq. ( 4) where the depolarisation term is a function of the neodymium activity in the Al-Nd alloys.

Electrolytic Extraction of Neodymium Ions by Co-Reduction

The following part of the work will concern the extraction of Nd(III) by co-reduction with Al(III) ions.

Experimental Conditions

The extraction was realised on tungsten electrode in LiF-CaF 2 media at T = 860°C. The initial concentrations in metallic ions were: [Al(III)] = 2.6 10 -4 mol.cm -3 ; [Nd(III)] = 7.5 10 -5 mol.cm -3 .

The experimental setting is described in the Experimental part (II) with a specific reference electrode and anodic compartment. Unlike to the preceding part of this work, extraction process implies the change of the composition therefore we had to replace, as reference of potentials, the platinum wire by a NiF 2 /Ni reference electrode isolated from the bath, to guarantee a more stable potential during long time electrolyses.

The electrolysis potentials were chosen by drawing on a W wire a cyclic voltammogram; this potential was the co-reduction peak (3a). Then, potentiostatic electrolysis was performed on a tungsten plate as cathode. Finally, an afterelectrolysis voltammogram is recorded to observe the extraction progress, correlated to the electrochemical signal decrease. These stages are repeated as a long as an electrochemical signal, provided by the melt in the electrochemical window of the fluoride solvent, can be detected by cyclic voltammetry.

Neodymium Aluminium Co-Reduction: Extraction Process

Electrolyses were performed on a tungsten plate during 3 hours and a record of the current versus time is plotted in Fig. 11. The disturbances of the current signal noted at this figure can be explained by the detachment of the alloy at the cathode surface. As it was observed above, the electrodeposited alloys are non adherent. Two steps can be supposed:

(I) the growth of the alloy phases increases the surface, thus the current (II) the alloy phase is released in the bath and the surface goes back to its stationary value.

As mentioned above, the process was followed by drawing periodically cyclic voltammograms of the solution. Such typical voltammograms are presented in Fig 12 where only the cathodic part is showed. A significant decrease of the current density on the cyclic voltammetry is observed, correlated to the decrease of Al(III) and Nd(III) ions concentration in the bath during the extraction process. Electrolyses were performed during 50 hours to obtain a cathodic current density value approaching zero. According to the comparison of the current, measured on the Fig. 12, at the end of the extraction process and at the one at the beginning of the process, the extraction efficiency was estimated to be at least 95% in neodymium.

CONCLUSION

The possibility of preparing Al-Nd compounds by co-deposition was evidenced on the cyclic voltammogram of the Al-Nd fluoride solutions: specific electrochemical systems for the co-reduction of Al(III) and Nd(III) ions were identified in the potential range between pure Al and Nd metals deposition. Each of the four reduction waves observed are correlated to Al-Nd intermetallic compounds, further identified with SEM observation and EDS analysis after a short electrolysis run: Al 11 Nd 3 , Al 3 Nd, AlNd 2 and AlNd 3 were obtained on a tungsten electrode. At increasing cathodic potential, these compositions are in agreement with Equation 5where more the electrolysis potential is cathodic, higher is the neodymium content in the alloy.

So, these preliminary experiments have shown that it is possible to extract both neodymium and aluminium ions present in the melt at potential comprised between the equilibrium potentials of each metal. Furthermore, a new experimental setting for the extraction has been developed and tested successfully and lead to an extraction efficiency of Nd(III) estimated to be at least 95 %.

This work has shown that a novel process for lanthanides extraction based on the coreduction between Al(III) and Nd(III) ions can be proposed. This method presents the advantage to eliminate simultaneously the two metallic ions in order to recycle the fluoride solvent. Indeed this co-reduction process can be extended to other electrochemical systems. Thus, in a more general aspect, this work lets to expect a promising route for preparing intermetallic compounds involving aluminium and lanthanides.

  I) Investigation on the respective reduction mechanisms of Al(III) and Nd(III) in LiF-CaF 2 on tungsten electrode (II) Investigation on the co-reduction of the mixture AlF 3 -NdF 3 and observations of the products of the co-reduction (III) Trial runs of quantitative extraction of Al and Nd by Al(III) and Nd(III) coreduction.

a 1 bFig. 1 :

 11 Fig. 1: Cyclic voltammogram of the LiF-CaF 2 -NdF 3 (2 10 -4 mol.cm -3 ) system at 100 mV.s -1 and T = 860 °C. Working electrode: W; Counter electrode: vitreous carbon; Quasi-reference electrode: Pt On the cyclic voltammogram of the LiF-CaF 2 -NdF 3 (C 0 = 1.10 -4 mol.cm -3 ) system at 860 °C on inert Mo electrode at 100 mV.s -1 shown in Fig. 1,

Fig. 2 :

 2 Fig. 2: Typical cyclic voltammogram of the LiF-CaF 2 -AlF 3 (1.8 10 -4 mol.cm -3 ) system at 100 mV.s -1 and T = 860 °C. Working electrode: W; Counter electrode: vitreous carbon; Quasireference electrode: Pt.

Fig. 3 : 2 Fig. 4 :

 324 Fig. 3: Square wave voltammogram of LiF-CaF 2 -NdF 3 (2 10 -4 mol.cm -3 ). Frequency: 9 Hz; T = 860 °C; Working electrode: W; Counter electrode: vitreous carbon; Quasi-reference electrode: Pt.A typical square wave voltammogram of the system LiF-CaF 2 -AlF 3 (C 0 = 1.82 10 -4 mol. cm -3 ) is shown in Fig.4at T = 860 °C and f = 9 Hz. The curve exhibits one peak at about -1.2 V vs. Pt which corresponds to the E p/2 of the cyclic voltammogram.

Fig. 5 :

 5 Fig. 5: Square wave voltammogram of the LiF-CaF 2 -AlF 3 -NdF 3 system (respectively 1.8 10 -4 and 2 10 -4 mol.cm -3 ) at 9 Hz and T = 860 °C. Working electrode: W; Counter electrode: vitreous carbon; Quasi-reference electrode: Pt.

Fig. 6 :

 6 Fig. 6: Cyclic voltammogram of the LiF-CaF 2 -AlF 3 -NdF 3 system (respectively 1.8 10 -4 and 2 10 -4 mol.cm -3 ) at 100 mV.s -1 and T = 860 °C. Working electrode: W; Counter electrode: vitreous carbon; Quasi-reference electrode: Pt.

Fig. 7 :

 7 Fig. 7: Micrograph of the cross section of a tungsten wire after electrolysis. Experimental conditions: T = 860 °C, E = -1.33 V vs. Pt, t = 1200 s.² E p = -1.88 V vs. Pt: the Nd(III)/Nd system of Fig. 1 is again observed on Fig. 6 (peaks 1 a and 1 b) with a similar enhancement of the peak.At this potential of pure neodymium deposition observed in Fig.1, the electrolysis yields in Fig.8an intermetallic Al-Nd compound on the tungsten surface. The EDS analysis allows determining that the product is AlNd 3 . Once again, this result explains the increase of the cathodic current density observed in Fig.5for the Al-Nd co-reduction and suggests a superimposition of peaks of Al-Nd co-reduction and pure Nd deposition.

3 WFig. 8 :Fig. 10 :

 3810 Fig. 8: Micrograph of the cross section of a tungsten wire after electrolysis. Experimental conditions: T = 860 °C, E = -1.88 V vs. Pt, t = 1200 s. E p = -1.49V vs. Pt: the first additional reduction peak (3 a), comprised between the respective reduction potentials of Al(III) into Al and Nd(III) into Nd, should be attributed to the aluminium-neodymium co-reduction. Its reoxidation peak is observed at E = -1.34 V vs. Pt

Fig. 11 :

 11 Fig. 11: Cathodic current on tungsten electrode during potentiostatic electrolysis versus time. Experimental conditions: T = 860 °C, S = 3 cm², E = -1.5 V vs. NiF 2 /Ni.

Fig. 12 :

 12 Fig. 12 : Cathodic current density evolution during electrolysis measured by cyclic voltammetry. Experimental conditions: T = 860 °C, v = 100 mV.s -1 ; Working electrode: W; Counter electrode: vitreous carbon; Reference electrode: NiF 2 /Ni.