Inspiration

In Malaysia, people still fall or walk onto LRT and KTM tracks, and some of these cases end in death. When we read the news reports, we saw the same pattern every time. Stations already have CCTV, but one operator cannot watch every screen all shift, so the footage is usually only checked after the accident. We wanted the cameras that are already there to warn staff before a train arrives.

What it does

RedOnTrack has two parts:

  1. Edge AI model on existing CCTV. It detects every person in the frame and checks where they are standing:

    • Red zone (the track): intrusion alert
    • Yellow zone (the warning strip): warning
    • Platform: safe While a train is at the platform the zones switch off ("TRAIN PRESENT: ZONES DISABLED"), so people boarding don't set off false alarms.
  2. Web dashboard for station staff. It shows:

    • live camera views with alerts as they happen
    • an incident log with footage from every camera angle
    • weekly and monthly incident charts
    • an analysis for each incident: likely cause, risk level and preventive steps Admins and operators can also drag the red and yellow zone corners on the camera image to fit each station, then export them for the model.

How we built it

  • Model: YOLO11n (Ultralytics), fine-tuned for 50 epochs at 640 px on two classes, person and train. The zone check uses the point at the bottom centre of each person's box (where their feet are) and tests whether it falls inside the red or yellow polygon.
  • Dashboard: React 19, TypeScript (strict), Vite and Tailwind CSS.
    • Logins have three roles (admin, operator, viewer), and each role sees different pages and actions.
    • The incident analysis uses Gemini through a server proxy, so the API key is never in the browser. If Gemini isn't available, a built-in rule-based analyser takes over, so the demo always works.
    • The camera views play real recorded runs of our model, and the dashboard raises its alerts at the same moments as the model.
  • Testing and deployment: 53 unit tests (Vitest). The site deploys to GitHub Pages through GitHub Actions.

Challenges we ran into

  • False alarms when a train arrives. Passengers boarding were counted as being in the red zone. We fixed this by also training the model on a train class and switching the zones off while a train is present.
  • Every station is different. Fixed zone positions didn't fit every camera angle, so we built the zone editor.
  • Keeping the demo honest. We wanted the dashboard to show what our model actually does, not made-up animations. We used the model's own result videos and matched the alert timing to its output.

What we learned

  • How to fine-tune YOLO and turn its detections into simple safety rules with zones.
  • How to design a dashboard around what station staff actually need: fast alerts, clear incident records and different access for each role.
  • How to keep API keys safe in a public web app, and why the app needs a fallback when the AI service fails.

What's next

  • Test the model on more stations, at night and in the rain.
  • Run it on low-cost edge devices at the station.
  • Connect it to the on-site alarm and to real-time notifications for station staff.

Prior work and what we built during the hackathon

  • Before the hackathon: the YOLO11 model (trained March 2026), the first version of the dashboard and the pitch video.
  • During the hackathon:
    • the zone editor
    • showing the model's real footage on the dashboard and matching its alert timing
    • incident replays from every camera
    • the offline analyser and the secure Gemini proxy
    • unit tests
    • the GitHub Pages deployment
    • the README and user guide

Built With

Share this project:

Updates

Submission history