Skip to Content
DocsUse CasesClassifying Driving Conditions

Classifying Driving Conditions

A truck averaging 40 km/h could be cruising steadily or crawling through stop-and-go traffic. Speed alone cannot tell the difference — and the distinction drives fuel forecasts, arrival estimates, and driver coaching.

This is real GPS data from a heavy commercial vehicle on NH30 in Uttar Pradesh — a 4-hour run crossing highway stretches and congested zones approaching Budaun. A winkComposer flow extracts three perspectives from the raw speed signal and fuses them into a driving condition classification: Highway, City, or Jam.

Drag the slider and watch the route paint itself green, amber, or red. Hover over the labelled points on the map to see Street View photos of what the truck actually encountered.

Loading driving mode demo...

What You’re Seeing

The map shows the truck heading northwest from east of Dataganj through Shahjahanpur toward Budaun. Each segment is coloured by classified driving condition — green for highway, amber for city traffic, red for jam. The white dot tracks the truck’s position and coordinates update as you scrub.

The chart shows the three signals the pipeline processes. Raw speed (grey) is noisy. The sg5-smoothed line (cyan) reveals the speed regime — steady near 50 km/h on the highway, dropping into a ragged 20–30 zone approaching Budaun. The choppiness trace (purple, right axis) is the missing dimension: calm on the highway, erupting in the congested zone.

The coloured bands behind the chart mark the classified condition. Notice the transition — where smoothed speed still reads 40–45 km/h but choppiness is already rising. The classifier catches congestion before the speed drop makes it obvious.

The assessment card shows which evidence sources drive the current classification and how persistent they are — the same question fleet managers ask: is this real congestion or a momentary slowdown?

Three labelled points on the map mark locations verified against Google Street View — hover over any label to see the actual road conditions. Watch for the brief amber/red flash around minute 57 on an otherwise green highway: that is a flyover construction zone where jersey barriers force the truck from 55 to 19 km/h. The classifier flags it and recovers within 2 minutes. Now scrub to minute 218 near Budaun — the truck crawls at 5–9 km/h through a narrow town road choked with parked vehicles. Same three signals, same appraise node, but the construction zone is a transient disruption while the town congestion is structural. The conviction builds and stays high.


How It Works

One flow, four building blocks. Each kernel node applies a small window of weights to the speed stream — a lightweight convolution. Swap the weights and the same mechanism smooths, differentiates, or detects momentum. Appraise fuses the three outputs into a classification:

smoothersg5 smooths speed, preserving sharp transitions→ smoothSpeed: what regime is the truck in?choppymomentum5 detects the acceleration–braking seesaw→ choppiness: calm on highway, violent in trafficaccelsgRate5 captures rate of speed change→ speedRate: how sharply is speed changing?drivingConditionfuses 3 evidence sources into→ Highway / City / Jam + conviction × persistence

sg5 (Savitzky-Golay, 5-point) smooths the speed while preserving sharp transitions. Its output answers “what regime is the truck in?” — the trend line that separates highway cruising from sluggish urban driving. This is the dominant signal: when smoothed speed drops below 42 km/h, the speed-regime neuron fires.

momentum5 computes a weighted recent direction — a seesaw that is calm when speed is steady and violent when the truck is accelerating and braking in quick succession. Steady cruising at 45 km/h and stop-and-go averaging 45 km/h produce the same smoothed speed but very different momentum amplitudes. Only oscillations outside a calm band of ±3 contribute — highway-level variation produces zero deviation.

sgRate5 (Savitzky-Golay first derivative) captures the rate of speed change. It supplements choppiness with directional information — is the truck accelerating or braking? Only changes exceeding ±2 register.

The condition assessment fuses all three into a conviction score using a two-layer spiking neural network. Each source accumulates evidence independently:

  • Speed regime — smoothed speed below 42 km/h (highway floor); dominant signal, heavily weighted
  • Driving choppiness — momentum amplitude outside the calm band; detects stop-and-go that smoothing hides
  • Speed changes — acceleration magnitude beyond steady-state; supplements choppiness with direction

The system learns the highway baseline automatically during the first ~28 samples. After calibration, the combined conviction determines the driving condition — Highway (low), City (moderate), or Jam (high). The half-life of 4 minutes keeps the classifier responsive: it detects a regime change within 2–3 samples and recovers just as fast when conditions improve.


Where This Pattern Fits

DomainWhat it classifiesWhy speed alone fails
Fleet fuel managementDriving regime per segmentSame average speed, vastly different consumption
Insurance telematicsDriving smoothness scoringSmooth highway and erratic city look identical after averaging
Bus route punctualityFree-flow vs stop-and-go segmentsA bus averaging 30 km/h in free-flow keeps schedule; in stop-and-go it does not
Delivery ETACongestion detection for corridor estimatesArrival time in congested corridors needs choppiness, not just speed
Driver coachingHarsh driving vs traffic-forced brakingFrequent braking in a jam is unavoidable, not a coaching signal

References

  • A. Savitzky and M. J. E. Golay, “Smoothing and Differentiation of Data by Simplified Least Squares Procedures,” Analytical Chemistry, 36(8), pp. 1627–1639, 1964. doi:10.1021/ac60214a047 
  • A. V. Oppenheim and R. W. Schafer, Discrete-Time Signal Processing, 3rd ed., Pearson, 2010.
  • Dataset: Anonymised GPS telemetry from a heavy commercial vehicle on NH30, Uttar Pradesh, India. 259 readings at 60-second intervals, ~4 hours. Speed and coordinates only — no vehicle or operator identifiers.
  • Street View imagery: Ground-truth photographs on the interactive map are from Google Maps Street View , © 2026 Google. Used for editorial verification of classifier output at three locations along the route.

Next Steps

Last updated on