{"id":27553723,"url":"https://github.com/divitmittal/driver-drowsiness-detection","last_synced_at":"2026-07-12T23:31:56.131Z","repository":{"id":265953339,"uuid":"896909866","full_name":"DivitMittal/Driver-Drowsiness-Detection","owner":"DivitMittal","description":"Real-time drowsiness detection on driver's face continuously for signs of fatigue using deep learning methodologies","archived":false,"fork":false,"pushed_at":"2025-12-22T18:02:54.000Z","size":2660,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-24T06:45:49.231Z","etag":null,"topics":["computer-vision","deep-learning","drowsiness-detection","siamese-neural-network"],"latest_commit_sha":null,"homepage":"https://deepwiki.com/DivitMittal/Driver-Drowsiness-Detection","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivitMittal.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-01T15:53:23.000Z","updated_at":"2025-12-22T18:02:57.000Z","dependencies_parsed_at":"2025-03-30T21:19:51.140Z","dependency_job_id":"ad47fe0e-1e1b-4db3-a717-f439d558febf","html_url":"https://github.com/DivitMittal/Driver-Drowsiness-Detection","commit_stats":null,"previous_names":["divitmittal/driver-drowsiness-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DivitMittal/Driver-Drowsiness-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2FDriver-Drowsiness-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2FDriver-Drowsiness-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2FDriver-Drowsiness-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2FDriver-Drowsiness-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivitMittal","download_url":"https://codeload.github.com/DivitMittal/Driver-Drowsiness-Detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2FDriver-Drowsiness-Detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35405750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","drowsiness-detection","siamese-neural-network"],"created_at":"2025-04-19T12:53:21.330Z","updated_at":"2026-07-12T23:31:56.125Z","avatar_url":"https://github.com/DivitMittal.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Driver Drowsiness Detection System\n:toc: left\n:toclevels: 3\n:sectlinks:\n:icons: font\n:source-highlighter: rouge\n:imagesdir: assets\n\nlink:https://github.com/DivitMittal/Driver-Drowsiness-Detection/actions/workflows/flake-check.yml[image:https://github.com/DivitMittal/Driver-Drowsiness-Detection/actions/workflows/flake-check.yml/badge.svg[Flake Check]]\nlink:https://github.com/DivitMittal/Driver-Drowsiness-Detection/actions/workflows/flake-lock-update.yml[image:https://github.com/DivitMittal/Driver-Drowsiness-Detection/actions/workflows/flake-lock-update.yml/badge.svg[Flake Lock Update]]\n\n== Overview\n\nDriver fatigue represents a significant risk factor in vehicular accidents globally. This project implements a real-time **Driver Drowsiness Detection** system designed to mitigate this risk by leveraging advanced computer vision techniques and deep learning, specifically employing **Siamese Neural Networks**. The system performs continuous monitoring of the driver's facial region via a standard camera feed, analyzing key physiological indicators associated with drowsiness to provide timely alerts.\n\n== Core Functionality and Features\n\nThe system integrates several detection modules based on facial feature analysis:\n\n*   **Real-Time Facial Monitoring:** Continuously captures and processes video frames from a camera pointed at the driver.\n*   **Eye State Analysis (EAR):** Calculates the Eye Aspect Ratio (EAR), a metric derived from facial landmarks representing the ratio of eye height to width. Prolonged periods of low EAR (indicating closed eyes) are a primary indicator of microsleep or drowsiness.\n+\nimage::eye.jpg[Sample Eye Detection, width=300]\n\n*   **Head Pose Estimation:** Monitors the orientation and movement of the driver's head. Significant deviations, such as head nodding (pitch changes) or slumping (roll/yaw changes), are correlated with reduced alertness. (Note: Specific implementation details may vary).\n*   **Mouth State Analysis (Yawning Detection):** Analyzes the mouth region to detect yawning events based on characteristic shape changes and duration. Yawning is a well-established physiological response to fatigue.\n+\nimage::yawn.jpg[Sample Yawn Detection, width=300]\n\n*   **Siamese Neural Network Integration:** The core innovation lies in utilizing a Siamese Neural Network architecture. Unlike traditional classifiers that operate on single inputs, Siamese networks learn a similarity metric by comparing pairs of inputs (e.g., a current frame vs. a baseline 'alert' frame, an open eye vs. a closed eye). This architecture excels at detecting subtle state changes indicative of increasing drowsiness across the monitored features (eyes, head, mouth).\n\n== System Architecture and Data Flow\n\n=== Data Processing Pipeline\n\nEffective training of the Siamese network necessitates a structured data preprocessing pipeline. This pipeline transforms raw image data into appropriately formatted pairs (anchor, positive, negative) for similarity learning.\n\n.Data Processing Pipeline Diagram\nimage::data-pipeline.png[Data Pipeline Diagram, align=center]\n\n=== Siamese Model Architecture\n\nThe Siamese network employs two identical sub-networks (sharing weights) to process input image pairs. The outputs (embeddings) are then compared using a distance metric to determine similarity.\n\n.Siamese Model Architecture Diagram\nimage::model-architecture.png[Siamese Model Architecture Diagram, align=center]\n\n== Core Technologies Utilized\n\nThe implementation relies on a standard stack for computer vision and deep learning tasks:\n\n*   **Python:** Version 3.8 or higher recommended. The primary programming language.\n*   **TensorFlow \u0026 Keras:** Foundational deep learning frameworks (e.g., TF 2.17.0, Keras 3.6.0 used in development) for constructing, training, and deploying the Siamese Neural Network.\n*   **OpenCV (Open Source Computer Vision Library):** Essential for real-time image acquisition (camera interface), preprocessing, and potentially basic feature extraction tasks.\n*   **Dlib:** A powerful C++ library with Python bindings, often employed for high-performance facial landmark detection, crucial for isolating eye, mouth, and head regions.\n*   **Imutils:** A collection of convenience functions built on top of OpenCV, simplifying common image processing operations like resizing, rotation, and skeletonization.\n*   **Numpy:** The fundamental package for numerical computation in Python, indispensable for array manipulations inherent in image data and deep learning tensors.\n*   **Matplotlib:** Standard Python library for generating static, animated, and interactive visualizations, useful for displaying sample data or training progress.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivitmittal%2Fdriver-drowsiness-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivitmittal%2Fdriver-drowsiness-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivitmittal%2Fdriver-drowsiness-detection/lists"}