CheXmask: a large-scale dataset of anatomical segmentation masks for multi-center chest x-ray images

Nicolás Gaggion, Candelaria Mosquera, Lucas Mansilla, Julia Mariel Saidman, Martina Aineseder, Diego H. Milone, Enzo Ferrante

Abstract

The development of successful artificial intelligence models for chest X-ray analysis relies on large, diverse datasets with high-quality annotations. While several databases of chest X-ray images have been released, most include disease diagnosis labels but lack detailed pixel-level anatomical segmentation labels. To address this gap, we introduce an extensive chest X-ray multi-center segmentation dataset with uniform and fine-grain anatomical annotations for images coming from five well-known publicly available databases: ChestX-ray8, CheXpert, MIMIC-CXR-JPG, Padchest, and VinDr-CXR, resulting in 657,566 segmentation masks. Our methodology utilizes the HybridGNet model to ensure consistent and high-quality segmentations across all datasets. Rigorous validation, including expert physician evaluation and automatic quality control, was conducted to validate the resulting masks. Additionally, we provide individualized quality indices per mask and an overall quality estimation per dataset. This dataset serves as a valuable resource for the broader scientific community, streamlining the development and assessment of innovative methodologies in chest X-ray analysis.

Introduction

While the medical imaging community has access to millions of chest X-rays, a significant "annotation bottleneck" persists. Most large-scale datasets provide disease-level labels (e.g., presence of pneumonia), but lack the pixel-level masks required for precise anatomical localization. Manual segmentation remains the gold standard but is prohibitively slow and expensive to scale to hundreds of thousands of images.

Without these masks, it is difficult to train AI models for quantitative tasks, such as measuring the cardiothoracic ratio for heart failure assessment, or to ensure that diagnostic models are focusing on relevant anatomical regions rather than background noise. CheXmask addresses this by providing a "silver standard" dataset—automatically generated but rigorously validated—at an unprecedented scale of over 650,000 images.

Methodology

The researchers employed a robust two-stage pipeline to build and validate the dataset, ensuring both anatomical plausibility and statistical reliability.

Segmentation with HybridGNet

To avoid the common pitfalls of standard U-Net architectures, which can occasionally produce anatomically impossible shapes, the team utilized HybridGNet. This model integrates standard convolutional layers for image encoding with graph generative models. By predicting organ contours as a set of connected landmarks, the model enforces anatomical constraints, ensuring the resulting masks are biologically plausible.

Quality Control via Reverse Classification Accuracy (RCA)

Validating over 650,000 masks manually is impossible. Instead, the authors implemented the Reverse Classification Accuracy (RCA) framework. For a given image, a "reverse classifier" is trained using the predicted mask as the ground truth. This classifier is then tested on a small reference set of images with known expert labels. High performance on the reference set serves as a proxy for the quality of the original predicted mask.

The data processing flowchart illustrating the journey from raw input to validated dataset.

Dataset Composition

CheXmask provides standardized annotations for the "Big Five" publicly available chest X-ray (CXR) datasets, ensuring broad demographic and geographic coverage:

  • ChestX-ray8 (NIH)
  • CheXpert (Stanford)
  • MIMIC-CXR-JPG (MIT/Beth Israel)
  • Padchest (Spain)
  • VinDr-CXR (Vietnam)

In total, the joint dataset contains 657,566 frontal chest X-ray images captured through 2020. The release includes masks in both their original resolution and a standardized 1024x1024 format.

Technical Validation and Results

Accuracy and Quality Distribution

Validation against expert physician annotations demonstrated high mean Dice Similarity Coefficients (DSC) for lungs (0.949 to 0.982) and the heart (0.912 to 0.979) across all source datasets. A key feature of CheXmask is the inclusion of an individual quality index (RCA-estimated DSC) for every mask. This allows researchers to filter the data based on their specific needs, typically excluding samples with a score below 0.7.

Distribution of RCA-estimated quality scores across the entire CheXmask database, showing the high frequency of high-quality segmentations.

Insights into Protocol Bias

The study revealed that segmentation quality is not uniform across imaging protocols. Anteroposterior (AP) views—frequently taken of bedridden or acutely ill patients—proved significantly more challenging to segment than standard Posteroanterior (PA) views. This difficulty stems from patient positioning and the presence of medical artifacts like cables or tubes.

Furthermore, the masks follow an "anatomy" strategy rather than an "air" strategy. This means they include opaque areas of the lung (such as those caused by severe infection or consolidation) that might be excluded by models that only identify air-filled regions, providing a more consistent anatomical boundary.

Discussion and Future Work

While CheXmask represents a massive leap forward, the authors acknowledge certain limitations. The "gold standard" subset used for technical validation was reviewed by a single physician, and large public datasets are known to contain occasional metadata errors (e.g., lateral views mislabeled as frontal).

However, the scale and validated quality of CheXmask open new doors for the scientific community. Future applications include using these masks for self-supervised learning, implementing attention mechanisms to focus diagnostic models on specific organs, and developing more accurate automated tools for measuring anatomical indices in clinical practice.

Summary updated

BibTeX
@inproceedings{gaggion2024chexmask,
  author = {Nicolás Gaggion and Candelaria Mosquera and Lucas Mansilla and Julia Mariel Saidman and Martina Aineseder and Diego H. Milone and Enzo Ferrante},
  title = {{CheXmask: a large-scale dataset of anatomical segmentation masks for multi-center chest x-ray images}},
  booktitle = {Scientific},
  year = {2024},
  doi = {10.1038/s41597-024-03358-1},
}
Figure