An Automobile Environment Detection System Based on Deep Neural Network and its Implementation Using IoT-Enabled In-Vehicle Air Quality Sensors

: This paper elucidates the development of a deep learning–based driver assistant that can prevent driving accidents arising from drowsiness. As a precursor to this assistant, the relationship between the sensation of sleep depravity among drivers during long journeys and CO 2 concentrations in vehicles is established. Multimodal signals are collected by the assistant using ﬁve sensors that measure the levels of CO, CO 2 , and particulate matter (PM), as well as the temperature and humidity. These signals are then transmitted to a server via the Internet of Things, and a deep neural network utilizes this information to analyze the air quality in the vehicle. The deep network employs long short-term memory (LSTM), skip-generative adversarial network (GAN), and variational auto-encoder (VAE) models to build an air quality anomaly detection model. The deep learning models gather data via LSTM, while the semi-supervised deep learning models collect data via GANs and VAEs. The purpose of this assistant is to provide vehicle air quality information, such as PM alerts and sleep-deprived driving alerts, to drivers in real time and thereby prevent accidents.


Introduction
Sleep deprivation (drowsiness) and impaired cognition can cause traffic accidents [1], and the number of traffic accidents due to driver drowsiness and fatigue is increasing annually. According to the Korea Expressway Corporation, 180 out of the 942 highway traffic accident casualties that occurred from 2012 to 2017 were due to drowsy driving. Driver drowsiness is especially dangerous at high speeds, as losing consciousness even for 3 s at 100 km/h will cause the driver to skip approximately 100 m. Damage from public transport accidents is even more severe.
Driver drowsiness can be caused by conditions such as driver fatigue, lack of sleep, chronic fatigue, and an increased CO 2 concentration in the vehicle. Fatigue and headaches during driving are caused not only because of health conditions but also owing to the air quality inside the vehicle, especially when driving for long periods. A major cause of driver drowsiness is lack of ventilation. Therefore, proper ventilation and fresh air recirculation should prevent drowsiness [2].
Previous studies have been focused on the development of sensors and algorithm-based technologies to recognize and process driver and environmental conditions. Although camera-based recognition determines driver drowsiness, its performance depends on the circumstances and its adoption is limited owing to high costs. Most driver state detection (DSD) technologies adopt methods based on cameras or other sensors, but these devices are difficult to install and may constrain the behavior of drivers. Most in-vehicle DSD systems are also less reliable than rule-based artificial

Trends in ADAS Research
The progress in autonomous driving technology is drawing considerable attention toward research on ADASs owing to their potential with regard to precision driver safety [7]. To prevent accidents, some governments and automakers of countries that promote autonomous driving are expediting the development and adoption of ADASs by mandating their integration. Functions for safe driving (e.g., forward collision warnings), which integrate driver monitoring systems (DMSs) [8] and ADASs, are essential for autonomous cars of Level 3 and above [9,10]. In autonomous driving, safety is not possible without these technologies.
Autonomous vehicles integrate intelligent sensors and information and communication technology with mechanical and traffic technologies to help drivers navigate safely using self-aware systems and judgment control. Furthermore, they utilize recognition technology for location and obstacle detection, judgment technology that determines the next course of action based on the detection, and control technology that quickly and precisely executes the appropriate action [2]. This approach is being developed further for the next generation of autonomous vehicles and will use in-vehicle sensor hardware integrated with deep learning. In addition, it is important to integrate the aforementioned functions seamlessly into a robust, unified system [11]. Moreover, DMSs have become crucial as it has become necessary to comply with standards such as those enforced by the New Car Assessment Programme (NCAP). Because of the integration of DMSs into automobiles as the primary safety features in the context of the European NCAP, the market for DMS is expected to grow rapidly owing to the widespread adoption of in-vehicle systems.
A DMS analyzes the facial expressions and biometric information of the driver to identify and monitor his or her condition. Infrared camera modules are installed on the steering wheel to track the eyes and face direction of the driver, enabling the system to warn the driver through the medium of sound upon detecting drowsiness or squinting. Pressure sensors and vibration actuators are embedded in the seatbelt and seat to monitor the breathing, heart rate, and pulse of the driver. These devices identify drowsiness and provide tactile warnings.

Predicting Driver Drowsiness
There are several techniques for predicting driver drowsiness. In psychophysiological approaches [12], electronic devices are attached to the skin of the driver to determine his or her condition from biological signals via various methods, including electroencephalography, electrocardiography, electrooculography, and electromyography. As drowsiness impairs muscle coordination, and consequently the ability to drive, a second approach involves analyzing vehicle operation information to infer the psychophysiological state of the driver. This approach involves analyzing steering wheel movement, driving speed, and degree of lane departure [12]. A third approach for DSD is based on visual information obtained by performing image processing on driver behavior [13]. Portions of the face of the driver are tracked and analyzed to detect signs of drowsiness, such as yawning in the mouth region and eye activity [14]. In relatively recent studies, vehicular operation and visual driver information have been utilized to perform DSD. The visual characteristics (from facial parts such as the eyes, and mouth), vehicle operation (to infer the physical characteristics of the driver), and vehicle measurements are analyzed to determine driver drowsiness or distraction level [2,[15][16][17].
Representative DSD technologies include facial recognition, heartbeat detection, and lane departure detection. In facial recognition, in-vehicle near-infrared cameras are used to monitor the eye activity of the driver to detect driver fatigue, drowsiness, and poor physical conditions [10,18,19]. In this method, facial feature points such as muscles, expressions, and facial direction are extracted, converted into images, and subjected to pattern recognition. However, this approach requires further improvement. Technology that can identify and analyze the biosignals of the driver (e.g., pulse, heart rate, brain blood flow, brain waves, body temperature, sweat, and degree of body load) is emerging [12]. For instance, a slow heart rate may indicate drowsy driving, and the DSD system can alert the driver when the heart rate falls below a threshold.
Detection devices are being integrated with various equipment for supplementary tasks such as driver drowsiness and lane departure detection, primarily by automobile and component manufacturers. The development of a driver monitoring technology that captures, recognizes, and judges driver behavior efficiently through parameters such as steering wheel operation is also advancing [20][21][22][23][24]. When driving a vehicle, a driver performs basic operations such as adjusting the steering wheel, pushing the accelerator pedal, and checking the mirror. Under a reduced focus, the ability of the driver to perform these basic operations is compromised. In lane departure detection, active measures are utilized-for example, the generation of a strong vibration in the steering wheel when the vehicle departs from the lane or begins departure without the driver activating the turn signal. If the automobile travels on a lane for a certain period and crosses the left yellow line or if the steering wheel angle is outside the normal range, the system considers the driver to be drowsy and generates a warning. A built-in drowsiness prevention system activates the lane departure warning system along with the brakes as well as a complementary warning when the automobile is too close to the vehicle in front. This technology also includes a function to shorten the brake system deployment time automatically to avoid collisions. Under mild drowsiness, the system only provides voice assistance. However, if an extreme situation such as deep drowsiness or fainting is identified, the system not only provides voice assistance but also vibrates the seat to wake up the driver to prevent an accident. Likewise, when the vehicle departs from the lane, the pedal vibrates to warn the driver. In similar dangerous situations, the Pre-Safe seat belt tightens two or three times. Hence, the vehicle systems can actively intervene to reduce the risk of an accident [20].

Effect of CO 2
Several studies have indicated that air quality is better inside vehicles than that outside. However, the California Air Resources Board reported that the amounts of hydrocarbons and CO 2 within the vehicle are at least two to 10 times those outside the vehicle [21]. Furthermore, some areas, such as China and Hong Kong, are highly affected by particulate matter (PM). In the case of severe dust, it has been reported that in-vehicle air conditioning systems are not ventilated via external ventilation [8,16]. In particular, if the in-vehicle filter is not replaced at an appropriate time, the air quality is worse inside the vehicle than that outside it, because of the concentration of CO 2 inside the vehicle. In this regard, the situation in Korea is similar to that in China and Hong Kong. Accordingly, in Korea, indoor air quality is regulated through the Indoor Air Quality Control Act. The contaminants to be managed are as follows: particulate matter (PM 10 and PM 2.5 ), carbon dioxide (CO 2 ), formaldehyde, total airborne bacteria, carbon monoxide (CO), nitrogen dioxide (NO 2 ), radon (Rn), volatile organic compounds (VOCs), asbestos, ozone, mold, benzene, toluene ethylbenzene, xylene, and styrene. The management standards are as follows. The concentrations of PM 10 , PM 2.5 , CO 2 , and CO should be less than 100 µg/m 3 , 50 µg/m 3 , 1,000 ppm, and 10 ppm, respectively, according to the standards. In accordance with Korean laws and standards, the criteria for toxic indoor pollutants and poor air quality were also specified in this study.
In addition, when the air filter is not replaced regularly or when the external concentration of PM is high during a certain period, which can be the case in Korea, the CO 2 concentration in the vehicle increases rapidly when the internal circulation mode is utilized [8]. The factors affecting the air quality inside automobiles can be divided into internal pollutants, such as external air, exhaust fumes emitted from other vehicles, odors from factories and agricultural lands, and external pollutants, such as dust from tires and roads, CO 2 from respiration, and VOCs produced by the interior components of the vehicle (Figure 1). In addition, new cars generally have extremely high formaldehyde contents. The concentrations of pollutants from vehicle exhausts are higher inside the vehicle than those outside. contaminants to be managed are as follows: particulate matter (PM10 and PM2.5), carbon dioxide (CO2), formaldehyde, total airborne bacteria, carbon monoxide (CO), nitrogen dioxide (NO2), radon (Rn), volatile organic compounds (VOCs), asbestos, ozone, mold, benzene, toluene ethylbenzene, xylene, and styrene. The management standards are as follows. The concentrations of PM10, PM2.5, CO2, and CO should be less than 100 µ g/m 3 , 50 µ g/m 3 , 1,000 ppm, and 10 ppm, respectively, according to the standards. In accordance with Korean laws and standards, the criteria for toxic indoor pollutants and poor air quality were also specified in this study.
In addition, when the air filter is not replaced regularly or when the external concentration of PM is high during a certain period, which can be the case in Korea, the CO2 concentration in the vehicle increases rapidly when the internal circulation mode is utilized [8]. The factors affecting the air quality inside automobiles can be divided into internal pollutants, such as external air, exhaust fumes emitted from other vehicles, odors from factories and agricultural lands, and external pollutants, such as dust from tires and roads, CO2 from respiration, and VOCs produced by the interior components of the vehicle (Figure 1). In addition, new cars generally have extremely high formaldehyde contents. The concentrations of pollutants from vehicle exhausts are higher inside the vehicle than those outside. It is difficult to lower the windows to ventilate the car while driving on urban streets. However, if the air conditioning system is used only in the internal circulation mode, CO2 from respiration will cause O2 depletion, causing fatigue and impaired muscle coordination and judgement, which is ultimately manifested as drowsiness. Medical journals and industrial safety studies have indicated that the level of CO2 affects sleepiness and fatigue, but more research is needed on the direct causal relationship between CO2 and sleepiness [25].
According to data published by the Korea Road Traffic Authority, when the occupancy of an express bus is 70%, the average CO2 concentration in the vehicle is 3422 ppm, with a maximum of 6765 ppm after 90 min of driving [25][26][27]. If the CO2 concentration exceeds 2000 ppm, the driver may experience a headache or drowsiness. A concentration exceeding 5000 ppm will drastically reduce the O2 level and cause brain injury. Concurring with these findings, in 2012, the American Association of Occupational Health published a study on drowsy driving that indicated that if the CO2 concentration in a confined space exceeds 2000 ppm, the occupants may experience headaches or drowsiness [12,13]. The potential health problems associated with high CO2 concentrations are listed in Table 1. It is difficult to lower the windows to ventilate the car while driving on urban streets. However, if the air conditioning system is used only in the internal circulation mode, CO 2 from respiration will cause O 2 depletion, causing fatigue and impaired muscle coordination and judgement, which is ultimately manifested as drowsiness. Medical journals and industrial safety studies have indicated that the level of CO 2 affects sleepiness and fatigue, but more research is needed on the direct causal relationship between CO 2 and sleepiness [25].
According to data published by the Korea Road Traffic Authority, when the occupancy of an express bus is 70%, the average CO 2 concentration in the vehicle is 3422 ppm, with a maximum of 6765 ppm after 90 min of driving [25][26][27]. If the CO 2 concentration exceeds 2000 ppm, the driver may experience a headache or drowsiness. A concentration exceeding 5000 ppm will drastically reduce the O 2 level and cause brain injury. Concurring with these findings, in 2012, the American Association of Occupational Health published a study on drowsy driving that indicated that if the CO 2 concentration in a confined space exceeds 2000 ppm, the occupants may experience headaches or drowsiness [12,13]. The potential health problems associated with high CO 2 concentrations are listed in Table 1.

Air Quality Sensor (AQS)
If an automobile is driven for a long time, the amount of CO 2 in its cabin will increase and O 2 will be depleted owing to respiration. O 2 depletion, in turn, causes fatigue and drowsy driving [20,27]. Hence, CO 2 causes fatigue, reduces O 2 levels, and impairs driver muscle coordination and judgement. Thus, to improve fatigue prevention techniques, an autonomous system to monitor air pollution in vehicles during journeys and to improve air quality is needed.
In recent years, various studies have been conducted to develop technologies for filtering harmful substances and odors, including general air pollutants, vehicle exhaust gases, and VOCs, from automobiles [1,25]. However, these filter systems have design limitations. High-end automobiles are equipped with air conditioners that monitor the CO 2 level in the cabin, recirculate fresh air, and provide a warning when a certain CO 2 level is exceeded. These air conditioners have been upgraded to regulate PM. When a high concentration of PM is detected in the vehicle, the air inside the vehicle is discharged, and fresh air is sucked in, filtered, and recirculated throughout the vehicle by the improved air conditioning system [28,29].
Such technologies are already under development. For example, compact integrated air quality sensors (AQSs) for monitoring indoor air pollution, PM2.5 concentration sensors, surface treatment technology for microbial habitat (mold) suppression, disinfectors in air conditioning system components (such as heat exchangers) and cluster ionizers for air purification, generator technology, cabin filter replacement notification devices, and integrated air conditioning systems, such as multi-function air cleaners, are being developed [12].
We developed an IoT-enabled vehicle AQS for measuring the concentrations of CO 2 , PM, and other pollutants. Furthermore, based on sensor measurements, we devised a DSD system for drowsy driving accident prevention [20].
For the AQS, we collected information from five types of sensors (CO, CO 2 , PM, temperature, and humidity sensors) with the performance specifications summarized in Table 2. The measured value depends on the operating temperature. We aimed to develop a system and service that can recognize and monitor various problems that may occur during vehicle operation, such as driver drowsiness due to CO 2 , hazardous in-vehicle PM levels, hazardous gas leakage, and fire hazards. Type: NDIR (Nondispersive Infrared) Sensor Measurement Range: 0-5,000 ppm Accuracy: 400-5000 ppm ± 75 ppm or 10% of reading, whichever is greater Operating Temperature: +10-+50 with an aerodynamic diameter equal to or less than 2.5 µg/m 3 is referred to as PM 2.5 , and PM with a diameter between 2.5 and 10 µg/m 3 is referred to as PM 10 . PM with a diameter less than 1.0 µg/m 3 is defined as PM 1

IoT Sensor Platform
In this research, we integrated an AQS with the IoT. The purpose of the IoT is to use connected technologies to develop a "smarter" environment, enabling lifestyle simplification by saving time, energy, and money. Through this technology, industries can reduce expenditures. The enormous investments and several studies conducted on the IoT have made it an increasing trend in recent years. The IoT involves a set of connected devices that can transfer data among themselves to optimize their performance. These actions occur automatically and without human awareness or input. The IoT sensor platform ( Figure 2) includes four main components-1) sensors, 2) processing networks, 3) data analysis, and 4) system monitoring. Modern IoT-enabled sensor solutions analyze collected data, perform real-time analysis, and provide timely notifications of the sensor status based on measurements, to increase managerial and response efficiencies. Key technologies such as deep learning and distributed parallel processing are used to analyze patterns in the collected data and to detect anomalies in real time [5]. Pre-trained deep learning solutions can accurately monitor driver health and detect operational anomalies for all types of sensors. AI-based sensor solutions can reduce operational and managerial costs [16]. In fact, unnecessary support for system checks can be reduced using these solutions. Moreover, sensor data compensation technology can be used to improve the performance of low-cost sensors, reach a level of precision similar to those of expensive precision instruments, and reduce the initial investment, especially for large sensors. *PM (Particulate matter) with an aerodynamic diameter equal to or less than 2.5 µ g/m 3 is referred to as PM2.5, and PM with a diameter between 2.5 and 10 µ g/m 3 is referred to as PM10. PM with a diameter less than 1.0 µ g/m 3 is defined as PM1

IoT Sensor Platform
In this research, we integrated an AQS with the IoT. The purpose of the IoT is to use connected technologies to develop a "smarter" environment, enabling lifestyle simplification by saving time, energy, and money. Through this technology, industries can reduce expenditures. The enormous investments and several studies conducted on the IoT have made it an increasing trend in recent years. The IoT involves a set of connected devices that can transfer data among themselves to optimize their performance. These actions occur automatically and without human awareness or input. The IoT sensor platform ( Figure 2) includes four main components-1) sensors, 2) processing networks, 3) data analysis, and 4) system monitoring. Modern IoT-enabled sensor solutions analyze collected data, perform real-time analysis, and provide timely notifications of the sensor status based on measurements, to increase managerial and response efficiencies. Key technologies such as deep learning and distributed parallel processing are used to analyze patterns in the collected data and to detect anomalies in real time [5]. Pre-trained deep learning solutions can accurately monitor driver health and detect operational anomalies for all types of sensors. AI-based sensor solutions can reduce operational and managerial costs [16]. In fact, unnecessary support for system checks can be reduced using these solutions. Moreover, sensor data compensation technology can be used to improve the performance of low-cost sensors, reach a level of precision similar to those of expensive precision instruments, and reduce the initial investment, especially for large sensors.

Deep Learning-Based Sensors
The IoT and "smart cities" are generating substantial amounts of time-series sensor data for analysis. The importance of sensors has been further highlighted in smart mobility for autonomous

Deep Learning-Based Sensors
The IoT and "smart cities" are generating substantial amounts of time-series sensor data for analysis. The importance of sensors has been further highlighted in smart mobility for autonomous vehicles, which have witnessed active research and development. Automotive original equipment manufacturers (OEMs), semiconductor firms, AI companies, and software startups have led to the rapid development of related technologies and platforms. Sensors are key components of automobiles, similar to their role in all products of highly interconnected technology-intensive industries. Research on AI, computer vision, and sensor networks is helping to reduce driver and pedestrian accidents in some countries, increasing the adoption of technology to enhance safety.
Extensive research is being conducted on deep learning to enable computers to determine optimal algorithms via artificial neural networks that resemble human neural networks using large volumes of data. Deep learning is a popular machine learning approach that has achieved significant progress in all traditional machine learning fields [23,30].
Deep learning techniques are becoming indispensable in autonomous driving, for tasks such as the recognition of people, cars, and lanes surrounding autonomous vehicles [24,[31][32][33]. In fact, deep learning can handle the numerous variables in a driving environment that otherwise hinder the development of conventional algorithms. In the same vein, real-time, high-performance semantic segmentation based on deep learning for driving environment recognition has been developed successfully. For instance, SegNet is a system that visually monitors the status of the driver and identifies characteristics such as pupil status, eye blinking, and gaze via deep learning algorithms. Facial landmark information allows SegNet to analyze the head pose and gaze to identify the awareness level of the driver [30]. Moreover, deep learning has been used to process important in-vehicle sensor data. In contrast, the use of the sensors has recently increased in various fields, such as anomaly detection, whose principles can be applied to DSD [4,34,35]. In the following sections, we discuss three deep learning algorithms used in sensing systems for anomaly detection [36][37][38].

Deep Learning-Based Anomaly Detection
The identification of items or patterns in a dataset that do not conform to other items or an expected pattern is referred to as anomaly detection. These unexpected patterns may be called anomalies, outliers, novelties, exceptions, noise, surprises, or deviations [39]. Anomaly detection reveals unexpected patterns in the data. Further, it is widely used in various fields, including fraud detection, intrusion detection, safety critical systems, health monitoring, detecting illegal use of credit cards, detecting eco-system disturbances, and military surveillance [35,39]. Moreover, it can be used in preprocessing to remove outliers from datasets, which can significantly improve the performance of subsequent machine learning algorithms, especially in supervised learning tasks.
Studies on sensor networks constitute emerging research topics, and it is difficult to collect information without errors from wireless sensors. It is particularly important from a data analysis perspective because of its special features. Abnormal values in sensor network data indicate that the sensor has correctly identified an abnormal event or that there is a problem in the sensor [40,41]. Thus, sensor network anomaly detection involves both sensor malfunctions and intrusions [42]. The types of data collected by sensors vary widely and include binary, discrete, continuous, voice, and video data, which are continuously generated. Data may be noisy or missing, depending on the environment in which the sensor is installed. Sensor network anomaly detection has many challenges because it functions in real time.
Because sensors are installed in multiple locations, a distributed data mining approach is required for analysis. Noise and missing values must be distinguished from outliers. Anomaly detection has also been studied using in situ data with respect to time. The problem of abnormality detection in time-series data is as follows. Time-series data follow a continuous series of data points in a temporal order, and a specific point in time is highly affected by the preceding and following values. In general, the analysis is conducted by selecting an appropriate time window. This window is classified according to whether the objective of the analysis is to find an abnormal point in the time data or an abnormal pattern of change [37].
The label indicates whether or not the data entity is abnormal. The use of the training material to label inaccuracies (i.e., to perform classification) incurs a tremendous computational effort and cost. It is substantially difficult to classify all possible types of anomalies. If an abnormality has appeared rarely or if a new type of abnormality has emerged, it is difficult obtain a classified data entity. Therefore, it is necessary to deal with unlabeled data.
There are many challenges in the task of anomaly detection that distinguish it from a binary classification task. For example, because anomalous systems exhibit considerably more diverse behaviors than a normal system and are rare by nature, anomalous data are often severely underrepresented in training sets [39,43].
There are three broad categories of anomaly detection techniques, based on the extent to which labeled data are available: supervised, semi-supervised, and unsupervised.
In supervised anomaly detection, a binary (abnormal and normal) labeled dataset is given; then, a binary classifier is trained using this data. This approach should address the unbalanced dataset problem resulting from the existence of few data points with abnormal labels. Semi-supervised anomaly detection techniques require a training set that contains only normal data points. Anomalies are detected by building the normal behavior model of the system, then testing the likelihood of generation of the test data point by using the learned model. Unsupervised anomaly detection techniques deal with unlabeled datasets by making the implicit assumption that most data points are normal [39,44].
Supervised anomaly detection is used when label information is available for all entities in the learning material or a classification model is learned to determine anomalies; this is the most common approach. Generally, the data are in an imbalanced state in which the abnormality rate is negligible compared to the normal rate [45,46].
Semi-supervised anomaly detection is used when label information is only available for the learning subjects and the normality/abnormality status is not known for materials without label information. Generally, the model is trained using only normal data and is then applied to the test data [47].
Unsupervised anomaly detection is the most widely used anomaly detection method for unlabeled data. In this method, outlier detection is mainly based on the distance between the entities in the data. In general, it is assumed that the ratio of the normal data is overwhelmingly large. If this assumption is wrong, problems such as high false alarm rates occur [45][46][47][48].
When a labeled dataset can be generated by relating historical data and sensor data over time (i.e., when the data samples from sensors are labeled as normal or abnormal states), representative patterns in the measured values can be determined. In fact, labeled data and deep learning models enable computers to learn patterns from sensor measurements by supervised learning. Thus, supervised learning cannot be used in the initial stage (for example, when a sensor is first installed or when no historical data are available). In these cases, unsupervised learning is adopted to monitor the sensor state as it does not require labeled data. In unsupervised learning, anomalies such as sensor failures can be determined directly from measurements without relying on historical data. The deep learning model can be enhanced later with labeled data for more systematic processing of sensor measurements. In general, unsupervised anomaly detection algorithms provide similarity scores between measurements and normal data to indicate anomalies based on a threshold [49,50].
Unsupervised learning facilitates the detection of abnormal patterns from periodic data, as most sensors exhibit periodic measurement behaviors. Then, by using a generative model, it is possible to input a periodic pattern and to generate synthetic data for one cycle in the form of a probability distribution. The generative adversarial network (GAN) and variational auto-encoder (VAE) are common generative models for synthesizing sensor data from a given process [37,51].

Long Short-Term Memory (LSTM) Model
To prevent the loss of historic data and to leverage such data, long shot-term memory (LSTM) has been used extensively owing to its promising results [52,53]. Instead of simply accumulating historical information, LSTM introduces cell states and gate structures to select and deliver important information. The cell state contains the information obtained in the previous step. Rather than simply passing on this information to the next step, the forget and input gates determine the amount of information that will be discarded and the amount of new input data that will be reflected to update the cell state.
LSTM networks have been proven to be well suited for dealing with and predicting important events with long intervals and delays in a time series. LTSM networks can maintain long-term memory. In an LTSM network, a stacked LSTM hidden layer makes it possible to learn a high-level temporal feature without any fine tuning or preprocessing, which is otherwise required by other techniques [43].
Data collected from a sensor is learned via LSTM to train the model. This trained model is then used to estimate the sensor measurement values in real time. LSTM is a deep learning model suitable for modeling time-series data such as sensor measurements. To predict the value at time t, the structure uses data from instants (t − n), (t − n + 1), . . . , (t − 1), for some n, as input. LSTM can model the autocorrelation of the time-series data without requiring the assumption of stationarity and learn the temporal patterns of time-series data [48,54].
Xie et al. [39] trained a LSTM model with data collected by a sensor and used the trained model to estimate the sensor measurements in real time. In the case of a steady-state sensor, there is little difference in the residual errors between the values estimated by the LSTM model and the actual measured values. This residual error can be used to detect points of frequent anomalies. Experiments with actual IoT sensor data have indicated that abnormality detection using LSTM mainly detects the sudden change of a value efficiently [38].

Skip-GANs and VAEs
These are methods of detecting abnormal patterns from a periodic pattern. A majority of sensor data have periodic change patterns in which similar patterns recur at regular intervals. Using a generative model, it is possible to learn the process of generating data for one cycle in the form of a probability distribution by inputting a continuously changing pattern.
The skip-GAN and VAE are representative generative models and can learn new patterns from similar patterns by learning the patterns of input data [55]. Both models train common sensor data patterns to artificially generate sensor data with similar patterns. The data generated by the generative model is similar to the actual measured values in the case of a steady-state sensor but different in the case of an abnormal state [54,56].
The difference between the pattern of the changes in the measured values and that generated by the generative model is quantified by using an anomaly score, where the greater the likelihood of the anomaly, the higher is the anomaly score [55,56].
To demonstrate the significance of skip-GANs, we provide the example of Schlegl et al. [46,56]. They proposed an algorithm for detecting diseases from medical images using a GAN. This algorithm was largely composed of learning and reasoning stages. In the learning stage, the GAN model was trained with the image of a healthy subject. In the inference step, when a new image was input, the GAN model generated an artificial image highly similar to the input image. As the GAN was trained only with normal data, the artificial image generated was assumed to be a normal image of a subject without the disease, and the anomaly score was calculated by comparing the normal image and the input image.
In another report, Xu et al. [54] proposed an anomaly detection algorithm using a VAE to monitor indicators such as the number of users of web applications and to implement appropriate measures when abnormal events occurred. In unsupervised learning methods, it is very important that the model does not overfit the specific image and that the normal pattern is well learned. To prevent these values from contributing to the loss function, Xu et al. [54] added a random missing value to the input data and used a modified loss function.
For a sensor under normal operation, data synthesized by the generative model are approximately equal to the measured data. When an anomaly occurs, however, the sensor measurements exhibit varying patterns. Hence, the difference between the synthetic and measured patterns can be used as the anomaly score, where higher values indicate a greater likelihood of an anomaly, providing an intuitive means of inferring the system status [57].

Input Data Configuration
The data collection period was selected from August 1, 2019 to September 30, 2019. Sensors were sequentially installed in 95 vehicles from SoCar, which is a car sharing platform in South Korea. The data were measured every 2 s when the customer boarded and operated the vehicle; these data were sent to the SK Planet Cloud Server. Through this process, 79 million data points were collected from the sensor. Each sensor data point collected from a vehicle of various sizes contains all the AQ parameters. During the data collection period, 95 sensors ( Figure 3) were installed in the vehicles chosen for the analysis (i.e., 30 sensors in the Carnival model of large vehicles, 32 sensors in the Avante (medium), and 33 sensors in the Morning (small)).

Input Data Configuration
The data collection period was selected from August 1, 2019 to September 30, 2019. Sensors were sequentially installed in 95 vehicles from SoCar, which is a car sharing platform in South Korea. The data were measured every 2 s when the customer boarded and operated the vehicle; these data were sent to the SK Planet Cloud Server. Through this process, 79 million data points were collected from the sensor. Each sensor data point collected from a vehicle of various sizes contains all the AQ parameters. During the data collection period, 95 sensors ( Figure 3) were installed in the vehicles chosen for the analysis (i.e., 30 sensors in the Carnival model of large vehicles, 32 sensors in the Avante (medium), and 33 sensors in the Morning (small)). The learning data set was selected by referring to the PM data distribution and the ultra-PM reference value was provided by Korea Environment Corporation (KEPC). We excluded some abnormal data during pre-processing, namely those with PM2.5 > 75 µ g/m 3 according to the enacting environmental authority (KEPC) and with temperatures greater than 50 °C. The data with the abovementioned conditions were excluded from the learning data set due to the effects of external air quality-that is, when PM2.5 < 75 µ g/m 3 , there is no influence of the external air quality on all the AQ parameters measured inside the vehicle. Figure 4 shows an example of the signals received from the AQS installed in the vehicle. We employed basic sensors and monitored the data in real time. The deep learning model was used to detect sensor measurements with anomalous readings, to notify the user. A function for correcting errors in the data was also included, enabling reliable data acquisition at low cost.
When analyzing air quality data collected by the sensors in a vehicle during a test drive for the experiment, a typical case of abnormal detection is the smoking of a cigarette in the vehicle. Therefore, if abnormal changes in PM values were recognized, the data were intensively analyzed and applied to the model from approximately 90 s after the change in PM value.
The data were manually labeled using anomaly criteria and analyzed to address the data imbalance caused by random oversampling. Subsequently, the deep neural network was trained to identify normal or abnormal conditions from the sensor data. As the input data represent a time series, LSTM was set as the basic structure, and the input data were composited for improved computational speed and optimized to maximize the detection performance. The learning data set was selected by referring to the PM data distribution and the ultra-PM reference value was provided by Korea Environment Corporation (KEPC). We excluded some abnormal data during pre-processing, namely those with PM 2.5 > 75 µg/m 3 according to the enacting environmental authority (KEPC) and with temperatures greater than 50 • C. The data with the abovementioned conditions were excluded from the learning data set due to the effects of external air quality-that is, when PM 2.5 < 75 µg/m 3 , there is no influence of the external air quality on all the AQ parameters measured inside the vehicle. Figure 4 shows an example of the signals received from the AQS installed in the vehicle. We employed basic sensors and monitored the data in real time. The deep learning model was used to detect sensor measurements with anomalous readings, to notify the user. A function for correcting errors in the data was also included, enabling reliable data acquisition at low cost.
When analyzing air quality data collected by the sensors in a vehicle during a test drive for the experiment, a typical case of abnormal detection is the smoking of a cigarette in the vehicle. Therefore, if abnormal changes in PM values were recognized, the data were intensively analyzed and applied to the model from approximately 90 s after the change in PM value.

Results of Deep Learning Model
We applied the DSD system to actual IoT sensor data to develop a deep learning model that could accurately determine the sensor state by learning the changes in the patterns. The VAE structure provided a smaller network capacity under the same conditions. However, their detection performance was almost identical, demonstrating the successful conversion of the DSD into a lightweight structure.
The experimental results demonstrated the anomaly detection performance of the proposed algorithm, which was better than the performances of existing techniques. To verify the anomaly detection performance of each deep learning model, the predicted values obtained from the developed model were reconstructed in a manner similar to the actual value based on the PM2.5 of normal and abnormal data. In Figures 5-7, the blue and red lines represent the predicted and actual values, respectively.
The LSTM was trained to overfit the normal data. The LSTM model used by the deep learning model had higher sensitivity to PM and was reconfigured to a low value to reconstruct the abnormal The data were manually labeled using anomaly criteria and analyzed to address the data imbalance caused by random oversampling. Subsequently, the deep neural network was trained to identify normal or abnormal conditions from the sensor data. As the input data represent a time series, LSTM was set as the basic structure, and the input data were composited for improved computational speed and optimized to maximize the detection performance.

Results of Deep Learning Model
We applied the DSD system to actual IoT sensor data to develop a deep learning model that could accurately determine the sensor state by learning the changes in the patterns. The VAE structure provided a smaller network capacity under the same conditions. However, their detection performance was almost identical, demonstrating the successful conversion of the DSD into a lightweight structure.
The experimental results demonstrated the anomaly detection performance of the proposed algorithm, which was better than the performances of existing techniques. To verify the anomaly detection performance of each deep learning model, the predicted values obtained from the developed model were reconstructed in a manner similar to the actual value based on the PM2.5 of normal and abnormal data. In Figures 5-7, the blue and red lines represent the predicted and actual values, respectively.
The LSTM was trained to overfit the normal data. The LSTM model used by the deep learning model had higher sensitivity to PM and was reconfigured to a low value to reconstruct the abnormal data. Thus, the model was designed to have high sensitivity to small changes in the PM data, which resulted in more detections than would be possible with the existing models ( Figure 5).
The VAE model was reconfigured to follow the trend of PM value changes and was sensitive at high PM values. This model was reconfigured to follow the trend of PM value changes, and the detection was effective for higher PM concentrations ( Figure 6).
The skip-GAN exhibited superior detection performance compared to the existing models at the point at which the PM value started to increase (Figure 7). The skip-GAN could detect abnormalities more effectively than the other models when the air quality exhibited high PM concentrations.
Sustainability 2020, 12, x FOR PEER REVIEW 12 of 17 data. Thus, the model was designed to have high sensitivity to small changes in the PM data, which resulted in more detections than would be possible with the existing models ( Figure 5). The VAE model was reconfigured to follow the trend of PM value changes and was sensitive at high PM values. This model was reconfigured to follow the trend of PM value changes, and the detection was effective for higher PM concentrations ( Figure 6).
The skip-GAN exhibited superior detection performance compared to the existing models at the point at which the PM value started to increase (Figure 7). The skip-GAN could detect abnormalities more effectively than the other models when the air quality exhibited high PM concentrations.   data. Thus, the model was designed to have high sensitivity to small changes in the PM data, which resulted in more detections than would be possible with the existing models ( Figure 5). The VAE model was reconfigured to follow the trend of PM value changes and was sensitive at high PM values. This model was reconfigured to follow the trend of PM value changes, and the detection was effective for higher PM concentrations ( Figure 6).
The skip-GAN exhibited superior detection performance compared to the existing models at the point at which the PM value started to increase (Figure 7). The skip-GAN could detect abnormalities more effectively than the other models when the air quality exhibited high PM concentrations.

Conclusions
Currently, high-performance ADAS products are being developed and commercialized. This has led to a significant reduction in their prices, and the detection accuracy is constantly being improved. In line with this development, the proposed DSD system is a low-cost, basic product that can easily be installed in vehicles. To prevent fatigue-related accidents, the system informs the driver and passengers of the CO2 levels, monitors the CO and CO2 concentrations, and predicts the drowsiness state of the driver.
The DSD system measures and monitors in-vehicle air quality (through factors such as CO2 concentration) using relevant sensors. It uses the data acquired from these sensors to monitor the interior environment in real time to detect the state of the driver and to help prevent accidents. The development of an ADAS standard and products satisfying the safety needs of customers is necessary for the advancement of technologies preventing driver drowsiness. Furthermore, data regarding the psychophysiological changes of drivers that affect long-term driving can be used to draft policies for road accident prevention, after the commercialization of this technology. The various behavioral factors influencing driving identified by the proposed system can be used to devise specific services and human-computer interface principles to enhance future autonomous vehicles. These developments will help OEMs prioritize marketing decisions for selecting key services and ADAS functionality.
We developed a DSD system based on a deep neural network and IoT-enabled in-vehicle AQS to prevent or minimize the risk of accidents related to driver drowsiness or sleep deprivation. We also analyzed the development trends of technology for facilitating DSD in the context of ADASs. The application of driver drowsiness prevention devices in various fields was studied. It was found that their adoption is limited by issues such as high cost and low detection accuracy. We manufactured a low-cost sensor with basic specifications, integrated it with a deep learning model, and proved its greater effectiveness in detecting abnormalities in the interior environment of a vehicle, as compared to existing methods.

Managerial Implications
Korea is enacting and implementing "Environmental Air Quality Management Standards for Newly Made Vehicles," which has the objective of minimizing the damage caused to drivers and passengers due to harmful compounds generated by the interior materials of new cars. Related organizations and automobile companies are undertaking significant measures to optimize the selection of materials used for the interior parts of automobiles and to analyze harmful compounds.

Conclusions
Currently, high-performance ADAS products are being developed and commercialized. This has led to a significant reduction in their prices, and the detection accuracy is constantly being improved. In line with this development, the proposed DSD system is a low-cost, basic product that can easily be installed in vehicles. To prevent fatigue-related accidents, the system informs the driver and passengers of the CO 2 levels, monitors the CO and CO 2 concentrations, and predicts the drowsiness state of the driver.
The DSD system measures and monitors in-vehicle air quality (through factors such as CO 2 concentration) using relevant sensors. It uses the data acquired from these sensors to monitor the interior environment in real time to detect the state of the driver and to help prevent accidents. The development of an ADAS standard and products satisfying the safety needs of customers is necessary for the advancement of technologies preventing driver drowsiness. Furthermore, data regarding the psychophysiological changes of drivers that affect long-term driving can be used to draft policies for road accident prevention, after the commercialization of this technology. The various behavioral factors influencing driving identified by the proposed system can be used to devise specific services and human-computer interface principles to enhance future autonomous vehicles. These developments will help OEMs prioritize marketing decisions for selecting key services and ADAS functionality.
We developed a DSD system based on a deep neural network and IoT-enabled in-vehicle AQS to prevent or minimize the risk of accidents related to driver drowsiness or sleep deprivation. We also analyzed the development trends of technology for facilitating DSD in the context of ADASs. The application of driver drowsiness prevention devices in various fields was studied. It was found that their adoption is limited by issues such as high cost and low detection accuracy. We manufactured a low-cost sensor with basic specifications, integrated it with a deep learning model, and proved its greater effectiveness in detecting abnormalities in the interior environment of a vehicle, as compared to existing methods.

Managerial Implications
Korea is enacting and implementing "Environmental Air Quality Management Standards for Newly Made Vehicles," which has the objective of minimizing the damage caused to drivers and passengers due to harmful compounds generated by the interior materials of new cars. Related organizations and automobile companies are undertaking significant measures to optimize the selection of materials used for the interior parts of automobiles and to analyze harmful compounds.
For example, AQSs improve the performance of existing air conditioning filters and involve the application of a new type of air purifier. They use new electronic sensors to detect harmful gases, especially NOx and CO, as well as PM, and provide an effective means of eliminating odors and reducing the influx of PM in vehicles through air cleaning functions when driving in polluted regions, such as urban areas or tunnels where traffic is abundant.
Eco-friendliness factors, such as the air quality inside vehicles, are recognized as important purchase conditions for consumers because of the increased amount of time spent by drivers and passengers inside vehicles and their interest in health.

Practical and Social Implications
To prevent driver drowsiness, the proposed system predicts physical conditions such as driver fatigue and inattention and provides appropriate voice alerts on the smartphone of the driver. If slight drowsiness is detected, simple actions such as activating the air conditioner are automatically performed. As the drowsiness of the driver increases, the system actively prompts the driver to perform functions for safe driving.
Depending on the level of drowsiness, the driver will perform the appropriate course of action, such as using a smartphone GPS to locate a place, lowering the windows of the vehicle for ventilation, using a nearby resting area, or calling a family member. When the driver responds appropriately and returns to a stable condition, the service will terminate. Thus, it helps prevent accidents and save lives.
The proposed service concept will be applied to the smartphone navigation T map in the future. T map is the primary navigation service brand used in Korea. Predicting the CO 2 concentration and fatigue level at the appropriate time for drivers using T map enables the system to recommend that the driver take a break at a highway rest area through voice guidance or to rest at a drowsy driving shelter.
In addition to performing active safety functions, the proposed system utilizes services connected to management systems for in-vehicle air quality management and road rest areas corresponding to the driving route and time.
The prototype does not consider excess alerts. In the future, we plan to develop a location-based service by utilizing the abnormal and normal detection functions of the system. We will employ human-computer interaction technology to prevent abnormal alarms that may distract drivers. Moreover, when the fatigue of a driver reaches a certain threshold, the system turns on a warning indicator for mandatory rest and warns the driver about the possibility of an accident.
DSD systems are offered as premium options in some luxury cars; hence, they are not accessible to everyone. Our product can improve the performance of AQSs using deep learning, and it is also affordable. In the future, this system will be expanded to develop a comprehensive driver safety system that combines emergency warnings and actions, as well as drowsiness, head pose, and gaze tracking.

Limitations
Present studies on driver drowsiness prevention are conducted in controlled environments to produce the best results under ideal conditions. Consequently, they are not reliable for all practical situations. To compensate for this limitation, we tested the proposed DSD system using actual vehicles rather than simulators. However, various factors that affect in-vehicle air quality while driving were not considered in this study. The driving environment changes in real time and is affected by the weather, which requires special consideration. Moreover, driving datasets are still insufficient for verifying model fitness, especially in metropolitan areas. In future works, model accuracy should be further investigated, and the sensor data accumulated from various driving situations should be considered. In addition, the generalization of anomaly detection performance should be verified. The anomaly detection model should be further upgraded for the five types of sensors by combining it with other data. It is necessary to gauge air quality using multiple models to account for the complexity of variables for describing the interior of a vehicle. Existing models should be advanced and optimized by considering the factors that affect air quality data, such as driving history. For this purpose, it is necessary to refine machine learning models for optimal anomaly detection according to the updated specifications of the sensors, through further investigation. Several practical situations can be identified and predicted by considering more diverse data, such as vehicle mileage and driving time, using AI-based analysis and by relating this information to the vehicle driving environment.