DEV Community

Multigrid
Multigrid

Posted on • Originally published at multigrid.ai

Fleet Telematics Anomaly Detection

A vehicle producing unusual telemetry is usually doing something ordinary in unusual conditions. Separating a genuine mechanical or behavioural anomaly from a hill, a cold morning or a different driver is most of the work, and it is a normalisation problem before it is a detection problem.

What a telematics stream contains

A telematics unit reads two quite different sources. The vehicle bus carries engineering signals published by the powertrain and body controllers — engine speed, coolant temperature, fuel rate, throttle position, brake status, odometer, diagnostic trouble codes. On heavy vehicles these arrive as SAE J1939 parameter groups; on light vehicles they are commonly read through OBD-II service modes. The second source is the unit’s own sensors: GNSS position and speed, and a three-axis accelerometer sampled far faster than the bus signals.

Those two sources have very different characters and mixing them carelessly causes trouble. Bus signals are event-driven and arrive at rates set by the publishing controller, so a “1 Hz” feed is often a resampled reconstruction rather than a measurement cadence. The accelerometer is genuinely high rate and is what detects harsh events. GNSS speed and bus speed disagree systematically, since wheel-derived speed depends on tyre circumference and drifts with tread wear — that difference is itself a useful signal, and treating it as an error is a missed opportunity.

Why fleet-wide thresholds fail

The instinct is to set a threshold: flag fuel consumption above some litres per hundred kilometres, or coolant temperature above some value. Every such threshold is dominated by factors that have nothing to do with vehicle health.

  • Load. A truck at gross weight uses far more fuel than the same truck empty. Without payload, consumption is uninterpretable.
  • Route and terrain. Urban stop-start and sustained motorway cruise produce different distributions of every signal. Gradient alone moves fuel rate by a large factor.
  • Ambient conditions. Cold starts, headwinds and air-conditioning load all shift the baseline seasonally, so a detector tuned in July alarms in January.
  • Driver. Acceleration and braking behaviour vary more between drivers than most mechanical faults do, and vehicles are frequently shared.
  • Vehicle age and specification. A mixed fleet has several models, engine variants and axle configurations that are not comparable to each other at all.

The consequence is that raw fleet-wide comparison produces alerts ranked by route difficulty. This is the same structural problem as scoring correlated channels independently, discussed in cross-stream anomaly detection: the interesting signal is a residual, and everything above is what has to be removed to expose it.

Conditioning out the duty cycle

Two approaches, and production systems usually use both.

Model the expected value from context

Fit a regression predicting the signal of interest from the context variables — payload, gradient, ambient temperature, speed profile, vehicle model — on healthy data, then monitor the residual. Fuel consumption predicted from mass, distance, elevation gain and average speed has a residual that is far closer to stationary than raw consumption, and a persistent positive residual on one vehicle is a meaningful indication rather than a route artefact.

Compare each vehicle against itself

A per-vehicle baseline sidesteps model and specification differences entirely: the question becomes whether this truck is behaving unlike the way this truck behaved last month on comparable trips. The strong version segments by operating regime first — a coolant temperature baseline conditioned on ambient temperature band and sustained load band — so that comparison is like for like. The weakness is that a fault present from the start is baked into the baseline and never detected, which is why peer comparison within the same model and duty cycle should run alongside it.

Both approaches need trips segmented sensibly. The natural unit is the ignition cycle, and within it a distinction between idle, low-speed and cruise segments, because statistics pooled across regimes are dominated by whichever regime happened to be longest that day.

Detectors that fit this data

  • Physical constraint checks first. Speed above a plausible maximum, coolant temperature below ambient, fuel level rising while driving, odometer decreasing. These are cheap, need no training, and catch data faults rather than vehicle faults — which is exactly what you want before anything statistical runs.
  • Cumulative sum on residuals. Mechanical degradation is gradual, and a CUSUM chart on a conditioned residual is specifically designed to detect a small persistent mean shift far sooner than a threshold on the value does. For slow faults it is usually a better fit than any learned detector.
  • Event detection on the accelerometer. Harsh braking, acceleration, cornering and impact are detected from the high-rate channel with thresholds on magnitude and duration. The thresholds are genuinely arbitrary and must be calibrated per vehicle class, since the same deceleration feels different in a van and a laden truck. Publishing them as absolute values across a mixed fleet produces unfair driver scores.
  • Sequence models on diagnostic codes. Trouble codes are discrete events, and their co-occurrence patterns carry more information than any individual code. A code that normally appears alone but now appears with two others is a change worth surfacing.

Practical constraints

Connectivity is intermittent by definition. Vehicles enter tunnels, cross borders, park in basements. The unit must buffer and forward, which means late and out-of-order arrival is normal rather than exceptional, and any detector operating on a fixed processing window has to tolerate a trip arriving hours after it ended — the same watermark problem handled in streaming sensor data into a model.

Data volume decisions follow from the same constraint. Sending raw high-rate accelerometer data over cellular for an entire fleet is rarely justifiable, so units compute event summaries locally and upload full waveforms only around detected events. That is a specific instance of the edge and cloud preprocessing split, and the per-vehicle cost follows the message-count arithmetic in ingest cost.

Finally, telematics data is about identifiable people as much as about vehicles. Location traces are among the most re-identifiable data that exists, and driver behaviour scoring derived from them has employment consequences. In many jurisdictions that carries specific legal obligations around notice, purpose limitation, retention and consultation, and a scoring system that affects someone’s pay or job is a decision for the organisation and its legal advisers, not a modelling parameter. Build the retention policy and the aggregation boundaries in from the start, because retrofitting them to a system already relied on is far harder.

Related

Top comments (0)