Inspiration
Construction sites are among the most dangerous workplaces in the world — falls from height, workers struck by equipment, and unauthorized entry into hazard zones (excavation pits, crane swing radius, live machinery lanes) cause a huge share of on-site injuries every year. Safety today is reactive: a supervisor can't watch every camera at once, and by the time someone notices a fall or a worker wandering somewhere dangerous, it's often too late.
We had already built an AI surveillance platform for a different context and realized the same core technology — real-time pose estimation, object detection, and zone tracking — was a near-perfect fit for construction site safety. So we rebuilt it around the industry's most urgent, highest-frequency hazards.
What it does
SafeGuard AI turns ordinary site cameras into an active safety layer that watches the job site continuously and alerts supervisors the instant something goes wrong:
- Fall Detection — uses pose estimation to recognize when a worker's body position indicates a fall from scaffolding, a ladder, or an edge, and immediately flags it as a possible height-related incident.
- Danger Zone Intrusion — defines virtual restricted zones (excavation pits, crane radius, live machinery lanes) on the camera feed and fires an alert the instant a tracked worker enters one.
- Equipment Proximity Alerts — tracks each worker with a unique ID and calculates real-time distance to moving machinery (excavators, forklifts, trucks), triggering an alert when someone gets dangerously close.
- PPE Compliance Detection — flags missing hard hats or safety vests using an object detection layer.
- Instant Notifications — the moment a violation is detected, SafeGuard AI sends an SMS, WhatsApp message, or email to the site supervisor with a snapshot of the incident, so someone can act in seconds instead of finding out after the fact.
How we built it
The pipeline runs a multi-threaded computer vision stack on live or recorded video feeds:
- Capture — OpenCV pulls frames from a camera or video source.
- Detect — YOLOv8 identifies people, equipment, and PPE items in each frame; MediaPipe extracts pose/skeleton data to assess body position for fall detection.
- Track — a centroid tracking algorithm assigns a persistent ID to each worker across frames and calculates proximity to tracked machinery.
- Analyze zones — polygon-based zone analysis checks whether any tracked worker has entered a restricted area.
- Alert — when a rule is violated, the alert system fires a notification via Twilio (SMS), WhatsApp, or SMTP email, with an attached snapshot.
- Display — the annotated feed (with bounding boxes, zone overlays, and active alerts) streams via WebSockets to a live dashboard, where a safety team can monitor every camera and review incident history.
Backend: Python, Flask/FastAPI, threading for concurrent AI pipelines. Data: PostgreSQL for event logs, Firebase for auth/session sync. Frontend: a real-time dashboard showing live feeds, active alerts, and per-zone status.
Challenges we ran into
- Tuning zone-intrusion and dwell-time thresholds so alerts trigger on genuine hazards without excessive false positives.
- Getting pose estimation to reliably distinguish a genuine fall from a worker simply crouching or bending to work.
- Running multiple detection pipelines (object detection, pose estimation, tracking) concurrently without blocking the live video stream — solved with careful use of threading.
- Sourcing and integrating construction-specific PPE detection given the short build window.
Accomplishments that we're proud of
Taking an existing, working real-time computer vision pipeline and adapting its architecture to an entirely new, high-stakes domain — while keeping the core detection and alerting logic robust — in a very short timeframe.
What we learned
That a well-designed vision pipeline (detect → track → analyze → alert) is genuinely domain-agnostic — the same building blocks that work for security monitoring transfer directly to physical safety monitoring, as long as you rethink what "anomaly" means for the new context.
What's next for SafeGuard AI
- Train a dedicated PPE-detection model on construction-specific imagery (hard hats, vests, gloves, harnesses) rather than relying on placeholder detection.
- Integrate live Meta smart glasses feeds so foremen and workers get hazard alerts directly in their field of view, not just on a dashboard.
- Add predictive risk scoring per zone based on historical incident density, time of day, and crew size.
- Pilot on a live construction site to validate detection accuracy and alert response time in real-world conditions.
Built With
- computer-vision
- fastapi
- firebase
- flask
- mediapipe
- numpy
- object-detection
- opencv
- pose-estimation
- postgresql
- python
- threading
- twilio
- websockets
- yolov8
Log in or sign up for Devpost to join the conversation.