## 2 Materials and Methods
### Proposed Model Architecture
#### 2.2.5 Edge Computing Device Layer  
The proposed architecture of driver drowsiness detection and alert is shown in Figure 3, video stream capturing followed by frame selection, face detection, landmarks extraction, and classification. If a driver's face is discovered, it is detected and cropped from the image using the Viola-Jones [16; 17] face detection algorithm before being provided as input to the machine learning phase as facial landmarks. The machine learning algorithm detects whether or not the driver is classified as drowsy at the earliest frame. The input to the machine learning model will be 68 facial landmarks of the face provided by the OpenCV library, and each landmark is presented as an x and y coordinate in the face. Since this is a real-time application, the model needs to be very simple and fast to assure the continuous processing of the frames in minimal time. Therefore, when choosing the model to employ, several famous architectures were not included because of their large number of parameters. Considering the VGG16 [18] architecture with 138M parameters, the lightest version of the Efficientnet-B0 [19] has 5.3 M parameters and the Squeezenet [20] has 421 K. Our proposed dense model, presented in Figure 4, requires training only 5 K parameters making it more suited to real-time applications. The parameters of the presented model were chosen by several experiments using a grid search to assure the best-chosen model for the problem addressed has a dropout rate of 0.2 and a batch normalization momentum of 0.8. The machine learning model needs to be trained with several frames labeled as being drowsy or non-drowsy. To best train the model and assure its generalization ability, the dataset is split by actors to make sure that the model is tested by actors that were not previously seen. The dataset contains unequal frames per actor taken from the original video dataset [21]. The idea behind the proposed work is to detect drowsiness as early as possible using a single frame instead of multiple  
Figure 3: Proposed machine learning architecture. consecutive frames. The available dataset was then split into 10 folds for the different experimentation each fold contains a few actors for training and others for testing. Accuracy, precision, recall, and F-measure will be used to assess the proposed idea. Accuracy is measured by the percentage of points out of all the data points that were successfully predicted. Precision and recall are two measures that are used in conjunction to evaluate how well systems perform. Precision is defined as the fraction of all retrieved instances that are relevant occurrences. Recall, also referred to as \"sensitivity,\" is the proportion of retrieved instances among all relevant examples. A perfect classifier has precision and recall that are both equal to one. The harmonic average of precision and recall is the F-measure. The experimentation and results will be further explained in the upcoming section, namely the split by actors. Another experiment is also presented that aims to further enhance the classification results, thus achieving the highest value possible. This approach will require the driver to provide two videos, one marked as drowsy and the other as non-drowsy, as a calibration step before the initiation of the program. The provided videos will help the model be fine-tuned to the specific features of the driver, thus dramatically enhancing the classification results. The results will also be presented in the upcoming section in the trained with calibration results. In this research, we employ the dataset generated by [22] from the Arlington Real-Life Drowsiness Dataset (UTA-RLDD) analysis from the University of Texas at Arlington [21]. The original dataset was developed for the multi-stage drowsiness detection task, focusing on both extreme and readily apparent cases of drowsiness as well as subtle cases where minor micro-expressions serve as the discriminating criteria.