Skip to content
RoadGuard AI
Live Demo

Fixed-camera traffic intelligence

Traffic event detection& accident anticipation

RoadGuard AI reads a single fixed CCTV camera, names the dangerous things that happen on the road, places each one on a timeline — and estimates how likely a collision is in the next 5 seconds, before it starts.

14
event classes
5 s
risk horizon
Offline
no hosted AI at evaluation
Four-way intersection, midday
00:00.0
Risk3%Nominal
Risk · 5 s horizonReconstruction · demo data

The preview above is the real interface running on a sample clip. Because no footage is published yet, the frame is a reconstruction drawn from exported tracks over the calibrated scene.

14

Event classes

The full official taxonomy, from collisions to fire and smoke.

5 s

Anticipation horizon

Risk answers one question: will an accident start within 5 seconds?

Offline

Evaluation mode

Inference runs locally. No hosted AI service is required to score.

Fixed

Camera model

Lanes, stop lines and crossings are calibrated once, then reused.

The problem

One video in, a labelled timeline out

A traffic camera produces hours of footage that nobody watches. The task is to turn that footage into a short list of moments worth someone's attention — and to say how dangerous each moment was.

Input

An MP4 from one fixed road camera. Nothing else — no maps, no sensors, no second view.

sample_01.mp4 · 1920 × 1080 · 25 fps

Output

Time-segment events, each with a start, an end and one of 14 class labels.

  • 00:12.4 → 00:18.9Collision
  • 00:40.0 → 00:43.5Red-light running
  • 01:12.2 → 01:17.4Wrong-way driving

Wire format

[
  [12.4, 18.9, "accident"],
  [40.0, 43.5, "red_light"],
  [72.2, 77.4, "wrong_way"]
]

The second task

At every frame, one number

Alongside the event list, the system reports a risk score between 0 and 1: the probability that an accident starts within the next 5 seconds.

That word — starts — is the whole difficulty. The score has to be built from what is visible now: closing speeds, converging paths, whether anyone is braking. It cannot look ahead, so it has to infer.

0.00–0.25
Nominal — no conflict developing.
0.25–0.50
Elevated — paths converging.
0.50–1.00
Alarm — an operator should be looking at this camera.
0.00.51.01.5s warningimpact 00:18.0time

Illustration of the intended behaviour, not measured output. A useful curve has to cross the alarm line before the red band, inside the 5-second horizon — a curve that spikes after impact has detected a crash, not anticipated one.

Approach

How a clip becomes a timeline

Four stages are shared by everything: decode, detect, track. After tracking the pipeline forks — one branch asks what rule was broken, the other asks how close this came to a collision.

  1. 01

    Video

    One MP4 from the fixed camera.

  2. 02

    Frame sampling

    Decode at a fixed rate, keep timestamps exact.

  3. 03

    Object detection

    Cars, trucks, buses, two-wheelers, pedestrians.

  4. 04

    Multi-object tracking

    Persistent IDs across frames.

tracked road users feed both branches

Branch A — rules and geometry

Produces the event segments that get submitted.

  1. A·1

    Trajectory history

    Position, speed and heading over time, per ID.

  2. A·2

    Scene geometry

    Lanes, stop lines, crossings, signal region.

  3. A·3

    Rules and learned models

    Geometry decides violations; models decide conflicts.

  4. A·4

    Temporal post-processing

    Merge fragments, drop noise, fix boundaries.

  5. A·5

    Event segments

    start, end, label — the submitted output.

Branch B — accident anticipation

Produces one causal risk score per sampled frame.

  1. B·1

    Relative motion

    Every pair of nearby road users.

  2. B·2

    Path intersection

    Do the projected paths cross?

  3. B·3

    Time to collision

    How long until they would meet.

  4. B·4

    Conflict features

    Braking, heading change, occlusion, density.

  5. B·5

    Risk score 0–1

    Probability of an accident within 5 seconds.

Components

What each part is responsible for

Six pieces, each with one job. The split matters because it decides where a failure gets fixed: a missed pedestrian is a detector problem, a wrong-way false positive is usually a calibration problem.

Detection

Find every road user in the frame, including the ones that are small, partly hidden or barely lit.

  • Six classes: car, truck, bus, motorcycle, bicycle, pedestrian
  • Resolution is chosen by the smallest pedestrian that must survive
  • Night and dusk clips set the recall floor

Tracking

Turn per-frame boxes into road users with a history, which is what every rule actually reads.

  • One persistent ID per road user
  • Short occlusions are bridged rather than starting a new ID
  • Trajectories carry position, speed and heading

Scene geometry

Calibrate the road once, then reuse it. A fixed camera makes this the cheapest accuracy available.

  • Road and lane polygons, with an expected direction per lane
  • Stop lines, crosswalks, the intersection box, solid markings
  • A region the signal colour is read from

Rule engine

Where the traffic code gives a crisp definition, encode the definition instead of learning it.

  • Deterministic, inspectable and cheap to run
  • Each rule states the geometry it depends on
  • A failing rule points at a calibration error, not a mystery

Learned interaction models

Some classes have no clean geometric definition. Those are learned from interaction features.

  • Collision and near miss, from relative motion between tracks
  • Fire, smoke and road obstacles, from appearance
  • Used where rules were tried and did not generalise

Temporal processing

The difference between a noisy per-frame signal and a segment an evaluator can score.

  • Fragments of one class merged across short gaps
  • Sub-threshold blips dropped
  • No overlapping segments within a single class

Rules, written out

Where the traffic code is precise, the code is too. These are the conditions, not paraphrases of them.

  • Wrong-way driving

    Track heading stays opposite the lane's calibrated direction for a sustained window.

  • Stopped vehicle

    Displacement under a small threshold for at least 10 seconds, inside the road polygon.

  • Pedestrian on roadway

    Pedestrian centroid inside the road polygon and outside every crosswalk polygon.

  • Red-light running

    Stop-line crossing timestamp falls inside a window where the signal region reads red.

  • Solid-line crossing

    Track polyline intersects a calibrated solid line, with hysteresis so jitter does not fire.

  • Illegal U-turn

    Heading rotates through roughly 180 degrees inside a region flagged no-U-turn.

Taxonomy

The 14 classes, and how each is decided

Some of these are geometry problems with exact answers. Others are judgement calls that a rule cannot express. Grouping them by category is how the work was divided.

14 classes shown
  • Collision

    accident

    Two or more road users make contact.

    How it is decided

    Learned interaction model over tracked pairs: sudden velocity loss, box overlap, and post-impact scatter.

    CriticalSafety
  • Fire or smoke

    fire_smoke

    Visible fire or smoke in the scene.

    How it is decided

    Appearance classifier on candidate regions, gated by texture motion so exhaust plumes do not count.

    CriticalRoad condition
  • Near miss

    near_miss

    A collision was narrowly avoided.

    How it is decided

    Time-to-collision falls below threshold while both tracks survive and never overlap.

    HighSafety
  • Red-light running

    red_light

    A vehicle crosses the stop line while the signal is red.

    How it is decided

    Stop-line crossing timestamp compared against signal state read from the traffic-light region.

    HighTraffic rule
  • Wrong-way driving

    wrong_way

    A vehicle travels against the lane's expected direction.

    How it is decided

    Track heading stays opposite to the calibrated lane-direction vector for a sustained window.

    HighTraffic rule
  • Illegal U-turn

    illegal_u_turn

    A vehicle reverses direction where the manoeuvre is forbidden.

    How it is decided

    Trajectory heading rotates through roughly 180 degrees inside a region flagged no-U-turn.

    HighTraffic rule
  • Illegal turn

    illegal_turn

    A vehicle turns where that movement is not permitted.

    How it is decided

    Entry and exit lanes of the track are checked against the intersection's permitted-movement table.

    HighTraffic rule
  • Solid-line crossing

    solid_line_crossing

    A vehicle crosses a solid lane marking.

    How it is decided

    Track polyline intersects a calibrated solid-line segment, with a hysteresis margin for jitter.

    HighTraffic rule
  • Stop-line violation

    stop_line

    A vehicle fails to stop behind the stop line when required.

    How it is decided

    No standstill frame is found behind the stop line before the track passes it.

    HighTraffic rule
  • Pedestrian on roadway

    jaywalking

    A pedestrian is in the carriageway away from a crossing.

    How it is decided

    Pedestrian track centroid falls inside the road polygon and outside every crosswalk polygon.

    HighPedestrian
  • Not yielding to pedestrian

    failure_to_yield

    A vehicle does not give way to a pedestrian who has priority.

    How it is decided

    Vehicle enters the crosswalk while a pedestrian occupies it, without decelerating.

    HighPedestrian
  • Stopped vehicle

    stopped_vehicle

    A vehicle stands still in the carriageway.

    How it is decided

    Track displacement stays under a small threshold for at least 10 seconds inside the road polygon.

    ModerateRoad condition
  • Congestion

    congestion

    Traffic slows to a crawl and density rises.

    How it is decided

    Lane occupancy above threshold together with median speed below threshold, smoothed over a window.

    ModerateRoad condition
  • Obstacle on road

    road_obstacle

    Debris or an object blocks part of the carriageway.

    How it is decided

    A static foreground region persists inside the road polygon without matching any road-user class.

    ModerateRoad condition

Sample results

Four clips, all visualised

Each clip has a full result page: player, event timeline, risk curve and event log, all on one clock.

Open sample results

Live demo

Run it on your own clip

Upload an MP4 up to 100 MB and 2 minutes and you get the same interface: events on a timeline, a risk curve, and a player that follows both.