## 3 Methodology  
This study proposes a deep learning architecture, ReSVM, for driver's distraction detection. ReSVM is an optimized version of ResNet-50 that uses deep features obtained by the latter's pooling layer and feeds these features to a support vector machine (SVM) as can be seen in Figure 3.  
Previously, deep learning architectures, such as CNNs, could only use sigmoid functions for various computer vision tasks. Therefore, there was a limit on the number of layers of these networks. More recently, with the introduction of rectified linear unit, AlexNet and VGGNet have been able to use an increased number of layers i.e., 5 and 19, respectively. The increase in the number of layers resulted in an increase in training error. Later on, this degradation problem was addressed with the development of residual networks (ResNets) [30]. A large number of training samples from the ImageNet dataset were used for training a residual neural network (ResNet-50) to classify a diverse range of images including living things such as animals, birds, rodents, etc., and also various inanimate objects. The residual networks, with 50 or 101 layers, use residual blocks in their network architecture [30] and have consecutive 1 \(\times\) 1, 3 \(\times\) 3, and 1 \(\times\) 1 convolution layers. Normally, deep ResNet layers contain 3 \(\times\) 3 filters. Feature size is inversely proportional to the number of filters, i.e., if the feature map size is doubled, then the number of filters is reduced to half and vice versa. Due to this relationship, the time complexity is conserved. The ReSVM takes an input of images with different sizes and variable lighting conditions as shown in Figure 3. The basic idea is to stack all the features as a feature map that is obtained from the last multilayer perceptron convolution layer (mlpconv) of the trained ResNet-50. Then, mean of the feature map is computed and fed to the SVM layer for classification [54]. Global average pooling carries several advantages over fully connected layers. For one, it is more native to the convolution structure because it enforces correspondence between feature maps and different categories [55]. An overfitting at this layer is avoided as there exists no parameter that needs optimization in case of global average pooling. The spatial information is summed up in case of global average pooling, which makes it more robust to spatial translations of the input. SVM has been in use for the last couple of decades owing to its accurate classification with lower computational costs and excellent generalization ability [56; 57]. A non-linear approximation and adaptive learning capability of SVM brings various benefits in handling non-linear data and small samples [58]. SVM is suitable for both regression as well as classification tasks. The SVM algorithm finds a hyperplane by classifying the data points in an N-dimensional space. The objective of the SVM algorithm is to find a maximum separating margin between the hyperplane and the data points. For maximizing the margins, hinge loss is used as a loss function. Our experimental results clearly show that SVM (with non-linear RBF kernel [59]) used with our architecture outperforms a neural network (MLP) on all four datasets. This improvement can be attributed to some inherent strengths of SVMs. Namely, they have good generalization capabilities which prevent overfitting, and they can also handle non-linear data efficiently. In the case of artificial neural networks, there is no specific rule for determining their structure. The appropriate network structure is achieved through experience and trial and error. It can further be observed that SVM also exhibits better results as compared to ID3, AdaBoost, naive Bayes, random forest, and k-NN. * Training data \(\{\mathbf{x}_{i},y_{i}\}\)\(i=1,\ldots,l\), \(\mathbf{x}_{i}\in\mathbb{R}^{n}\), and \(y_{i}\in\{-1,1\}\).