E-bicycle injuries in the United States rose 293% between 2019 and 2022, and e-scooter injuries rose 88%. Most of that growth is among young adults, which is to say the people on a college campus. Yet almost nobody measures how scooters and bikes are ridden on campus. The usual tools are a person with a clipboard or a survey, and both are slow, small and biased.

I spent the summer of 2026 at the University of Alabama's TRIP Lab, in the Autonomous and Connected Transportation REU, building the measuring instrument instead: a system that watches intersections through cameras the university already owns and logs who rides what, every second, all day. This is how it works, what it gets right, and where it still fails.

The poster took first prize in the ACT category of the REU poster competition.

Sameen holding the first-prize certificate at the University of Alabama REU poster competition

First prize, ACT category, July 2026.

Sameen explaining the poster to a visitor at the poster session

At the poster session.

5
Live camera feeds
~27k
Training images, 7 datasets
0.86
mAP@50, validation
0.74
mAP@50, held-out test

The pipeline

Everything runs unattended on one lab computer with an RTX 5060 (8 GB).

Campus CCTV, 5 RTSP feeds
      |
FrameReader thread per camera   # always hands over the newest frame
      |
YOLO11s, 6 custom classes       # one model instance per camera
      |
ByteTrack                       # persistent ID per object
      |
unique-count logic
      |
      +--> annotated video, rotated hourly
      +--> CSV, one row per second per camera

The detector knows six classes. Three are the things being counted (scooter, bicycle, e_bicycle), one supports the counting (person), and two describe behaviour (with_helmet, without_helmet).

Building the dataset

There is no public dataset with all six classes, so I merged seven: five scooter, helmet and person sets, plus an e-bike set and a bicycle set added for the second version of the model. Each one names its classes differently. One calls a scooter escooter, another electricscooter; one spells bicycle Bycycle; one ships LabelMe JSON instead of YOLO text files.

The merge script does four things:

  • One class map. Every label is lowercased and mapped into the six-class scheme. Classes I don't want (bollards, motorbikes, cars) are dropped.
  • Format conversion. The LabelMe set is converted to YOLO boxes on the fly and split 70/15/15 with a fixed seed.
  • MD5 deduplication. Every image is hashed and checked against the hashes already seen. The same picture cannot land in both the training and the test split, and duplicates across datasets disappear.
  • One output layout with train, validation and test folders that the trainer reads directly.

The deduplication step matters more than it looks. Public datasets copy from each other, and a duplicated image across splits makes test scores look better than they are.

Bar chart of training label counts: scooter 9,975, without_helmet 6,724, person 2,835, e_bicycle 938, with_helmet 865, bicycle 409

Label instances in the training split. Scooter has about 24 times as many examples as bicycle, and that imbalance explains most of the results below.

Training

The model is YOLO11s. Rather than start from generic weights, I fine-tuned from the project's earlier scooter-only model, so the backbone kept what it knew about scooters and only the detection head was re-initialised for six classes. It trained for 100 epochs at 640 px, batch 16, on the same RTX 5060 that runs it in production. Validation mAP@50 went from 0.75 after the first epoch to 0.86 by epoch 50 and then flattened; the last fifty epochs bought almost nothing.

Results, and why I report two numbers

The validation score is 0.86 mAP@50. The held-out test score is 0.74. I report both because the gap is the finding.

ClassAP@50, validationAP@50, test
scooter0.9720.970
person0.9340.869
with_helmet0.8800.865
e_bicycleno validation examples0.690
without_helmet0.6070.615
bicycle0.9250.433
All classes0.8640.741
Per-class average precision at IoU 0.50 on the test set, from 0.970 for scooter down to 0.433 for bicycle

Per-class AP@50 on the test set. Performance follows the amount of training data almost exactly.

Scooters are solved: 0.97 on both splits, from nearly ten thousand examples. Bicycle is the opposite. It scores 0.93 on validation and 0.43 on test, which is what 409 training examples buys you: a model that memorised the bicycles it saw. The e-bicycle class had essentially no validation examples at all, so its only honest number is the test one.

Normalized confusion matrix on the test set

Normalised confusion matrix on the test set. The weak spot is without_helmet, which trades places with the background in both directions.

The helmet problem. Recall on without_helmet is only 0.56 on validation: the model misses close to half of bare-headed riders and also sees bare heads in empty background. The class has plenty of labels, but they are noisy. Until that is fixed, helmet-compliance numbers from this system should not be trusted.

Counting each rider exactly once

Detection gives you boxes per frame. Research needs counts of riders. Getting from one to the other was the hardest correctness problem in the project, because naive counting goes wrong in three separate ways.

1. Flicker

A detector will occasionally see a scooter for a single frame that isn't there. So a track has to survive four consecutive frames before it counts. Blips die first.

2. Reconnects

Network cameras drop and come back. When a stream reconnects, the tracker starts numbering from 1 again, and the scooter that was ID 5 becomes ID 1 and gets counted twice. I key every count on (reconnect_id, track_id, class), so a new connection opens a new namespace.

3. Occlusion

A rider passes behind a tree or a bus, the tracker loses them, and they come out the other side with a new ID. The fix is in the tracker configuration: hold a lost track for 60 frames (two seconds) instead of the default 30, and require a stricter match so IDs switch less often.

# bytetrack_campus.yaml
tracker_type: bytetrack
track_high_thresh: 0.45   # relaxed for overhead angles
track_low_thresh:  0.10
new_track_thresh:  0.55
track_buffer:      60     # 2 s at 30 fps, the key change
match_thresh:      0.85   # stricter matching, fewer ID switches

Two smaller details keep the system honest over a 24-hour run. Each camera gets its own model instance, so one camera's tracker state can never leak into another's. And each reader thread drains the stream buffer before handing over a frame, so the detector always sees the present rather than a frame from a second ago.

What the researchers get

One CSV per camera with one row per second. Each row has a millisecond timestamp and, for every class, how many are visible now and how many unique ones have passed this session. That is about 432,000 rows a day per camera. Annotated video is saved alongside in hourly files, both as an archive and as the raw material for the next round of training.

What doesn't work yet

  • The domain gap. This is the big one. The training images are mostly standing kick scooters and catalogue photos of e-bikes on white backgrounds. The campus fleet is seated rental scooters seen from an overhead camera. The model has to be fine-tuned on real campus footage before its counts mean much there.
  • Summer. I trained and tested while most students were away, so there were few riders to validate against.
  • Class imbalance. Bicycle, e-bicycle and helmet classes need many more examples.
  • Overfitting to validation. The 0.86 to 0.74 drop says some of the validation score is memorisation.
What I would do next. Collect and label footage from these exact cameras once the fall semester brings riders back, fine-tune a third version on it, and add zones for road, crosswalk and sidewalk so the system can report where people ride, not only how many.

What I took from it

The model was the smaller half of the work. Most of the engineering went into the parts around it: making seven datasets agree with each other, keeping duplicates out of the test set, and making a count survive a dropped camera feed. And the most useful line on the poster turned out to be the unflattering one, the test score next to the validation score.

This was team research at the TRIP Lab, presented as a poster at the University of Alabama REU symposium with P. Pawar, A. Hudson, B. McManus, A. Yoder and D. Stavrinos. I built the detection model, the dataset pipeline and the counting system. Training data came from the Roboflow Universe community and the University of Virginia's ScooterDet dataset, used under their published licences.