Weakly Supervised Contrastive Learning for Chest X-Ray Report Generation

An Yan, Zexue He, Xing Lu, Jiang Du, Eric Y. Chang, Amilcare Gentili, Julian J. McAuley, Chun-Nan Hsu

Weakly Supervised Contrastive Learning for Chest X-Ray Report Generation

Abstract

Automated radiology report generation is a high-stakes task often hindered by data imbalance, where a majority of "normal" cases lead models to produce generic, clinically uninformative outputs. We present a weakly supervised contrastive learning (WCL) framework designed to enhance the clinical accuracy and diversity of generated reports. By leveraging domain-specific clustering to identify semantically similar "hard negatives," our model learns to distinguish subtle pathological features. Experimental results on the MIMIC-CXR and MIMIC-ABN datasets show that our method, MDT+WCL, significantly outperforms existing baselines in both linguistic fluency and clinical efficacy.

Introduction

The generation of automated radiology reports from chest X-rays (CXR) is a complex image-to-text challenge. A primary obstacle in this field is the "safe bet" phenomenon: because most clinical images are normal, models trained with standard cross-entropy loss tend to over-generate high-frequency, generic phrases like "no acute findings." This results in two major issues: a lack of clinical detail in the outputs and a lack of robustness when faced with subtle abnormalities.

Traditional contrastive learning often fails here because it relies on random negative samples (e.g., comparing a lung X-ray to a report of a broken limb), which are too easy for the model to differentiate. To achieve clinical utility, a model must learn to distinguish between a "normal" lung and one exhibiting subtle opacities—a "hard negative" scenario.

Methodology

The proposed framework integrates a Memory-driven Transformer (MDT) backbone with a novel Weakly Supervised Contrastive Loss (WCL). The workflow is divided into three distinct phases:

  1. Report Labeling via Clustering: The training set reports are processed through CheXBERT, a BERT model pre-trained on medical text, to generate high-dimensional embeddings. K-Means clustering is then applied to group these reports based on semantic and clinical similarity.
  2. Hard Negative Identification: During the training process, reports belonging to the same cluster as the target ground-truth report are designated as "hard negatives." These represent clinically similar but distinct cases that the model must learn to differentiate.
  3. The WCL Objective: A contrastive loss function is introduced, utilizing a hyperparameter ($\alpha$) to assign higher weights to these hard negatives. This forces the model to focus on fine-grained visual features that distinguish the target report from its semantically close counterparts.
The MDT+WCL architecture, highlighting the use of CheXBERT and K-Means clustering to generate the weakly supervised signal for contrastive learning.

The final training objective is a composite of standard cross-entropy loss, ensuring linguistic fluency, and the WCL objective, ensuring clinical precision.

Experimental Setup

The framework was evaluated on two benchmark datasets:

  • MIMIC-CXR: A large-scale dataset containing over 222,000 chest X-ray and report pairs.
  • MIMIC-ABN: A subset of MIMIC-CXR specifically filtered for abnormal findings, providing a rigorous test for describing complex pathologies.

Results and Discussion

The MDT+WCL model demonstrated superior performance across multiple evaluation axes.

Quantitative Performance

As shown in the results table, the model achieved state-of-the-art results in both Natural Language Generation (NLG) and Clinical Efficacy (CE) metrics. Notably, on the MIMIC-CXR dataset, the model improved the Clinical F1-score from 27.6 to 29.4, indicating a significant enhancement in the model's ability to correctly identify 14 different disease categories.

Performance metrics for MDT+WCL compared to baseline models across the MIMIC-ABN and MIMIC-CXR datasets.

Qualitative Insights

Beyond metric improvements, the contrastive approach addresses the "spiky" distribution of report lengths common in standard models. By penalizing generic outputs through hard-negative contrast, the model produces a length distribution that more closely mirrors human-written reports. Qualitative case studies further confirm that the model can identify specific anatomical locations of pathologies (e.g., "linear left basilar opacity") where baseline models remain vague.

Conclusion and Future Work

This research demonstrates that "teaching" a model through semantic similarity and hard negatives can significantly improve the quality of automated medical reports. By turning an unsupervised dataset into a weakly supervised one via clustering, the MDT+WCL framework achieves higher clinical accuracy.

Future work will focus on expanding this framework to other imaging modalities such as CT and MRI scans. Additionally, the authors aim to explore dynamic clustering methods that discover hard negatives during the training process and seek direct clinical validation from practicing radiologists to assess the real-world impact on clinical workflows.

Summary updated

BibTeX
@inproceedings{yan2021weakly,
  author = {An Yan and Zexue He and Xing Lu and Jiang Du and Eric Y. Chang and Amilcare Gentili and Julian J. McAuley and Chun-Nan Hsu},
  title = {{Weakly Supervised Contrastive Learning for Chest X-Ray Report Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.336},
}
Figure