Neylton/ppe-safety-inspector
๐ฆบ IMSafe PPE Compliance Inspector
Professional AI-powered workplace safety system for Personal Protective Equipment (PPE) compliance detection.

๐ฏ Overview
IMSafe PPE Inspector is an advanced computer vision system designed to automatically detect and verify Personal Protective Equipment compliance in workplace environments. The system ensures workers are wearing both safety helmets and high-visibility safety vests before granting access to hazardous work areas.
โจ Key Features
- ๐ Real-time PPE Detection: Instant analysis of worker safety compliance
- ๐ฏ High Accuracy: Trained on professional workplace safety datasets
- โ๏ธ Configurable Thresholds: Adjustable confidence levels for different safety requirements
- ๐จ Clear Decision Making: Immediate ALLOW/DENY decisions with detailed reasoning
- ๐ Detailed Analytics: Confidence scores and probability breakdowns
- ๐ Web Interface: Easy-to-use Streamlit interface for immediate deployment
๐ก๏ธ Safety Requirements
โ SAFE (Access Granted)
- Worker wearing safety helmet on head
- Worker wearing high-visibility safety vest/jacket
- Both items clearly visible and properly worn
- Confidence level above configured threshold
โ UNSAFE (Access Denied)
- Missing safety helmet
- Missing safety vest/jacket
- Either item improperly worn
- Low confidence in detection
๐ Quick Start
Option 1: Use Online (Recommended)
Visit our live demo: IMSafe PPE Inspector
Option 2: Local Installation
# Clone the repository
git clone https://huggingface.co/spaces/YOUR_USERNAME/ppe-safety-inspector
cd ppe-safety-inspector
# Install dependencies
pip install -r requirements.txt
# Run the application
streamlit run app.py๐ How to Use
- Upload Image: Click "Choose an image of a worker..." and select a photo
- Automatic Analysis: The system immediately analyzes the uploaded image
- View Results: Get instant ALLOW/DENY decision with confidence scores
- Adjust Settings: Use the sidebar to modify confidence thresholds
๐ง Technical Details
Model Architecture
- Type: Custom Convolutional Neural Network (CNN)
- Input: RGB images (224x224 pixels)
- Output: Binary classification (Safe/Unsafe PPE)
- Framework: PyTorch
- Inference: CPU-optimized for fast deployment
Training Data
- Dataset Size: 156+ professionally verified images
- Classes: Safe PPE (helmet + vest) vs Unsafe PPE (missing equipment)
- Validation: Stratified train/test split with balanced accuracy metrics
- Augmentation: Color-blind training to prevent bias toward specific colors
Performance Metrics
- Overall Accuracy: 84.4%+
- Safe PPE Detection: 88.2%+
- Unsafe PPE Detection: 80.0%+
- Inference Time: <1 second per image
โ ๏ธ Important Safety Notice
This AI system is designed to assist with PPE compliance checking but should not be the sole method for ensuring workplace safety. Always combine with:
- Human oversight and verification
- Regular safety training programs
- Compliance with local safety regulations
- Organization-specific safety protocols
๐๏ธ Use Cases
- Construction Sites: Entry gate monitoring
- Manufacturing Facilities: Production floor access control
- Industrial Plants: Hazardous area compliance checking
- Warehouses: Safety zone entry verification
- Mining Operations: Equipment area access control
๐ฌ Model Development
The PPE detection model was developed using:
- Balanced Training: Equal emphasis on both safe and unsafe detection
- Color-Blind Augmentation: Prevents bias toward specific vest colors
- Shape-Focused Learning: Emphasizes helmet and vest shapes over colors
- Professional Validation: Verified against real workplace safety scenarios
๐ Confidence Thresholds
Recommended settings based on safety requirements:
- High Security (0.85+): Critical safety areas, zero tolerance
- Standard Security (0.75): Regular workplace monitoring
- Monitoring Mode (0.65): Training and awareness applications
๐ค Contributing
We welcome contributions to improve workplace safety through AI:
- Dataset Expansion: Additional verified PPE images
- Model Improvements: Enhanced detection algorithms
- Feature Requests: New safety compliance features
- Bug Reports: Issues and edge cases
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Workplace safety professionals who validated our training data
- Open source computer vision community
- PyTorch and Streamlit development teams
๐ Support
For questions, issues, or deployment assistance:
- Create an issue in this repository
- Contact: [Your contact information]
<div align="center">
๐ก๏ธ Protecting Workers Through AI-Powered Safety Compliance
Built with โค๏ธ for workplace safety
</div>
