An AI-powered application designed to detect driver drowsiness in real-time, enhancing road safety by alerting drivers to potential fatigue.
StayAwake-AI/
├── .devcontainer/ # Development container configuration
├── diagrams/ # Project diagrams and visualizations
├── docs/ # Documentation files
│ ├── efficientnet_architecture_comparison.md
│ └── relevant data sets and resources.md
├── models_inattention/ # Model results and performance metrics
│ ├── B0/ # EfficientNet-B0 results
│ ├── B1/ # EfficientNet-B1 results
│ ├── B2/ # EfficientNet-B2 results
│ ├── B4/ # EfficientNet-B4 results
│ └── ImageNet_Pretrained_B4/ # Pre-trained B4 results
├── notebooks/ # Jupyter notebooks
│ ├── driver-drowsiness-detection-case-study.ipynb
│ └── README.md
├── only_cm/ # Confusion matrices and evaluation plots
├── only_models/ # Trained model weights (.keras files)
├── scripts/ # Utility scripts
│ ├── fetch_learning_rates.py
│ └── models_diagrams.py
├── model_card.md # Comprehensive model documentation
├── run notebook.md # Instructions for running notebooks
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Visit the live notebook: Driver Drowsiness Detection on Kaggle
- View the results: See all outputs, visualizations, and model performance
- Run immediately: Click "Copy and Edit" to create your own editable version
For the best experience with pre-configured environment and access to all datasets and models:
- Visit the Kaggle Notebook: Access the complete notebook with all resources
- Click "Copy and Edit": Create your own version of the notebook
- Enable GPU (recommended): Go to Settings → Accelerator → GPU
- Run All Cells: Execute the entire notebook with one click
What's included on Kaggle:
- ✅ Complete driver inattention dataset
- ✅ Pre-trained EfficientNet models (B0, B1, B4)
- ✅ All required Python libraries
- ✅ Sample images for testing
- ✅ Visualization and evaluation code
- Python 3.8+
- GPU with CUDA support (recommended)
- Git
- Clone the repository:
git clone https://github.com/veyselserifoglu/StayAwake-AI.git
cd StayAwake-AI
- Install dependencies:
pip install -r requirements.txt
-
Download required resources:
-
Adjust file paths in the notebook to match your local directory structure
-
Run the notebook:
jupyter notebook notebooks/driver-drowsiness-detection-case-study.ipynb
Note: Local execution requires significant setup and may encounter path/dependency issues. Kaggle is strongly recommended for the best experience.
You can choose between two development environments:
- Docker
- VS Code
- VS Code Remote - Containers extension
- Clone the repository:
git clone https://github.com/veyselserifoglu/StayAwake-AI.git
cd StayAwake-AI
- Open the project in VS Code:
code .
-
When prompted, click "Reopen in Container" to start the development environment.
-
The container will automatically:
- Install all required dependencies
- Set up the Python environment
- Configure VS Code with recommended extensions
- Follow the local development setup instructions above
- Use your preferred IDE or text editor
- Install Jupyter for notebook development:
pip install jupyter
jupyter notebook
This project implements driver inattention detection using EfficientNet architectures:
- EfficientNet-B0: Lightweight model with 84.2% validation accuracy
- EfficientNet-B1: Balanced model with 86.1% validation accuracy
- EfficientNet-B4: High-performance model with 88.7% validation accuracy
- EfficientNet-B4 (ImageNet Pretrained): Best performing model with 91.3% validation accuracy
For detailed model information, see model_card.md
.
notebooks/
: Contains the main Jupyter notebook with complete implementationmodel_card.md
: Comprehensive documentation of all models and their performancerun notebook.md
: Quick start guide for running the notebookmodels_inattention/
: Performance metrics and results for each model variantonly_models/
: Pre-trained model weights in Keras formatonly_cm/
: Confusion matrices and evaluation visualizationsscripts/
: Utility scripts for model analysis and visualization
-
Create a new branch for your feature:
git checkout -b feature/your-feature-name
- Branch naming convention:
feature/
for new features,fix/
for bug fixes - Each branch should focus on a single feature or fix
- Branches should not live longer than one week
- If work takes longer than a week, create a new branch and reference the previous work
- Branch naming convention:
-
Make your changes and commit them:
git add . git commit -m "feat: description of your changes"
-
Push your branch and submit a pull request:
git push origin feature/your-feature-name
- Create a pull request from your branch to
main
- Include a clear description of your changes
- Reference any related issues
- Create a pull request from your branch to
-
After your pull request is merged:
- Delete your feature branch
- Update your local
main
branch
git checkout main git pull origin main
This project is licensed under the MIT License - see the LICENSE file for details.