Skip to content

shaishav06/SafeSite-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SafeSite AI: PPE Detection for Construction Site Safety using YOLOv8

SafeSite AI

4,764 workers died on the job in 2020 (3.4 per 100,000 full-time equivalent workers). Workers in transportation, material moving, and construction occupations accounted for nearly half of all fatal occupational injuries (47.4%), with 1,282 and 976 workplace deaths, respectively.

Occupational Safety and Health Administration (US Department of Labour)


🚧 Introduction

Construction sites are hazardous environments, often leading to accidents due to the absence of proper safety equipment. SafeSite AI is an AI-powered solution that detects Personal Protective Equipment (PPE) compliance among workers. This project leverages YOLOv8 for real-time object detection and can be further extended to track workers and trigger alerts for safety monitoring.

We used the dataset provided by Roboflow on the Construction Site Safety Image Dataset.

For easy access, the dataset is also available on Kaggle.

The dataset consists of 2,801 labeled images in YOLOv8 format, split into:

  • Training: 2,605 images
  • Validation: 114 images
  • Testing: 82 images

🏗️ Objects Detected (10 Classes):

  • Hardhat, Mask, NO-Hardhat, NO-Mask, NO-Safety Vest, Person, Safety Cone, Safety Vest, Machinery, Vehicle

PPE Classes


⚙️ Setup

The model was trained and tested on Kaggle using an NVIDIA P100 GPU. We utilized the ultralytics library from Ultralytics to implement YOLOv8 custom object detection.

To set up the project locally:

# Clone the repository
git clone https://github.com/your-repo/SafeSiteAI.git
cd SafeSiteAI

# Install dependencies
pip install ultralytics opencv-python numpy matplotlib

# Run the detection script
python detect.py --weights models/best.pt --source source_files/demo_video.mp4

For more details, check out this notebook.


📁 File Hierarchy

├───assets
├───data
│   ├───data.yaml
│   ├───ppe_data.yaml
│   ├───train
│   │   ├───images
│   │   └───labels
│   ├───valid
│   │   ├───images
│   │   └───labels
│   └───test
│       ├───images
│       └───labels
├───models
│   ├───yolov8n.pt  # Pre-trained model
│   ├───best.pt     # Custom trained model
├───output
│   └───output_yolov8n_100e
├───results
│   ├───confusion_matrix.png
│   ├───train_batch14672.jpg
│   ├───val_batch2_pred.jpg
│   ├───results.png
├───source_files
│   ├───videos
│   ├───images
└───README.md

📊 Results

The model was trained for 100 epochs, completing in 2.719 hours. The following images showcase the model’s performance:

Confusion Matrix

Training Batch

Validation Predictions

Final Results


🎯 Outputs

Here are some sample detections from the trained model:

Output 1

Output 2

Output 3


🚀 Future Work

🔹 Train the model for additional epochs to improve accuracy.
🔹 Compare results with four other YOLOv8 models.
🔹 Implement worker ID tracking and store bounding boxes for those not wearing PPE.
🔹 Deploy an ML-powered safety alert system with real-time monitoring.


🎬 Demo Video

To see SafeSite AI in action, check out the demo video available in the repository:

Demo Video


📩 Contact

For inquiries, improvements, or collaborations, feel free to reach out!

📧 Email: [email protected]
🔗 GitHub: shaishav06 GitHub Profile
🌐 Website: My Website

Alt text Linkedin: Shaishav Surati

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published