An eye-closure monitoring mobile application for preventing drowsy driving accidents,
built with Flutter + Firebase and powered by a lightweight YOLOv5n model.
🏆 Award: 1st Place, Google Korea ML Bootcamp (2024, Cohort 3)
Selected as the top project among final demo teams, based on technical depth, completeness, and impact
Hosted by Google Korea and NIPA, the bootcamp focused on building deployable AI systems for real-world applications.
Drowsy driving is the leading cause of fatal highway accidents in South Korea,
with a death rate nearly twice as high as drunk driving (2.9 vs. 1.5 per 100 incidents).
Despite its danger, only 17% of surveyed drivers recognized it as a top-3 risk factor.
Sources:
- Korea Road Traffic Authority Press Release (2016–2020), Road Safety Division
- National Police Agency Traffic Statistics (2019–2023)
- Korea Transportation Safety Authority: 2023 Traffic Safety Perception Survey
- AAA Foundation (2023): Driver self-assessment simulation
| 🔹 40% of drivers have experienced drowsiness at the wheel |
|---|
| 🔹 Only 17% of respondents consider it a top-3 risk factor |
| 🔹 Existing systems are costly, embedded, or lack accessibility |
WakeUp is a lightweight and free mobile solution to detect eye closures, issue warnings, and log drowsy behavior patterns.
|
|
| Layer | Stack |
|---|---|
| Framework | Flutter SDK 3.24.1 / Dart SDK 3.5.1 |
| Frontend | Flutter Widgets, Camera (0.11.0+2) |
| Backend | Firebase (Auth, Cloud Firestore, Cloud Functions) |
| ML Inference | YOLOv5n (PyTorch → TFLite), flutter_vision (1.1.4) |
| Location Services | geolocator (10.1.1), geoflutterfire2 (2.3.15) |
| Storage & Security | Cloud Firestore, flutter_secure_storage (9.2.2) |
| Additional Features | audioplayers (6.1.0), google_generative_ai (0.4.6) |
| DevOps | GCP (limited due to account expiration) |
We initially experimented with EfficientDet-lite and OpenCV-based CNN pipelines but discarded them due to memory overhead and lack of TFLite compatibility on mobile. After several iterations, YOLOv5n proved to be the best balance between speed and accuracy for our real-time use case.
Over 140k eye images were filtered, cleaned, and augmented to curate a ~9,200 image dataset.
Initially, the model output confidence hovered around 40% due to noise in the eye images.
After comprehensive dataset cleaning and augmentation, all final models achieved over 96% precision and recall, with F1 scores exceeding 0.95, indicating highly reliable detection performance.
Early training with raw, unprocessed data (YOLOv8s v0.1 and v0.2) yielded superficially strong metrics — high confidence scores and clean-looking PR/confusion matrices. However, real-world test accuracy was unreliable and unstable, clearly indicating overfitting and poor generalization. (All data was found in public and open source)
To address this, we implemented a three-phase preprocessing pipeline:
-
Phase 1: Removed low-quality or misleading samples
-
Cropped-eye-only images
-
Half-open eyes, blurry or low-resolution images
-
Overexposed or light-reflecting cases
-
-
Phase 2: Filtered for label clarity and spatial consistency
-
Manually reviewed for background interference, eye occlusion
-
Removed photos with multiple faces or corrupted labeling
-
-
Phase 3: Augmented for diversity and robustness
-
Applied brightness adjustment and horizontal flipping
-
Final dataset curated to ~9,200 clean and balanced samples
-
| Version | Precision | Recall | F1 Score | mAP@50 | mAP@50–95 | Notes |
|---|---|---|---|---|---|---|
| YOLOv8s_v0.1 | ~0.87 | ~0.89 | ~0.88 | ~0.91 | ~0.455 | ❌ Duplicates, unfiltered data |
| YOLOv8s_v0.2 | ~0.90 | ~0.90 | ~0.90 | ~0.80 | ~0.40 | ❌ Poor background filtering |
After this pipeline was applied, models trained on the new data — YOLOv8n, YOLOv5s, and YOLOv5n — showed:
- Consistently higher real-world reliability
- Stable learning curves with minimal overfitting
- An average +6.8% mAP@50–95 improvement
- Better performance even with smaller architectures
✳️ Key Insight: Preprocessing quality directly influenced real-world robustness. A smaller model with clean data (e.g., YOLOv5n) outperformed a larger model trained on noisy data (e.g., YOLOv8s).
| Model | Precision | Recall | F1 Score | mAP@50 | mAP@50–95 |
|---|---|---|---|---|---|
| YOLOv5n | 0.9676 | 0.9619 | 0.9647 | 0.9631 | 0.4822 |
| YOLOv5s | 0.9710 | 0.9651 | 0.9680 | 0.9632 | 0.4978 |
| YOLOv8n | 0.9672 | 0.9461 | 0.9565 | 0.9629 | 0.5126 |
Despite YOLOv8n's excellent validation score, its real-world test accuracy was ~60%, indicating overfitting or lack of robustness.
YOLOv5n and YOLOv5s consistently delivered >99% accurate predictions in real-time conditions.
✅ YOLOv5n was selected due to its compact size, fast inference, and high accuracy — ideal for mobile deployment.
- Precision: Correctness of predicted positive class (eye-closed).
- Recall: Coverage of actual positives identified.
- F1 Score: Harmonic mean of precision and recall.
- mAP@50: Detection accuracy at 0.5 IoU.
- mAP@50–95: Stricter range (0.5–0.95 IoU), indicates generalization.
| YOLOv5n | YOLOv5s | YOLOv8n | YOLOv8s_v0.1 | YOLOv8s_v0.2 |
|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
| YOLOv5n | YOLOv5s | YOLOv8n | YOLOv8s_v0.1 | YOLOv8s_v0.2 |
|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
| YOLOv5n | YOLOv5s | YOLOv8n | YOLOv8s_v0.1 | YOLOv8s_v0.2 |
|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
| YOLOv5n | YOLOv5s | YOLOv8n | YOLOv8s_v0.1 | YOLOv8s_v0.2 |
|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
graph TD
%% Core Inputs
A[Camera Module<br>flutter_camera] -->|Video Frame| B[YOLOv5n Model<br>flutter_vision]
C[Geolocation Service<br>geolocator] -->|Location Data| D[Risk Assessment<br>geoflutterfire2]
%% Core Processing
B -->|Eye State Detection| E{Eye Closed ≥ 1.2s?}
%% Event Flows
E -->|Yes| F[Alert System<br>audioplayers]
F -->|Audio & Visual| G[User Interface<br>Flutter Widgets]
E -->|No| H[Normal Monitoring]
%% Data Storage
E -->|All Events| I[Event Logger]
I --> J[(Firebase<br>Cloud Firestore)]
J -->|Risk Zone Data| D
%% Risk Analysis
D -->|High Risk Area| F
%% User Configuration
K[User Settings<br>flutter_secure_storage] --> G
%% Gemini Integration
J -->|User Data History| L[Gemini API<br>google_generative_ai]
L -->|Personalized Advice| G
%% External API Update
M[Traffic Accident Public Data API] -->|Update Risk Zones| J
J -->|Fetches Risk Zones| D
%% User Authentication
N[User Authentication<br>Firebase Auth] --> G
N --> J
classDef flutter fill:#54C5F8,stroke:#333,stroke-width:2px,color:white;
classDef ml fill:#f9f,stroke:#333,stroke-width:2px;
classDef firebase fill:#FFCA28,stroke:#333,stroke-width:2px;
classDef geo fill:#4CAF50,stroke:#333,stroke-width:1px,color:white;
classDef ui fill:#bbf,stroke:#333,stroke-width:1px;
classDef ai fill:#34A853,stroke:#333,stroke-width:1px,color:white;
classDef api fill:#FF5722,stroke:#333,stroke-width:1px,color:white;
class A,G,K flutter;
class B,E ml;
class J,N firebase;
class C,D geo;
class F,H,I ui;
class L ai;
class M api;
| Home Screen | Screen Components |
|
|
| Log Window | Alert Triggered (after 1.2s of closing) |
|
Alert.Triggered.mp4 |
little bug:
sshould bemsat the report of 'eye closed time'
| Known Issues | Future Improvements |
|---|---|
|
|
|
Jaeman Lee (Team Lead, ML + System Integration, Fullstack Development, Data Preprocessing, Model Training) Juho Son (Data Preprocessing, Model Training, Resource Research) Bonghyeon Baek (Data Preprocessing, Model evaluation, Resource Research) |

























