DeepMoM: Robust Deep Learning With Median-of-Means

Shih-Ting Huang, Johannes LedererJ. Comput. Graph. Stat 2021

Abstract

Data used in deep learning is notoriously problematic. For example, data are usually combined from diverse sources, rarely cleaned and vetted thoroughly, and sometimes corrupted on purpose. Intentional corruption that targets the weak spots of algorithms has been studied extensively under the label of "adversarial attacks." In contrast, the arguably much more common case of corruption that reflects the limited quality of data has been studied much less. Such "random" corruptions are due to measurement errors, unreliable sources, convenience sampling, and so forth. These kinds of corruption are common in deep learning, because data are rarely collected according to strict protocols -- in strong contrast to the formalized data collection in some parts of classical statistics. This paper concerns such corruption. We introduce an approach motivated by very recent insights into median-of-means and Le Cam's principle, we show that the approach can be readily implemented, and we demonstrate that it performs very well in practice. In conclusion, we believe that our approach is a very promising alternative to standard parameter training based on least-squares and cross-entropy loss.

TL;DR

DeepMoM introduces a robust training framework for neural networks that replaces standard loss functions with a "Median-of-Means" (MoM) approach. By partitioning data into blocks and focusing on the median loss across those blocks, the algorithm effectively ignores "random" corruptions—like sensor errors or outliers—without sacrificing performance on clean data.

What Problem Does This Paper Address?

Deep learning models are notoriously sensitive to "bad" data. While a lot of research focuses on adversarial attacks (intentional, malicious attempts to break a model), the authors argue that random corruption is a much more common problem in the real world. This includes measurement errors, unreliable data sources, and heavy-tailed noise (outliers that are far from the average).

Standard training methods use loss functions like Mean Squared Error (MSE) or Cross-Entropy, which average the error across all samples. The problem? A single massive outlier can "pull" the average so far that the model starts prioritizing the noise over the actual signal. Existing fixes, like Huber loss, help but often fail to use the "good" data as efficiently as they could.

Methods

The authors propose DeepMoM, which integrates the Median-of-Means principle into deep learning via a procedure inspired by the statistician Lucien Le Cam.

The core algorithm works in three steps:

  1. Partition: Split the data (or a mini-batch) into $b$ separate blocks.
  2. Calculate: For each block, calculate the mean loss increment between two different sets of model parameters.
  3. Median Update: Instead of updating based on the global average, the algorithm identifies the block that represents the median of these means and uses that specific block to update the parameters.

Mathematically, this is framed as a min-max problem: the algorithm tries to find parameters that minimize the maximum possible "robust" loss. The authors provide a stochastic gradient-based algorithm that makes this computationally feasible for deep neural networks, requiring only two gradient updates per step.

Datasets

The paper evaluates DeepMoM across three distinct scenarios:

  • TCGA (The Cancer Genome Atlas): A real-world dataset of microRNA data used to classify seven different cancer types. This data is known to be "messy," with some parts following a normal distribution and others exhibiting heavy tails.
  • Synthetic Regression Data: Generated Gaussian inputs with three types of corruption: "outlier" outputs (heavy but bounded), "everywhere" noise (Student’s t-distribution), and corrupted inputs (adding Gaussian noise to the features).
  • Spiral Dataset: A synthetic 2D classification task with five classes, used to test how the model handles shuffled (wrong) labels and noisy inputs.
Table 1: Overview of the TCGA dataset used for evaluation, showing the distribution of samples across different cancer types.

Key Insights and Ideas

  • The Power of the Median: The "aha moment" here is that by taking the median of block means, you naturally "filter out" blocks that contain heavy outliers. As long as more than half of your blocks are relatively clean, the median will stay focused on the informative data.
  • A Generalization of Standard Learning: The authors show that if you set the number of blocks ($b$) to 1, DeepMoM becomes identical to standard MSE or Cross-Entropy training. This makes it a flexible generalization rather than a completely alien approach.
  • Efficiency vs. Robustness: Usually, robust estimators are less efficient (they need more data to reach the same accuracy on clean sets). DeepMoM manages to stay competitive with standard methods on perfect data while vastly outperforming them as soon as noise is introduced.

Key Results

The empirical results show a significant "robustness gap":

  • Real-world Cancer Data: DeepMoM achieved 91.49% accuracy on the TCGA dataset, while standard Soft-max Cross Entropy (SCE) trailed significantly at 78.12%.
Table 2: Comparison of classification accuracy on TCGA data, highlighting the performance advantage of the MoM approach.
  • Regression with Outliers: In a scenario with 25% corrupted samples, DeepMoM’s scaled prediction error was 2.47, compared to a massive 121.58 for standard squared error.
  • Label Noise: On the spiral classification task with 25% shuffled labels, DeepMoM maintained 85.6% accuracy, whereas the standard SCE approach dropped to 73.2%.

Limitations and Future Work

  • Architecture Scope: The paper focuses primarily on feed-forward neural networks with ReLU activations. While the authors suggest the principle should work for Convolutional Neural Networks (CNNs) or Transformers, they haven't demonstrated it in this specific paper.
  • Hyperparameter Tuning: The number of blocks ($b$) is a critical hyperparameter. In the paper, it was chosen via 10-fold cross-validation, which adds computational overhead.
  • Adversarial Context: The authors explicitly state they did not compare against adversarial defense methods because their focus is on "random" rather than "mean-spirited" corruption. Integrating MoM into adversarial training frameworks remains an open area for research.

Summary updated

BibTeX
@article{huang2021deepmom,
  author = {Shih-Ting Huang and Johannes Lederer},
  title = {{DeepMoM: Robust Deep Learning With Median-of-Means}},
  journal = {J. Comput. Graph. Stat.},
  year = {2021},
  url = {https://openreview.net/forum?id=3grLoPeeAa},
}
Figure