Machine Learning and Deep Learning Techniques used in Cybersecurity and Digital Forensics : a Review Jaouhar Fattahi, Ph.D Abstract In the paced realms of cybersecurity and digital forensics machine learning (ML) and deep learning (DL) have emerged as game changing technologies that introduce methods to identify stop and analyze cyber risks. This review presents an overview of the ML and DL approaches used in these fields showcasing their advantages drawbacks and possibilities. It covers a range of AI techniques used in spotting intrusions in systems and classifying malware to prevent cybersecurity attacks, detect anomalies and enhance resilience. This study concludes by highlighting areas where further research is needed and suggesting ways to create transparent and scalable ML and DL solutions that are suited to the evolving landscape of cybersecurity and digital forensics. 1 Introduction In this age of technology and digital advancements cybersecurity has become a priority due to the fast paced growth of technology and the growing dependence on digital platforms. This reliance has opened up avenues for advancement and creativity. It has also brought about risks and dangers that pose a challenge to safeguarding digital resources and confidential data. Digital forensics works hand in hand with cybersecurity by looking into and solving incidents that happen on; it concentrates on collecting and safeguard proof and then examining it further to find answers. This process is vital in identifying cybercrimes like identity theft and fraud while also making sure that those responsible are held accountable in the world. The introduction of machine learning (ML) and deep learning (DL) techniques into investigations have expanded its functionalities by automating the analysis of data sets efficiently. This helps in better spotting harmful software and getting deeper insights, into intricate cyber events. In this study we are going to review common machine learning and deep learning techniques used in cybersecurity and digital forensics applications. 2 Standard Machine Learning techniques and algorithms 2.1 Machine Learning Machine Learning is an area of artificial intelligence that involves the design, analysis, development, and implementation of methods that allow a machine to evolve through a systematic process, which allows it to accomplish tasks that are difficult to perform by conventional algorithmic means without using explicit instructions. This process roughly consists of the following seven sequential steps. 1. Collecting data: this step is extremely important because the quality and quantity of data the data scientist collects will directly affect the quality of the predictive model. A good data collection must ensure that data belonging to one class or another is balanced (i.e. reflecting the reality). The collection should also be as comprehensive as possible and should not focus only on the general case. It must also provide a sufficient number of samples that can provide reliable results. The more samples there are, the more generalizable the predictive model is. 2. Investigating data: this step aims at understanding the characteristics of the collected data and probably pre-processing them prior to being used to build the model. In this step, it is a good practice to perform some checks on data by printing a data summary containing the number of samples, the number of classes, the number of samples pertaining to a class, the data distribution, etc. Using visualization tools is also recommended to pick up relevant relationships between different variables and to discover if the data are balanced or not and if there are missing data or not. The data scientist needs also to perform some relevant and useful measurements like calculating the correlation between features and the output to determine which features are important and which ones are less important, as well as whether the features are linearly correlated or not. 3. Preparing data: a data scientist needs to split the data in at least two parts. The first part will serve to train the model. The second part will serve to evaluate the model performance. In a wide range of cases, data needs other types of treatment like normalization, error correction, tokenization, vectorization, data type conversion, data de-duping, etc. 4. Choosing the model: the choice of the best model for a given problem depends on the size, quality, and nature of the data. Even the most experienced data scientists cannot always know which algorithm will work best before they try it. However, there are some models that are better suited to certain types of problems. For instance, some are very well suited to image data, others to sequences (such as text or music), some to digital data, others to particular textual data. 5. Training the model: To build a model, one first tries to find the optimal model using the training data. This consists in using a metric called a loss function that uses numerical optimization techniques. The loss function determines to what extent the modelling of the problem, which is an approximation of reality, loses information in relation to the reality observed through the data samples. Structured, clean, and consistent data samples are worth gold. It is also important to have the right amount of data. To ensure better learning dynamics while making reasonable use of available resources, it is common to split the data into packets, called batches. When we have gone through all the batches, we say that we have run an epoch. 6. Evaluating the model: model evaluation (or validation or testing) consists in running it with data that have never been used for training. This allows to observe how the model could work with data that it has not yet explored. Many metrics are widely used to determine how well the built model behaves, such as accuracy, precision, recall and F1 Score. The confusion matrix is also widely used to determine false positives, false negatives, true positives and true negatives. To provide a visual touch, Receiver Operating Characteristic (ROC) curves could also be used. 7. Tuning the model parameters: once the model evaluation is completed, it is possible that its performance may be unsatisfactory and that it could improve further. This can be done by tweaking its parameters. These parameters can be related to initialization, regularization, optimization, learning rate, batches sizes, number of epochs, or even to the model architecture. 2.1.1 Supervised learning Learning is said to be supervised when the data entering the process are already categorized (labeled) and algorithms must use them to predict an outcome so that they can proceed the same way when the data are no longer categorized. In other words, in supervised learning one has prior knowledge of what the output values of the samples should be. 2.1.2 Unsupervised learning Unsupervised learning is much more complex since the system has to detect similarities in the data it receives and organize them accordingly. Unsupervised learning therefore has no labeled outcomes. Its objective is thus to deduce the natural structure present in a set of data points. In other words, in unsupervised learning one does not have prior knowledge of what the output values of the samples might be. 2.1.3 Classification Classification is a family of supervised methods used to categorize data using an algorithm. It requires that the data points have discrete values. The learning data are grouped in categories (classes). Then, the new input data are classified according to the learned data. Classification produces discrete values. 2.1.4 Regression Regression is a supervised method for understanding the relationships between a variable of interest and explanatory variables. Regression usually requires that the data points have continuous values. In a regression, first, the factors (i.e. independent variables) are found. Then, coefficients (i.e. multipliers) with independent variables are calculated to minimize differences between true and predicted values. Finally, a formula for the regression is set. This formula is used to predict the dependent variable (i.e. one wants to measure) from independent variables (i.e. one thinks the target measure hinges on). 2.1.5 Clustering Clustering is an unsupervised technique that consists in grouping the data into homogeneous groups called clusters, so that the elements within the same cluster are similar, and the elements belonging to two different clusters are not similar. 2.1.6 Reinforcement learning Reinforcement Learning is a method that consists in letting the algorithm learn from its own errors. The algorithm begins by making totally random decisions and then develops its own method to correctly accomplish the task entrusted to it. That is, an agent in a current state S learns from its environment by interacting with it through actions. Once an action A is performed, the environment returns a new state S^{\prime} along with an associated reward R , which can be positive (for a good action) or negative (for a bad action). This process is repeated until the agent decision reaches a confirmed maturity translated into a long and steady behaviour of good actions. Thus, this learning method has the advantage of allowing the machine to be more creative. 2.1.7 Common problems • Underfitting: this problem happens when the model cannot capture enough patterns from data. This may be the case when one uses a model for a problem of an incompatible nature (e.g. a linear regression for a non-linear problem, a simple Artificial Neural Network (ANN) for a sequential problem, an Recurrent Neural Network (RNN) without memory for problems needing past information, etc.). When underfitting is observed, the model accuracy is generally low. • Overfitting: this is the opposite of the under-fitting problem. It happens when the learning clings too closely, or even exactly, to a particular set of data. We say that the model learns the existing data by heart . A model in an underfitting (or overlearning) situation has difficulty generalizing the characteristics of the data and loses its predictive capabilities on new samples. Figure 1: Model underfitting and overfitting • Missing data: real-world data are not always neat and consistent. Generally, they are prone to being incomplete, noisy, and incongruous, and it is important for the analyst to handle them by either populating in the missing values or removing them as they can induce prediction or classification mistakes. There are many possible reasons why they happen, ranging from human mistakes in data acquisition to imprecise sensor measurements by way of software glitches in the data handling process. A common way to correct this is to replace missing values with the mean, median, or mode values. They can also be attributed the value given by a regression model, such as linear regression, or the value having the majority of votes using a k -Nearest Neighbours ( k -NN) model. • Vanishing gradient: the problem of the vanishing gradient arises when one trains a neural network model using gradient optimization techniques. This is one of the major problems in Machine Learning and Deep Learning because it usually leads to a very long training time or even to a non-convergence towards the correct minimum. It is manifested by the fact that the gradients tend to become smaller and smaller as one keeps moving backward in the neural network during the back-propagation phase until the model ceases learning from data. This problem, which we will present in more detail in this document, is addressed in several ways, such as by using appropriate activation functions, or models with short memory such as Long Short-Term Memory (LSTM) models and Gated Recurrent Units (GRU) models. • Exploding gradient: gradient explosion occurs when large error gradients build up which results in huge updates to the weights of the model during the training phase. When gradient amplitudes accumulate, network instability generally results, which may lead to bad prediction outcomes. This problem is usually handled using clipping techniques to keep gradients stable. With these techniques, a predefined gradient threshold is used, and then the gradients that are above this threshold are rescaled. • Initialization: initialization can have a direct effect on model convergence. It can speed up training or it can generate awkward problems. It may generate exploding or vanishing gradients. Some guide lines and techniques [ 1 , 2 ] are proposed to provide suitable initial values to a given model. This still remains an active research area though. 2.2 Machine Learning Algorithms 2.2.1 Linear Regressions Linear regression (LinR) was first used in statistics to understand the link between input and output of numerical variables. It is used in Machine Learning as a model to predict the output from the inputs under the assumption of a linear relationship between them. LinR is probably the simplest Machine Learning model. For a single input and x a single output y , the model consists in a line having the following equation: y=b_{0}+b_{1}x For multiple inputs, the model consists in a hyperplane having the following equation y=b_{0}+b_{1}x_{1}+b_{2}x_{2}+...+b_{n}x_{n} Various techniques can be used to prepare the linear regression equation from a training dataset and hence to find the most adequate coefficients for the problem. The most widely used is the standard ordinary least (sum of) squares method. For a simple LinR, this method consists in minimizing the error observed between the predicted and the true outputs of the data set, given by the following equation: E(a,b) = \displaystyle\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2} = \displaystyle\sum_{i=1}^{n}(y_{i}-(\hat{b}_{0}+\hat{b_{1}}x_{i}))^{2} where \hat{y}_{i} is the actual output for the example i . Figure 2: Linear Regression To determine the coefficients \hat{b}_{0} and \hat{b}_{1} , the following steps are performed. 1. Compute the partial derivative of E(a,b) with respect to \hat{b}_{0} and \hat{b}_{1} ; 2. Set each partial derivative to zero; 3. Solve the resulting system of equations. This results in the following values: \left\{\begin{array}[]{ll}\hat{b}_{0}=&\bar{y}-\hat{b}_{1}\bar{x}\\ \\ \\ \hat{b}_{1}=&\displaystyle\frac{\displaystyle\sum_{i=1}^{n}(x_{i}-\bar{x})(y_{i}-\bar{y})}{\displaystyle\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}}\\ \end{array}\right. where \bar{x} is the mean value of the inputs and \bar{y} is the mean value of the outputs. These two values are used as estimators for b_{0} and b_{1} respectively. With multiple linear regression (i.e. linear regression with many predictors), k independent variables and k+1 regression coefficient are involved. The steps to calculate these coefficients are similar to simple regression ones, but one must solve k+1 equations with k+1 unknowns to find the least-squares solution. This involves a few matrix operations like matrix multiplications and matrix inversions. It is worth mentioning that there is another type of regression called polynomial regression in which the regression function can involve terms such as b_{i}x_{j}^{k}x_{p}^{h} . This regression could be seen as a linear regression by performing a variable change and considering the term x_{j}^{k}x_{p}^{h} as a new predictor. To know how well a linear regression model fits the data, we calculate the coefficient of determination (also called R -squared) given by: R^{2}=\displaystyle\frac{\displaystyle\sum_{i=1}^{n}(\hat{y}_{i}-\bar{y})^{2}}{\displaystyle\sum_{i=1}^{n}(y_{i}-\bar{y})^{2}} If the coefficient of determination is close to 1 , then the linear regression model is a good fit for the problem. If it is close to 0 , then the model is not adequate for the problem. Another metric to measure the accuracy of predictions is the standard error of the estimate (also called the residual standard error or the root mean square error) given by: \sigma_{\text{est}}=\displaystyle\sqrt{\displaystyle\frac{\displaystyle\sum_{i=1}^{n}(\hat{y}_{i}-\bar{y})^{2}}{n-p}} where p is the number of parameters being estimated. If we calculate the standard error of the estimate for a regression model with b_{0} and b_{1} , then p=2 . The smaller is \sigma_{\text{est}} the better is the model because a value close to zero indicates that most observations are close to the fitted line. Linear regression is a very simple and intuitive method. In addition to its capability to classify data and predict the output of unseen data, it helps to understand the relationship between variables. However, it is only useful when the relationship between variables is linear. It is also sensitive to outliers. 2.2.2 Logistic Regressions Logistic regression (LogR) is a statistical method of analyzing datasets in which one or more independent variables (predictors) predict a result quantified with a binary variable. LogR model is based on a transformation ( logit ) which computes the logarithm of the probability of event divided by the probability of no event. It is defined as follows: \texttt{logit}(p)=\texttt{ln}\displaystyle\frac{p}{1-p} where p=p(y=1|X) is the conditional probability of y being true knowing X ; X=(x_{1},x_{2},...,x_{n}) is the input vector, y is the predicted value, p is the probability of presence of the event, 1-p is the probability of absence of the event, and \displaystyle\frac{p}{1-p} are odds . Assuming a linear relationship between the predictors and \texttt{logit}(p) , meaning \texttt{logit}(p)=\beta_{0}+\beta_{1}x_{1}+...+\beta_{n}x_{n} , we have \displaystyle\frac{p}{1-p}=e^{\beta_{0}+\beta_{1}x_{1}+...+\beta_{n}x_{n}} or p=\displaystyle\frac{1}{1+e^{-(\beta_{0}+\beta_{1}x_{1}+...+\beta_{n}x_{n})}} Notice that p is exactly the sigmoid function \sigma , also known as the logistic function, applied on the weighted inputs. If it returns a value greater than 0.5 , then the event is considered present. If it returns a value less than 0.5 , then the event is considered absent. If the returned value is close to 0.5 , then the decision regarding the presence of the event is hard to make. Figure 3: Logistic Regression Figure 4: Linear Regression versus Logistic Regression The learning process purpose is to determine the best values for the coefficients \beta_{i} . This is reached using the gradient descent. The cost function to be minimized is called the LogLoss given by the following formula \texttt{LogLoss}=\displaystyle\sum_{(X,y)\in D}-y\penalty\ \texttt{ln}(\hat{y})-(1-y)\penalty\ \texttt{ln}(1-\hat{y}) where D is the training dataset, X=(x_{1},x_{2},...,x_{n}) is the input vector, y is the actual labeled value and \hat{y} is the predicted value. In order to remedy the overfitting problem that frequently occurs, a regularization term should be added to the LogLoss function, resulting in the regulated RegLogLoss that should be minimized, given by the following formula: \texttt{RegLogLoss}=\displaystyle\sum_{(X,y)\in D}-y\penalty\ \texttt{ln}(\hat{y})-(1-y)\penalty\ \texttt{ln}(1-\hat{y})+\displaystyle\frac{\lambda}{2}||w||^{2} where \lambda is a parameter and w is the weight vector. Logistic regression is easy to implement and efficient to train. It provides conditional probabilities which may be very useful in a large number of applications. It is usually possible to transform most non-linear features into linear ones. However, it becomes fairly complicated with multiple predictors. 2.2.3 Decision Trees A Decision Tree (DT) classifier is a supervised classification algorithm in Machine Learning. It consists of a tree-like graph where a node is an attribute with a question and a leaf is a class to which belongs an item (see Figure 5 ). It is built as follows. For a training dataset, where each record contains a set of attributes, one of which is the class, a DT classifier attempts to construct a model for the class attribute based on the values of the other attributes. In most cases, a particular dataset is partitioned into training and testing sets, with the training set serving to construct the model and the testing set serving to validate it. A DT classifies the examples by sorting them from the root to a leaf, and the leaf node gives the answer (the class). Each node in the tree serves as a test case for certain attributes, and each branching edge represents one of the possible answers. This process is run recursively on each subtree rooted at a new node. For a given dataset, a decision tree is not necessarily unique. For that, we need to find the tree that suits best the dataset, meaning, the tree with the greatest likelihood of correct classification for unseen examples. For that, some algorithms have been suggested such as the Iterative Dichotomiser 3 algorithm (ID3) [ 3 ] . This algorithm builds decision trees using a top-down greedy strategy based on an entropy function and its derived gain function to select attributes in a way that the resulting tree is the smallest possible, meaning, involving as few attributes as possible. With that in mind, ID3 does not guarantee an optimal tree and can overfit the training data. This algorithm consists of the following steps [ 4 ] : 1. Compute the entropy and the gain for every attribute. The entropy function is given by: \mathcal{E}(D)=\displaystyle\sum_{x\in X}-p(x)\texttt{log}_{2}(p(x)) where D is a given partition, X is the set of classes, and \displaystyle p(x)=\frac{\text{the number of elements of the class }x}{\text{the number of elements of the data set}} Note that when S is perfectly classified, \mathcal{E}(S)=0 . The gain function is given by: \texttt{Gain}(D,A)=\mathcal{E}(S)-\displaystyle\sum_{i=1}^{v}\displaystyle\frac{|D_{i}|}{|D|}\mathcal{E}(D_{i}) where D is a given partition, A is an attribute having v different values, and D_{i} is a sub-partition of D . 2. Split the dataset into subsets on the attribute having the highest gain once the partitioning is performed; 3. Create a decision tree node using that attribute; and 4. If the dataset is perfectly classified, then terminate, else, recurse on subsets with the remaining attributes. The Classification and Regression Trees algorithm (CART [ 5 ] ) supports both regression and classification and builds binary trees (i.e. a single split results in two children). CART uses a cost function to test all attributes and the one with the smallest cost is selected in each splitting step. For regression problems, the cost function is usually the sum of squares error given by SSE=\displaystyle\sum(y_{i}-\bar{y})^{2} where y_{i} is the predictor and \bar{y} is its mean value. For classification problems, the cost function is the Gini score given by: G=\displaystyle\sum(p_{i}*(1-p_{i}))^{2} where p_{i} is the proportion of same class inputs present in a given group. The best score (i.e. G=0 ) occurs when a group contains only inputs of the same class (i.e. p_{i} is either 1 or 0 ), and the worst score (i.e. G=0.5 ) occurs when a node has a 50 - 50 split of classes (i.e. p_{i}=0.5 ). The performance of a tree can be improved by pruning, which consists in getting rid of branches that make use of attributes with low importance. Other algorithms such as C4.5 [ 6 ] and MARS [ 7 ] propose other strategies to build decision trees. Several examples using decision trees can be found in [ 8 , 9 , 10 , 11 ] . Decision tree algorithms are known to generate simple rules that are easy to understand and interpret. They can handle both continuous and categorical features. However, they are prone to errors in classification problems with multiple classes and can be computationally costly to train. Figure 5: Decision tree process 2.2.4 Random Forest Random Forests are Ensemble Learning methods for both classification and regression. They work by building a variety of decision trees during the training phase and provide the predicted class or value by following the general scheme of one of the Ensemble Learning techniques. These techniques are presented in an independent sub-section (see 4.1 ). 2.3 Naive Bayes Classifiers The Naive Bayes classifier is a probabilistic algorithm used to discriminate different entries based on some features. The core of the algorithm is based on Bayes’ theorem which posits: P(A|B)=\frac{P(B|A).P(A)}{P(B)} where: • A and B are two events ( B is the evidence and A is the hypothesis); • P(A|B) is the posterior probability which is the probability of A happening given that B has happened; • P(B|A) (the likelihood) is the posterior probability of B happening given that A has happened; • P(A) is the prior probability of A happening; and • P(B) is the prior probability of B happening. The theorem assumes that the features are all independent, which means that the presence of a given feature does not affect another feature. That is why the algorithm is referred to as naive. To understand how the Naive Bayes classifier derives from Bayes theorem, assume a feature vector X=(x_{1},x_{2},\mbox{ ... },x_{n}) and a class variable y_{k} among K classes in the training data. Bayes’s theorem implies: P(y_{k}|X)=\frac{P(X|y_{k}).P(y_{k})}{P(X)},k\in\{1,2,\mbox{ ... },K\} (1) Considering the chain rule [ 12 ] for multiple events: P(A_{1}\cap A_{2}\cap\mbox{ ... }\cap A_{n})=P(A_{1}|A_{2}\cap\mbox{ ... }\cap A_{n}).P(A_{2}\cap\mbox{ ... }\cap A_{n}) (2) the likelihood P(X|y_{k}) could be written: \begin{split}P(X|y_{k})&=P(x_{1},x_{2},\mbox{ ... },x_{n}|y_{k})\\ &=P(x_{1}|x_{2},\mbox{ ... },x_{n}|y_{k}).P(x_{2}|x_{3}\mbox{ ... },x_{n}|y_{k})\mbox{ ... }P(x_{n-1}|x_{n}|y_{k}).P(x_{n}|y_{k})\end{split} (3) This is where the independence assumption of Bayes’ theorem comes in handy. This assumption states that: P(x_{i}|x_{i+1}\mbox{ ... }x_{n}|y_{k})=P(x_{i}|y_{k}),i\in\{1\mbox{ ... }n\} (4) The likelihood could then be reduced to: P(X|y_{k})=\prod_{i=1}^{n}P(x_{i}|y_{k}) (5) The posterior probability P(y_{k}|X) could also be reduced to: P(y_{k}|X)=\frac{P(y_{k}).\prod_{i=1}^{n}P(x_{i}|y_{k})}{P(X)},k\in\{1,2,\mbox{ ... },K\} (6) Considering that P(X) is a constant for all k\in 1,2,\mbox{ ... },K , the Naive Bayes classification problem could be formulated as follows: for the different class values y_{k} , k\in\{1,2,\mbox{ ... },K\} ; maximize P(y_{k}).\prod_{i=1}^{n}P(x_{i}|y_{k}) (7) Notice that the probability P(y_{k}) is the relative frequency of the class y_{k} in the training data. Also, notice that P(x_{i}|y_{k}) could be calculated using known distributions such as the Gaussian (or Normal) distribution [ 13 ] , the Bernoulli distribution [ 14 ] , or the multinomial distribution [ 15 ] . In such cases one has Gaussian (or normal) naive Bayes classifier, Bernoulli naive Bayes classifier, or a Multinomial naive Bayes classifier, respectively. The naive Bayes algorithm is reputed to be computationally fast and simple to implement, and to cope well with classification problems with high dimensional features and limited training datasets. However, it tightly relies on the independence assumption, and consequently does not cope well with classification problems where this assumption is not satisfied. 2.3.1 Support Vector Machine A Support Vector Machine (SVM) algorithm is a Machine Learning algorithm used to solve classification, regression, and anomaly detection problems. It is known for its solid theoretical foundation. Its purpose is to separate data into classes using a boundary in such a way that the distance between different data classes and the boundary is as large as possible. This distance is also called margin and the SVM is referred to as wide margin separator . The support vectors are generated by the data points closest to the boundary. Support vectors are the critical elements of the training set and if they change, this will probably change the position of the separating line. In Figure 6 , in a two-dimensional space, the boundary is most likely the green line, the support vectors are most likely determined by the two points on the blue line as well as the two points on the red line, and the margin is most likely the distance between the boundary and the blue and red lines. Margin maximization ensures robustness against noise and allows the model to be more generalizable. The basic concept of linear boundary implies that the data should be linearly separable, which is rarely the case (see Figure 7 ). To overcome this shortcoming, SVMs often use what are called kernels [ 16 ] which are mathematical functions that allow SVM to perform a linear separation of a non-linearly separable problem in a higher-dimensional space (see Figure 8 ). The theory underpinning SVM is quite challenging and introduces several advanced mathematical concepts. We will devote an annex to cover most of these aspects. Figure 6: Support Vector Machine (in two dimensions) Figure 7: SVM (non linearly separable data) Figure 8: SVM (linear separation in a higher-dimensional space using kernels) SVM has many advantages. Depending on the data, the performance of SVMs is at least of the same order as that of neural networks. It is also a robust technique because it determines the optimal hyperplane boundaries using the nearest points (support vectors) only, not distant points. However, SVM is reputed to be an opaque technique and very sensitive to the choice of kernel parameters. In addition, its computation time is often long during the learning phase. 2.3.2 k-Nearest Neighbors k -Nearest Neighbors ( k -NN), where k is an integer, is a very simple and intuitive classification algorithm. Its purpose is to classify target points of unknown classes according to their distances from k points of a learning sample whose classes are known in advance. k -NN is so a supervised algorithm. Each point P of the sample is considered as a vector of \bm{\mathbb{R}}^{n} described by its coordinates (p_{1},p_{2},...,p_{n}) . In order to determine the class of a target point Q , each of the closest k points to it makes a vote. The class of Q corresponds to the class having the majority of votes. k -NN could use many metrics in a normed vector space to find the closest points to Q , for instance: • the Euclidean distance: d(P,Q)=\sqrt{\displaystyle\sum_{i=1}^{n}(p_{i}-q_{i})^{2}} • the Manhattan distance, defined by: d(P,Q)={\displaystyle\sum_{i=1}^{n}|p_{i}-q_{i}|} • the Minkowski distance, defined by d(P,Q)=\sqrt[j]{\displaystyle\sum_{i=1}^{n}|p_{i}-q_{i}|^{j}} where j is an integer number such that j\geq 1 . It is a generalization of both the Euclidean distance ( j=2 ) and the Manhattan distance ( j=1 ). • the Tchebychev distance, defined by: d(P,Q)=\displaystyle\max_{i\in\{0,...,n\}}(|p_{i}-q_{i}|) • the Canberra distance, defined by: d(P,Q)={\displaystyle\sum_{i=1}^{n}\frac{|p_{i}-q_{i}|}{|p_{i}|+|q_{i}|}} The value of k influences both the accuracy and the performance of the algorithm. That is, a small value of k implies that the noise may have a significant impact on the result and a large value makes the calculation expensive. The k value is generally determined based on the empirical results. The k -NN algorithm has many advantages. First, it is simple, intuitive, and well-performing with small datasets. In addition, it makes no particular assumption and does not actually build any model. It also constantly evolves as new training data is collected. However, k -NN becomes slow as the dataset grows. It also does not contend well with imbalanced data. That is, if we have two classes, Normal and Abnormal , and a predominate number of the training data labeled as Normal , then the algorithm strongly prefer to assign individual data points to the Normal class instead of the Abormal one. The k -NN algorithm does not deal with missing values as well. 2.3.3 Artificial Neural Networks An Artificial Neural Network (ANN) is a layered model. It is widely used in artificial intelligence. Its structure is very similar to the network of neurons in human brain with layers of linked nodes. A neural network can be trained so that it can recognize patterns, classify data, and predict future outcomes. An artificial neural network, as given by Figure 9 , consists of the following layers and components: • an input layer, usually denoted by x ; • a hidden layer, with a set of neurons; • an output layer, usually denoted by \hat{y} ; • connections between all the input layer nodes and the hidden layer nodes, and between the hidden layer nodes and the output layer nodes; • a set of weights and biases for each connection; and • an activation function. Figure 9: Artificial Neural Network The training process of an ANN consists in the steps shown in Figure 10 . Figure 10: ANN: forward and backward propagation 2.3.3.1 Forward propagation The goal of this step is to calculate the output vector \hat{y} from an input vector x . During this step, weights and biases are decided and an activation function is applied to the resulting output. For a basic neural the output is given by the following equation: \hat{y}=\sigma(W_{2}\sigma(W_{1}x+b_{1})+b_{2}) where \sigma is an activation function, W_{1} and W_{2} are weights, and b_{1} and b_{2} are biases. In this step, the information flows in only one direction, from the input layer to the output layer. 2.3.3.2 Error estimation Once the forward propagation is done, one needs to evaluate how good the prediction is. For that, a loss function (also called cost function or objective function) is used to estimate the error between the ground truth y and the predicted output \hat{y} . Various loss functions [ 17 ] can be used for that purpose and their performance depends on the nature of the problem. The most common loss functions are given in Table 1 . Something Long Loss function name Equation Mean squared error (MSE) \displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2} Mean squared logarithmic error (MSLE) \displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}(\texttt{ln}(y_{i}+1)-\texttt{ln}(\hat{y}_{i}+1))^{2} L2 \displaystyle\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2} Mean absolute error (MAE) \displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}|y_{i}-\hat{y}_{i}| Mean absolute percentage error (MAPE) \displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}|\displaystyle\frac{y_{i}-\hat{y}_{i}}{y_{i}}|.100 L1 \displaystyle\sum_{i=1}^{n}|y_{i}-\hat{y}_{i}| Cross entropy (CE) \displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}[y_{i}\texttt{ln}(\hat{y})+(1-y_{i})\texttt{ln}(1-\hat{y}_{i})] Negative logarithmic likelihood (NLL) -\displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}\texttt{ln}(\hat{y}_{i}) Poisson -\displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}(\hat{y}_{i}-y_{i}.\texttt{ln}(\hat{y}_{i})) Cosine proximity -\displaystyle\frac{y.\hat{y}}{||y||||\hat{y}||} ; " . " is the scalar product Hinge \displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}\texttt{max}(0,1-y_{i}.\hat{y}_{i}) Squared Hinge \displaystyle\frac{1}{n}\displaystyle\sum_{i=1}^{n}(\texttt{max}(0,1-y_{i}.\hat{y}_{i}))^{2} Table 1: Common loss functions 2.3.3.3 Backward propagation Once the error is measured by a loss function, one has to define the strategy to propagate it backward in order to adjust weights and biases in a manner that makes the network converge towards the optimal output. The optimal output obviously corresponds to the point where the loss function reaches its minimum. For that, one needs to calculate the gradient of the loss function. The gradient indicates in which direction the network should walk to get closer to the minimum (i.e. the tangent direction given by partial derivatives). This step is called the gradient descent (see Figure 11 ). Figure 11: Gradient descent For a loss function \mathcal{L} , weights and biases are updated according to the following iterative equation [ 18 ] : \left\{\begin{array}[]{l}W_{t+1}=W_{t}-\eta\displaystyle\frac{\partial\mathcal{L}}{\partial W}\\ \\ b_{t+1}=b_{t}-\eta\displaystyle\frac{\partial\mathcal{L}}{\partial b}\end{array}\right. The factor \eta is called the learning rate. Its role is to determine to what extent the weights and biases should move towards the minimum. The larger \eta is, the bigger is the correction at each step. If it is set too large, the descent can jump over the minimum, which leads to oscillations around it or even to a clear divergence. If it is set too small, the convergence to the bottom is sure but may take a very long time. This being said, in some cases the descent may lead to a local minimum instead of the absolute one as shown in Figure 12 . Figure 12: Convergence to a local minimum Gradient descent may be costly in terms of convergence speed. Optimizers have been developed to achieve a trade-off between convergence speed and accuracy. In this document, we reserve an annex to discuss these optimizers including their mathematical foundation. Forward propagation, error estimation, and backward propagation are repeated until a fairly small loss is reached. The initial weights and biases are given randomly. 3 Deep Learning techniques 3.1 Deep Learning Deep Learning (DL) is a category of algorithms deriving from artificial neural networks and inspired by the human brain behaviour. The network is made up of tens or even hundreds of layers of neurons, each receiving and interpreting the information from the previous layer. At each step, the wrong answers are returned to the upstream levels to correct the mathematical model. As the program progresses, it reorganizes the information into more complex blocks. When the model is subsequently applied to other cases, it is able to classify data that it has never experienced. 3.2 Deep Learning Algorithms 3.2.1 Multilayer perceptron The multilayer perceptron, as given by Figure 13 , is organized in three parts 1. The input layer: a set of neurons that carry the input signal; 2. The hidden layers: they constitute the heart of the perceptron. This is where the relationships between the variables will be established. Choosing the right number of neurons per layer and the right number of layers is a difficult problem. However, in general, a small number of layers is sufficient for most problems and a large number of layers often leads to overfitting problems. In practice, there are at least as many neurons per layer as there are of inputs, but this is not always the case; and 3. The output layer: this layer represents the final result of the network (the prediction). Figure 13: Multilayer perceptron (two hidden layers) 3.2.2 Recurring Neural Networks Recurring Neural Networks (RNNs) take into account not only the current input they see, but also the input they have previously perceived over time. That means that the decision made at the time step t-1 affects the decision that will be made at the upcoming time step t . Hence, an RNN has two sources of input, the present and the recent past. Adding memory to neural networks has a goal. In fact, the sequence itself is information that should be taken care of. The sequential information is maintained in an internal memory (hidden state(s)). This latter is crucial to capture long-term dependencies between events that are distant in time. A simple RNN (see Figure 14 ) has a short-term memory, a single layer and a recurring connection with itself that allows it to learn the impact of the previous input x_{t-1} as well as the current input x_{t} on the prediction y_{t} . It gives the RNN a contextual sense. At a time t , the hidden state h_{t-1} is fed into the network and merged with the input x_{t} to provide the hidden states h_{t} and y_{t} . During the back-propagation time, the RNN learns to tweak different weights to reflect the repercussion of the current input and the previous output on the current output. A non-linear activation function, usually the hyperbolic tangent function, is used to squash the values of the hidden states h_{t} and y_{t} at every step. It is acceptable to assume that h_{0} is a vector of zeros. The equations of the hidden states are as follows: h_{t} = \texttt{tanh}(W_{x}x_{t}+U_{h}h_{t-1}+b_{h}) y_{t} = \texttt{tanh}(W_{y}h_{t}+b_{y}) where W_{x},U_{h}\mbox{ and }W_{h} , are weights and b_{h}\mbox{ and }b_{y} are biases, all adjusted during the back-propagation time. More complex RNNs are also available such as one-to-many, many-to-one and many-to-many RNNs [ 19 ] as well as Jordan networks [ 20 ] . Although RNNs cope efficiently with sequences, especially short sequences, they may suffer from a number of problems [ 21 ] . The first one is the exploding problem. This may appear when the model weights quickly become very large during the training process. The second problem is the vanishing gradient when the values of the gradient become extremely small, this causes the model to cease learning. This may restrict RNNs from processing long sequences (e.g. long paragraphs) with efficacy. In addition, RNNs are reputed to be sensitive to how the model is initialized. This may lead to a model-overfitting problem and hence strange results could be encountered when an RNN is applied to data that the model has not seen during its learning phase. This being said, it is worth mentioning some recent research on a breed of RNNs called Independently RNNs (IndRNNs) [ 22 ] , claiming that it is possible to address the RNN limits in an effective manner. However, this requires further confirmation from independent researchers and industrialists since these models are not yet sufficiently studied and experimented with. Figure 14: RNN (repeating module) 3.2.3 Long Short-Term Memory Networks Long Short-Term Memory (LSTM) networks [ 23 ] pertain to the family of RNNs in the sense that they are able to learn long-term dependencies and deal with sequences. They were devised to overcome the RNN problems mentioned above. The key element of an LSTM is its cell state which acts as the memory of the network that carries the relevant information during the sequence processing. In simple RNNs, the repeating module consists of a single tanh layer. In LSTMs, the repeating module is more complex and consists of three components called gates (see Figure 15 ). The first gate is called a forget gate, which consists of a neural network layer with sigmoid. At a time step t , this layer examines the previous hidden output h_{t-1} as well as the current input x_{t} . These two inputs are first concatenated, then multiplied by weight matrices and a bias is added. Then the sigmoid function is applied. This is expressed by the equation: f_{t} = \sigma(W_{f}.[h_{t-1},x_{t}]+b_{f}) The sigmoid function generates a vector with values ranging from 0 to 1 . Basically, its role is to decide which values the cell state should maintain and which values should be thrown away. If the sigmoid outputs 0 for a given element in the vector, that means that the forget gate wants the cell state to forget it. If it outputs 1 , that means that the forget gate want the cell state to maintain it. This vector is then multiplied (pointwise multiplication) [ 24 ] by the previous cell state c_{t-1} . The second gate is called the input gate. Its role is to determine what new information should be added to the cell state. This is made possible thanks to two layers. The first one is a sigmoid that outputs a vector of 0 and 1 values that determine what should be modified and what should not be. This is illustrated by the equation: i_{t} = \sigma(W_{i}.[h_{t-1},x_{t}]+b_{i}) The second layer is a tanh layer that creates a vector of new candidate values \tilde{c} that could be added to the cell state. This is expressed by the equation: \tilde{c}_{t} = tanh (W_{c}.[h_{t-1},x_{t}]+b_{c}) The tanh function is used because its output can be positive or negative, allowing for both increases and decreases in the cell state. Now, it is time to update the cell state considering the two previous gates’ outputs. This is expressed by the equation c_{t} = (f_{t}\times c_{t-1})+(i_{t}\times\tilde{c}_{t}) The third gate is the output gate. This gate decides what the cell will output. The output depends on a filtered version of the cell state. For that, a sigmoid layer, similar to the two sigmoid layers of the previous gates, will first decide which parts of the cell state will be output by generating a vector of 0 and 1 values. Then, a tanh function squashes the updated cell state. Finally, a pointwise multiplication is carried out between the sigmoid output vector and the filtered cell state. The output is the hidden output state h_{t} . This is expressed by the following equations: o_{t} = \sigma(W_{o}.[h_{t-1},x_{t}]+b_{o}) h_{t} = o_{t}\times tanh (c_{t}) There are some variations of LSTM. For instance, Gers et Schmidhuber [ 25 ] added connections, called peephole connections, between gates and the cell state to ameliorate the learning of long term dependencies and to deal with longer sequences. These gates have the following equations: f_{t} = \sigma(W_{f}.[c_{t-1},h_{t-1},x_{t}]+b_{f}) i_{t} = \sigma(W_{i}.[c_{t-1},h_{t-1},x_{t}]+b_{i}) o_{t} = \sigma(W_{o}.[c_{t-1},h_{t-1},x_{t}]+b_{o}) Other LSTM variations are summarized in Table 2 . Something Long LSTM variation Description Something Long NIG No input gate (i.e. i_{t}=1 ) Something Long NFG No forget gate (i.e. f_{t}=1 ) Something Long NOG No output gate (i.e. o_{t}=1 ) Something Long NIAF No input activation function Something Long NOAF No output activation function Something Long CIFG Coupled input and forget gate (i.e. f_{t}=1-i_{t} ) Something Long NPH No peepholes Something Long FGR Full gate recurrence Table 2: LSTM variations A comprehensive discussion of these LSTM variations’ results is available in [ 26 ] . LSTMs are better than RNNs in remembering information for a long time since they have the capability of removing or adding information to their cell states thanks to their gates. However, they are more opaque and harder to debug. They are also more time-consuming than RNNs owing to their additional built-in neural network layers. Figure 15: LSTM (cell) 3.2.4 Gated Recurrent Units Gated Recurrent Unit (GRU) networks [ 27 ] also belong to the RNN family. They are also designed to overcome their limitations in particular the vanishing gradient problem. There are similarities and differences between GRU and LSTM. The main similarity is that both use gates. The main differences are that GRU does not contain a cell state variable and contains fewer gates than the LSTM. Figure 16 describes a GRU cell. Basically, a GRU cell has two gates: reset and update gates. It takes in entry the previous hidden output h_{t-1} and the current input x_{t} , concatenates them, multiplies them by weights and applies a sigmoid function to squeeze the output between 0 and 1. This is given by the equation: r_{t} = \sigma(W_{r}.[h_{t-1},x_{t}]) Just after that, an intermediary memory state, h^{\prime}_{t} , is calculated according to this equation h^{\prime}_{t} = tanh (W.[r_{t}\times h_{t-1},x_{t}]) The pointwise multiplication r_{t}\times h_{t-1} allows the reset gate to decide, thanks to the sigmoid function in the definition of r_{t} , how much of the past hidden output h_{t-1} to reset and how much to keep. The tanh function squeezes the intermediary hidden state between -1 and 1 . The update gate z_{t} is identical to the reset gate but differs in the weights. It also takes in entry the previous hidden output h_{t-1} and the current input x_{t} , concatenates them multiplies them by weights, and applies a sigmoid function to squeeze the output between 0 and 1. This is given by the equation z_{t} = \sigma(W_{z}.[h_{t-1},x_{t}]) Once done, the GRU cell updates the current memory content according to this equation h_{t} = (1-z_{t})\times h_{t-1}+z_{t}\times h^{\prime}(t) Note that if the update gate delivers a z_{t} close to 0 , the current memory content will be mostly influenced by the past value of h_{t-1} and if it is close to 1 , it will be mostly influenced by the updated value h^{\prime}_{t} . In general, LSTM and GRU have comparable performance in prediction time and there is no universal way to prefer one over the other. However, GRUs are a little faster to train and need fewer data to generalize. Both LSTMs and GRUs tend to deprecate simple RNNs. Figure 16: GRU (cell) 3.2.5 Convolutional Neural Networks Convolutional Neural Networks (CNNs) refer to a subcategory of neural networks. CNNs are mainly designed to process images but can also be used in other problems. Their architecture is more specific, though. It is composed of two main blocks. The first block is the particularity of this type of neural network, and functions as a feature extractor. To do this, it carries out a template-matching by applying convolution filtering operations. The first layer filters the input data with several convolution kernels and returns feature maps which are first normalized using an activation function and then resized. This process is repeated several times. This is to say, a filtration of the feature maps obtained with new kernels is performed which gives birth to new feature maps to normalize and resize, which are filtered again, etc. Finally, the values of the last feature maps are concatenated in a vector. This vector is the output of the first block and the input of the second. The second block is not specific to a CNN. It is at the end of all the neural networks used for classification. The input vector values are transformed—using several linear combinations and activation functions— to return a new vector as an output. This last vector contains as many elements as there are classes. The element i generally represents the probability that the input belongs to the class i . Each element is therefore between 0 and 1 and the sum equals 1 . These probabilities are calculated by the last layer of this block—and therefore of the network—using a sigmoid function in case of two classes, or a Softmax function in case of multiple classes. As with ordinary neural networks, layer parameters are determined by the descent of the gradient and usually cross-entropy is minimized during the training phase. There are four types of layers [ 28 ] in a convolutional neural network: the convolution layer, the pooling layer, the ReLU correction layer and the fully-connected layer. • The convolution layer (CONV): this layer is the key component of convolutional neural networks and is always at least the first layer. Its purpose is to identify the presence of a set of features in the data received as input (often images). This is achieved by convolution filtering. The principle is to slip a window representing the feature onto the data matrix and to calculate the convolution product of the feature and each portion by the scanned matrix. A feature is then seen as a filter. The convolution layer therefore receives several matrices as inputs, and calculates the convolution of each of them with each filter. The filters correspond exactly to the wanted features in the input matrix. For each pair (matrix, filter) we obtain an activation map, or feature map, which indicates where the features are located in the image. The higher the value, the more the corresponding location in the image looks like the feature; • The pooling layer (POOL): This type of layer is often placed between two convolution layers. It receives several feature maps as input, and applies to each of them the pooling operation which consists in reducing the size of the input matrices, while preserving their important characteristics. To do this, the input matrix is divided into regular cells, then the maximum value is kept within each cell. In practice, small square cells are often used to avoid losing too much information. The same number of feature maps is presented at the output as at the input, but they are much smaller. The pooling layer reduces the number of parameters and calculations in the network. This improves the efficiency of the network and reduces overfitting; and • The Rectified Linear Unit (ReLU) correction layer: this correction layer replaces all negative values received at the inputs with zeros using the ReLU activation function defined as follows. \texttt{ReLU}(x)=\texttt{max}(0,x) This results in neural networks several times faster without significantly impacting the generalization of the precision. This also increases non-linearity in the entire network. • The fully-connected layer (FC): This is the last layer for every neural network whether it is convolutional or not. This type of layer receives an input vector and generates a new output vector. To do this, it applies a linear combination and possibly an activation function to the values received as inputs. 4 Advanced techniques 4.1 Ensemble Learning Ensemble Learning (EL) is the process of combining several decisions provided by several predictors to obtain the best prediction (Figure 17 ). It basically tries to answer the question stated by Kearns and Valiant [ 29 ] : "Can a set of weak learners create a single strong learner?". EL is interested in determining the most strategic and efficient way to build a good metapredictor from less performing predictors. The main goal of EL is to minimize the bias error and the variance of the separate models (Figure 18 ). The bias error is the average of the difference between the predicted result and the actual result. A high bias error implies that the model is under-performing and missing out on important patterns. On the other hand, variance quantifies how consistent the predictions are between each other over different training samples but does not care if the model is accurate or not. Models that demonstrate high bias and low variance underfit the truth target. All the same, models that demonstrate low bias and high variance overfit the truth target. A trade-off between bias and variance should be so established. There are several EL techniques. Hereafter, we present the most commonly used ones. Figure 17: Ensemble Learning process Figure 18: Bias and variance 4.1.1 Simple Ensemble Learning techniques These techniques are straightforward and the decision could be one of the following: 1. The mode of the results, which is the most frequently occurring outcome of the used predictors; 2. The average of the results given by different models, if applicable; 3. The weighted average of the results given by different models, if applicable. In this decision procedure, a weight is assigned to each model and the final decision will be the weighted average. The weight could be the accuracy of the model observed on similar data. Although they are simple, these techniques happen to be very powerful in practice for many problems. 4.1.2 Advanced Ensemble Learning techniques 1. Bootstrap AGGregating (BAGGing): in this technique, multiple random samples are first generated from the training dataset with replacement, meaning that an element may crop up multiple times in the same sample. These samples are called bootstrapped samples. Then, an independent model is built for every sample using the same algorithm. Finally, a combiner algorithm is used to aggregate over the decisions of these models (also called independent homogeneous weak learners) and a final decision is made, usually using average or plurality voting. Bagging hence allows multiple similar models with high variance to water down their variance; 2. Boosting: the fundamental difference between BAGGing and Boosting is that with the first technique weak homogeneous learners are trained in parallel whereas with Boosting they are trained in sequence in a way that each model learns from the mistakes of its predecessor . That is, after each training step, misclassified data increases its weights so that the subsequent learner focuses on them during its training. Boosting also assigns a weight to each model in a way that a learner with a better classification result will be assigned a higher weight. In some Boosting techniques, a model with results judged very weak could be discarded. By building multiple incremental models, Boosting usually leads to a decrease in the bias while keeping variance low; and 3. Stacking: Stacking is quite different from Boosting or BAGGing. Its main idea is to tackle a learning problem with different types of models that are able to learn some aspects of the problem, but not the entire problem. It uses a meta-model stacked on top of a number of different intermediate learners. These intermediate learners provide the meta-model with intermediate predictions, usually in the form of probabilities, which make up the its inputs. According to their results, the meta-model will discern where each model performs well and where it performs poorly. In practice, the meta-model is a logistic regression. It is worth mentioning that there is a practical package in Python called ML-Ensemble [ 30 ] which simplifies the process of creating ensembles. This package is compatible with both Scikit-learn and Keras and so allows building ensembles for both deep and classical Machine Learning models. 5 Theory of evidence of Dempster-Shafer Dempster-Shafer theory (DST) was first introduced by Arthur P. Dempster [ 31 ] , then extended by Glenn Shafer [ 32 , 33 , 34 , 35 ] . It has been proposed to formally model and validate the uncertainty associated with statistical inferences. This theory makes it possible to combine evidence stemming from different sources to reach a certain degree of belief on a given question. DST is also known as the theory of evidence. It is also perceived as a generalization of the Bayesian theory of subjective probability [ 36 ] . It has a clear connection with several well-known theories such as probability theory [ 37 ] , possibility theory [ 38 ] and imprecise probability theory [ 39 ] . All the same, it is fundamentally different from them. 5.1 Formalism Let \Omega be a universe (i.e. the set of all entities that we want to consider) and \mathcal{P}(\Omega) the set of all the subsets of \Omega including the empty set \emptyset (also denoted by 2^{X} ). 5.1.0.1 Mass function The mass function, denoted by m: \mathcal{P}(\Omega) \rightarrow [0,1 ], is a function such that m(\emptyset)=0 and \displaystyle\sum_{A\in\mathcal{P}(\Omega)}m(A)=1 . It expresses the proportion of available evidence supporting the proposition that an event X is entirely A , where A is a set of states. It is important to emphasize that the mass of A does not consider the subsets of A , which have their own masses. 5.1.0.2 Belief function The belief function, denoted by \texttt{bel}: \mathcal{P}(\Omega) \rightarrow [0,1 ], attributes to a set A the sum of masses of all its subsets. Meaning, \texttt{bel}(A)=\displaystyle\sum_{B\in\mathcal{P}(\Omega)|B\subseteq A}m(B) . This function expresses the proportion of available evidence supporting the observation that an event X is something in A . 5.1.0.3 Plausibility function The plausibility function, denoted by \texttt{pl}: \mathcal{P}(\Omega) \rightarrow [0,1 ], attributes to a set A the sum of masses of all the subsets that intersect A . Meaning, \texttt{pl}(A)=\displaystyle\sum_{B\in\mathcal{P}(\Omega)|B\cap A\not=\emptyset}m(B) . This function expresses the fact that there is nothing that leads to conclude that an event X is not A . It is not hard to notice that: \texttt{pl}(A)=1-\texttt{bel}(1-\overline{A}) and that under the Bayes conditions: \texttt{pl}=\texttt{bel} It is also easy to notice that: m(A)\leq\texttt{bel}(A)\leq\texttt{pl}(A) Table 19 shows an example of calculation of mass, belief and plausibility in Dempster-Shafer theory. Something Long Hypothesis (attack type) Mass Belief Plausibility Something Long Empty set 0 0 0 Something Long Denial-of-service (DDoS) 0.35 0.35 0.67 Something Long Man-in-the-middle (MitM) 0.15 0.15 0.45 Something Long SQL injection (SQL) 0.10 0.10 0.38 Something Long DDoS or MitM 0.12 0.62 0.90 Something Long DDoS or SQL 0.10 0.55 0.85 Something Long MitM or SQL 0.08 0.33 0.65 Something Long DDoS or MitM or SQL 0.1 1 1 Table 3: Example of mass, belief, and plausibility in Dempster-Shafer theory 5.1.0.4 Joining masses The need for joining masses arises when we have more than one source providing mass values (more than one predictor). Joining two masses consists in combining them in order to come up with a single overall value for the same set of states. This is given by the following rules known as Dempster’s Rules of Combination (DRC) [ 40 ] (given for two masses m_{1} and m_{2} stemming from two different sources) \text{DRC }::\left\{\begin{array}[]{lll}m_{\texttt{joint}}(\emptyset)=0\\ \\ m_{\texttt{joint}}(A)=\displaystyle\frac{1}{1-k}\displaystyle\sum_{B\cap C=A\not=\emptyset}m_{1}(B)m_{2}(C)\\ \text{where }k=\displaystyle\sum_{B\cap C=\emptyset}m_{1}(B)m_{2}(C),k\not=1&&\\ \end{array}\right. k is a factor that measures the conflict between two masses and 1-k is the normalization factor that allows one to ignore the conflict between the two masses involved. 5.2 Usage in data classification Although there are no fixed rules that define how to use DST in classification, most systems that do so follow the schema defined in Figure 19 . To remain practical, we will present two ways, taken from the work of Chen et al. [ 41 ] , of using this theory. Some irrelevant details are omitted for the sake of clarity. 5.2.0.1 First example Authors use the Wisconsin Breast Cancer Diagnosis (WBCD) dataset [ 42 ] which contains nine normalized integer attributes ranging from 1 to 10 and two classes: normal and abnormal . Smaller values tend to describe normality while larger values tend to describe abnormality. The dataset is then randomly divided into 10 subsets having almost equal sizes. For each run, one of the ten subsets is used as test data and the nine remaining subsets to train the model. During the training process, for each run and for each attribute, a modified median threshold t is established. Then, for each attribute, the training data are ordered from small to large. Since the distribution of the WBCD dataset is a normal one, the mass functions, for each attribute, are modeled with a sigmoid function as follows: \left\{\begin{array}[]{lll}m(\texttt{normal})=\displaystyle\frac{1}{1+e^{v-t}}\\ \\ m(\texttt{abnormal})=1-m(\texttt{normal})\\ \end{array}\right. where v is the value of the attribute. Then, DRC is used to calculate the overall mass values. Finally, for a given item, if the normal mass value is superior to the abnormal mass value, then it is classified normal. Otherwise, it is classified abnormal. Figure 19: DST exploitation scheme 5.2.0.2 Second example In this example, the Iris dataset [ 43 ] is used. The dataset has four real positive attributes and three classes. The data are divided exactly the same way as in the previous example. During the training of one model, for each attribute, a maximum and a minimum value for each class are established. When an item can be classified into two classes (overlap between intervals), say class1 and class2 , then it is classified \{\texttt{class1},\texttt{class2}\} with a certain mass value. The same in case of three classes. The mass values are assigned as follows. When an item belongs to a single class, say class1 , a value of 0.9 is given to m(\texttt{class1}) and a value of 0.1 is given to the uncertainty m(\texttt{any}) . Whereas when an item belongs to two classes class1 and class2 , a value of 0.9 is given to m(\{\texttt{class1, class2}\}) and a value of 0.1 is given to m(\texttt{any}) . Finally, when an item belongs to the three classes, a value of 1 is given to m(\texttt{any}) . After that, DRC is used to generate an overall hypothesis for the four attributes. The belief function is then used, and for each item, it is classified into the hypothesis with the highest belief value. If the hypothesis represents more than one class, a further step is performed. This step consists in calculating the Feature Selection Value (FSV), for each attribute for each class in the set of classes of the hypothesis. Then, the attribute a having the smallest FSV is chosen. Then, for each of the n candidate classes the distance d between the attribute value v_{a} and the mean value \overline{v}_{a} of that attribute over the dataset is calculated. The selected class is the one having the smallest distance. The FSV and the distances d_{i} are calculated as follows: \texttt{FSV}=\frac{\displaystyle\prod_{i=1}^{n}\sigma(\texttt{class}_{i})}{\displaystyle\sigma\bigcup_{i=1}^{n}\texttt{class}_{i}} d_{i}=|v_{a_{i}}-\overline{v}_{a_{i}}|,i\in\{1,...,n\} \sigma\mbox{ is the standard deviation.} More elaborate examples can be found in [ 41 , 44 , 45 , 46 , 47 , 48 ] . DS theory, in learning problems, is reputed to cope well with missing data. It is also known to enhance model accuracy with less overfitting. However, problem modelling using this theory remains data-dependent in terms of complexity. 6 Other related techniques 6.1 Dropout Dropout [ 49 ] is perceived as a regularization technique to combat overfitting. Its principle is to randomly ignore a certain percentage of the nodes of a layer at each iteration. The final outgoing weights of each neuron are weighted according to its retention probability. This avoids the over-specialization of a neuron and therefore rote learning. 6.2 Dropconnect Dropconnect [ 50 ] is an alternative to dropout consisting in inhibiting a connection and this always in a random way. In dropout, a number of randomly selected activated nodes is disabled in each layer whereas in dropconnect a randomly selected subset of weights in the network is temporarily zeroed (at each iteration). The results are similar to dropout in terms of speed and ability to generalize learning. 6.3 Early stopping Early stopping [ 51 ] is a form of regularization used to combat overfitting. This technique allows the model parameters to be updated to better adapt to the training data for each iteration. To some point, this enhances the model’s performance on data out of the training set. However, beyond this point, the improvement plays against the error generalization. Early stopping rules give indications of the number of iterations that can be performed before the model starts to overfit [ 52 ] . 6.4 Adversarial training Adversarial training tries to fool models using malicious input (adversarial examples). Such a technique can be useful, for example, to show how a malicious opponent can surreptitiously manipulate input data to exploit specific vulnerabilities in learning algorithms and jeopardize the security of the Machine Learning system. The adversarial examples are intentionally constructed using an optimization procedure [ 53 ] . They help to regularize models and make them more robust. 6.5 Data Augmentation The easiest way to reduce overfitting is to increase the size of the training dataset. However, doing so may turn out to be too expensive. For that, some research studies have emerged trying to reduce this cost by proposing augmentation algorithms and policies. For example, D. Cubuk et al. in [ 54 ] propose a procedure called AutoAugment to automatically search for improved data augmentation policies. Population-Based Augmentation (PBA) policy [ 55 ] has also been proposed and shown to have better performance than AutoAugment with one thousand times less computations in some cases. All the same, this result should be taken with caution pending confirmation by further research. 7 Practical Aspects 7.1 Python Python is a programming language for general use but very suitable for Machine Learning thanks to multiple dedicated packages and libraries. Among them we mention the following. 7.1.1 Scikit-Learn Scikit-Learn [ 56 ] is a Python library for Machine Learning that encompasses functions for estimating algorithms such as random forests, logistic regressions, classification algorithms, and support vector machines. It offers great advantages, such as: • It is an open source project; • Its code is fast, some parts are implemented in Cython; • It has excellent documentation and a large and active community; • It is very well integrated with the Pandas and Seaborn Libraries; • It has a uniform API between all algorithms, making it easy to switch from one to the other; For a new programmer in the Machine Learning domain, it is recommended that they have good knowledge of the following packages: • Scipy: Scipy [ 57 ] is an open-source ecosystem for mathematics, science, and engineering. It offers a large number of numerical routines for integration, interpolation, optimization, linear algebra, and statistics; • Pandas: Pandas [ 58 ] is also an open-source library offering high-performance and easy-to-use data structures, as well as data analysis tools; • Numpy: Numpy [ 59 ] is an essential package for scientific computing with Python. It provides powerful capabilities for N-dimensional array management, linear algebra calculus, Fourier transformation handling, random number utilization, etc.; • Matplotlib: Matplotlib [ 60 ] is a fundamental Python library to generate 2D graphics such as lines, curves, histograms, bar charts, error charts, scatter plots, etc. 7.1.2 Tensorflow Tensorflow [ 61 ] is an open source Machine Learning library, created by Google, for developing and running Machine Learning and Deep Learning applications. It can be conceived as a programming system in which calculations are represented in the form of graphs. The nodes represent mathematical operations, and the arrows represent multidimensional data exchanged between them. Although Tensorflow is a Python library, the mathematical operations themselves are not performed in Python. They are written in high-performance C++. Thanks to abstraction, this framework facilitates the implementation of algorithms and allows the developer to focus on the general logic of an application. In addition, the eager execution mode allows the evaluation and modification of all graph operations separately rather than having to build the entire graph as a single opaque object and evaluate everything at once. Besides, the TensorBoard visualization suite allows the inspection of graphics’ internal workings through a web-based interactive dashboard. Among its disadvantages is the fact that the same model running on two different systems will sometimes vary even if the data with which it has been fed are exactly the same. It also requires knowledge of advanced calculus and linear algebra as well as an important understanding of the Machine Learning complexity. 7.1.3 Theano Theano [ 62 ] is a numerical computation and Deep Learning Python library developed by Mila, a research team from McGill University and the Université de Montréal. It support tensors and algebra operations and allows parallel execution. However, it may output unclear error messages. In addition, compiling a model in Theano may take a long time compared to other libraries. Theano, nowadays, tends to be masked by Tensorflow which is gaining a lot of ground to the detriment of Theano. 7.1.4 CNTK Microsoft Cognitive Toolkit (CNTK) [ 63 ] is a Python framework for Machine Learning and Deep Learning developed by Microsoft Research. It provides an intuitive way to build models and offers easy interfaces. It is an alternative to Tensorflow. 7.1.5 Torch Torch [ 64 ] is a software platform for scientific computing that primarily uses GPUs and allows one to work with multiple Machine Learning algorithms. Its ease of use and efficiency are due to the LuaJIT scripting language and the underlying implementation of C/CUDA. It is worth mentioning that Torch is not the same project as PyTorch, despite the similar name. 7.1.6 PyTorch PyTorch [ 65 ] is an open-source Python project similar to Torch that provides several Machine Learning algorithms. It also offers a library called LibTorch to implement extensions to PyTorch and write Machine Learning applications in pure C++. Models written with PyTorch can be converted and used in C++ with TorchScript. 7.1.7 Keras Keras [ 66 ] is a high level, user-friendly, modular, and extensible API that facilitates the development of Deep Learning applications and can run on Tensorflow, Theano and CNTK on both CPUs and GPUs. Keras is part of the Tensorflow core, making it Tensorflow’s preferred API. 7.2 R R [ 67 ] is one of the main languages of statistics and data science. Many statistical and Machine Learning methods are implemented in R, organized in specialized packages like rpart, mice, party, caret, randomForest, nnet, e1071, kernLab, igraph, glmnet, ROCR, gbm, arules, tree, klaR, ipred, lars, CORElearn, and earth. R comes with a large number of experimental datasets and has an interface to Keras via the libraries kerasR, Keras, and keras. R is a serious rival to Python and is used by a growing number of data engineers. 7.3 Matlab Matlab [ 68 ] implements several Machine Learning algorithms such as logistic regression, classification trees, support vector machines, ensemble methods, and Deep Learning. It also uses model refinement and reduction techniques to create accurate models. Nevertheless, Python and R seem to be easier and faster overall, but from a graphical and visual point of view, Matlab seems to be more convenient. 7.4 Java There are several Java environments that implement Machine Learning algorithms. Among them, we mention the following. • Weka [ 69 ] : Weka stands for Waikato Environment for Knowledge Analysis. It is open source software developed by the University of Waikato, New Zealand. It consists of a collection of Machine Learning and Deep Learning algorithms and encompasses hands-on tools for data preparation, classification, regression, clustering, and visualization; • KNIME [ 70 ] : KNIME stands for KoNstanz Information Miner. It is open source software developed by Konstanz University, Germany. It is an integrated tool that implements a wide range of Machine Learning algorithms as well as genetic algorithms and may be used along with Java tools like Spark. The KNIME Deep Learning extensions allow users to read, create, edit, train, and execute deep neural networks and permit the integration with Tensorflow using both CPUs and GPUs; • RapidMiner [ 71 ] : RapidMinEr is developed at Technical University of Dortmund, Germany. It is a free open source software dedicated to data engineering. It contains many tools to process data: reading different input formats, data preparation and cleaning, statistics, Machine Learning and Deep Learning algorithms, performance evaluation, and various visualizations. It is not easy to handle at first sight, but with a little practice, it allows to quickly set up a complete data processing chain, from data entry to their classification; • MALLET [ 72 ] : MALLET stands for MAchine Learning for LanguagE Toolkit. It is basically a Java-based package for Machine Learning applications. It also encompasses routines and tools for text processing, sequence tagging, natural language processing, information extraction, and numerical optimization; • DL4J [ 73 ] : DL4J stands for Deep Learning For Java. It is the first professional open source commercial Deep Learning library written for Java and Scala developers. Integrated with Hadoop and Spark, DL4J is designed for use in professional environments with GPU and distributed processors; • Java-ML [ 74 ] : Java-ML is a Java API with a collection of automatic learning algorithms implemented in Java. It does not provide any standard interface for algorithms; • JSAT [ 75 ] : JSAT is a library to quickly start working with automatic learning problems. It is available for use under GPL 3. JSAT has no external dependencies, and is pure Java; • MLlib [ 76 ] : MLlib is a scalable Spark Apache learning library. It contains a long list of Machine Learning algorithms and several underlying statistical, optimization, and linear algebra primitives. 8 Conclusion The advancements in cybersecurity and digital forensics brought about a change through machine learning and deep learning technologies that offer ways to tackle intricate issues like identifying threats and anomalies in data analysis and studying digital evidence, with improved methods. These approaches have shown promise in improving precision and effectiveness while also addressing issues such as resilience and the protection of data. Our future focus will be on transfer learning [ 77 , 78 , 79 ] which makes use of existing models in specialized tasks and investigating the capabilities of Graph Neural Networks (commonly referred to as GNNs) particularly used in depicting intricate cyber landscapes and digital connections. We will also be delving into Explainable AI (known as XAI) [ 80 , 81 , 82 , 83 , 84 , 85 ] which enhances model transparency and interpretability. Appendix A List of the most important conferences In Table A.1 , we give a list of the most famous international conferences focusing on security and cyber security as well as their rank. We rely on the COmputing Research and Education (CORE) association of Australasia [ 86 ] which is one of the most reliable conference and journal ranking institutions in the academic world. According to CORE, conferences are assigned to one of the following categories: • A* : flagship conference, a leading venue; • A : excellent conference, and highly respected; • B : good conference, and well regarded; • C : conference that meets minimum standards. The provided list may not be exhaustive and other important conferences could be added. Something Long Conference name Initialism Rank ACM Conference on Computer and Communications Security CCS A* IEEE Symposium on Security and Privacy S&P A* Usenix Security Symposium USENIX-Security A* IEEE Computer Security Foundations Symposium CSF (was CSFW) A European Symposium On Research In Computer Security ESORICS A IEEE/IFIP International Symposium on Trusted Computing and Communications TrustCom A Annual Computer Security Applications Conference ACSAC A IEEE Conference on Systems, Man and Cyber netics SMC B IFIP Information Security & Privacy Conference IFIP SEC B International Conference on Availability, Reliability and Security ARES B ACM Symposium on Information, Computer and Communications Security AsiaCCS B Computational Intelligence in Security for Information Systems CISIS B Information Security Practice and Experience Conference ISPEC B IEEE Symposium on Computational Intelligence in Cyber Security IEEE CICS C International Workshop on Visualization for Cyber Security VizSec C International Conference on Computational Intelligence and Security CIS C International Conference on Information Security and Cryptography SECRYPT C International Conference on Risks and Security of Internet and Systems CRiSIS C International Workshop on Critical Information Infrastructures Security CRITIS C Table A.1: List of the most important conferences Appendix B List of the most important journals In Table B.1 , we give a list of some famous journals for security and Machine Learning applications and techniques. The journals are ranked by the Computing Research and Education Association of Australasia (CORE) [ 86 ] . Other journals of high quality could also be added. Something Long Journal name ISSN Rank IEEE Transactions on Neural Networks and Learning Systems (was IEEE Transactions on Neural Networks) 1045-9227 A* ACM Transactions on Computer Systems 0734-2071 A* ACM Transactions on Software Engineering and Methodology 1557-7392 A* IEEE Transactions on Computers 0018-9340 A* IEEE Transactions on Evolutionary Computation 1941-0026 A* Machine Learning 1573-0565 A* ACM Transactions on Information and System Security 1094-9224 A IEEE Transactions on Information Forensics and Security 1556-6013 A IEEE Transactions on Dependable and Secure Computing 1545-5971 A IEEE Transactions on Knowledge and Data Engineering 1558-2191 A Journal of Machine Learning Research 1532-4435 A Computers and Security 0167-4048 B Journal of Computer Security 1875-8924 B IEEE Security and Privacy Magazine 1540-7993 B Information Security Technical Report 1363-4127 B IEEE Transactions on Systems, Man and Cybernetics, Part A: Systems and Humans 1083-4427 B IET Information Security 1751-8709 C Information Security Journal: a Global Perspective 1939-3555 C International Journal of Security and Networks 1747-8405 C International Journal of Information Security 1615-5262 C International Journal of Electronic Security and Digital Forensics 1751-9128 C Table B.1: List of the most important Journals Appendix C List of the most significant books Hereafter, we give a list of the most relevant books related to the theme of our work in this document. • Fundamentals of Machine Learning for Predictive Data Analytics: Algorithms, Worked Examples, and Case Studies, by John D. Kelleher (Author), Brian Mac Namee (Author), Aoife D’Arcy (Author). ISBN: 978-0262029445. Publisher: The MIT Press (2015). • Support Vector Machines, by Ingo Steinwart (Author), Andreas Christmann (Author). ISBN: 978-0387772417. Publisher: Springer (2008). • Deep Learning with Python, by Francois Chollet (Author). ISBN: 978-1617294433. Publisher: Manning Publications (2017). • Hands-On Machine Learning with Scikit-Learn and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems, by Aurélien Géron (Author). ISBN: 978-1491962299. Publisher: O’Reilly Media (2017). • Deep Learning, by Ian Goodfellow (Author), Yoshua Bengio (Author), Aaron Courville (Author). ISBN: 978-0262035613. Publisher: The MIT Press (2016). • Machine Learning: An Algorithmic Perspective, by Stephen Marsland (Author). ISBN: 978-1466583283. Publisher: Chapman and Hall/CRC (2014). • Machine Learning: A Bayesian and Optimization Perspective, by Sergios Theodoridis (Author). ISBN: 978-0128015223. Publisher: Academic Press (2015). • Machine Learning: A Probabilistic Perspective, by Kevin P. Murphy (Author). ISBN: 978-0262018029. Publisher: The MIT Press (2012). • The Elements of Statistical Learning: Data Mining, Inference, and Prediction, by Trevor Hastie (Author), Robert Tibshirani (Author), Jerome Friedman (Author). ISBN: 978-0387848570. Publisher: Springer (2017). • Deep Learning Applications for Cyber Security, by Mamoun Alazab (Editor), Ming Jian Tang (Editor). ISBN: 978-3030130565. Publisher: Springer (2019). • Classic Works of the Dempster-Shafer Theory of Belief Functions, by Ronald R. Yager (Editor), Liping Liu (Editor). ISBN: 978-3642064784. Publisher: Springer (2008). • Combining Classifiers using the Dempster Shafer Theory of Evidence, by Imran Naseem (Author). ISBN: 978-3639232240. Publisher: VDM Verlag Dr. Müller (2010). • Understanding Machine Learning: From Theory to Algorithms, by Shai Shalev-Shwartz (Author), Shai Ben-David (Author). ISBN: 978-1107057135. Publisher: Cambridge University Press (2014). • Machine Learning: The Art and Science of Algorithms that Make Sense of Data, by Peter Flach (Author). ISBN: 978-1107422223. Publisher: Cambridge University Press (2012). • Cyber security Essentials, by Charles J. Brooks (Author), Christopher Grow (Author), Philip Craig (Author), Donald Short (Author). ISBN: 978-1119362395. Publisher: Sybex (2018). Appendix D List of the most relevant online tutorials On the Internet, there is a large number of resources that offer reliable information and tutorials on Machine Learning and Deep Learning. Among them, we choose the following resources: • Udemy: Udemy is a marketplace for teaching and learning. It offers online courses on a wide spectrum of knowledge, in particular in the field of Reinforced Learning, Unsupervised and Supervised Learning, Python, Keras, AI, ML, DL, etc.; • Datacamp: Datacamp is one of the most well-known platforms for learning Data Science, ML, and DL online; • Luis Serrano tutorials: Luis Serrano is a Machine Learning Engineer at Google. He offers free video sequences on several aspects of the field in a simplified way. His channel could easily be found on Youtube; • MIT Deep Learning: it is a collection of MIT courses and lectures on Deep Learning, deep reinforcement learning, autonomous vehicles, and artificial intelligence; and • Tutorialspoint: Tutorialspoint is one of the biggest online tutorials libraries. It’s free and generally aimed at beginners; Appendix E List of the most used websites for datasets Kaggle offers a large number of public datasets in a large number of fields. These datasets are listed here [ 87 ] . Other public datasets are available at Data World [ 88 ] , Data Gov [ 89 ] , Socrata OpenData [ 90 ] , UCI Machine Learning Repository [ 91 ] , Amazon Web Services Open Data Registry [ 92 ] , Earthdata [ 93 ] , and Reddit [ 94 ] websites; and many others. Appendix F SVM Theory Notations and definitions Norm of a vector The norm (or magnitude) of a vector x=(x_{1},x_{2},...,x_{n}) in a vector space of dimension n is its length. It is denoted by: ||x||=\sqrt{x_{1}^{2}+x_{2}^{2}+...+x_{n}^{2}} Direction of a vector The direction of a vector x=(x_{1},x_{2},...,x_{n}) , denoted by w , is the vector: w=(\frac{x_{1}}{||x||},\frac{x_{2}}{||x||},...,\frac{x_{n}}{||x||}) Geometrically, w represents in which direction vector x is oriented with no regard to its norm. Parallel vectors have the same direction. Dot product The dot (or scalar) product of two vectors x=(x_{1},x_{2},...,x_{n}) and y=(y_{1},y_{2},...,y_{n}) is x.y=\displaystyle\sum_{i=1}^{n}x_{i}.y_{i} The dot product is a real number not a vector. Geometrically, it is the product of the Euclidean norms of the two vectors and the cosine of the angle between them. It represents how much push one vector is giving to the other . Linear separation Hyperplane In a two dimensional space, data might be separated by a line having the equation y=a.x+b or simply by a.x-y+b=0 . If we replace x with x_{1} and y with x_{2} , the equation becomes a.x_{1}-x_{2}+b=0 Let x=(x_{1},x_{2}) and w=(a,-1) , we obtain: w.x+b=0 This equation can be generalized to a space of dimension n . In that case, it is called the equation of hyperplane. Classification If we know the equation of the hyperplane that segregates data, the classification is given by the following function for any vector x_{i} h(x_{i})=\left\{\begin{array}[]{ll}+1&\mbox{if }w.x_{i}+b\geq 0\\ -1&\mbox{else.}\end{array}\right. That means that the points above the hyperplane are classified as class +1, and the points below the hyperplane are classified as class -1. The problem is then how to find the best hyperplane. This will require hyperplanes’ metrics. Bad metric: A Let us have a dataset of m rows defined as follows: D=\{(x_{i},y_{i})|x_{i}\in\bm{\mathbb{R}}^{n}\wedge y_{i}\in\{-1,+1\}\} Let us have a hyperplane of equation w.x+b=0 . To determine the closest point point to the hyperplane, let us define the metric A such that: A=\displaystyle\min_{i\in\{1,...,m\}}|w.x+b| If we have j hyperplanes, every hyperplane will have a value for A . The intuitive selection would be to choose the hyperplane corresponding to the largest A value (the furthest-nearest point in order to maximize the margin) defined by: H=\displaystyle\max_{i\in\{1,...,j\}}\{h_{i}|A_{i}\} However, due to the absolute value in the definition of the metric A —that does not distinguish between a point located on one side of the hyperplane and another point on the other side, and then may lead to a bad classification, this metric could not be used as is. Better metric: B Now, instead of using A , we use the function B defined as follows: B=\displaystyle\min_{i\in\{1,...,m\}}y_{i}(w.x+b) Unlike A , B uses the label of y (i.e. -1 or +1 ) in its definition. Like that, the product y_{i}(w.x+b) will always be positive for a good classification and always negative for a bad one. We now may be tempted to select the hyperplane with the largest positive value of B defined by: H=\displaystyle\max_{i\in\{1,...,j\}}\{h_{i}|B_{i}\} Unfortunately, B is still not good as a metric as it suffers from the scale variant problem. That is, if we consider w_{1}=(1,2) and w_{2}=(2,4) , although they do represent the same hyperplane (collinear vectors), they can give different results when dot-multiplied by another vector. Best metric: C Now, instead of using B , we use the function C defined as follows C=\displaystyle\min_{i\in\{1,...,m\}}y_{i}(\frac{w}{||w||}.x+\frac{b}{||w||}) In the definition of C , dividing by ||w|| remedies the scale variant problem. We finally select the hyperplane with the largest positive value of C defined by: H=\displaystyle\max_{i\in\{1,...,j\}}\{h_{i}|C_{i}\} Optimization We are now led to find the hyperplane H , fully defined by w and b , that maximizes C provided that all the points with the same class in the m entries in the dataset have a distance from H larger than or equal to C . This is expressed by the following optimization problem (s.t. means subject to): \begin{array}[]{ccc}&\displaystyle\max_{w,b}{{\penalty\ C}}&\\ &\textrm{s.t.}y_{i}(\frac{w}{||w||}.x+\frac{b}{||w||})\geq C,i\in\{1...m\}&\\ \end{array} Considering C=\frac{B}{||w||} , the problem becomes: \begin{array}[]{ccc}&\displaystyle\max_{w,b}{\frac{B}{||w||}}&\\ &\textrm{s.t.}y_{i}(w.x+b)\geq B,i\in\{1...m\}&\\ \end{array} Let us rescale w such that B=1 . The problem becomes: \begin{array}[]{ccc}&\displaystyle\max_{w,b}{\frac{1}{||w||}}&\\ &\textrm{s.t.}y_{i}(w.x+b)\geq 1,i\in\{1...m\}&\\ \end{array} Which can be expressed as: \begin{array}[]{ccc}&\displaystyle\min_{w,b}{||w||}&\\ &\textrm{s.t.}y_{i}(w.x+b)\geq 1,i\in\{1...m\}&\\ \end{array} This problem is equivalent to the convex quadratic optimization problem expressed as follows: \begin{array}[]{ccc}&\displaystyle\min_{w,b}{\frac{1}{2}||w||^{2}}&\\ &\textrm{s.t.}y_{i}(w.x+b)-1\geq 0,i\in\{1...m\}&\\ \end{array} (F.1) Solving the SVM convex quadratic optimization problem We give here a short overview on the solution of the SVM convex quadratic optimization problem [ 95 ] . A more detailed explanation can be found in [ 96 , 97 ] . The SVM convex quadratic optimization problem can be solved by the Lagrange method. Because it is quadratic, the surface is a paraboloid (convex) with a single minimum. This avoids the problem of local optimums encountered with neural networks. The Lagrange dual problem [ 98 ] states that solving the convex problem: \begin{array}[]{ccc}&\displaystyle\min_{x\in D}f(x)&\\ &\textrm{s.t.}g(x)\leq 0,i\in\{1,...,m\}&\\ \end{array} comes down to solving the problem: \begin{array}[]{ccc}&\displaystyle\max_{\lambda}\min_{x}\penalty\ (f(x)+\displaystyle\sum_{i=1}^{m}\lambda_{i}g_{i}(x))&\\ &\textrm{s.t.}\lambda_{i}\geq 0,i\in\{1,...,m\}&\\ \end{array} The objective function f(x)+\displaystyle\sum_{i=1}^{m}\lambda_{i}g_{i}(x) is called the Lagrangian function and denoted by \mathcal{L} , and \lambda_{i} are called the Lagrange multipliers. In the case of the SVM convex optimization problem, we have: \left\{\begin{array}[]{lll}f(w)&=&\frac{1}{2}||w||^{2}\\ g_{i}(w,b)&=&y_{i}.(w.x+b)-1,i\in\{1,...,m\}\\ \mathcal{L}(w,b,\lambda)&=&\frac{1}{2}||w||^{2}-\displaystyle\sum_{i=1}^{m}\lambda_{i}[y_{i}(w.x+b)-1]\\ \end{array}\right. The Lagrange dual problem for the SVM convex optimization problem is then: \begin{array}[]{ccc}&\displaystyle\max_{\lambda}\min_{w,b}\penalty\ \frac{1}{2}||w||^{2}-\displaystyle\sum_{i=1}^{m}\lambda_{j}[y_{i}.(w.x+b)-1]&\\ &\textrm{s.t.}\lambda_{i}\geq 0,i\in\{1,...,m\}&\\ \end{array} (F.2) There are some dedicated packages to solve convex optimization problems such as CVXOPT [ 99 ] and CVXPY [ 100 ] in Python, CVX [ 101 ] in Matlab and GUROBI [ 102 ] in Java. Another way to solve the SVM optimization problem is to solve its Wolfe dual form [ 98 ] stated as follows: \begin{array}[]{clc}&\displaystyle\max_{\lambda,w,b}\penalty\ \frac{1}{2}w.w-\displaystyle\sum_{i=1}^{m}\lambda_{i}[y_{i}(w.x_{i}+b)-1]&\\ &\textrm{s.t. }\mathop{\nabla}\frac{1}{2}w.w-\displaystyle\sum_{i=1}^{m}\lambda_{i}\mathop{\nabla}[y_{i}(w.x_{i}+b)-1]=0&\\ &\textrm{and }\penalty\ \lambda_{i}\geq 0,i\in\{1,...,m\}&\\ \end{array} (F.3) where \mathop{\nabla} is the gradient and \lambda_{i} are the Lagrange multipliers. The Lagrangian function to maximize is: \begin{array}[]{ c c l}\mathcal{L}(w,b,\lambda)&=&\frac{1}{2}w.w-\displaystyle\sum_{i=1}^{m}\lambda_{i}[y_{i}(w.x_{i}+b)-1]\\ &=&\frac{1}{2}w.w-\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}w.x_{i}-b\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}+\displaystyle\sum_{i=1}^{m}\lambda_{i}\end{array} (F.4) We calculate the gradient over w and b , we get from the constraint: \begin{array}[]{ c c l}\mathop{\nabla}_{w}\mathcal{L}(w,b,\lambda)&=&w-\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}x_{i}=0\\ \mathop{\nabla}_{b}\mathcal{L}(w,b,\lambda)&=&-\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}=0\end{array} (F.5) So we get: \begin{array}[]{ c c l}w&=&\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}x_{i}\\ \displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}&=&0\end{array} (F.6) Considering the equation F.6 , the equation F.4 becomes: \begin{array}[]{ c c l}\mathcal{L}(w,b,\lambda)&=&\frac{1}{2}w.w-\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}w.x_{i}-b\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}+\displaystyle\sum_{i=1}^{m}\lambda_{i}\\ &=&\frac{1}{2}w.w-\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}w.x_{i}+\displaystyle\sum_{i=1}^{m}\lambda_{i}\\ &=&\frac{1}{2}\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}x_{i}.\displaystyle\sum_{j=1}^{m}\lambda_{j}y_{j}x_{j}-\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}x_{i}.\displaystyle\sum_{j=1}^{m}\lambda_{j}y_{j}x_{j}+\displaystyle\sum_{i=1}^{m}\lambda_{i}\\ &=&-\frac{1}{2}\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}x_{i}.\displaystyle\sum_{j=1}^{m}\lambda_{j}y_{j}x_{j}+\displaystyle\sum_{i=1}^{m}\lambda_{i}\\ &=&\displaystyle\sum_{i=1}^{m}\lambda_{i}-\frac{1}{2}\displaystyle\sum_{i=1}^{m}\displaystyle\sum_{j=1}^{m}\lambda_{i}\lambda_{j}y_{i}y_{j}x_{i}.x_{j}\\ \end{array} (F.7) The Wolfe dual problem becomes: \begin{array}[]{ccc}&\displaystyle\max_{\lambda}\displaystyle\sum_{i=1}^{m}\lambda_{i}-\frac{1}{2}\displaystyle\sum_{i=1}^{m}\displaystyle\sum_{j=1}^{m}\lambda_{i}\lambda_{j}y_{i}y_{j}x_{i}.x_{j}&\\ &\textrm{s.t.}\lambda_{i}\geq 0\wedge\displaystyle\sum_{i=1}^{m}\lambda_{i}y_{i}=0,i\in\{1,...,m\}&\\ \end{array} (F.8) Note that the objective function in the Wolfe dual problem depends solely on the Lagrangian multipliers, which makes it easier to solve than the Lagrange dual problem. Soft Margin SVM When the data are not linearly separable due to noisy points, which is often the case, the above problem formulation could lead to nothing. For that, we introduce slack variables \zeta_{i} and a regularization parameter r such that optimization problem becomes \begin{array}[]{ccc}&\displaystyle\min_{w,b,\xi}{\frac{1}{2}||w||^{2}+r.\displaystyle\sum_{j=1}^{m}\zeta_{i}}&\\ &\textrm{s.t.}y_{i}(w.x+b)-1+\zeta_{i}\geq 0,\zeta_{i}\geq 0\wedge i\in\{1...m\}&\\ \end{array} The variables \zeta_{i} are introduced to tolerate points that do not satisfy the original constraints. The regularization parameter r is introduced to control how much SVM will tolerate misclassification in each trained example. In fact, a high value of r will reduce the impact of \zeta_{i} (low misclassification tolerance), and a low value of r will increase the impact of \zeta_{i} (high misclassification tolerance). Kernel tricks Kernel tricks (or kernels) are introduced to allow an SVM to deal with data that are not linearly separable by nature and not due to noise (see Figure 7 ). The trick is to find a mapping function \varphi that transforms the dataset into a larger space where linear SVM can be performed (see Figure 8 ). Notice that in Wolfe dual problem given in F.8 , the maximization problem hinges only on the dot product of the support vectors (i.e. x_{i}.x_{j} ). If we map the dataset to a higher-dimensional space, we will have to maximize the objective function: \displaystyle\max_{\lambda}\displaystyle\sum_{i=1}^{m}\lambda_{i}-\frac{1}{2}\displaystyle\sum_{i=1}^{m}\displaystyle\sum_{j=1}^{m}\lambda_{i}\lambda_{j}y_{i}y_{j}\varphi(x_{i}).\varphi(x_{j}) under the same constraints. Finding the mapping function \varphi is a hard task in practice. However, we do not really have to. All we need is the dot product \varphi(x_{i}).\varphi(x_{j}) for the support vectors. Here the Mercer theorem [ 103 ] comes in handy. It states that under some conditions on the form of a kernel function K (symmetric, positive, and semi-definite), there exists a mapping function \varphi such that we have always: K(x_{i},x_{j})=\varphi(x_{i}).\varphi(x_{j}) The example at the end of this annex shows this is true for the Gaussian kernel function. The SVM maximization problem becomes \displaystyle\max_{\lambda}\displaystyle\sum_{i=1}^{m}\lambda_{i}-\frac{1}{2}\displaystyle\sum_{i=1}^{m}\displaystyle\sum_{j=1}^{m}\lambda_{i}\lambda_{j}y_{i}y_{j}K(x_{i},x_{j}) As we can see, SVM tightly depends on the chosen kernel. In Table F.1 , we give some common kernel functions [ 104 ] . Something Long K(x_{i},x_{j})=(x_{i}.x_{j}+1)^{p} Polynomial kernel Something Long K(x_{i},x_{j})=e^{-\displaystyle\frac{||x_{i}-x_{j}||^{2}}{2\sigma^{2}}} Gaussian kernel Something Long K(x_{i},x_{j})=e^{-\displaystyle\gamma||x_{i}-x_{j}||^{2}} Gaussian Radial Basis Function (RBF) Something Long K(x_{i},x_{j})=e^{-\displaystyle\frac{||x_{i}-x_{j}||}{\sigma}} Laplace RBF kernel Something Long K(x_{i},x_{j})=tanh(\displaystyle\eta x_{i}.x_{j}+\nu) Hyperbolic tangent kernel Table F.1: Common SVM kernel functions Example: Let K(x_{i},x_{j})=(x_{i}.x_{j}+1)^{p} be the Gaussian kernel function with p=2 . Something Long K(x_{i},x_{j}) = K((x_{i_{1}},x_{i_{2}}),(x_{j_{1}},x_{j_{2}})) = 1+(x_{i_{1}}x_{j_{1}})^{2}+(x_{i_{2}}x_{j_{2}})^{2}+2x_{i_{1}}x_{j_{1}}+2x_{i_{2}}x_{j_{2}}+2x_{i_{1}}x_{j_{1}}x_{i_{2}}x_{j_{2}} = (1,\sqrt{2}x_{i_{1}},\sqrt{2}x_{i_{2}},x_{i}^{2},\sqrt{2}x_{i_{1}}x_{i_{2}},x_{i_{2}}^{2}) . (1,\sqrt{2}x_{j_{1}},\sqrt{2}x_{j_{2}},x_{i}^{2},\sqrt{2}x_{j_{1}}x_{j_{2}},x_{j_{2}}^{2}) = \varphi(x_{i}).\varphi(x_{j}) , where Something Long \varphi(x_{i}) = (1,\sqrt{2}x_{i_{1}},\sqrt{2}x_{i_{2}},x_{i}^{2},\sqrt{2}x_{i_{1}}x_{i_{2}},x_{i_{2}}^{2}) , and Something Long \varphi(x_{j}) = (1,\sqrt{2}x_{j_{1}},\sqrt{2}x_{j_{2}},x_{i}^{2},\sqrt{2}x_{j_{1}}x_{j_{2}},x_{j_{2}}^{2}) Appendix G Common activation functions In artificial neural networks, a neuron does not directly output its weighted sum b+\displaystyle\Sigma_{i}w_{i}*x_{i} . Instead, this sum passes through a function called an activation function (or transfer function) that has a flattening effect on the output and transforms it to values like yes or no. It maps the resulting values to a span ranging from 0 to 1 or -1 to 1 , etc. A neural network without an activation function is simply a linear regression model. The activation functions also make back-propagation possible since gradients are provided along with error to update weights and biases. There are two categories of activation functions: linear and non-linear. Linear activation functions are functions that are represented by a line. Their derivatives are constants. They are rapid and suitable when the addressed problem is linear by nature. Nonlinear activation functions are the most used activation functions. They are suitable for problems that are not linear by nature, which are most often encountered in Machine Learning. Table G.1 presents the most utilized activation functions, namely sigmoid, hyperbolic tangent (tanh), rectified linear unit (ReLU), parametric rectified Linear unit (PReLU or Leaky ReLU), exponential linear unit (ELU), and Softplus. Table G.2 presents the advantages and drawbacks of these functions. It is important to also mention the Softmax function used in multi-class classification problems, which exponentiates the outputs and renormalizes them. This makes their sum equal to 1 and allows each output to be interpreted as a probability: \sigma(x_{i})=\displaystyle\frac{e^{x_{i}}}{\displaystyle\sum_{k=1}^{K}e^{x_{k}}},\text{ for }i=1,...,K. This mainly gives the probability of the output belonging to a particular class among the K classes. Further details on activation functions can be found in [ 105 , 106 ] . Table G.1: Common activation functions Something Long Activation function Advantages Disadvantages Something Long Sigmoid ( \sigma ) differentiable, monotonic. vanishing gradients, output is not zero-centered, saturation, slow convergence. Something Long Hyperbolic tangent (tanh) differentiable and monotonic, derivative is monotonic, output is zero-centered, easy to optimize. vanishing gradients, saturation, slow convergence. Something Long Rectified Linear Unit (ReLU) differentiable and monotonic, derivative is monotonic, does not activate all the neurons at the same time, efficient. outputs are not zero-centered, when the gradient attains zero for the negative values, it does not converge towards the minimum. Something Long Parametric Rectified Linear Unit (PReLU or Leaky ReLU) differentiable and monotonic, derivative is monotonic, efficient, allows negative value during back propagation. results could be inconsistent, outputs are not zero-centered, if the learning rate is very high this will overshoot killing the neuron. Something Long Exponential Linear Unit (ELU) improves training performance, uses exponential for the negative part and no longer a linear function, performs better than the other ReLUs, no worries about dead neuron (dying ReLU). for positive values, it may blow up the activation (it ranges between [0,\infty[ ) Something Long Softplus differentiable and monotonic, the derivative of softplus is the sigmoid, efficient, used for multivariate classification. vanishing gradients, output is not zero centered, saturation Table G.2: Activation functions: advantages and disadvantages Appendix H Gradient descent optimizers The role of the gradient descent is not only to find the minimum of a cost function (also called loss function or objective function), but also to optimize the convergence to that minimum. Gradient descent uses optimizers for that purpose. In fact, the descent to the optimum may be very expensive in terms of speed of convergence (slow). For that, optimizers could be very useful in accelerating that convergence, but they may negatively affect the model accuracy. A trade-off between speed and accuracy should be negotiated. Notations In this annex, we use the following notations, which are the most common notations used in machine learning literature. • \theta is a vector of \displaystyle\mathbb{R}^{d} . It represents the model parameters (weights and biases vector). • J(\theta) : is the cost function. • The gradient descent updates the parameters \theta in the direction opposite that of the gradient of the cost function, denoted by \nabla J(\theta) . • \eta is the learning rate which represents the size of the steps the descent takes towards the minimum. • x^{(i)} and y^{(i)} are respectively the i th training example and its label. When we do not need to specify the rank i , it is omitted. Gradient descent types There are three types of gradient descents which differ in the amount of data used to calculate the gradient of the cost function. • Batch Gradient Descent or Vanilla Gradient Descent: uses the entire dataset. The gradient is calculated as follows \theta=\theta-\eta\nabla J(\theta) and the descent makes one update on the model parameters every epoch. • Stochastic Gradient Descent (SGD): makes one parameter update at a time, for every single training example x^{(i)} and y^{(i)} . The gradient is calculated as follows \theta=\theta-\eta\nabla J(\theta,x^{(i)},y^{(i)}) • Mini-batch Gradient Descent: makes one parameter update for every n training examples x^{(i:i+n)} and y^{(i:i+n)} . The gradient is calculated as follows: \theta=\theta-\eta\nabla J(\theta,x^{(i:i+n)},y^{(i:i+n)}) Something Long Name Advantages Disadvantages Something Long Batch Gradient Descent One update at a time Slow gradient descent; difficult for datasets that don’t fit in memory; impossible for online learning; high variance Something Long Stochastic Gradient Descent (SGD) Sure convergence for both non-convex and convex optimization; suitable for datasets that don’t fit in memory; possible online learning High variance; fluctuates heavily Something Long Mini-batch Gradient Descent Reduces the variance; stable convergence Programmer should find the best batch size Table H.1: Comparison between gradient descent types Gradient descent optimization algorithms Momentum Momentum [ 107 ] is an algorithm to accelerate SGD. It pushes the descent down the hill in the relevant direction and mitigates oscillations in irrelevant directions. Momentum adds a fraction \gamma of the previous update vector to the current update vector as given by: \left\{\begin{array}[]{ll}v_{t}=\gamma v_{t-1}+\eta\nabla J(\theta)&\\ \\ \theta=\theta-v_{t-1}&\\ \end{array}\right. \gamma is usually set close to 0.9 . Nesterov accelerated gradient The Nesterov accelerated gradient (NAG) algorithm [ 108 ] is similar to Momentum with the difference that the corrective term v_{t} approximates the next position of the parameters (by computing \theta-\gamma v_{t-1} ) prior to performing the current update. This is given by: \left\{\begin{array}[]{ll}v_{t}=\gamma v_{t-1}+\eta\nabla J(\theta-\gamma v_{t-1})&\\ \\ \theta=\theta-v_{t}&\\ \end{array}\right. This algorithm prevents blind descent (uncontrolled descent that may diverge) and gives the Momentum algorithm more orientation toward the minimum. AdaGrad AdaGrad [ 109 ] is an adaptive algorithm that makes small updates to parameters related to frequently occurring features and larger updates to parameters related to less frequent features by scaling the learning rate for each dimension. The equation for the parameter update is as follows: \theta_{t+1}^{(i)}=\theta_{t}^{(i)}-\displaystyle\frac{\eta}{\sqrt{\epsilon+G_{t}^{(i,i)}}}g_{t}^{(i)} where \epsilon is a small term added to prevent the division by zero, g_{t,i} is the gradient of the loss function at the time step t for the dimension i , and G_{t}^{(i,i)} is the sum of each step’s squared gradients up until the current time step (i.e. G_{t}^{(i,i)}=\displaystyle\sum_{\tau=1}^{t}(g_{\tau}^{(i)})^{2} ). The main drawback of AdaGrad is the accumulation of the squared gradients in the denominator (positive numbers), which may cause the algorithm to stop learning. Adadelta The Adadelta algorithm [ 110 ] is devised to overcome the insufficiencies of AdaGrad by limiting the accumulated past gradients to a time window of a fixed size. Its parameter update equation is as follows: \theta_{t+1}^{(i)}=\theta_{t}^{(i)}-\displaystyle\frac{RMS[\Delta\theta]_{t-1}^{(i)}}{RMS[g]_{t}^{(i)}}g_{t}^{(i)} where RMS[\Delta\theta]_{t-1}^{(i)} is the root mean squared error of the parameter updates until the previous time step in the time window and RMS[g]_{t}^{(i)} is the root mean squared error of the gradients until the current time step in the time window. Adam Adaptive Moment estimation (Adam) [ 111 ] calculates two quantities m_{t} and v_{t} before updating the parameters as follows: \left\{\begin{array}[]{ll}m_{t}=\beta_{1}m_{t-1}+(1-\beta_{1})g_{t}&\\ \\ v_{t}=\beta_{2}v_{t-1}+(1-\beta_{2})|g_{t}|^{2}&\\ \end{array}\right. where g_{t} is the gradient of the loss function, and \beta_{1} and \beta_{2} are two factors close to 1 . m_{t} is an estimate of the first moment and v_{t} is an estimate of the second moment representing the uncentered variance. It turns out that these two quantities are biased towards zero. To remedy to that, the estimates of the first moment and the second moment are respectively approximated as follows: \left\{\begin{array}[]{ll}\hat{m}_{t}=\displaystyle\frac{m_{t}}{1-\beta_{1}^{t}}&\\ \\ \hat{v}_{t}=\displaystyle\frac{v_{t}}{1-\beta_{2}^{t}}&\\ \end{array}\right. Finally, the parameters are updated as follows: \theta_{t+1}=\theta_{t}-\displaystyle\frac{\eta}{\displaystyle\sqrt{\hat{v}}+\epsilon}\hat{m}_{t} where \epsilon is a positive number close to zero to prevent division by zero. AdaMax Unlike Adam, AdaMax [ 111 ] uses the infinite norm l_{\infty} rather than the norm l_{2} when calculating v_{t} and replaces the term {\displaystyle\sqrt{\hat{v}}+\epsilon} with u_{t}=\texttt{max}(\beta_{2}v_{t-1},|g_{t}|) . The convergence turns out to be more stable in many cases when using the infinite norm. The parameters are updated as follows: \theta_{t+1}=\theta_{t}-\displaystyle\frac{\eta}{u_{t}}\hat{m}_{t} Nadam Nesterov-accelerated Adaptive Moment estimation (Nadam) [ 112 ] is a combination of Adam and NAG with some approximations. It updates the parameters as follows: \theta_{t+1}=\theta_{t}-\displaystyle\frac{\eta}{\displaystyle\sqrt{\hat{v}}+\epsilon}(\beta_{1}\hat{m}_{t}+\displaystyle\frac{1-\beta_{1}}{1-\beta_{1}^{t}}g_{t}) where all the parameters are the same as in Adam. AMSGrad AMSGrad [ 113 , 114 ] is to some extent a combination of Adam, AdaMax, and AdaGrad. It uses the maximum of past squared gradients to update the parameters as follows: \left\{\begin{array}[]{ll}m_{t}=\beta_{1}m_{t-1}+(1-\beta_{1})g_{t}&\\ \\ v_{t}=\beta_{2}v{t-1}+(1-\beta_{2})|g_{t}|^{2}&\\ \\ \hat{v}=\texttt{max}({\hat{v}_{t-1},v_{t})}&\\ \\ \theta_{t+1}=\theta_{t}-\displaystyle\frac{\eta}{\displaystyle\sqrt{\hat{v}}+\epsilon}{m}_{t}&\\ \end{array}\right. where all the parameters are the same as in Adam, AdaMax, and AdaGrad. RMSprop RMSprop [ 115 ] is very similar to AdaGrad. It also uses the past squared gradients to update the parameters as follows: \left\{\begin{array}[]{ll}E[g_{t}^{2}]=\beta E[g^{2}]_{t-1}+(1-\beta)g_{t}^{2}&\\ \\ \theta_{t+1}=\theta_{t}-\displaystyle\frac{\eta}{\displaystyle\sqrt{E[g_{t}^{2}]}+\epsilon}{m}_{t}&\\ \end{array}\right. where all the parameters are the same as in AdaGrad and E(g_{t}^{2}) is the moving average of squared gradients at time step t . Which is the best optimizer? It is difficult to answer this question! This tightly depends on the data in the training dataset. The state of the art at the present time lacks reliable results regarding the preference of one optimizer over another. Hence, the choice of the most adequate optimizer for a given problem remains an empirical observation.