CLEARPATH — Safer Schools, Smarter Decisions
Inspiration
When a potential threat is reported at a school, the first information is often wrong. Camera feeds may be blurry, frozen, or obstructed. An evacuation route that looks valid on a map may even move students toward danger.
Systems that jump directly from “weapon detected” to “evacuate” worried us. We wanted to build something that gathers evidence, adapts to unreliable information, acknowledges uncertainty, and leaves every consequential decision to a trained person.
That idea became CLEARPATH — a simulation and training platform for school safety teams.
What it does
CLEARPATH combines computer vision, agentic reasoning, and a 3D digital twin of a fictional school campus to simulate how safety teams can assess reports and evaluate response procedures.
When a simulated report arrives, an agent:
- Chooses which camera to analyze next, based on how much it expects to learn about the threat's location.
- Runs an OpenCV 5 pipeline on the footage: image-quality checks, CLAHE and dark-channel dehazing, MOG2 background subtraction, Farneback optical flow, YOLOX-S through
cv.dnn, and tracking. - Changes its plan based on what it sees:
- Hazy footage → re-run with dehazing.
- Frozen or covered lens → mark the camera as a coverage gap.
- Tracked motion and optical flow disagree → re-analyze with denser detection.
- Uses a location gate. An observation is placed in a school zone only if the footage is registered to that camera or a human confirms it. Otherwise, its location remains unknown.
- Updates a Bayesian threat belief over the digital twin. It checks every evacuation route twice: once for mathematical validity and once for operational safety.
- Recommends a Standard Response Protocol procedure, then always pauses for human review. Reviewers confirm or dismiss each observation, providing reasons for dismissals, and then approve or reject the procedure. Every action is logged as
SIMULATED.
How we built it
- Vision service: FastAPI + OpenCV 5.0.0. A stateless service that runs locally or as a separate service on an AWS Graviton (arm64) instance.
- Agent and decision engine: Python. An explicit perceive → validate → decide → review state machine. Every step is traced, including the tool used, its arguments, the result, and the reason.
- Evidence-weighted reasoning: Camera reliability (r \in [0,1]) determines how strongly each piece of evidence influences the threat belief:
$$ P(z \mid e) \propto P(z)\,\mathrm{LR}(e \mid z)^{r} $$
A frozen or obstructed feed ((r \approx 0)) therefore barely changes the belief. (P(\text{no threat})) never drops below (0.03), and a report alone can never localize a threat.
- Digital twin: Zones, doors, exits, and cameras representing a fictional school. Shapely validates geometry, and NetworkX computes routes.
- UI: React, TypeScript, and React Three Fiber. A 3D campus twin and a full-size evidence review with key frames, red boxes around people measured running, frame stepping, and an “original footage” toggle.
- AWS: The planned deployment uses Graviton EC2 (systemd and nginx, without containers), a private S3 bucket for run archives, CloudWatch metrics tagged with
Arch,OpenCV, andCOOLdimensions, and a least-privilege IAM role with IMDSv2 and SSM.
Challenges we ran into
- Honest test data. Real incident footage was neither available nor appropriate. We recomposited real pedestrian sprites from OpenCV's public
vtest.aviusing OpenCV, allowing us to establish exact per-frame ground truth for the synthetic composites. - A location bug. The footage was outdoors, but we replayed it on “indoor” cameras. Our first version incorrectly placed people on a lawn inside the East Hall threat zone. We fixed the root cause with the location gate: unverified locations are shown as unknown until a human confirms them.
- “A route exists” vs. “a route is safe.” These had to be modelled as separate checks.
- Not overclaiming. Our selected COCO model has no firearm class, so CLEARPATH does not detect guns. We have also not measured COOL performance and do not claim it.
Evaluation and results
Reproducible scripts in the repository evaluate CLEARPATH on synthetic composites and simulated workflows:
- 15/15 activity labels correct.
- Person detection precision: 0.970 and recall: 0.932 — optimistic because the sprites were cut using the same detector.
- 0/10 false candidate events in the tested scenarios.
- 160/160 human-review state checks passed.
- 4/4 scenarios produced the expected outcomes after human review, compared with 0/4 for a naive “evacuate on any weapon report” rule.
These results describe prototype performance under the tested conditions, not real-world school-safety performance. Each reported metric should be reproducible using the repository's evaluation scripts.
What we learned
- An agent is useful when perception changes its next action. Narrating a fixed result is not enough.
- Showing uncertainty and camera coverage gaps matters as much as detections.
- Every number we report needs a script that reproduces it.
- Human review and location validation are essential safeguards when evidence is incomplete.
What's next
- Validation on consented, real footage.
- Calibrated cameras for automatic location verification.
- A properly licensed weapon-detection model behind the existing extension point.
- HTTPS and authentication for review actions.
- Measured COOL performance on Graviton.
CLEARPATH explores how computer vision and agentic AI can support safer, more evidence-based decisions while keeping people accountable for consequential actions.
Simulation only. No real alerts, notifications, or door commands are ever sent.
Built With
- amazon-web-services
- amazonec2
- amazons3
- awscloudshell
- graviton
- opencv5
- python
- react
- three.js
- typescript
- yolo
Log in or sign up for Devpost to join the conversation.