Professional Documents
Culture Documents
Reflection Rotation
Fig.6 Same image after reflection & rotation transformations
D.Gray Scaling
Fig.13: Gray-scale of mouth images
The process of successfully and tastefully introducing color
to grayscale, monochromatic photographs is known as E.Image Resize
grayscale to color picture conversion. These days, automated 1)Image Resizing
conversion is a challenging field that blends deep learning, For consistency and compatibility with Convolutional
machine learning, and artistic methods. Even though it is neural network models (CNNs), it is frequently
generally accepted among professionals that grayscale necessary to resize the input photos to a fixed size. In
photographs have a special artistic value, color may be this instance, the photos are adjusted to have 224x224
perceived as a loss of information. This study provides a pixel dimensions [19].
summary of techniques and steps for grayscale photo 2)Image Aspect Ratio
colorization. [17] as shown in Fig.11, Fig.12 and In order to avoid distortion, it is crucial to maintain the
Fig.13.Grayscale scaling is a popular picture preprocessing aspect ratio when scaling the photographs. Resizing
method for turning color photos into grayscale images, which while keeping the aspect ratio guarantees that the
is utilized in driver drowsiness detection. In this method, the image's object proportions are accurate [11].
RGB (Red, Green, and Blue) color channels are combined 3). Libraries for image processing
into a single channel that represents the grayscale image's Several libraries for image processing offer functions
intensity. Grayscale image conversion simplifies data and resize images to particular dimensions. Libraries like
lowers computer complexity by focusing on brightness or OpenCV, PIL (Python Imaging Library), and scikit-
intensity information rather than color information. Eye image provide interpolation techniques in addition to
movements, facial emotions, and head positions, among other resizing capabilities to obtain the desired size. [12] [13]
crucial face traits and patterns for drowsiness detection, [20].
clearly captured in grayscale photos [18].
F.CNN Architecture
The pooling layers reduce the computational cost by down
sampling the feature maps, while the convolutional layers use
filters to capture features like edges, corners, and textures.
Classifying the extracted features is done by the completely
linked layers [21] [22]. Training Data: A sizable dataset of
labelled pictures or videos is needed to train a CNN for driver
sleepiness detection. Both tired and awake drivers should be
represented in this dataset in a variety of ways. The CNN
gains the ability to identify the patterns connected to
sleepiness by training on this dataset [21]. Preprocessing:
Techniques for preprocessing may be used to enhance
important features and lower noise before feeding pictures or
video frames into the CNN. Images are frequently resized,
Fig.11 Gray-scale of eye images made grayscale, and had their pixel values normalized as part
of the preprocessing process [7] [23]. Transfer Learning:
With little training data, CNN performance can be improved
by using transfer learning. In order to detect driver
drowsiness, this method uses pre-trained tuned using big
visual datasets. Transfer learning can help the CNN detect
tiredness by utilizing the information gained from the original
job [22].
G.Random Forest
For the purpose of making predictions, the Random Forest
method mixes several decision trees. It is a specific kind of
Fig.12: Gray-scale of head images ensemble learning method. It creates a lot of decision trees
during the training phase, and during the output phase it
creates the class that is the average of the classes predicted by Head 20,000
each tree [24] [25]. The Random Forest technique for driver
sleepiness detection requires the extraction of pertinent Classes Drowsy Non-Drowsy
features from the input data. The use of head posture
Test 30,000 30,000
information, mouth-related cues, and eye-related cues (such
as eye closure length) is common in this setting [26]. Training Train 30,000 30,000
and Testing: To train the Random Forest model, a labelled
dataset with examples of cases of both sleepy and not-drowsy
driving is necessary. To ensure generalizability, the dataset F1- Precision Recall
should contain a range of events and subjects. The score
Model Accura
functionality of the training model is next assessed with cy
unobserved data [27]. Feature Importance: Random Forest Convolutional 96% 93% 93% 93%
offers a metric for feature importance that quantifies the Neural Network
relative weights that various characteristics have during the
Random Forest 86% 85% 85% 85%
classification procedure. This knowledge is used for best
indicators of driver intoxication [28]. These measurements
shed light on the model's capacity to distinguish between tired
and awake states. [29]
H. User-friendly Interface
User-friendly platform is implemented using Tkinter
interface. Without any prior programming experience, users
will be able to input video, view the drowsy state or not, and
interact with the model as depicted in Fig.14 and Fig.15.
VI. CONCLUSION
Finally, the experiment on the driver sleepiness detection
system from the video was effective in developing an
accurate methodology for foretelling driver’s drowsiness
based on face images/frames. The project uses Canny edges
and other pre-processing techniques as well as grayscale
conversion and image scaling. It employed (CNN)
architecture and random forest model’s fatigue. After being
training and validating using the accuracy measures, the
results demonstrated that the models were adequate to
correctly identifying sleepy. A user-friendly interface was
created with Gradio to increase accessibility and user
interaction. Users could now upload films and receive real-
time forecasts of driver fatigue from trained algorithms with
ease.
REFERENCES
[22] Khan, F., Hussain, A., & Amin, Y. (2021). Driver drowsiness models.
International Journal of Advanced Computer Science and
Applications, 12(2), 73-82.
[23] Wang, Z., Zhao, Y., Liu, W., & Liu, J. (2018). Real-time driver
drowsiness detection via CNN-based facial landmarks and multiscale
entropy.
[24] Breiman, L. (2001). Random forests. Machine learning, 45(1), 5-32..
[25] Liaw, A., & Wiener, M. (2002). Classification and regression by
randomForest. R News, 2(3), 18-22.