SS-CXR: Multitask Representation Learning using Self Supervised Pre-training from Chest X-Rays

Syed Muhammad Anwar, Abhijeet Parida, Sara Atito, Muhammad Awais, Gustavo Nino, Josef Kitler, Marius George Linguraru

Abstract

Chest X-rays (CXRs) are a widely used imaging modality for the diagnosis and prognosis of lung disease. The image analysis tasks vary. Examples include pathology detection and lung segmentation. There is a large body of work where machine learning algorithms are developed for specific tasks. A significant recent example is Coronavirus disease (covid-19) detection using CXR data. However, the traditional diagnostic tool design methods based on supervised learning are burdened by the need to provide training data annotation, which should be of good quality for better clinical outcomes. Here, we propose an alternative solution, a new self-supervised paradigm, where a general representation from CXRs is learned using a group-masked self-supervised framework. The pre-trained model is then fine-tuned for domain-specific tasks such as covid-19, pneumonia detection, and general health screening. We show that the same pre-training can be used for the lung segmentation task. Our proposed paradigm shows robust performance in multiple downstream tasks which demonstrates the success of the pre-training. Moreover, the performance of the pre-trained models on data with significant drift during test time proves the learning of a better generic representation. The methods are further validated by covid-19 detection in a unique small-scale pediatric data set. The performance gain in accuracy (~25%) is significant when compared to a supervised transformer-based method. This adds credence to the strength and reliability of our proposed framework and pre-training strategy.

Introduction

Medical imaging analysis, particularly for chest X-rays (CXRs), traditionally relies on supervised learning models that require extensive, high-quality manual annotations. This process is not only resource-intensive but also prone to human bias and struggles with "data drift"—where models fail when applied to new clinical environments or distinct patient populations, such as children whose anatomy differs significantly from adults.

To address these challenges, we propose SS-CXR, a self-supervised learning (SSL) framework designed to learn general representations from CXRs without the need for initial labels. By training a model to understand the underlying "language" of thoracic anatomy, we create a domain-specific foundation model that can be fine-tuned for diverse downstream tasks, including pathology detection and lung segmentation. This approach leverages massive datasets like COVIDxCXR-3 (31,493 images) to build a robust representation that generalizes even to small-scale, high-drift scenarios like pediatric diagnostics.

Methodology

The SS-CXR framework employs a Vision Transformer (ViT-S) backbone and a novel Group Masked Model Learning (GMML) strategy for pre-training.

The SS-CXR Pipeline

The overall workflow transitions from self-supervised pre-training on large-scale unlabeled data to fine-tuning on specific clinical tasks. This allows the model to learn anatomical features before being tasked with specific diagnostic labels.

Overview of the SS-CXR framework, comparing supervised learning with the proposed self-supervised pre-training and fine-tuning pipeline.

Self-Supervised Pre-training via GMML

The core innovation is the GMML pretext task. Instead of using labels, the model is presented with corrupted CXRs where patches are either masked with noise (70%) or swapped with patches from other images (35%). The model's objective is to reconstruct the original, clean image. To succeed, the model must learn the underlying structure of human anatomy—where ribs should be, the shape of the heart, and the texture of healthy lung tissue.

The Group Masked Model Learning (GMML) process: an input CXR is corrupted and then reconstructed by a Vision Transformer and light decoder to minimize reconstruction loss.

Results and Discussion

SS-CXR demonstrated significant performance gains across multiple domains, outperforming both from-scratch supervised models and those pre-trained on generic non-medical images (ImageNet):

  • COVID-19 Detection: The model achieved 96% accuracy in multi-class classification (Healthy vs. Pneumonia vs. COVID).
  • Pediatric Generalization: On a challenging pediatric dataset of 189 images from Children’s National Hospital, SS-CXR achieved 94.73% accuracy—a ~25% improvement over standard supervised transformers. This suggests that adult-trained foundation models can effectively bridge the gap to pediatric medicine where data is scarce.
  • Lung Segmentation: Validated on datasets from Shenzhen and Montgomery County, the model improved Surface Distance metrics by approximately 46% compared to standard benchmarks, proving that the learned representations are spatially aware.
  • Clinical Baseline: The model significantly outperformed the reported accuracy and true positive rates of thoracic radiologists in identifying COVID-19 from CXRs.

Conclusion

SS-CXR demonstrates that self-supervised pre-training on domain-specific medical data creates robust foundation models capable of excelling in diverse tasks with minimal labeled data. By forcing the model to "fill in the blanks" of corrupted images, it develops a deep notion of visual integrity essential for medical diagnosis. Future work will explore expanding this framework to other modalities like CT scans and improving model interpretability to better align with clinical reasoning.

Summary updated

BibTeX
@inproceedings{anwar2024ss,
  author = {Syed Muhammad Anwar and Abhijeet Parida and Sara Atito and Muhammad Awais and Gustavo Nino and Josef Kitler and Marius George Linguraru},
  title = {{SS-CXR: Multitask Representation Learning using Self Supervised Pre-training from Chest X-Rays}},
  booktitle = {ICIP},
  year = {2024},
  doi = {10.1109/icip51287.2024.10647378},
}
Figure