A Lightweight In-Vehicle Alcohol Detection Using Smart Sensing and Supervised Learning

: According to the risk investigations of being involved in an accident, alcohol-impaired driving is one of the major causes of motor vehicle accidents. Preventing highly intoxicated persons from driving could potentially save many lives. This paper proposes a lightweight in-vehicle alcohol detection that processes the data generated from six alcohol sensors (MQ-3 alcohol sensors) using an optimizable shallow neural network (O-SNN). The experimental evaluation results exhibit a high-performance detection system, scoring a 99.8% detection accuracy with a very short inferencing delay of 2.22 µ s. Hence, the proposed model can be efﬁciently deployed and used to discover in-vehicle alcohol with high accuracy and low inference overhead as a part of the driver alcohol detection system for safety (DADSS) system aiming at the massive deployment of alcohol-sensing systems that could potentially save thousands of lives annually.


Introduction
Alcohol is a harmful and intoxicating substance that can lead to addiction.According to the World Health Organization (WHO), every year, three million people die as a result of alcohol consumption (Figure 1), and millions more suffer from impairments and poor health.Overall, harmful alcohol use accounts for 5.1 percent of the global disease burden.More precisely, harmful alcohol use accounts for 7.1 percent and 2.2 percent of the worldwide burden of illness, respectively, for males and females [1].Alcohol is the main cause of early death and disability in people aged 20 to 39 years old, accounting for 13.5 percent of all deaths in this age group [2].Alcohol-related deaths and hospitalization are more common in disadvantaged and especially vulnerable populations.
In addition, alcohol consumption can lead to driver impairment, which is a major cause of car accidents around the world [3].Indeed, drinking alcohol before (or even while) driving decreases several of the driver's functional abilities, including tracking power, vision, concentration, reaction time, and proper speed control, all of which increase the risk of a crash [4].According to [5], drivers with a blood alcohol concentration (BAC) of 1.5 g/L are judged to be 20 times more dangerous than sober drivers.
Moreover, driving under the influence of alcohol is frequently related to not wearing seat belts, which increases the risk of injury in most cases, as reported in [6].For instance, a study published in 2014 revealed that alcohol was involved in around 25 percent of all traffic fatalities in Europe [7].Between 1995 and 1997, approximately 40 percent of drivers involved in road accidents in Greece were found to have consumed alcohol [8].In the United States, alcohol-related car crashes killed more than 10,000 people in 2019, accounting for almost 30 percent of all road fatalities [9].
To address this problem, a large amount of research, both in industry and in the academy, has been carried out on smart systems [10] that can identify this type of behavior and help to avoid the corresponding risks.The research community has attempted to develop smart systems that may be integrated into modern vehicles to recognize risky behavior and avoid accidents caused by alcohol consumption [11][12][13][14][15][16][17].
According to the survey article presented in [18], there exist mainly two categories of drivers behaviors detection techniques, namely: 1.
Real-time techniques: These methods entail gathering and processing data about the driver's behavior continuously [19].The key advantage of these techniques is that they may detect incidents instantaneously, allowing for timely decisions to be made and damages to be minimized.Some examples of these techniques are: vehicle-mounted cameras [20], smartphone built-in sensors [21,22], specialized hardware/sensors [23], advanced driver assistance systems (ADAS) [24], etc. 2.
Non-real-time techniques: These techniques use offline collected data related to drivers' behaviors.They are generally more precise since they use more sophisticated materials and have more available time for computation and analysis.These techniques allow specialized governmental institutions to make future decisions and appropriate measurements for reducing possible risks and accidents.Some examples of these techniques are: vehicle-mounted cameras [25], in-vehicle data recorders [26], simulators [27], questionnaires [28,29], etc.These techniques may also be used for detecting driving infractions and providing shreds of evidence against drivers when they are issued penalty notices.
In this work, we adopted an approach based on artificial intelligence (AI) techniques for analyzing data collected using MQ-3 sensors [30] in order to detect the presence of alcohol inside vehicles.The main characteristic of this type of sensors is that they have a high sensitivity to alcohol with good resistance to disturbance of gasoline, smoke, and vapor.The sensors are connected via an ARM Cortex M4 Microcontroller [31].The obtained data are stored as a CSV file containing 14,400 samples.The detection problem was then modeled as a supervised machine learning (ML) problem using shallow neural networks (SNN) [32].
The first step for our ML problem is the preprocessing stage which consisted of importing the data from the CSV file.The second step is the learning stage, during which, the training and testing processes were performed.The next step is the evaluation stage, which consisted of validating our ML model by computing specific performance indicators.Our software module was then uploaded to the microcontroller unit.After this, the device may be installed inside the vehicle to be controlled for detecting alcohol presence.
The major contributions of this paper are as follows: • We developed a new lightweight in-vehicle alcohol detection system using smart sensing and optimizable neural networks.A comprehensive architecture and description are demonstrated to provide the complete view of the computation process.

•
We evaluated our intelligent model on dataset instances generated from a sensory circuit, achieving: -High-performance indicators of 99.8%, 99.7%, and 99.5% for accuracy, harmonic mean, and kappa index, respectively.-Low inferencing overhead equal to 2.22 µs, making our system appropriate for real-time use in real-life conditions.
The remaining part of the paper is outlined as follows.Section 2 reviews related works on similar approaches.In Section 3, the adopted in-vehicle alcohol detection model is presented in details.In Section 4, the main obtained results are presented.Finally, Section 5 concludes the paper.

Related Work
As formerly stated in the introduction section, several research works in the literature concentrated on the study of alcohol detection for drivers using different instruments and techniques.Below, we consider only 10 studies related to this topic.The main findings of these works are summarized in Table 1.The purpose of the study presented in [20] was to prevent drivers from both starting their cars after drinking alcohol and not wearing their seat belts.This system uses an MQ-3 alcohol sensor, which is attached to the driver's seat belt.The Raspberry Pi compares the reading from the sensor unit to the allowable threshold value.The ignition locking mechanism prohibits the drivers from starting the car if they are inebriated.A Raspberry Pi camera is also installed on the system to identify the driver's presence.The paper's authors did not provide enough technical details about the adopted solution, and no experimental results were reported.
Similarly, the authors of [33] proposed a breath sample testing-based driver alcohol detection system.The suggested system was developed with the Arduino Compatible Compiler for LabVIEW (ACCL), enabling Arduino boards to be programmed using Labview.The system can analyze the amount of alcohol in a breath sample and control the ignition system's operation to prevent drunk driving.The maximum error of alcohol concentration estimation by the proposed solution reached almost 31 percent.
The authors of [34] proposed a portable alcohol detection system that includes a breath sensor unit, a smartphone that controls the sensor device and communicates various data, and a data cloud system.The detection system can be used to keep an eye on the driver from afar.Four different sensors make up the breath sensor unit.The first is a water vapor sensor, which determines whether the gas being applied is human breath.The others are semiconductor gas sensors that can detect hydrogen, acetaldehyde, and ethanol.The results of the driver's alcohol test are forwarded to a data cloud system to be analyzed automatically, which may cause problems in case of connection failures.
In [35], a vehicle-based alcohol detection system based on IoT technology [42] is presented.The core controller used is a STC12C5A60S2 single-chip microcomputer with an MQ-3 alcohol sensor for collecting data on air alcohol concentration and a GU900E GPRS module for wireless connection.When the driver takes the wheel, the device performs an automated alcohol detection.When the drunk driving threshold is met, the system activates the relay, disables the car, activates the sound and light alert, utilizes the GU900E to execute base station location, and finally sends an SMS of the GPS information to the driver's family.The paper's author failed to offer sufficient technical details about the chosen approach, and no experimental data were reported.
The authors of the study [36] developed a driver-monitoring and assisting gadget that uses IoT sensors such as an alcohol sensor and an air pressure sensor to check for sobriety, and machine learning techniques to capture micro-sleep and frequent yawns in order to detect drowsiness.The driver is instructed to blow into the mouthpiece when the device is turned on.The driver is authorized to turn the ignition on after a clean and proper blow.Following that, the device employs a camera to monitor the driver for signs of drowsiness constantly and alerts the drowsy driver via the vehicle's sound system or a buzzer.The experimental results reported in this work covered a very limited number of drivers (only three).
The authors of the article [37] proposed a non-invasive approach for detecting the presence of alcohol within a vehicle.The proposed technique relies on a set of MQ-3 alcohol sensors installed inside the car.A feature selection technique was carried out utilizing a genetic algorithm.The features obtained through this technique were utilized to build an SVM classification model that detects the presence of alcohol.The proposed methodology is described in detail.However, it is unclear how alcohol detection will be achieved once the ML model is constructed and whether it will be carried out in a real-time or a non-real-time fashion.
The goal of the study presented in [38] was to check how well different classifications and machine learning techniques could predict alcohol consumption and related functional states.The data were analyzed in 10-second time frames with no superposition or gaps.Two analyses employing classification and machine learning techniques were utilized to test both the algorithms' potential to detect alcohol use and functioning states.The main limitation is that the considered data were limited to young drivers.
The aim of the work presented in [39] was to conduct an empirical study to recognize driving behavior and to compare the performance of common machine learning techniques.According to the testing results, many sensor readings acquired from the CAN bus are either highly connected with one another or less relevantly related to driving behavior identification.Compared to other approaches, ensemble tree-based algorithms such as decision trees and random forests outperform classic machine learning techniques.The authors adopted a general approach and did not specifically concentrate on the alcohol detection problem.
The authors of the paper [40] proposed a low-cost, non-intrusive real-time driver drowsiness detection system that was coupled with an alcohol detection system.The MQ-3 sensor is used to detect alcohol in this system.Face detection is then performed using a webcam mounted on the car's dashboard.Drowsiness is recognized, and a warning is issued based on the threshold values of four extracted key face traits.Both systems are connected using a Raspberry Pi3 and an Arduino UNO.In this work, only a few ML techniques were tested.
A case-based classification method for alcohol detection utilizing physiological indicators was proposed in [41].Four physiological measures are used in a case-based reasoning system to detect alcoholic state, including skin conductance, finger temperature, respiration rate, and heart rate variability.The drivers participating in this study are divided into intoxicated and sober.In this work, only one ML technique was tested.

In-Vehicle Alcohol Detection Model
The goal of this model is to detect the presence of alcohol inside a vehicle.An intelligent, self-reliant model was proposed for this purpose.The proposed model was composed of a hardware module for smart sensing and a software module for the intelligent supervised detection model.The top view design of the proposed approach is illustrated in Figure 2. Illustration of the proposed approach.The proposed system combines the benefits of sensing technology through the ARM Cortex units along with power of machine learning approaches.This has led to a smart sensing detection system.

The Hardware Module
This module was placed inside the vehicle and comprised six MQ-3 sensors and a memory unit connected via ARM Cortex M4 Microcontroller [43].MQ-3 gas sensor has a high sensitivity to alcohol with good resistance to disturbance of gasoline, smoke, and vapor [44].This sensor provides an analog resistive output based on alcohol concentration, and thus it was connected to ARM Cortex M4 Microcontroller via ADC (analog-to-digital convertor) unit.The memory unit is important for keeping track of the readings calibrated through the six sensors to provide more comprehensive and accurate detectability of in-vehicle alcohol levels.The readings were captured through the ARM Cortex M4 Microcontroller using a small C language program written for the microcontroller to collect the readings of the six sensors.The hardware part of this model is illustrated in Figure 3.After several experiments, a large number of samples were collected and stored as a CSV file that contains 14,400 samples for the in-vehicle alcohol level experiments.These samples were distributed equally as 7200 samples for in-vehicle with alcohol and 7200 samples for in-vehicle without alcohol, and finally deployed in a balanced dataset (IVA 2021) [45] to be used for further investigation and modeling.Moreover, the main reasons to use MQ-3 sensor can be summarized as follows: • The availability (very commonly used and available in almost every electronic shop).

•
The affordability (available in electronic shops at low rates and prices).

•
Its high sensitivity to alcohol.MQ-3 gas sensor has high sensitivity to alcohol, and has good resistance to disturbance of gasoline, smoke, and vapor.This sensor provides an analog resistive output based on alcohol concentration.When the alcohol gas exists, the sensor's conductivity increases, along with an increase in the gas concentration.

•
Other important features: easy SIP header interface, compatible with most of the microcontrollers, low-power standby mode, fast response and high sensitivity to alcohol gas, long life and low cost, and requires simple drive circuit.
In addition, the MQ-3 sensor , also referred to as an alcohol sensor, detects ethanol in the air.When a drunk person breathes near the alcohol sensor, it detects the ethanol in their breath and provides an output based on alcohol concentration.Specifically, the MQ-3 sensor detects the attentiveness of alcohol gas in the air and produces an analog voltage as an output reading.The sensor can activate at temperatures ranging from −10 to 50 • C with a power supply of less than 150 Ma to 5 V.The sensing range is from 0.04 mg/L to 4 mg/L, which is suitable for alcohol detectors such as breathalyzers.To calibrate this sensor, it is recommended to use 4 mg/L (200 ppm) alcohol concentration, 21% oxygen concentration, 65% relative humidity, at 20 • C. The complete specifications of the MQ-3 sensor are provided below in Figure 4.

The Software Module
This module was developed, coded, and uploaded to the microcontroller unit.The invehicle alcohol detection problem was modeled as a supervised machine learning problem developed as a classification system using shallow neural networks (SNN) [46] with their corresponding modules and algorithms (Table 2).The complete framework for this system is illustrated in Figure 4. Initially, the collected dataset from the hardware module was preprocessed before being fed into the learning operations.

•
The preprocessing stage began by importing/localizing the data from the CSV file and making it local in the running model.Several data distortions were fixed at this stage, including removing duplication, handling empty records, fixing data inconsistencies, and others [47].Then, the data were randomly shuffled to ensure that the dataset has no specific sequencing or biasing.In addition, in order to improve the classification process, all data records were standardized (uniformly scaled) using Z-score normalization [48] so that all features are equally important, which eases the supervised learning process of ML approaches.At this point, the data are ready to be fed through the learning phases, and, hence, the data were split into two subsets: the training dataset to train the model with 70% of the total number of samples and the testing dataset to validate the model effectiveness with the remaining 30% of the total number of samples.Furthermore, to ensure a highly effective validation process, we used a 5-fold cross-validation [49] that provides five different combination splits of training and testing datasets.The final evaluation metrics are an overall average of the 5-fold cross-validation phases.

•
The learning stage is the intelligent part of this module.At this stage, all training and testing (validation) processes were performed.The optimizable neural network (ONN) was used to train, validate, and test the system.ONN is an optimizable learning model that makes use of different neural network architectures in order to pick up the best architecture that maximizes the performance of the model [50].In this system, our ONN operated several neural network architectures that have a number of fully connected layers ranging from 1 to 3. The number of neurons at every layer ranged from 1 to 100 and the number of iterations was limited to 1000 iterations per model and 30 epochs of training.To sum up, Table 3 below shows the complete configurations and specifications of our proposed ONN.Note that a shallow neural network (SNN) with 10 neurons at the hidden layer was selected by the ONN as the optimal learning model for this dedicated problem.The architectural diagram for this optimizable SNN (O-SNN) is depicted in Figure 4b.The O-SNN received 6 inputs (coming from the readings of the six MQ-3 sensors) and processed them at the hidden layer (processor layer) to produce one of the two decisions at the output layer (binary classifier).
In this study, the proposed alcohol detection system was modeled as an optimizationbased neural network problem.Unlike traditional neural network models, the main idea of the proposed optimizable neural network (ONN) is to develop an automated system that makes use of different neural network architectures and configurations (hyperparameters) in order to create a complete search space for all possible networks' architectures and hyperparameters.For every resultant model, the performance was evaluated, and then the model with optimized (best) performance criteria (i.e., classification accuracy and minimum classification error) was then selected as an inferencing model for this specific task and specific dataset.According to the brief of system modeling specifications and configurations presented in Table 3, our learning model was developed to try several architectures and hyperparameters, including the number of fully connected layers being set to 1, 2, or 3 layers, with every hidden layer size set to be in the range from 1 to 100 (input and output layers were fixed according to our application); the activation function options attempted with every architecture being ReLU, Tanh, Sigmoid, or none; the data standardization option being set to Yes or No; and the regularization strength (Lambda) being attempted in the range from (6.9444 × 10 −10 ) to (6.9444).In addition, the learning process in every experiment underwent the following common specifications: the learning optimization algorithm was set to Bayesian optimizers as they are efficient because they select hyperparameters in an informed manner, which is compatible with the acquisition function (expected improvement per second plus) [53].For the training algorithm, we used the scaled conjugate gradient (SCG) due to its simplicity to determine the new direction vector lower cost [54].For the loss/cost function, cross-entropy error was used.Cross-entropy loss is used when adjusting model weights during training.The aim is to minimize the loss (a perfect model has a cross-entropy loss of 0).For the feature selection process, we used all features used in the model since all of them are significant, representing the reading of different sensors.
For data division and distribution, we randomly divided our dataset into several folds, each being 70% training and 30% testing.Specifically, we used a 5-fold cross-validation process and the performance of the five experiments was averaged to produce the overall performance.Figure 5 illustrates the implemented validation process.
Accordingly, the final optimized neural network was selected and constructed as a shallow neural network (SNN) with one fully connected layer comprising 10 neurons, with optimal hyperparameters selected as follows: Sigmoid function as an activation function, and the optimal regularization strength is 1.0887 × 10 −9 with data standardization (Z-score normalization) and 30 iterations of model training.Eventually, the main constraint of this study was that it is application-specific, which means that one should re-execute the whole procedure to attain an optimizable neural network for the new application (task) and new dataset, whereas the main strength of this study is that it can locate the neural network architecture and hyperparameters that best fitted with the application being investigated in terms of several performance metrics, such as the classification accuracy, the minimum classification error, and the inferencing overhead.
The evaluation stage is a crucial phase for any ML-based model to figure out whether the model will be the best solution for a given problem.In this research, we evaluated our system in terms of five vital performance indicators [55], including: 1.
The binary confusion matrix analysis: The confusion matrix is like a summary of the prediction results for a particular classification problem.It compares the actual data for a target variable to that predicted by a model.Correct and false predictions are revealed and distributed by class, allowing them to be compared with defined values.The confusion matrix is used to evaluate the performance of a classification model.It therefore shows how confusing a certain model can be when making predictions.In its simplest form, it is a 2 × 2 matrix.For more complex classification problems, it is always possible to add rows and columns to the basic form.

2.
The predictive accuracy (%): The predictive accuracy is determined by dividing the total number of correct predictions by the total number of samples in the dataset.The accuracy ranges from 0.0 to 1.0, with 1.0 being the best.Since accuracy might be confusing when applied to unbalanced datasets, alternative metrics based on a confusion matrix are also needed to assess the performance.

3.
The harmonic predictive average (also called F-measure %): It enables an evaluation of a model, taking into consideration both precision and recall using a single score, which is useful for explaining the performance of the model.Whereas precision determines the proportion of accurate predictions for the positive class, recall measures the proportion of the positive class's correct predictions out of all possible positive predictions.Precision and recall are given equal weights in the harmonic mean, which is used to calculate the harmonic predictive average.4.
The predictive kappa index (%): This is an extremely helpful yet underused measure.Measures such as accuracy or precision/recall do not give a complete view of the classifier's performance in the event of a multi-class classification task.In other situations, programmers could come across an issue with unbalanced classes; for instance, if there are two classes-let's call them X and Y-and X only comes up 5% of the time.Classical measurements may be deceptive in this situation, necessitating the employment of more advanced techniques.In this context, the predictive kappa index is a very effective metric that can effectively manage difficulties involving multiple classes and unbalanced classes. 5.
The predictive time (µs): It is essential to use neural networks that can produce quick and precise predictions.As a result, when developing these systems, we should aim to reduce not one but two objectives: (1) the prediction error on certain validation data and ( 2) the prediction speed.The design parameters, also known as tuning parameters, include factors such as the number of hidden layers, the number of neurons per layer, learning rates, regularization parameters, etc.
The computational formulas for these metrics are shown in Figure 6.The deployment stage occurs when the system is efficiently developed and evaluated.If the developed system meets the requirements, then it can be deployed for online real-time functionality.It can be placed in-vehicle, equipped with a battery (rechargeable) and a small LCD display to read the output decision.

Results and Analysis
This paper proposes a computational intelligence model that requires high computational power at both the implementation and experimentation stages.The proposed in-vehicle alcohol detection was developed and evaluated on a high-performance computing platform comprising fast processing units (Intel Core I.7, Generation-11, central processing unit-CPU ) and parallel computation units (4 GB of addition graphical processing unit-GPU).Initially, the ONN model was implemented and operated toward the allocation of the optimal neural network model that maximizes the detection performance and minimizes the inferencing (prediction) delay.
Figure 7 shows the model optimization using ONN trying the aforementioned hyperparameter search range (stated in Table 3) aiming to determine the best-point hyperparameters that score the minimum classification error within 30 iterations of the learning process.After seven iterations only, the ONN model was able to reach the minimum classification error (MCE) that belongs to the best-point hyperparameters (optimized hyperparameters) from the hyperparameter search range as follows: the optimal model is the neural network (O-SNN) with one hidden layer composed of 10 neurons (six features at the input layer and two classes at the output layer), and the optimal activation function is the sigmoid function with a data standardization option using Z-score normalization and regularization strength (λ = 1.0887 × 10 −9 ).At this point and henceforth, the discussion will focus on the O-SNN model illustrated in Figure 4b, as it was selected as the best neural network architecture to model our problem statement of in-vehicle alcohol detection with a high-performance and least delay.For instance, Figure 8 traces the performance trajectories of the O-SNN in terms of the cross-entropy loss (CEL) function [56]   As can be clearly observed from the figure, overall, the model exhibits a high capability in discriminating positive classes and negative classes, having TP = 7200, FP = 32, FN = 0, and TN = 7168.Accordingly, the overall performance metrics reveal that the system is highly sensitive (sensitivity = 99.6%),highly specific (specificity = 100%), highly accurate (accuracy = 99.8%), and highly precise (precision = 100%).Accordingly, the performance indication metrics for accuracy, harmonic means, kappa index, and prediction delay are summarized in Table 4.In short, the proposed in-vehicle alcohol detection-based O-SNN model is precise, accurate, and lightweight, and can provide an inferencing outcome of less than 2.5 µs, and a classification error of less than at least 2.5%.
Eventually, Table 4 provides a performance comparison of our proposed in-vehicle alcohol detection system with other up-to-date state-of-art in-vehicle alcohol detection systems developed via machine learning (ML) or deep learning (DL) models.The table contrasts our best empirical findings recorded for the O-SNN-based model with the corresponding findings stated in the existing state-of-art models.In addition to the year of publication, the evaluation in the table compares four comparable design performance scopes, including the detection scheme (using the ML or DL model), the testing accuracy fractions for the detection systems, the harmonic mean (F-score) fractions for the detection systems, and the kappa index fractions for the detection systems.Subsequently, the table considers six distinct alcohol detection systems for the in-vehicle ecosystem developed during the last five years (from 2016 to 2021), alongside our proposed in-vehicle alcohol detection system, which relies on the optimizable shallow neural networks (O-SNN) as the core learning model.The reported detection schemes incorporate the following supervised learning models: a genetic algorithm with support vector machine/radial that has been used by [37]; Ross-Quinlan decision trees known as (C4.5 DT), used in the development of am alcohol detection system in [57]; a reduced error pruning tree (REPT-DT) decision tree, which was employed in [38]; a random forest classifier (RFC) model used in [39]; a support vector machine (SVM) utilized by the author of [40]; and, finally, a k-nearest neighbors (kNN) learning model that was used in [41].According to the information provided in the comparison table, one can indisputably conclude that our in-vehicle alcohol detection system is superior, with the highest performance records over the other compared state-of-art schemes.The proposed model has enhanced the validation accuracy by a proportion of 2.2-13.8%over the compared models.In addition, the proposed model can be successfully adopted in real-time ecosystems due to the low prediction delay required by the proposed system (once the data are calibrated by the sensors, only 2.2 µs are needed by the intelligent model to provide the detection outcome).

Conclusions
A new lightweight in-vehicle alcohol detection using smart sensing and optimizable neural networks was developed, implemented, and evaluated in this paper.Specifically, the proposed system is composed of two subsystems: (1) the hardware subsystem utilizing a microcontroller, MQ-3 sensors, ADC module, memory unit, battery, and a small LCD unit; (2) the software subsystem utilizing a data preprocessing stage, optimizable shallow neural network (O-SNN), and evaluation module.The proposed learning model was trained using several variants of neural network architectures ranging from one to three layers with a variable number of neurons at every layer.The empirical investigation revealed that the best optimizable design is obtained with SNN comprising one hidden layer with 10 neurons and a Sigmoid activation function.High-performance indicators were recorded for the O-SNN model, with values of 99.8%, 99.7%, and 99.5% for accuracy, harmonic mean, and kappa index, respectively.In addition, the proposed model is lightweight since it can provide the detection decision with only 2.2 µs.Hence, we believe that the proposed in-vehicle alcohol detection can be efficiently deployed to provide its functionality in a realworld deployment.Our technique may be applied to different automobiles to determine whether or not the driver has ingested alcohol.This makes it much simpler for police officers to identify drunk drivers.Our system can also be utilized in a variety of businesses or organizations to identify employee alcohol usage.By achieving this, we are offering automobiles and other vehicles an autonomous safety system.
Though the main focus of this research was to develop an intelligent self-reliant lightweight in-vehicle alcohol detection system with high-performance indicators and low inferencing overhead for real-life conditions, building an array with different sensors can be considered as a future direction to extend and improve the proposed system.In addition, another interesting future direction is practical in-vehicle experimentation by placing the developed system inside a car and testing the model in a real-time manner.Furthermore, it is essential for the labeling process for the real-time collected data to be investigated further since the the goodness of the labeling is directly related to the quality of the learning process.An other interesting future direction consists of extending our system with necessary components for blocking the vehicle in case of risks or danger and contacting either the nearest police office or the family members of the drunk driver that has shared with them their current position.In addition, other sensors may be used to collect data, such as speed, vehicle stability, photos of the driver, and so on.This information will improve the precision and efficiency of the prediction process.The sensors to use may be either built-in or external sensors, such as mobile phone sensors.

Figure 1 .
Figure 1.Some statistics and critical facts about the dramatic consequences of alcohol consumption.This clearly shows that alcohol is a major cause of car accidents around the world.

Figure 2 .
Figure2.Illustration of the proposed approach.The proposed system combines the benefits of sensing technology through the ARM Cortex units along with power of machine learning approaches.This has led to a smart sensing detection system.

Figure 3 .
Figure 3.The hardware module for the in-vehicle alcohol detection.The illustrated hardware module was composed mainly of six MQ-3 sensors connected through the ADC of the ARM Cortex controller to provide readings about the alcohol status in the surrounding environment.

Figure 4 .
Figure 4.The software module for the in-vehicle alcohol detection: (a) top view model architecture, including the core hardware unit and the main phases of the learning model; (b) structure of ONN model, including the optimized configuration.

Figure 5 .
Figure 5.The five-fold cross-validation process.At each experiment, the validation dataset (fold) and the training dataset were changed, aiming to visit all instances in the overall dataset in both training and validation processes.The overall performance metric was calculated from the average of the five experiments to provide more robust evaluation metrics (such as accuracy, precision, recall).

Figure 6 .
Figure 6.The five performance indicators used in the evaluation of our proposed system.These are the standard evaluation metrics used in almost all machine-learning-based models to provide insights into the system performance.

Figure 7 .
Figure 7. Model optimization for optimizable neural network model using the hyperparameter search range.The plot investigates the trajectory of estimated minimum classification error, and the observed minimum classification error with respect to varying numbers of iterations (max = 30 iterations).In this figure, the best point hyperparameters that satisfies the minimum error hyperparameters are also traced.
for 55 epochs of the learning process, including training, validation, and testing trajectories.The target value of CEL is to reach the zero value; however, the best validation performance was recorded after epoch 49, with CEL = 1.0 × 10 −3 .Along with the figure, the table attached to the figure summarizes the error values obtained for the training, validation, and testing dataset in terms of crossentropy loss (CEL) and the minimum classification error (MCE).The table reveals the robustness of this model, scoring low error rates for all subsets of the dataset (the training, validation, and testing).

Figure 8 .
Figure 8. Tracing performance of the learning process for training, validation, and testing stages.In this figure, the trajectories for training error, testing error, and validation error in terms of cross entropy loss (CEL) are tracked in order to obtain the best point performance.The best point is recorded at CEL of 0.0010.To obtain more perceptions of the proposed model and the solution approach, Figure 9 demonstrates the two-class confusion matrix analysis of the O-SNN model for the training dataset, validation dataset, testing dataset, and the overall dataset.In addition, along with the figure, a summary of performance indicators (ACC, HMS, KaI, and PrT) is provided.The employed datasets were balanced, comprising a total of 14,400 samples distributed equally between the positive and the negative classes (7200 samples per class).As can be clearly observed from the figure, overall, the model exhibits a high capability in discriminating positive classes and negative classes, having TP = 7200, FP = 32, FN = 0, and TN = 7168.Accordingly, the overall performance metrics reveal that the system is highly sensitive (sensitivity = 99.6%),highly specific (specificity = 100%), highly accurate (accuracy = 99.8%), and highly precise (precision = 100%).Accordingly, the performance indication metrics for accuracy, harmonic means, kappa index, and prediction delay are summarized in Table4.In short, the proposed in-vehicle alcohol detection-based O-SNN model is precise, accurate, and lightweight, and can provide an inferencing outcome of less than 2.5 µs, and a classification error of less than at least 2.5%.Eventually, Table4provides a performance comparison of our proposed in-vehicle alcohol detection system with other up-to-date state-of-art in-vehicle alcohol detection systems developed via machine learning (ML) or deep learning (DL) models.The table contrasts our best empirical findings recorded for the O-SNN-based model with the corresponding findings stated in the existing state-of-art models.In addition to the year of publication, the evaluation in the table compares four comparable design performance scopes, including the detection scheme (using the ML or DL model), the testing accuracy fractions for the detection systems, the harmonic mean (F-score) fractions for the detection systems, and the kappa index fractions for the detection systems.Subsequently, the table considers six distinct alcohol detection systems for the in-vehicle ecosystem developed during the last five years (from 2016 to 2021), alongside our proposed in-vehicle alcohol

Figure 9 .
Figure 9. Two-class confusion matrix analysis of the O-SNN model along with summary of performance indicators (ACC, HMS, KaI, and PrT).The figure analyzes the confusion matrix for testing dataset, the confusion matrix for validation dataset, the confusion matrix for training dataset, and the confusion matrix for overall dataset.The model performed highly, recording high performance score.

Table 1 .
Summary of related works.This summary concentrates on the most recent related state-ofthe-art studies conducted between 2016 and 2022 in the same area of study.

Table 2 .
The specifications of MQ-3 sensors used in this study.The information provided in this table are taken from the data sheet of MQ-3 sensor manufacture.

Table 3 .
The brief of system modeling specifications and configurations.The upper part of the table presents the hyperparameter search range, where different models are trained and tested to obtain the optimized model.The second part is the learning process specifications, which is common for all experiments.The last part is optimized hyperparameters, which show the best values for hyperparameters and neural network architecture resulted from trying all possible configurations in the hyperparameter search range.

Table 4 .
Comparison with other existing ML-based in-vehicle alcohol detection systems.The table shows that different learning models and different evaluation metrics were used in the existing models.