Computer vision system that detects whether workers are wearing safety helmets in construction or industrial environments.
The model helps automate workplace safety monitoring and reduce manual inspection effort.
Ensuring helmet compliance on construction sites is critical to prevent serious injuries.
Manual monitoring is inefficient, inconsistent, and difficult to scale across large industrial environments.
An automated image-based system can monitor helmet usage and alert supervisors when violations occur.
This project builds a deep learning image classification model to detect whether a worker is wearing a helmet.
The system trains multiple models and compares performance:
- Simple CNN model
- VGG16 transfer learning model
- VGG16 + Feed Forward Neural Network
- VGG16 + Data Augmentation
The final selected model uses transfer learning with VGG16 and data augmentation to improve generalization.
- Total Images: 631
- With Helmet: 311
- Without Helmet: 320
- Original Image Size: 200 × 200
- Training Size Used: 64 × 64
Images include variations in:
- Lighting conditions
- Worker posture
- Viewing angles
- Industrial environments
Image Dataset
│
▼
Preprocessing
(RGB conversion, resize, normalization)
│
▼
Train / Validation / Test Split
│
▼
Model Training
(CNN + Transfer Learning)
│
▼
Evaluation
(Accuracy, Precision, Recall, F1)
│
▼
Final Model Selection
| Model | Validation Accuracy |
|---|---|
| CNN (Grayscale) | ~83% |
| VGG16 Base | ~89% |
| VGG16 + FFNN | ~98.9% |
| VGG16 + FFNN + Data Augmentation | ~97–98% |
Final model selected: VGG16 + FFNN + Data Augmentation
Reasons:
- Better generalization
- Reduced overfitting risk
- More robust to real-world variations
- Python
- TensorFlow / Keras
- OpenCV
- NumPy
- Pandas
- Scikit-Learn
- Matplotlib
- Seaborn
helmet_detection
│
├── helmet_detection.py # Main training script
│
├── data/ # Dataset (not included in repo)
│ ├── images_proj.npy
│ └── Labels_proj.csv
│
├── requirements.txt
│
└── README.mdClone the repository:
git clone https://github.com/your-username/helmet_detection.git
cd helmet_detectionInstall dependencies
pip install -r requirements.txtPlace the dataset files inside:
data/
├── images_proj.npy
└── Labels_proj.csvpython helmet_detection.pyThe script will:
- Load dataset
- Preprocess images
- Train CNN and VGG16 models
- Evaluate performance
- Select the final model
- Train on larger industrial datasets
- Use higher resolution images (128 or 224)
- Deploy real-time inference with CCTV feeds
- Implement helmet detection using object detection models (YOLO)
- Build safety alert dashboard for supervisors