mlmed/torchxrayvision

TorchXRayVision: A library of chest X-ray datasets and models. Classifiers, segmentation, and autoencoders.

What it solves

TorchXRayVision simplifies the process of working with chest X-ray datasets and deep learning models. It eliminates the need for researchers to train models from scratch for clinical questions and provides a uniform interface for evaluating models across multiple external datasets, which often have varying metadata formats.

How it works

The library provides a common pre-processing chain and a standardized interface for a wide variety of publicly available chest X-ray datasets. It includes pre-trained models (primarily DenseNet121 and ResNet50) for classification, representation learning, and anatomical segmentation, as well as pre-trained autoencoders for feature extraction.

Who it’s for

Medical imaging researchers and AI developers focusing on chest X-rays who need rapid analysis of large datasets, feature reuse for few-shot learning, or robust evaluation of model generalization across different data sources.

Highlights

  • Pre-trained Models: Access to models trained on diverse cohorts (e.g., NIH, CheXpert, MIMIC-CXR) to serve as baselines or feature extractors.
  • Unified Dataset Interface: Ability to swap datasets with a single line of code and merge or filter them to study distributional shifts.
  • Anatomical Segmentation: Pre-trained models for segmenting 14 different anatomical structures in the chest X-ray.
  • Pathology Masks: Support for pathology-specific masks in datasets like RSNA and SIIM for more precise analysis.
  • Distribution Shift Tools: Tools like CovariateDataset to simulate and study covariate shift and model generalization failures.