50+camera sites
100+hours of footage
5,000+frames hand-labeled
9classes
~0.90mAP · hardest classes
The problem
Counting what off-the-shelf models can't see.
An FDOT-funded safety study needed reliable counts of bicycles, e-bikes, and e-scooters at fixed camera sites across the district. Manual counting doesn't scale past a handful of videos, and stock detection models kept folding the interesting classes into each other: cars read as bicycles, e-bikes read as motorcycles, seated scooters read as almost anything.
The pipeline
Two passes: catch everything, then trust nothing.
A motion pass (MOG2 background subtraction inside a hand-drawn region of interest per site) catches every moving object cheaply. A review pass filters that to real micromobility before anything reaches the dataset. Production counting runs YOLOv8 for detection and ByteTrack for tracking, so each rider is counted once, not once per frame.
Site footage→Motion ROI→Review→YOLOv8 + ByteTrack→Per-site counts
The dataset
5,000+ frames, labeled by hand.
The training set merges field footage with public datasets, plus negative classes (cars, motorcycles) so the model learns what a bike is not. Missed cases get mined back in: a frame-extraction pipeline reads burned-in video timestamps via OCR, pulls the exact frames where the detector failed, and routes them through Label Studio with pre-labels for fast annotation.
The model
Nine classes, production grade.
Iterating on the detector with negative classes and mined hard cases pushed the toughest distinction, e-bike vs seated scooter, to ~0.90 mAP, eliminated false motorcycle detections, and was verified head-to-head on a held-out site before delivery.
What the data showed
Counts are the product. Safety is the story.
30%helmet compliance across observed riders
51%of riders traveling against traffic
Every verified detection carries a hand-reviewed set of safety attributes before it counts:
Helmet useTravel directionLane positionRider demographics
Validation & delivery
Shipped like a product, not a notebook.
No model version ships on faith: a manual review pass screens detections, and each new detector is run head-to-head against the previous one on a held-out site before it replaces anything. What the research team receives is reproducible, not a one-off run:
Annotated site videosdetections drawn frame by frame for spot-checking
Per-site CSV datasetscounts and safety attributes, analysis-ready
Batch processing scriptsrerun any site end to end, unattended
Methodology reportarchitecture, validation notes, and known limits
Stack
YOLOv8ByteTrackMOG2 · OpenCVLabel StudioPython
ESC or ✕ to close