Inspiration

Every day, millions of Malaysians rely on urban rail like the LRT, MRT and Monorail. But there have been fatal cases of people falling onto the tracks and being struck by a train, including at LRT stations in the Klang Valley. Station staff watch many CCTV screens at once, so a person on the track can easily be missed, and incidents are usually only reviewed after they happen. Most Malaysian stations already have CCTV — RedOnTrack makes those cameras detect danger in real time, so staff can act before a train arrives.

What it does

RedOnTrack watches platform CCTV and detects people and trains with our own YOLO11n model. Each camera has a red zone (track) and a yellow zone (warning strip).

New this hackathon — Live Detection:

  • The model runs inside the browser on any video, uploaded clip or webcam. No footage is sent to a server.
  • Each person gets an ID and a timer. Risk goes up the longer they stay in a zone (yellow = low → medium, track = medium → high).
  • When a real train is at the platform, zones switch off so boarding passengers don't trigger alarms.
  • Confirmed events are logged to the incident log automatically with a snapshot, and can be exported as CSV.

How we built it

  • YOLO11n (Ultralytics), 2 classes (person, train), exported to ONNX
  • ONNX Runtime Web (WebAssembly), React 19, TypeScript, Vite, Tailwind
  • Own decoding, zone check by foot position, simple tracker for dwell time, train gate
  • Python edge script (model/zone_detect.py) with the same rules
  • 64 unit tests (Vitest)

Challenges we ran into

  • The model sometimes saw a fake "train" on the yellow strip, which would switch zones off and hide a real intrusion. We fixed it by only counting a train if it is confident (≥ 0.8), covers the track zone and stays for 1 second.
  • One-frame glitches made alerts flicker, so a red-zone alert needs 0.5 s to confirm.
  • Getting the WebAssembly runtime to load in both dev and the built site.
  • Running the model fast enough on a normal laptop CPU.

What we learned

  • How to run a vision model directly in the browser with ONNX.
  • How simple time-based rules (confirm time, dwell time, train gate) cut false alarms a lot.
  • Why the edge device and the dashboard must use the same rules, so they always agree.

What's next

  • Pilot RedOnTrack with a Malaysian rail operator on real station cameras
  • Run on a real edge device with a live RTSP camera stream
  • WebGPU for faster browser detection
  • More training data (night, rain, crowded platforms)
  • Alerts to staff phones and platform speakers

Pre-existing work

  • Before Nov 23, 2026: the trained model (best.pt) and the base dashboard (login and roles, camera grid, zone editor, incident analysis, archive, footage catalog).
  • Built Nov 23–25, 2026: the Live Detection page, the ONNX export, the Python edge zone script, new tests and README updates (see the commits on these dates).

AI-assisted development

We used an AI coding assistant to help write parts of the code, and we reviewed, tested and can explain all of it. The Feature 5 narration in the demo video uses an AI-generated voice.

Team

  • Arleen: model training, live detection feature, dashboard
  • Muhammad Ibrahim Al-Imran Bin Mohd Isa: data collection, testing, pitch video

Built With

Share this project:

Updates

Submission history