Back to feed
News Story
APriority76
The Gradient
1 sources

Why Doesn't My Model Work?

Original

This article addresses a common issue in machine learning where models that perform well in training fail in real-world applications. It acknowledges the prevalence of this problem and likely offers insights or solutions.

SynthePulse Insight · AI deep reading

Why Models Fail: A Deep Dive into Data Traps and Leakage

Version 1 · 1 source

A model that performs excellently on a test set can fail miserably when deployed in the real world. This article explores the root causes of data misdirection and information leakage, revealing common mechanisms by which models appear good but are actually useless, and discusses preventive measures.

  • Hidden variables (e.g., body orientation in COVID CT scans) cause models to learn spurious correlations, predicting posture rather than disease.
  • Spurious correlations (e.g., tank recognition relying on weather rather than the target) are common in benchmark datasets, and deep models are particularly prone to capturing them.
  • Data leakage (e.g., preprocessing before splitting the test set) inflates test performance, overestimating the model's true generalization ability.
  • Human annotation errors (e.g., ~2% mislabeling rate in MNIST, CIFAR) are amplified in accuracy competitions, potentially masking real improvements.
  • Sensitivity to adversarial attacks is a direct consequence of models relying on spurious background correlations; adversarial training is effective but costly.
  • Tools like the REFORMS checklist have been proposed to systematically prevent common errors in machine learning.
Open section navigationDeceived by Data: Hidden Variables and Spurious Correlations

Deceived by Data: Hidden Variables and Spurious Correlations

Misleading data is the primary root cause of model failure. In the frenzy of COVID prediction models, a review by Roberts et al. found that multiple public datasets contained overlapping records, incorrect labels, and hidden variables, allowing models to accurately predict class labels without learning any useful knowledge. For example, in many COVID chest imaging datasets, body orientation became a hidden variable: sick patients were more likely to be scanned lying down, while healthy individuals were often standing. The model learned to predict posture rather than disease, rendering many COVID models ineffective in real-world scenarios.

Spurious correlations are more insidious. A classic example is the 'tank problem': the US military attempted to train a neural network to recognize tanks, but the model actually recognized the weather—all tank photos were taken at the same time. Similarly, many computer vision benchmark datasets contain background pixel groups spuriously correlated with class labels. Deep models, due to their powerful pattern-fitting abilities, tend to capture these spurious patterns, thereby reducing generalization.

Labeling Bias and Data Leakage

Data labeling also harbors risks. Image classification benchmarks like MNIST and CIFAR typically have a mislabeling rate of about 2%. When models compete for thousandths of a percent in accuracy, this noise can mask real improvements. For subjective tasks like sentiment classification, the risk of overfitting to specific annotators is higher.

Data leakage is another common pitfall. The most typical error is performing data-dependent preprocessing operations (e.g., centering, scaling, feature selection, or data augmentation) on the entire dataset before splitting into training and test sets. These operations implicitly introduce test set information into the training pipeline, leading to overestimated test performance. Even simple centering and scaling, if done before splitting, give the model an undue information advantage.

Consequences and Countermeasures

Models that rely on spurious correlations are sensitive to adversarial attacks: small perturbations to background pixels can flip predictions. Adversarial training can mitigate this issue but is computationally expensive. A simpler approach is to use explainable AI techniques (e.g., saliency maps) to inspect the model's decision basis—if the model focuses on background regions, generalization is likely poor.

To systematically prevent such errors, tools like the REFORMS checklist have been introduced, aiming to help researchers avoid common pitfalls in machine learning-based scientific practice.

Credibility boundary

This article is based on a review by a researcher with 20 years of machine learning experience published on The Gradient. It cites several published studies (e.g., Roberts et al.'s review of COVID models, cases from the AIAAIC repository) as support, but some specific examples (e.g., the tank problem) are long-standing anecdotes whose original sources are not explicitly provided in this article.

Insight takeaway

High accuracy on a test set does not equate to real-world effectiveness. Hidden variables, spurious correlations, labeling bias, and data leakage are the four root causes of models that appear good but are actually useless. By inspecting the model's decision basis, strictly separating preprocessing from the test set, and adopting systematic checklists, these risks can be significantly reduced.

Primary report

The Gradient

Primary source