yihong1120/Construction-Hazard-Detection

Enhances construction site safety using YOLO for object detection, identifying hazards like workers without helmets or safety vests, and proximity to machinery or vehicles. HDBSCAN clusters safety cone coordinates to create monitored zones. Post-processing algorithms improve detection accuracy.

What it solves

This project provides an AI-powered safety monitoring system for construction sites. It uses live camera feeds to automatically detect safety violations in real-time, such as workers missing hard hats or safety vests, workers entering restricted zones (defined by safety cones), or people standing too close to dangerous machinery, vehicles, and utility poles.

How it works

The system employs a YOLO-based object detection model to identify workers, safety gear, and equipment. It is built as a distributed architecture:

  • Processing Pipeline: main.py manages camera streams, while local YOLO workers perform GPU-accelerated inference via shared memory to maximize throughput.
  • Media Handling: MediaMTX handles the ingestion of RTSP streams and distributes them via HLS or WebRTC for live viewing.
  • Coordination: Redis manages authentication caches and live metadata, while PostgreSQL stores site configurations, user data, and violation records.
  • Notification & API: A suite of FastAPI services handles notifications (via FCM), violation logging, and streaming metadata.

Who it’s for

This system is designed for construction site managers, safety officers, and security teams who need automated, real-time monitoring of hazardous environments to reduce accidents and ensure regulatory compliance.

Highlights

  • Real-time Hazard Detection: Identifies missing PPE (hard hats, vests) and proximity hazards (machinery, vehicles, utility poles).
  • Multi-language Support: Labels and notifications are available in English, Traditional/Simplified Chinese, French, Thai, Vietnamese, Indonesian, and Japanese.
  • Zone Monitoring: Detects workers inside cone-derived controlled areas.
  • High-Throughput Architecture: Uses shared-memory YOLO workers and Intel iGPU encoding (h264_vaapi) to optimize GPU resources.
  • Comprehensive Tooling: Includes a Flutter frontend (separate repo), data augmentation utilities, and an MCP server for AI agents.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Dispatch