Robust Outlier Detection with Median Based Statistics

46 concepts34 papers1 proposal

When analyzing data, standard statistical tools like the sample mean ($\mu$) and standard deviation ($\sigma$) are the default choices for summarizing distributions. However, they possess a critical vulnerability: a single extreme outlier can pull the mean arbitrarily far, and inflate the standard deviation to infinity. Mathematically, the breakdown point—the proportion of incorrect observations an estimator can handle before producing an arbitrary result—of the mean and standard deviation is $0\%$.

To build systems that withstand real-world noise, sensor failures, or adversarial attacks, researchers increasingly replace these classical metrics with median-based statistics. The median has a breakdown point of $50\%$, meaning that more than half of the data points must be corrupted before the estimator fails. To replace the standard deviation, researchers utilize the Median Absolute Deviation (MAD), defined as:

$$\text{MAD} = \text{median}(|x_i - \text{median}(X)|)$$

By shifting from mean-centered to median-centered statistics, algorithms across machine learning, signal processing, and anomaly detection achieve a mathematical shield against extreme data contamination.


Robust Normalization and Scaling

Before data is fed into machine learning models, it is typically normalized to ensure features share a comparable scale. Standard $z$-score normalization subtracts the mean and divides by the standard deviation. But if a dataset contains volatile spikes or experimental artifacts, the standard deviation inflates dramatically. This compresses the normal, clean data into a tiny, indistinguishable fractional range, destroying the model's ability to learn subtle patterns.

Standard Scaling (Mean/StdDev):
[ Normal Data ] ------------ (Outlier) ------------> 
Result: Normal data gets compressed into a tiny cluster because StdDev is inflated.

Robust Scaling (Median/MAD or IQR):
[     Normal Data     ] ------------ (Outlier Ignored) ------------>
Result: Scale is determined solely by the core distribution; outliers remain isolated.

To preserve predictive signals in highly volatile environments, researchers swap classical scaling for robust alternatives using the median, MAD, or Interquartile Range (IQR).

In time-series forecasting, Wang et al. demonstrate that normalizing input windows with medians and IQRs prevents anomalous spikes from distorting the entire prediction scale during the subsequent denormalization process. This is particularly crucial for volatile financial data; Ma shows that while stable assets thrive under standard scaling, highly volatile assets like cryptocurrencies require robust median-based scaling to maintain predictive accuracy without losing price fluctuation nuances.

This principle is equally vital in high-throughput biology, where experimental noise is rampant:

  • Protein Microarrays: Zhu et al. utilize MAD instead of standard deviation for multi-parameter normalization, preventing exceptionally bright, erroneous spots from skewing the variance calculations of the entire array.
  • Microscopy Imaging: Lu et al. employ a modified $z$-score based on MAD to identify changes in protein localization, ensuring that noisy artifacts within a comparison group do not distort the feature set.
  • Network Traffic: Tang et al. apply median-based statistics to network flow features, ensuring that high-volume legitimate traffic does not obscure subtle, early-stage DDoS attack signatures.

Establishing Untainted Baselines for Anomaly Detection

Anomaly detection relies on defining a baseline of "normal" behavior and flagging deviations. However, if the historical or training data contains undetected anomalies, a mean-based baseline absorbs these errors, widening the threshold of normality and allowing subsequent anomalies to slip through unnoticed.

Because median-based thresholds remain stable in the presence of up to $50\%$ data contamination, they allow systems to establish clean baselines even within uncurated or actively failing environments.

Mean + 3*StdDev Threshold:
[ Normal Data ] -- (Historical Outlier) -- [ Expanded Threshold Boundary ]

Median + 3*MAD Threshold:
[ Normal Data ] [ Stable Threshold Boundary ] -- (Historical Outlier Ignored) --

In industrial IoT and fleet monitoring, Hendrickx et al. calculate the median distance between an asset and its fleet to establish a baseline. This prevents a single catastrophic machine failure from masking more subtle anomalies developing elsewhere in the fleet. Similarly, when monitoring environmental changes like floods via satellite imagery, Li et al. use the historical median of a time series as a reference baseline to filter out transient outliers like moving vessels or temporary surface changes.

This resilience is leveraged across several specialized anomaly detection frameworks:

  • Multi-Armed Bandits: The Robust Outlier Arm Identification (ROAI) framework developed by Zhu et al. defines outlier arms using the median and MAD, ensuring the algorithm remains sample-efficient and stable even when half the rewards are extreme values.
  • Microservice Troubleshooting: In root-cause analysis, Ha et al. show that using median and IQR deviation scoring shields the system against baseline contamination caused by delayed failure alerts.
  • Causal Graphs: For multivariate time series, Febrinanto et al. implement MAD-based anomaly scoring to prevent extreme training outliers from dulling the sensitivity of graph neural network forecasts.
  • Industrial Benchmarks: To handle sensor noise in complex objects, Artola et al. utilize a quantile-based score rather than relying on the single most extreme outlier, ensuring detection triggers on consistent regional signals rather than isolated noise.
  • Biological Classifiers: Krawczyk integrates local median comparisons to filter out corrupted data points in highly imbalanced enzyme metabolism datasets.

Robust Aggregation and Rejection Filters

Beyond setting thresholds, median statistics act as an outright rejection filter during data aggregation. When combining multiple overlapping or conflicting sources of information (such as spatial patches, model gradients, or sensor ranges), taking a weighted average blurs the errors into the final output. Taking the median, however, completely selects a valid data point from the majority distribution, discarding the outliers entirely.

Averaging Aggregation:
Source A (1.0) + Source B (1.2) + Source C (99.0) -> Average = 33.7 (Blurred Error)

Median Aggregation:
Median(1.0, 1.2, 99.0) -> Median = 1.2 (Outlier Completely Rejected)

In computer vision and image restoration, He et al. demonstrate that constant-time weighted median filtering preserves sharp depth boundaries in stereo matching. Because it selects the median value within a neighborhood rather than a weighted average, it avoids blurring erroneous data points across depth edges.

For geometric localization tasks, this property prevents signal reflections from corrupting coordinates:

  • Graph Realization: When stitching together sparse, noisy local patches to determine 3D coordinates, Singer et al. use the median to aggregate overlapping distance estimates, preventing poorly reconstructed local regions from corrupting the global structure.
  • Wireless Sensing: Park et al. utilize median-based statistical filters to mitigate non-line-of-sight signal outliers, preventing bounced, delayed measurements from biasing final position estimates.
  • Traffic Data: Qiu et al. implement histogram-based peak detection (which isolates the mode/median region of a frequency distribution) to estimate physical vehicle dimensions while ignoring sparse sensor noise.

This hard-rejection capability makes median aggregation highly effective for cleaning poisoned datasets and managing unlabeled data mixtures. Pulastya uses MAD to identify and filter out outliers within the latent representations of a Variational Autoencoder, systematically purging mislabeled samples from heavily poisoned training sets.

Finally, in out-of-distribution (OOD) detection, Falahati et al. demonstrate that the element-wise median of model gradients serves as a robust statistical anchor. Because the median maintains its high breakdown point, it reliably isolates the true in-distribution gradient direction even when the unlabeled data mixture is contaminated with up to $50\%$ OOD samples.

Key Foundational Work

Detection and removal of switching noise in push-to-talk and voice operated exchange communications systems (2007) — contributed 2 concept elements to this direction.
ProCAT: a data analysis approach for protein microarrays (2006) — contributed 1 concept elements to this direction.
Model-based analysis of two-color arrays (MA2C) (2007) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_median_based_outlier_detection_a9e9e6df,
  title = {median-based outlier detection},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/median-based-outlier-detection/rdr_a9e9e6dfe4704362a7247802487bf3a1},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 1, frozen text):

@misc{lacuna_median_based_outlier_detection_a9e9e6df_v1,
  title = {median-based outlier detection},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/median-based-outlier-detection/rdr_a9e9e6dfe4704362a7247802487bf3a1/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-20},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake