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.
π¨ THIS PROJECT IS PROTECTED BY COPYRIGHT LAW π¨
This repository is monitored for unauthorized copying, forking, or distribution. All activities are tracked and logged.
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
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
- 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
- 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
- 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
- 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
- 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
- Python: 3.8 or higher
- RAM: Minimum 4GB (8GB recommended)
- Storage: 500MB free space
- Camera: Optional (for live detection)
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
- Select "π· Image Upload" mode
- Upload an image file (JPG, PNG, BMP)
- View detection results and confidence scores
- System automatically logs violations
- Select "πΉ Live Camera" mode
- Allow camera permissions
- Capture photos for real-time analysis
- Get instant safety compliance feedback
- Select "π Batch Processing" mode
- Upload multiple images at once
- Generate comprehensive compliance report
- Export results for documentation
- Select "π Violation Logs" mode
- Review all detected violations
- Analyze compliance trends
- Export data for regulatory reporting
- 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)
- Adjust threshold based on your safety requirements
- Higher thresholds for critical safety zones
- Lower thresholds for general monitoring areas
- 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
- Accuracy: Depends on training data quality
- Processing Speed: Real-time capability
- Memory Usage: Optimized for standard hardware
β
HELMET DETECTED - COMPLIANT
Status: SAFE β
Confidence Level: 89.2%
β 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
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
- 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
- Run on local machine for single-user access
- Ideal for testing and small-scale monitoring
- Deploy on internal server for multi-user access
- Access from multiple devices on same network
- Deploy on Streamlit Cloud, Heroku, or AWS
- Requires model hosting solution (Google Drive, etc.)
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
- Use GPU-enabled TensorFlow for faster processing
- Optimize image resolution for speed vs accuracy balance
- Consider model quantization for mobile deployment
Β© 2025 Harshit Bhalani. All Rights Reserved.
This project is proprietary and confidential software. All rights are reserved by the copyright holder.
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.
- β 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
- β Viewing the code for educational purposes only
- β Learning from the implementation concepts
- β Discussing the project in academic contexts
- β Linking to this repository (not copying)
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
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
For licensing, permission, or commercial use inquiries, contact:
- Email: harshitbhalani187@gmail.com
- GitHub: @HarshitBhalani
- Subject: "Helmet Detection System - Licensing Inquiry"
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.
- Issues: Report bugs via GitHub Issues
- Discussions: Join project discussions
- Email: [harshitbhalani187@gmail.com]
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.
- 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
- 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
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.