## 2 Models
### Convolutional Neural Networks (CNNs)
#### 2.2.1 Multiclass Classification  
Image classification used to be a challenging task involving two stages: using feature descriptors to extract handcrafted features and then feeding them to a trainable network. The problem with this approach was that it was heavily dependent on the first stage, which was a complicated task [35]. However, the availability of GPUs, better algorithms, and larger datasets helped address this problem and fueled the popularity of CNNs [42]. The main obstacle in using a multiclass classification model in this study was that the measure of the stability of slopes (i.e., the _FS_) was a continuous variable, while the classification model was inherently suitable for discrete variables. To address this issue, the _FS_ values were grouped into nine categories based on the ranges of their _FS_ values. The categories of _FS_ values in Table 1. were adopted so that the classification model could reach accuracy to one decimal place. Aside from that, each range was associated with a unique label that was utilized in the multiclass class. The details of calculating the _FS_ values of these slope images are discussed in the following sections. To obtain a general understanding, let us assume there are \(k\) predefined classes in the data. Then, the goal of the multiclass classification model is to determine the input, \(x\), belongs to which of the \(k\) categories. To achieve this goal, the deep learning model will approach a function \(f\), which can be defined by its weights \(w\) to estimate the output \(y\) such that \(y\) =_f_(_x_|_w_). In this study, the input fed to the network was an image or images in the form of an array or arrays of numbers representing pixel values of the image or images. The output was a vector of \(k\) numbers, in which all elements were equal to zero except the one that was equal to the label. Before calculating the output, the Softmax layer computed the probability of the input image belonging to every class. The Softmax layer takes the output of the last linear layer _z_\({}_{i}\) and transforms it into the probabilities of the image belonging to each category by taking the exponents of each input and normalizing them over the sum of these probabilities:  
\[p_{i}=\frac{e^{z_{i}}}{\sum_{j=1}^{k}e^{z_{j}}} \tag{1}\]  
where _p_\({}_{i}\) is the probability that an image belongs to the _i_th category. \begin{table}
\begin{tabular}{c|c c} \hline \hline
**Category** & **Range of FS** & **Label** \\ \hline First & Less than 0.8 & 0 \\ Second & 0.8–0.9 & 1 \\ Third & 0.9–1.0 & 2 \\ Fourth & 1.0–1.1 & 3 \\ Fifth & 1.1–1.2 & 4 \\ Sixth & 1.2–1.3 & 5 \\ Seventh & 1.3–1.4 & 6 \\ Eighth & 1.4–1.5 & 7 \\ Ninth & Greater than 1.5 & 8 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Categories of FS values and their associated labels for multiclass classification. In deep learning, the goal is to minimize the error or loss. The loss function is a measure of how well the model fits the data. Cross-entropy is usually used to construct the loss function for the multiclass classification:  
\[J(w)=-\sum_{i=1}^{k}[y_{i}\ ln(p_{i})]. \tag{2}\]  
Deep learning involves two stages: training and testing. In both stages, predictions are the goal, namely by using a CNN to predict the \(FS\) of a slope based on its image data. Before predictions, these CNNs must be trained on a dataset of labeled slope images. In training, the deep learning model is improved to minimize the loss function in the optimization process to find the best weights \(w\) for the dataset. The CaffeNet architecture developed by the Berkeley Vision group was adopted for the classification model of this study [19]. Figure 1 illustrates the architecture of this model. This classifier is a one-GPU reproduction of AlexNet with minor improvements, including the removal of data augmentation and moving of the pooling layer in front of the normalization layer.