The Effect of Intrinsic Dataset Properties on Generalization: Unraveling Learning Differences Between Natural and Medical Images

Nicholas Konz, Maciej A. Mazurowski · DOI

Abstract

Neural networks often struggle to generalize on medical images compared to natural ones, even when datasets appear similarly complex. This study introduces label sharpness ($K_F$), a metric measuring the Lipschitz constant of the ground-truth labeling function, to explain this discrepancy. By analyzing eleven datasets across medical and natural domains, we demonstrate that medical images exhibit significantly higher label sharpness, leading to faster-rising generalization errors and increased adversarial vulnerability. We propose a new generalization scaling law incorporating both intrinsic dimensionality and label sharpness, providing a theoretical framework for understanding domain-specific learning behaviors.

Introduction

In computer vision, techniques developed for natural image benchmarks like ImageNet are frequently applied to specialized domains such as radiology. However, a "scaling discrepancy" exists: generalization error typically increases with a dataset's intrinsic dimension ($d_{data}$), but this rise is markedly steeper for medical images. Prior to this work, there was no theoretical explanation for why two datasets with comparable complexity would yield such divergent learning outcomes. This research investigates the relationship between images and their labels to bridge this gap.

Methodology: Beyond Image Complexity

The authors introduce two primary metrics to characterize datasets:

  1. Intrinsic Dimension ($d_{data}$): The minimum number of variables required to represent the data without significant information loss, estimated using standard estimators like MLE and TwoNN.
  2. Label Sharpness ($K_F$): The core contribution of this paper. It measures how "close" two images can be in pixel space while belonging to different classes. Formally, it is the Lipschitz constant of the ground-truth labeling function.
Comparison of intrinsic dimension ($d_{data}$) and label sharpness ($\hat{K}_F$) across medical (blue) and natural (orange) datasets.

The researchers derived a generalization scaling law that integrates $d_{data}$ and $K_F$, mathematically linking label sharpness to adversarial robustness. They also established that the raw dataset's dimensionality ($d_{data}$) acts as a theoretical upper bound for the representation intrinsic dimension ($d_{repr}$) learned by the network.

Experimental Setup

The study evaluated eleven datasets across three domains:

  • Medical: Seven datasets covering MRI (Brain, Breast, Prostate), CT (Brain), and X-ray (Chest, Musculoskeletal, Knee).
  • Natural: ImageNet, CIFAR10, SVHN, and MNIST.
  • Bridge: The ISIC skin lesion dataset.

These were evaluated across six CNN architectures: ResNet-18/34/50 and VGG-13/16/19.

Key Results and Insights

The Impact of Label Sharpness

A critical finding is that medical datasets possess significantly higher $K_F$ values (averaging around $2.5 \times 10^{-4}$) compared to natural ones (around $1 \times 10^{-4}$). In natural images, classes like "dog" and "car" are visually distinct. In contrast, healthy and diseased medical images may appear nearly identical to the untrained eye but carry opposite labels. This high label sharpness explains why medical tasks are inherently harder for models to learn.

Validation of the Scaling Law

The proposed scaling law, accounting for $K_F$, significantly outperformed models relying solely on dataset size and dimensionality. Likelihood analysis confirmed that this law better explains observed generalization patterns across all tested architectures.

Test loss ($L$) versus dataset intrinsic dimension ($d_{data}$) across various CNN architectures, showing the scaling behavior for medical and natural domains.

Adversarial Vulnerability

High label sharpness also correlates with a "robustness tax." Because labels change over minute distances in image space, medical models are more susceptible to adversarial attacks. The authors found a strong Pearson correlation (up to $r=0.77$) between label sharpness and the loss penalty from FGSM attacks.

Conclusion

This work identifies label sharpness as a key determinant of generalization and robustness in medical imaging. While the study focused on CNNs and binary classification, it provides a foundational framework for future research into non-convolutional architectures and more complex tasks like multi-class segmentation. Understanding these intrinsic properties is crucial for developing more reliable and secure AI systems for clinical applications.

Summary updated

BibTeX
@inproceedings{konz2024effect,
  author = {Nicholas Konz and Maciej A. Mazurowski},
  title = {{The Effect of Intrinsic Dataset Properties on Generalization: Unraveling Learning Differences Between Natural and Medical Images}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=ixP76Y33y1},
}
Figure