White Paper
Edge-AI-Based Driver Monitoring System for Automotive Prototyping
Real-time edge AI for intelligent driver safety monitoring in automotive prototyping
Executive Summary
Driver safety and in-vehicle intelligence are becoming increasingly important as vehicles incorporate more connected and software-driven features. At NKORR, we developed a prototype in-vehicle platform that brings together vehicle data, media functions, and AI-based driver monitoring within a Raspberry Pi-based architecture.
Our prototype uses a Raspberry Pi Head Unit that integrates the OBD Service, AI Service, and Media Service, with dedicated HMIs for the cluster and head unit. The OBD Service receives and processes vehicle information such as speed, RPM, and fuel data. The Media Service manages in-vehicle media functionality, while the AI Service provides Driver Monitoring System (DMS) capabilities.
For DMS, we use an in-vehicle camera with facial landmark and Eye Aspect Ratio (EAR) analysis for drowsiness detection. A lightweight YOLO model accelerated by the Google Coral Edge TPU enables fast detection of seatbelt compliance and mobile-phone usage. The AI results are communicated through a TCP Server to the Head Unit, where they can be presented through the HMI.
This prototype demonstrates NKORR’s approach to building a modular, edge-based in-vehicle platform that combines vehicle information, media, and intelligent driver-safety features.
Problem in Context
Road safety remains a major global challenge. The World Health Organization estimates that approximately 1.19 million people die every year in road traffic crashes, with road traffic injuries remaining the leading cause of death among people aged 5–29 [1].
India faces a significant share of this burden. According to the Ministry of Road Transport and Highways, India recorded 4,80,583 road accidents in 2023, resulting in 1,72,890 deaths and 4,62,825 injuries [2]. These figures highlight the need for technologies that can help identify unsafe driving conditions before they develop into critical situations.
Modern vehicles require multiple digital services to operate together, including vehicle data, media, human-machine interfaces, and intelligent safety functions. At NKORR, we identified the need for a modular embedded architecture that can bring these capabilities together while allowing each function to operate as an independent service.
Technical Deep Dive
3.1 System Architecture
The proposed automotive prototyping system adopts a distributed edge-computing architecture built around two Raspberry Pi based processing units, a Raspberry Pi Head Unit and a dedicated Raspberry Pi AI Unit. The architecture separates vehicle data acquisition, human–machine interaction, media processing, and AI inference into modular services.
The system interfaces with the vehicle through the On-Board Diagnostics (OBD) interface and uses an in-vehicle camera connected to the AI Unit for real-time driver monitoring. AI information is subsequently made available to the Head Unit through TCP-based communication.
3.1.1 Raspberry Pi Head Unit
The Raspberry Pi Head Unit acts as the primary application and user-interaction platform. It hosts the Cluster HMI and Head Unit HMI, together with the services responsible for vehicle-data processing, AI communication, and media functionality.
The Cluster HMI is intended to present vehicle-related information and driver-safety information to the driver. The Head Unit HMI provides the interface for infotainment and other application-level functions. The vehicle communicates with the Head Unit through an OBD adapter. The OBD functionality is encapsulated within the OBD Service, which consists of an OBD Reader and an OBD Parser. The OBD Reader is responsible for receiving raw responses from the OBD adapter. The OBD Parser processes these responses and converts them into structured application-level information that can be consumed by the HMI and other services.
This separation provides an abstraction between the vehicle communication layer and the application layer. Consequently, changes to the OBD communication mechanism or supported vehicle parameters can be implemented without requiring significant modifications to the HMI. The Head Unit also contains an AI Service, which acts as the application-side interface for driver-monitoring information received from the AI Unit. The AI Service processes the received safety states and makes them available to the appropriate HMI components.
A separate Media Service is responsible for media and infotainment-related functionality, allowing multimedia processing to remain independent of vehicle-data acquisition and AI inference.
3.1.2 Raspberry Pi AI Unit
The Raspberry Pi AI Unit is dedicated to real-time driver monitoring and edge AI processing. It receives video from an in-vehicle camera and performs the required computer-vision operations locally.
The AI Unit consists of the following primary components:
- Video Frame Reader
- YOLO Edge AI Model
- Drowsiness Detector
- Google Coral Edge TPU
- TCP Server
The Video Frame Reader continuously acquires frames from the driver facing camera and provides the frames to the appropriate processing pipeline. The driver-monitoring functionality is divided into two complementary processing approaches. Facial landmark analysis is used for drowsiness detection, while the YOLO-based object detection model is used for seatbelt and mobile-phone detection. The YOLO inference pipeline is accelerated using the Google Coral Edge TPU. This allows supported neural-network operations to be executed on a dedicated edge accelerator rather than relying exclusively on the Raspberry Pi CPU.
3.1.3 Driver Monitoring Pipeline
The driver monitoring system consists of two independent processing pipelines. The first pipeline focuses on drowsiness detection using facial landmarks and eye analysis to monitor the driver's eye closure. The second pipeline uses a YOLO-based object detection model to identify seatbelt usage and mobile-phone usage.
3.1.4 Edge Processing and Hardware Acceleration
A key design consideration of the proposed system is that driver-monitoring inference is performed at the edge. The Google Coral Edge TPU provides hardware acceleration for the supported YOLO model, reducing the reliance on CPU-only inference and allowing the Raspberry Pi to perform other system-level tasks concurrently.
The edge-based architecture provides several benefits for the automotive prototype, including
- Reduced CPU load for supported AI operations
- Faster availability of driver-monitoring results
- Improved suitability for embedded deployment
3.2 Drowsiness Detection
For drowsiness detection, we use facial landmark analysis to monitor the driver's eyes. The system first identifies the driver's face and extracts facial landmarks. From these landmarks, we isolate the coordinates corresponding to the left and right eyes.
We then calculate the Eye Aspect Ratio (EAR) to estimate the degree of eye opening. When the driver's eyes remain closed for a sustained period, the system interprets the change in EAR as an indication of potential drowsiness.
To make the detection more reliable, we do not rely on a single frame to determine the driver's state. Instead, we maintain a continuously updated detection score. Consecutive observations of closed eyes increase the score, while observations of open eyes reduce it. This helps prevent short eye closures such as normal blinking from immediately generating a drowsiness warning.
This approach provides a lightweight method for drowsiness monitoring that can run directly on the Raspberry Pi without requiring a large deep-learning model for eye-state classification.
3.3 Seatbelt and Mobile-Phone Detection
For seatbelt and mobile-phone detection, the system uses a YOLO object detection model accelerated by the Google Coral Edge TPU. The model processes camera frames and identifies objects relevant to driver safety.
The use of hardware acceleration is an important part of the architecture because driver-monitoring applications require detection results with minimal processing delay. Instead of relying entirely on the Raspberry Pi CPU to perform neural-network inference, supported model operations are offloaded to the Google Coral Edge TPU.
The YOLO model is deployed in an Edge TPU-compatible format, allowing the supported inference operations to execute on the accelerator. The camera frames supplied by the Video Frame Reader are passed through the detection pipeline, and the model predicts the classes of detected objects. The detection results are subsequently interpreted by the application logic to determine the corresponding driver-safety states.
The use of the Edge TPU allows the AI processing workload to be separated from the general-purpose processing performed by the Raspberry Pi CPU. This is particularly useful when camera acquisition, communication, system services, and other application components are executing concurrently. The generated safety states are then passed to the communication layer for delivery to the application.
3.4 Raspberry Pi to Android Communication
We use a TCP socket connection to communicate between the Raspberry Pi and the Android application. The Raspberry Pi operates as the socket server, while the Android application connects as the client.
The system represents the current driver-monitoring state as a JSON message containing the relevant safety conditions. These include the drowsiness state, seatbelt state, and mobile-phone state.
Rather than continuously transmitting the same information, the system compares the current state with the previously transmitted state. A new message is sent when a state change occurs. This reduces unnecessary communication and allows the Android application to respond to meaningful safety events.
The Android application receives these messages and presents the corresponding driver warnings and system information through its user interface. This separation allows the Raspberry Pi to focus on real-time sensing and AI inference while the Android application provides the driver-facing interface.
NKORR’s Approach
At NKORR, we approach driver monitoring as a real-time safety problem, where fast and reliable response is as important as detection accuracy. Our edge-first architecture processes driver data locally to minimize latency and reduce dependency on external systems.
Our approach prioritizes low latency, efficient edge inference, practical embedded deployment, and clear driver feedback, providing a flexible foundation that can evolve with future driver-monitoring requirements.
Recommendations
- Use dedicated AI acceleration when deploying computer-vision models on embedded hardware to improve inference performance while keeping the system computationally efficient.
- Design the platform as modular services so vehicle data, media, AI, and other functions can be developed and updated independently.
- Integrate AI results with the existing HMI so safety-related information can be presented clearly without requiring a separate user interface.
- Validate the system under real-world conditions including different lighting conditions, driver positions, camera placements, and vehicle environments before considering production deployment.
Authors & Contributors
References
| # | Source | Notes |
|---|---|---|
| 1 | https://www.who.int/en/news-room/fact-sheets/detail/road-traffic-injuries | World Health Organization, Road traffic injuries |
| 2 | https://morth.nic.in/sites/default/files/Road-Accident-in-India-2023-Publications.pdf | Ministry of Road Transport and Highways, Government of India, Road Accidents in India 2023 |