{"id":27776345,"url":"https://github.com/devyansh22156/alertdrive-android-application","last_synced_at":"2026-02-26T01:39:22.951Z","repository":{"id":290448203,"uuid":"974487785","full_name":"devyansh22156/AlertDrive-Android-Application","owner":"devyansh22156","description":"AlertDrive is a real-time Android application that monitors driver fatigue using live camera feeds, employing a lightweight EfficientNet‑B0 + GRU deep learning model served via a Flask backend to deliver rapid and accurate drowsiness alerts.","archived":false,"fork":false,"pushed_at":"2025-04-28T21:38:04.000Z","size":542,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T05:04:39.474Z","etag":null,"topics":["android-application","computer-vision","deep-learning","flask","kotlin-android","python"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devyansh22156.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-28T21:21:34.000Z","updated_at":"2025-04-29T02:53:50.000Z","dependencies_parsed_at":"2025-04-28T22:46:52.265Z","dependency_job_id":"bdecff43-c088-4b34-a137-479841437c8b","html_url":"https://github.com/devyansh22156/AlertDrive-Android-Application","commit_stats":null,"previous_names":["devyansh22156/alertdrive-android-application"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devyansh22156%2FAlertDrive-Android-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devyansh22156%2FAlertDrive-Android-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devyansh22156%2FAlertDrive-Android-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devyansh22156%2FAlertDrive-Android-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devyansh22156","download_url":"https://codeload.github.com/devyansh22156/AlertDrive-Android-Application/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644841,"owners_count":21620632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["android-application","computer-vision","deep-learning","flask","kotlin-android","python"],"created_at":"2025-04-30T05:04:44.268Z","updated_at":"2026-02-26T01:39:22.928Z","avatar_url":"https://github.com/devyansh22156.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚗 AlertDrive: Driver Drowsiness Detection Android App\n\n**AlertDrive** is a real-time Driver Drowsiness Detection application designed to help prevent road accidents caused by driver fatigue.  \nIt uses a deep learning model deployed via a Flask backend and an Android app built with Kotlin, Jetpack Compose, and CameraX.\n\n## 📸 Features\n\n- Real-time driver monitoring via phone camera.\n- Predicts **\"Non-Drowsy\"**, **\"Drowsy\"** and **\"No Face Detection\"** or states based on facial cues.\n- Displays prediction confidence and extracted features.\n- Alarm System, gets activated when driver feels **\"Drowsy\"**\n- Minimalistic and intuitive UI for quick usability.\n- Lightweight deep learning model combining EfficientNet and GRU for fast and accurate predictions.\n\n## 🏗️ System Architecture\n\n- **Backend (Flask Server)**:\n  - Receives camera frames from the app.\n  - Preprocesses and predicts driver state using a CNN+GRU model.\n  - Sends prediction label, confidence score, and feature vector back to app.\n  \n- **Frontend (Android App)**:\n  - Built with Kotlin and Jetpack Compose.\n  - Uses CameraX API for real-time frame capture.\n  - Automatically sends frames periodically to backend for prediction.\n  - Displays results to the driver.\n\n## 🛠️ Setup Instructions\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/devyansh22156/DriverDrowsinessDetection-Android-Application.git\ncd DriverDrowsinessDetection-Android-Application\n```\n\n### 2. Set up the Flask Backend (Server)\n\nNavigate to the `App_Server` directory:\n\n```bash\ncd App_Server\n```\n\nInstall the required Python packages:\n\n```bash\npip install -r requirements.txt\n```\n\nRun the Flask server:\n\n```bash\npython app.py\n```\n\n\u003e **Important**:  \n\u003e - Make sure your server is running on the **same network** (WiFi or Hotspot) as your Android phone.  \n\u003e - Note your **IP Address** (for example, `192.168.1.5`) — you will need it in the next step.\n\n### 3. Set up the Android App (Frontend)\n\nOpen the `app` directory in **Android Studio**.\n\n- Open `app/src/main/java/com/example/driverdrowsinessdetection/ApiClient.kt`\n- **Update the `BASE_URL`** variable with your computer's IP address and port (default Flask port is 5000):\n\n```kotlin\nprivate const val BASE_URL = \"http://\u003cyour-ip-address\u003e:5000/\"\n```\n\n**Example:**\n\n```kotlin\nprivate const val BASE_URL = \"http://192.168.1.5:5000/\"\n```\n\n### 4. Build and Run the App\n\n- Connect your Android device via USB with **developer mode** and **USB debugging** enabled.\n- Press **Run** (▶️) in Android Studio to install the app on your device.\n- Alternatively, **build an APK** and install it manually:\n  - Build → Build Bundle(s) / APK(s) → Build APK(s)\n  - Install the generated APK on your Android phone.\n\n### 5. Using AlertDrive\n\n- Open the app, login (dummy login currently), and navigate to the detection screen.\n- Press **Start Auto Detect**.\n- The app will automatically capture frames every 0.5 seconds and display predictions.\n- If the driver is detected as **drowsy**, appropriate feedback can be triggered.\n\n## 📚 Dataset Used\n\n- **NTHU Driver Drowsiness Detection Dataset (NTHUDDD2)** — 66,500 images annotated for drowsy/alert conditions, with various lighting conditions and occlusions like glasses.\n\n## 📈 Model Details\n\n- **Spatial Feature Extractor**: Pretrained EfficientNet-B0 (ImageNet weights).\n- **Fine-Tuned model weights**: https://drive.google.com/file/d/1gO5yMIWkIXpJ8abINwDpvyhF6pEXJJEz/view?usp=sharing\n- **Temporal Feature Model**: Gated Recurrent Unit (GRU) layer on extracted spatial features.\n- **Training**:\n  - Optimizer: Adam\n  - Loss: Binary Cross-Entropy\n  - Early stopping and data balancing techniques used.\n- **Achieved Accuracy**: ~99.65% on validation set.\n\n## 📱App Screenshots\nBelow are key app screens\n### Login screen\n![Login Screen](./UI_Images/login.jpg)\n\n### Dashboard screen\n![Dashboard](./UI_Images/dashboard.jpg)\n\n### Drowsy Detected\n![Drowsy Detected](./UI_Images/drowsy.jpg)\n\n### Non-Drowsy Detected\n![Non-Drowsy Detected](./UI_Images/nondrowsy.jpg)\n\n## 🚀 Future Improvements\n\n- Add interactive alert dashboard (e.g., vibrations, sounds).\n- Explore Transformer-based temporal modeling.\n- Integrate fatigue risk scoring over longer driving sessions.\n- Extend support to wearable devices (like smartwatches).\n\n## 🧑‍💻 Authors\n\n- **Anikait Agrawal (2022072)**\n- **Devyansh Chaudhary (2022156)**\n- **Dhawal Garg (2022160)**\n\n## 📄 License\n\nThis project is for academic and research purposes only.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevyansh22156%2Falertdrive-android-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevyansh22156%2Falertdrive-android-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevyansh22156%2Falertdrive-android-application/lists"}