Problem and approach
Detector, tracker, aligned scene map, rules
[start_sec, end_sec, label] over 14 classes, scored by temporal-IoU F1 at 0.3, 0.5 and 0.7. We manually labelled event intervals in all four sample clips and fine-tuned the object detector on annotated frames. Traffic rules use tracked objects and a scene map.Pipeline
- MP4 video4K, 29.97 fps, fixed camera
- Frame samplingRule-basedDecode once, analyse a subset of frames
- YOLO detectorLearnedFine-tuned, 8 classes incl. red/green signal heads
- ByteTrackRule-basedTrack ids and trajectories per road user
- Scene alignmentRule-basedSIFT + RANSAC homography maps scene.json onto the clip
- Event rulesRule-basedPer-class geometry and timing rules on tracks and zones
- Segment mergingRule-basedMerge fragments, drop blips, no same-class overlap
- Events[start_sec, end_sec, label]
Blue border = learned component. Everything else is deterministic code whose thresholds are listed below.
What is learned and what is rule-based
Learned: the object detector only. Rule-based: tracking association, scene alignment, every event decision and segment post-processing. Rules are inspectable and need no event labels, and the camera angle is fixed, so one scene map, re-aligned per clip, covers the hidden test set.
Models and data
- YOLO (Ultralytics), fine-tuned: 8 classes: car, bus, truck, motorcycle, bicycle, person, red light, green light. Weights ship in
weights/. Signal heads as detector classes let rules know the phase without a separate classifier. - ByteTrack (via Ultralytics) links detections into tracks, which every rule needs for direction, speed and dwell time.
- OpenCV SIFT + RANSAC estimates one homography per clip from stationary features against a bundled reference frame.
- Fine-tuning used annotated frames from the four organizer-provided videos only. No public dataset was added.
Why this design
- Four manually labelled clips give us a small dev set for tuning, while explicit rules use the scene layout directly.
- The hidden set uses the same camera and angle, so a hand-drawn map of lanes, stop lines, crossings and the island transfers, once alignment absorbs the small framing shifts we measured.
- Boundaries decide the score at IoU 0.7. Rules give exact start and end frames tied to the task's own conventions (for example red_light starts when the front crosses the stop line).
- One detector pass shares tracks across all implemented rules, reducing repeated inference.
Per-class logic
7 of 14 classes have a detector today. The others are listed with the approach we would try next. The harness only scores classes we predict or that occur, so we do not emit guesses.
| Class | Status | How it is decided |
|---|---|---|
| Collisionaccident | Not yet | Not detected yet. Candidate: box overlap plus abrupt stop of both tracks. |
| Near missnear_miss | Not yet | Not detected yet. Candidate: time-to-collision below a threshold plus sharp deceleration. |
| Red-light runningred_light | Rule | The estimated front edge of a vehicle crosses a stop line while the signal counts as red: a red head is detected, or no green head was seen in the last 25 processed frames. |
| Wrong-way drivingwrong_way | Not yet | Not detected yet. Candidate: track heading against the lane direction from scene.json. |
| Illegal U-turnillegal_u_turn | Not yet | Not detected yet. Candidate: heading change above 150° inside a no-U-turn zone. |
| Stopped vehiclestopped_vehicle | Not yet | Not detected yet. Candidate: stationary track for 10 s or more outside signal queues. |
| Pedestrian on roadwayjaywalking | Rule | Person ground point inside the carriageway polygon and outside every crossing, refuge island and kerb waiting zone. |
| Not yielding to a pedestrianfailure_to_yield | Rule | A tracked vehicle traverses a crossing polygon while a person is inside the same crossing; the event spans its traversal. |
| Illegal turnillegal_turn | Rule | A vehicle enters the junction, leaves it and then crosses the south-east crossing, a turn the markings prohibit from that approach. |
| Solid line crossingsolid_line_crossing | Rule | A box corner crosses a solid marking segment; the event ends when the vehicle is fully inside the target lane. |
| Stop-line violationstop_line | Rule | A vehicle rests within 30 px of a stop line during red without entering the junction. |
| Congestioncongestion | Rule | At least 75% of vehicles in a lane-direction group move slower than 0.6 box heights per second for 2 s; closes after 1 s clear. |
| Obstacle on roadroad_obstacle | Not yet | Not detected yet. Needs a detector beyond the 8 road-user classes. |
| Fire or smokefire_smoke | Not yet | Not detected yet. Needs a smoke/fire classifier. |
Scene map
Polygons and lines in normalised coordinates, drawn once on C3897 at 287 s and stored in scene.json: carriageway, lanes with travel direction, crossings, refuge island, kerb waiting zones, stop lines and solid markings.
