R2Gen-Mamba: A Selective State Space Model for Radiology Report Generation

Yongheng Sun, Yueh Z. Lee, Genevieve A. Woodard, Hongtu Zhu, Chunfeng Lian, Mingxia Liu

TL;DR

R2Gen-Mamba introduces a highly efficient hybrid architecture for automatic radiology report generation by swapping out the computationally heavy Transformer encoder for a linear-time Mamba encoder. This architectural shift slashes encoder computational complexity (FLOPs) by nearly 8x and drastically reduces parameter counts while simultaneously improving text generation quality and clinical accuracy on benchmark datasets.

What Problem Does This Paper Address?

Writing radiology reports manually is a major bottleneck in modern healthcare—it is slow, labor-intensive, and scaling it to meet the skyrocketing volume of medical imaging is a massive challenge. While deep learning models (specifically Transformers) have successfully automated parts of this task, they suffer from quadratic computational complexity ($O(N^2)$) relative to sequence length due to their self-attention mechanisms.

When processing long sequences of high-resolution image patches, this quadratic overhead makes Transformer-based encoders incredibly resource-heavy. This limits their deployment in real-world, resource-constrained clinical environments. The authors tackle this challenge by designing a high-fidelity report generator that drastically cuts down the compute budget without sacrificing clinical accuracy.

Methods

The authors propose R2Gen-Mamba, a sequence-to-sequence framework that combines the efficiency of Selective State Space Models (SSMs) with the powerful text-generation capabilities of Transformers.

The pipeline consists of three main stages:

  1. Visual Extractor: A pre-trained ResNet101 model extracts spatial feature maps from input X-ray images, which are then flattened into a sequence of patch features.
  2. Mamba Encoder: Instead of a standard Transformer encoder, the model uses a Mamba block to process the image patch sequence. Mamba utilizes a selective scan mechanism that achieves linear complexity ($O(N)$) relative to token count, drastically reducing the encoding overhead while maintaining long-range context.
  3. Transformer Decoder: The encoded features are passed to a standard autoregressive Transformer decoder (configured with 3 layers and 8 heads). The decoder retains the classic attention mechanisms required to generate coherent, grammatically correct text reports token-by-token.
Architecture of the proposed R2Gen-Mamba framework, highlighting the Mamba encoder and Transformer decoder modules.

Datasets

The model was trained and evaluated on two widely recognized chest X-ray benchmarks:

  • IU X-Ray: A smaller dataset containing 7,470 chest X-ray images paired with 3,955 reports, split 70%/10%/20% for training, validation, and testing.
  • MIMIC-CXR: A large-scale dataset comprising 473,057 images and 206,563 reports, using its official data split.

Following standard literature practices, any samples missing corresponding text reports were excluded from the experiments.

Key Insights and Ideas

  • The Hybrid Sweet Spot: The paper demonstrates that we don't need to completely abandon Transformers to achieve efficiency. By isolating the heavy sequence processing to the encoder (where image patches create long sequences) and utilizing Mamba there, they mitigate the worst of the $O(N^2)$ bottleneck while keeping the Transformer's proven text-generation strengths in the decoder.
  • Better Long-Range Semantics: Interestingly, R2Gen-Mamba didn't just match Transformers; it beat them on higher-order language metrics (like BLEU-3 and BLEU-4). This indicates that Mamba's selective state space approach is exceptionally good at capturing longer context dependencies and structural grammar in medical narratives compared to pure attention baselines.
  • Clinical Utility Over Rote Memorization: Beyond standard NLP metrics, the hybrid model scored higher on clinical efficacy (CE) metrics. This means the generated text accurately captures actual clinical findings (like identifying a pacemaker or pleural effusion) rather than just generating plausible-sounding medical jargon.

Key Results

  • Massive Efficiency Gains: The Mamba encoder reduced the parameter count from 4.728M (in the baseline R2Gen Transformer encoder) to just 594.944K. More impressively, computational complexity plummeted from 462.422M FLOPs to 58.216M FLOPs—nearly an 8x reduction in computational load.
  • State-of-the-Art Generation: On the IU X-Ray dataset, R2Gen-Mamba achieved SOTA results across all Natural Language Generation (NLG) metrics, including a BLEU-4 score of 0.176 (up from 0.166) and a ROUGE-L score of 0.382.
  • Superior Clinical Accuracy: On the massive MIMIC-CXR dataset, it outperformed existing SOTA models (like R2Gen-CMN and R2Gen-RL) in clinical efficacy, hitting a top Precision of 0.483 and an F1-score of 0.389 using CheXbert evaluation.
Quantitative comparison of R2Gen-Mamba against SOTA baselines on NLG and CE metrics.
Qualitative examples comparing ground truth reports with those generated by R2Gen-Mamba and other baselines.

Limitations and Future Work

While the paper highlights a major step forward in efficiency, a few limitations remain open for future exploration:

  • Transformer Dependency in the Decoder: The decoder still relies on a standard Transformer architecture. While text reports are relatively short, the decoding process remains autoregressive and quadratically complex. Future work could explore replacing the decoder with a pure Mamba or non-autoregressive structure to achieve end-to-end linear efficiency.
  • Visual Extractor Overhead: The framework still relies on a heavy, frozen convolutional backbone (ResNet101) to extract initial patch features. Optimizing or unifying this visual extraction step with the state-space model could yield further speedups.

Summary updated

BibTeX
@inproceedings{sun2025r,
  author = {Yongheng Sun and Yueh Z. Lee and Genevieve A. Woodard and Hongtu Zhu and Chunfeng Lian and Mingxia Liu},
  title = {{R2Gen-Mamba: A Selective State Space Model for Radiology Report Generation}},
  booktitle = {ISBI},
  year = {2025},
  doi = {10.1109/isbi60581.2025.10980814},
}
Figure