Skip to main content
QUICK REVIEW

[Paper Review] Generalizability of Machine Learning Models: Quantitative Evaluation of Three Methodological Pitfalls

Farhad Maleki, Katie Ovens|arXiv (Cornell University)|Feb 1, 2022
AI in cancer detectionComputer Science7 citations
TL;DR

This paper identifies and quantitatively evaluates three critical methodological pitfalls undermining machine learning model generalizability in healthcare: data leakage from improper data splitting (e.g., oversampling and feature selection before split), subject-level data leakage via random subject distribution across splits, and inappropriate performance metrics or baselines. The study demonstrates that these errors can inflate F1 scores by up to 71.2% and lead to models that fail catastrophically on new data, highlighting the urgent need for methodological rigor in model development and evaluation.

ABSTRACT

Purpose: Despite the potential of machine learning models, the lack of generalizability has hindered their widespread adoption in clinical practice. We investigate three methodological pitfalls: (1) violation of independence assumption, (2) model evaluation with an inappropriate performance indicator or baseline for comparison, and (3) batch effect. Materials and Methods: Using several retrospective datasets, we implement machine learning models with and without the pitfalls to quantitatively illustrate these pitfalls' effect on model generalizability. Results: Violation of independence assumption, more specifically, applying oversampling, feature selection, and data augmentation before splitting data into train, validation, and test sets, respectively, led to misleading and superficial gains in F1 scores of 71.2% in predicting local recurrence and 5.0% in predicting 3-year overall survival in head and neck cancer as well as 46.0% in distinguishing histopathological patterns in lung cancer. Further, randomly distributing data points for a subject across training, validation, and test sets led to a 21.8% superficial increase in F1 score. Also, we showed the importance of the choice of performance measures and baseline for comparison. In the presence of batch effect, a model built for pneumonia detection led to F1 score of 98.7%. However, when the same model was applied to a new dataset of normal patients, it only correctly classified 3.86% of the samples. Conclusions: These methodological pitfalls cannot be captured using internal model evaluation, and the inaccurate predictions made by such models may lead to wrong conclusions and interpretations. Therefore, understanding and avoiding these pitfalls is necessary for developing generalizable models.

Motivation & Objective

  • To investigate how common methodological errors compromise the generalizability of machine learning models in clinical settings.
  • To quantify the impact of data leakage due to improper data splitting, including oversampling, feature selection, and data augmentation before train/validate/test splits.
  • To evaluate the effect of subject-level data leakage, where data points from the same subject are randomly distributed across training, validation, and test sets.
  • To assess the influence of performance metric choice and baseline comparison on model evaluation outcomes.
  • To demonstrate the real-world consequences of batch effects on model performance using pneumonia detection as a case study.

Proposed method

  • The authors use retrospective clinical datasets from head and neck cancer, lung cancer, and pneumonia imaging to train and evaluate machine learning models.
  • They implement models both with and without the three methodological pitfalls to isolate and quantify their effects on model performance.
  • For data leakage, they apply oversampling, feature selection, and data augmentation before splitting the data into training, validation, and test sets.
  • For subject-level leakage, they randomly distribute data points from the same patient across different sets, violating the independence assumption.
  • They evaluate models using standard metrics like F1 score and compare performance against appropriate baselines to assess the impact of metric choice.
  • They test model robustness by applying a pneumonia detection model trained on one dataset to a new, independent dataset of normal patients to assess batch effect impact.

Experimental results

Research questions

  • RQ1To what extent does applying data preprocessing techniques such as oversampling and feature selection before data splitting inflate model performance metrics?
  • RQ2How does randomly distributing data points from the same subject across training, validation, and test sets affect model generalizability and F1 score?
  • RQ3How do the choice of performance metric and baseline for comparison influence the perceived effectiveness of a machine learning model?
  • RQ4To what extent does batch effect compromise model generalizability when applied to new, independent datasets?
  • RQ5Can internal model evaluation alone detect the presence of these methodological pitfalls?

Key findings

  • Applying oversampling, feature selection, and data augmentation before splitting data led to a 71.2% superficial increase in F1 score for predicting local recurrence in head and neck cancer.
  • Randomly distributing data points from the same subject across splits caused a 21.8% artificial increase in F1 score, demonstrating significant data leakage.
  • For lung cancer histopathological pattern classification, data leakage resulted in a 46.0% inflated F1 score, indicating severe overestimation of model performance.
  • In the presence of batch effect, a pneumonia detection model achieved a 98.7% F1 score on its training dataset but only 3.86% accuracy on a new dataset of normal patients, showing catastrophic failure on out-of-distribution data.
  • The study confirms that these pitfalls cannot be detected through internal model evaluation alone, as performance appears strong despite poor generalizability.
  • The results emphasize that inappropriate performance metrics and baselines can mislead researchers into believing models are effective when they are not, especially in imbalanced or biased datasets.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.