Skip to content

Safety rule violations, like not wearing helmets, are hard to track manually. A computer vision system can automate helmet compliance monitoring, enhance workplace safety, and reduce accident severity without needing extra staff.

Notifications You must be signed in to change notification settings

HarshitBhalani/helmet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ– Helmet Compliance Monitoring System

Automated Safety Compliance Through Computer Vision

Safety rule violations, like not wearing helmets, are hard to track manually. A computer vision system can automate helmet compliance monitoring, enhance workplace safety, and reduce accident severity without needing extra staff.

Helmet Detection Demo Python TensorFlow Streamlit

⚠️ IMPORTANT LEGAL NOTICE

🚨 THIS PROJECT IS PROTECTED BY COPYRIGHT LAW 🚨

This repository is monitored for unauthorized copying, forking, or distribution. All activities are tracked and logged.


🎯 Problem Statement

Traditional manual safety monitoring faces several challenges:

  • Human Error: Manual oversight can miss violations
  • Resource Intensive: Requires dedicated safety personnel
  • Inconsistent Monitoring: Cannot provide 24/7 surveillance
  • Delayed Response: Violations detected after incidents occur
  • Documentation Issues: Difficult to maintain compliance records

πŸ’‘ Solution

Our AI-powered system provides:

  • Real-time Detection: Instant helmet compliance verification
  • Automated Monitoring: Continuous surveillance without human intervention
  • Accurate Documentation: Automated violation logging and reporting
  • Cost-effective: Reduces need for additional safety staff
  • Scalable: Can monitor multiple locations simultaneously

πŸš€ Key Features

πŸ” Detection Capabilities

  • Real-time Helmet Detection - Instant compliance verification
  • Live Camera Integration - Continuous monitoring through webcam/IP cameras
  • Batch Image Processing - Analyze multiple images simultaneously
  • High Accuracy - Advanced AI model with adjustable confidence thresholds

πŸ“Š Monitoring & Analytics

  • Violation Logging - Automatic incident recording with timestamps
  • Compliance Reporting - Generate detailed safety compliance reports
  • Statistics Dashboard - Track compliance rates and trends
  • Export Functionality - Download reports in CSV format

βš™οΈ User-Friendly Interface

  • Intuitive Web Interface - Easy-to-use Streamlit dashboard
  • Adjustable Thresholds - Customize detection sensitivity
  • Multiple Input Methods - Upload images, use camera, or batch process
  • Real-time Feedback - Instant safety status notifications

🏭 Use Cases

Industrial Applications

  • Construction Sites - Monitor workers in hard hat zones
  • Manufacturing Plants - Ensure safety compliance in production areas
  • Warehouses - Automated safety checks in material handling zones
  • Mining Operations - Critical safety monitoring in hazardous environments

Benefits for Organizations

  • Reduced Accidents - Proactive safety violation prevention
  • Lower Insurance Costs - Improved safety records
  • Regulatory Compliance - Meet OSHA and safety standards
  • Enhanced Productivity - Automated monitoring frees staff for other tasks

πŸ“‹ Technical Requirements

System Requirements

  • Python: 3.8 or higher
  • RAM: Minimum 4GB (8GB recommended)
  • Storage: 500MB free space
  • Camera: Optional (for live detection)

Dependencies

streamlit==1.28.0
tensorflow==2.13.0
opencv-python==4.8.0.74
Pillow==10.0.0
numpy==1.24.3
pandas==2.0.3

πŸ“± How to Use

1. Single Image Detection

  • Select "πŸ“· Image Upload" mode
  • Upload an image file (JPG, PNG, BMP)
  • View detection results and confidence scores
  • System automatically logs violations

2. Live Camera Monitoring

  • Select "πŸ“Ή Live Camera" mode
  • Allow camera permissions
  • Capture photos for real-time analysis
  • Get instant safety compliance feedback

3. Batch Processing

  • Select "πŸ“ Batch Processing" mode
  • Upload multiple images at once
  • Generate comprehensive compliance report
  • Export results for documentation

4. View Reports

  • Select "πŸ“Š Violation Logs" mode
  • Review all detected violations
  • Analyze compliance trends
  • Export data for regulatory reporting

πŸŽ›οΈ Configuration Options

Detection Threshold Settings

  • 0.5-0.6: Lenient (reduces false violations, may miss some cases)
  • 0.7: Balanced (recommended for most environments)
  • 0.8-0.9: Strict (ideal for high-risk environments)

Customization Tips

  • Adjust threshold based on your safety requirements
  • Higher thresholds for critical safety zones
  • Lower thresholds for general monitoring areas

πŸ€– AI Model Information

Model Specifications

  • Architecture: Convolutional Neural Network (CNN)
  • Input Size: 224x224 pixels
  • Classes: 2 (With Helmet, Without Helmet)
  • Framework: TensorFlow/Keras
  • Training: Supervised learning on labeled helmet images

Performance Metrics

  • Accuracy: Depends on training data quality
  • Processing Speed: Real-time capability
  • Memory Usage: Optimized for standard hardware

πŸ“Š Sample Output

Compliance Detection

βœ… HELMET DETECTED - COMPLIANT
Status: SAFE βœ“
Confidence Level: 89.2%

Violation Alert

❌ NO HELMET DETECTED - VIOLATION
Status: UNSAFE ⚠️
Confidence Level: 94.7%

🚨 SAFETY VIOLATION ALERT
Immediate Actions Required:
- πŸ›‘ Stop work immediately  
- πŸͺ– Provide safety helmet
- πŸ“‹ Brief worker on safety protocols
- πŸ“ Document the incident

πŸ—οΈ Project Structure

helmet_streamlit_app/
β”œβ”€β”€ model/                   # Model directory
β”‚   β”œβ”€β”€ model.json          # Model architecture in JSON format
β”‚   β”œβ”€β”€ metadata.json       # Model metadata and configuration
β”‚   └── weights.bin         # Model weights in binary format
β”œβ”€β”€ app.py                  # Main Streamlit application
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ labels.txt             # Class labels for model
β”œβ”€β”€ README.md              # Project documentation
β”œβ”€β”€ .gitignore            # Git exclusion rules
└── model.h5              # Complete Keras/TensorFlow model file

πŸ”’ Security & Privacy

  • Local Processing: All detection happens on your local machine
  • No Data Upload: Images are not sent to external servers
  • Privacy Compliant: Suitable for sensitive workplace environments
  • Secure Logging: Violation logs stored locally

πŸš€ Deployment Options

Local Deployment

  • Run on local machine for single-user access
  • Ideal for testing and small-scale monitoring

Network Deployment

  • Deploy on internal server for multi-user access
  • Access from multiple devices on same network

Cloud Deployment (Advanced)

  • Deploy on Streamlit Cloud, Heroku, or AWS
  • Requires model hosting solution (Google Drive, etc.)

πŸ› οΈ Troubleshooting

Common Issues

Model Loading Error

❌ model.h5 file not found!

Solution: Ensure model.h5 is in the project root directory

Camera Access Error

Permission denied for camera access

Solution: Grant camera permissions in browser settings

Low Detection Accuracy

Many false positives/negatives

Solution: Adjust detection threshold or retrain model with better data

Performance Optimization

  • Use GPU-enabled TensorFlow for faster processing
  • Optimize image resolution for speed vs accuracy balance
  • Consider model quantization for mobile deployment

πŸ“„ LICENSE - ALL RIGHTS RESERVED

🚨 PROPRIETARY SOFTWARE - STRICT COPYRIGHT PROTECTION 🚨

Β© 2025 Harshit Bhalani. All Rights Reserved.

This project is proprietary and confidential software. All rights are reserved by the copyright holder.

βš–οΈ LEGAL TERMS & CONDITIONS

UNAUTHORIZED USE PROHIBITED

This repository and its contents are protected by copyright law and international treaties. Any unauthorized copying, distribution, modification, or use of this software is STRICTLY PROHIBITED and will result in legal action.

🚫 WHAT IS NOT PERMITTED:

  • ❌ Copying any portion of this code
  • ❌ Forking or cloning this repository for personal use
  • ❌ Redistributing in any form (source code, compiled, or modified)
  • ❌ Commercial use without explicit written permission
  • ❌ Creating derivative works based on this project
  • ❌ Reverse engineering or decompiling
  • ❌ Removing copyright notices or attribution
  • ❌ Using for competing products or services

βœ… WHAT IS PERMITTED:

  • βœ… Viewing the code for educational purposes only
  • βœ… Learning from the implementation concepts
  • βœ… Discussing the project in academic contexts
  • βœ… Linking to this repository (not copying)

πŸ” MONITORING & ENFORCEMENT

This repository is actively monitored for copyright violations.

  • All forks, downloads, and access attempts are logged
  • Automated detection systems identify unauthorized use
  • Legal action will be taken against violators
  • DMCA takedown notices will be issued for violations

⚠️ VIOLATION CONSEQUENCES

Unauthorized use of this software may result in:

  • Immediate legal action under copyright law
  • Cease and desist orders
  • Financial penalties and damages
  • Criminal prosecution under applicable laws

πŸ“§ LICENSING INQUIRIES

For licensing, permission, or commercial use inquiries, contact:

πŸ›‘οΈ DISCLAIMER

This software is provided "as is" without warranty of any kind. The author shall not be liable for any damages arising from the use of this software.


πŸ“ž Support & Contact

Getting Help

FAQ

Q: Can this detect other safety equipment? A: Currently focused on helmets, but can be extended for vests, gloves, etc.

Q: What accuracy can I expect? A: Depends on training data quality, typically 85-95% with good data.

Q: Can it work with IP cameras? A: Yes, with minor code modifications for RTSP streams.

Q: Is it suitable for outdoor use? A: Yes, but performance may vary with lighting conditions.

πŸ™ Acknowledgments

  • TensorFlow Team for the amazing ML framework
  • Streamlit for the intuitive web app framework
  • OpenCV for computer vision capabilities
  • Google Teachable Machine for accessible model training

πŸ“ˆ Future Enhancements

  • Multi-person detection in single image
  • Integration with existing security systems
  • Mobile application development
  • Advanced analytics and predictive insights
  • Support for multiple safety equipment types
  • Real-time video stream processing
  • Database integration for enterprise use
  • API development for third-party integrations

⚑ Automated Safety Monitoring for a Safer Workplace ⚑

πŸ”’ PROTECTED BY COPYRIGHT LAW πŸ”’

Made with ❀️ for workplace safety by Harshit Bhalani & team (raval Heet and patel dhairya)

Β© 2025 All Rights Reserved


🚨 FINAL WARNING

This project is protected by copyright law. Any unauthorized copying, distribution, or use will result in immediate legal action. We actively monitor and track all repository activity.

About

Safety rule violations, like not wearing helmets, are hard to track manually. A computer vision system can automate helmet compliance monitoring, enhance workplace safety, and reduce accident severity without needing extra staff.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages