ROBOT-HUMAN COLLISION PREVENTION

Top-down factory collision-prevention system — custom-trained YOLOv8n detects humans and robots through an IP camera, with bounding-box overlap logic raising collision warnings.

CVALGORITHMS
Dataset Custom top-down dataset — 1,612 person + 2,132 robot usable instances (2 robot types + human mannequin)
Model YOLOv8n (nano) — custom-trained
Detection Top-down IP camera view; bounding-box overlap triggers collision warning
Role R&D Engineer Intern — A*STAR ARTC
Period Sep 2023 – Feb 2024

1.0 PROBLEM

Fast-moving articulated robots are a major source of danger on factory floors. The standard safety solutions — door sensors, pressure mats, laser gates, and physical cages — share two drawbacks: heavy programmable logic controller (PLC) related expenses, and poor operating experience because they depend on humans not making mistakes. They also cannot adapt to dynamic workspaces where humans and robots genuinely share the floor.

The risk is not hypothetical. A Bureau of Labor Statistics study of its Census of Fatal Occupational Injuries surveillance system identified 41 robot-related workplace fatalities in the United States between 1992 and 2017.

The goal: achieve safety in a dynamic operating zone with just an internet protocol (IP) camera and 5G-and-beyond connectivity — a mission-critical use case with no new physical infrastructure on the floor.

2.0 APPROACH / ARCHITECTURE

An IP camera mounted top-down over the shared workspace feeds a custom-trained YOLOv8n (nano) detector. The dataset was collected and annotated at the A*STAR ARTC facility from the same top-down perspective, covering two different industrial robot types and a human mannequin in varied positions — 1,612 usable person instances and 2,132 usable robot instances after cleaning. Training on generic open-source datasets would not have worked: nothing public captures these specific robot forms, industrial backgrounds, or the overhead viewpoint.

2.1 Collision algorithm

Each detection is expanded 1.5× about its center before any comparison — a buffer zone, so the warning fires while there is still separation between human and robot, not at the moment of contact. The expanded coordinates are clamped to the frame bounds as part of the expansion.

Overriding those coordinates during real-time inference was the part that fought back: YOLO returns detections as PyTorch tensors, and mutating them in-stream threw runtime errors (attempts included .clone()-style tensor fixes). The working solution was a data-structure one — copy each detection out of the tensor into a plain Python list, and do all expansion and overriding on that copy, leaving the inference outputs untouched.

The expanded boxes accumulate in a per-frame list, and each new box is tested against all previous ones with an axis-aligned interval-overlap check — disjoint on either axis means no collision. On first overlap the system raises the on-screen warning, sounds an alarm, pushes a Microsoft Teams notification to supervisors, and saves a timestamped evidence frame — then stops checking, so one event produces one alert.

Side-by-side comparison of the detection view before and after the collision algorithm: both show robot and person bounding boxes, and the after view adds a red 'Potential Collision Detected!' warning as the boxes converge
Figure 1. Collision logic — before and after the algorithm, with the warning raised as bounding boxes converge

3.0 RESULTS

Deployed in an industrial safety context at A*STAR ARTC during the internship period. The trained YOLOv8n weights are available in the linked repository.

Top-down camera frame at the ARTC facility showing YOLOv8n detections: two robot arms boxed with confidences 0.76 and 0.39, and the human mannequin detected as person with confidence 0.92
Figure 2. Live detection — top-down view with two robots and the mannequin detected

4.0 ERRATA & REVISIONS

The linked repository hosts the trained YOLOv8n weights; the training-code repository (human_and_robot) still carries the upstream YOLO boilerplate README rather than a project-specific description, so this page serves as the primary documentation for the project.

The dataset was collected at one facility under specific lighting conditions with two robot types. A production safety system would require a more diverse dataset — multiple facilities, lighting variations, robot configurations — and confidence thresholding so the model abstains on uncertain inputs rather than silently producing a low-confidence detection. The 0.39-confidence robot detection visible in the demo frame is exactly the kind of case that thresholding policy would need to handle deliberately.

The pairwise overlap sweep is O(n²) in the number of detections — trivial for the handful of objects in a factory cell, but a deployment monitoring dozens of objects across a wider floor would swap it for a sweep-line or spatial-hashing approach.