Before raw sensor or log data ever reaches a machine-learning model, it usually
passes through a validation gate. One of the simplest and most effective checks
is the IQR (interquartile range) fence: compute the 25th and 75th
percentiles (Q1, Q3) of recent values, then flag anything outside
[Q1 − k·IQR, Q3 + k·IQR] as a likely sensor glitch, transmission
error, or genuine anomaly worth a second look.
Batch ETL jobs can catch a systemic sensor drift by comparing whole batches against history, but they add latency; streaming pipelines validate record-by-record with low latency but can be fooled by a short burst of correlated bad data — which is why many production systems run both.
A stream of sensor records flows down a track toward an IQR-based validation gate; the gate's fence is set from recent data statistics, and anything outside it gets diverted into a quarantine bin instead of reaching the model.
Each record's height encodes its sensor value. The green slab marks the current valid band — [Q1 − k·IQR, Q3 + k·IQR] — recomputed either continuously (streaming) or once per batch, showing the real trade-off ETL engineers face.
Adjust the IQR fence multiplier and outlier injection rate, switch between streaming and batch recalibration, and watch how the fence position and rejection rate respond in real time.
The IQR fence (typically k = 1.5) is one of the oldest robust outlier rules, dating to John Tukey's exploratory data analysis work — and it is still a first line of defence in modern ML feature pipelines.