LIVE · Streaming MTA GTFS-RT

Anomaly detection
for the NYC Subway,
every 30 seconds.

A streaming system that ingests live GTFS-Realtime feeds from the MTA, computes per-stop headway features, and scores anomalies with an online ML pipeline that retrains continuously. Operators triage incidents on a live Mapbox command center — ranked, contextualized, and color-coded by severity.

Launch Command Center Live Summary API online · 1 488 stops · 26 routes
Incident Board · Top 5 LIVE · 15m
L 14 St – Union Sq 512s / 302s 0.91
N 57 St – 7 Av 476s / 319s 0.87
A Fulton St 428s / 343s 0.74
F Jay St – MetroTech 382s / 296s 0.69
Q Kings Highway 334s / 288s 0.58
updated — /api/anomalies
Stations
in last 15m
Active Trains
route × stop
Scored Rows
features × model
Anomalies
score ≥ 0.60
Critical
score ≥ 0.85
01 / Pipeline

From GTFS feed to live incident

Streaming · Stateful · 30s cadence
STEP 01

Collect

Worker polls seven MTA GTFS-Realtime protobuf feeds every ~30 seconds, deduplicates trip updates, and emits normalized stop events.

Pythonprotobufasyncio
STEP 02

Persist

TimescaleDB stores stop-event time-series with hypertables for route/stop indexing, enabling fast range queries over observed vs predicted headway.

TimescaleDBSQLAlchemyAlembic
STEP 03

Score

Online ML with River retrains continuously on sliding windows. A shadow deep model runs in parallel for A/B quality telemetry and drift tracking.

RiverPyTorchscikit-learn
STEP 04

Visualize

Next.js command center with Mapbox renders live heatmaps, ranked incident table, and model telemetry. Auto-refresh every 10s with optimistic KPIs.

Next.jsMapbox GLTailwind
02 / Live

Real-time anomaly stream

Auto-refresh · 15m window
Anomaly feed · top scores LIVE
  • awaiting next worker cycle · feed refreshes every 10s
Routes · NYC Subway system
03 / Architecture

Six services, one dashboard

Docker compose · VPS deployment
Ingestion
  • workerMTA poll + dedupe
  • dbTimescaleDB
  • trainerRiver online
Inference
  • dl_shadowPyTorch A/B
  • apiFastAPI
  • telemetrydrift metrics
Surface
  • uiNext.js 14
  • mapMapbox GL
  • nginxSSL + subpath

Open the live command center.

Real map of New York City. Real MTA feeds. Real anomalies as they happen — ranked, scored, and visualized for operator triage.

Launch Map →