--- license: cc-by-nc-sa-4.0 language: - en base_model: Qwen/Qwen3-VL-2B-Instruct base_model_relation: adapter datasets: - ibrahimhamamci/CT-RATE pipeline_tag: image-text-to-text tags: - medical-imaging - radiology - computed-tomography - 3d - report-generation - nnfoundation - arxiv:2609.26924 - arxiv:2608.08713 --- ## nnFoundationViT-ReportGen-CT-RATE Copyright German Cancer Research Center (DKFZ) and contributors. Please make sure that your usage of these models is in compliance with their license. [![nnFoundation paper](https://img.shields.io/badge/nnFoundation-arXiv-b31b1b?logo=arxiv)](https://arxiv.org/abs/2609.26924) [![RMR paper](https://img.shields.io/badge/RMR-arXiv-b31b1b?logo=arxiv)](https://arxiv.org/abs/2608.08713) [![Code](https://img.shields.io/badge/GitHub-code-181717?logo=github)](https://github.com/MIC-DKFZ/3d_report_generation) `nnFoundationViT-ReportGen-CT-RATE` generates radiology reports (findings and impression) for **chest CT** volumes. Frozen [nnFoundationViT](https://huggingface.co/MIC-DKFZ/nnFoundationViT) features are passed through a trainable adapter to [Qwen3-VL-2B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct), adapted with LoRA, and trained on [CT-RATE](https://huggingface.co/datasets/ibrahimhamamci/CT-RATE). The training recipe builds on the findings of [Resolution Meets Reduction (RMR)](https://arxiv.org/abs/2608.08713) and improves on the report-generation models of the [nnFoundation paper](https://arxiv.org/abs/2609.26924); we recommend it for generating reports on new chest CT. For abdominal CT, use [nnFoundationViT-ReportGen-Merlin](https://huggingface.co/MIC-DKFZ/nnFoundationViT-ReportGen-Merlin). ## Model | Component | Details | Trained | |---|---|---| | Vision encoder | [nnFoundationViT](https://huggingface.co/MIC-DKFZ/nnFoundationViT), 192³ input, 24³ = 13,824 patch tokens | Frozen | | Adapter | Normalization and MLP applied to each patch token, no token reduction | Fully | | Language model | [Qwen3-VL-2B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct) | LoRA (r 32, α 64) on attention, MLP, and `lm_head` | This repository holds only the trained weights (adapter and LoRA, 46M parameters); the encoder and the language model are downloaded from their own repositories. ## Usage Reports are generated with [`inference_nifti.py`](https://github.com/MIC-DKFZ/3d_report_generation/blob/main/inference_nifti.py) from the [code repository](https://github.com/MIC-DKFZ/3d_report_generation), for a folder of NIfTI volumes: ```bash git clone https://github.com/MIC-DKFZ/3d_report_generation.git && cd 3d_report_generation uv sync --locked --python 3.12 --extra totalsegmentator uv run hf download MIC-DKFZ/nnFoundationViT-ReportGen-CT-RATE --local-dir models/ctrate uv run torchrun --standalone --nproc_per_node= inference_nifti.py \ --checkpoint_dir models/ctrate \ --input_dir /path/to/chest_ct_volumes \ --mask_dir /path/to/masks \ --output_dir /path/to/reports ``` The reports are saved in `inference_results.json`. See [report generation for NIfTI volumes](https://github.com/MIC-DKFZ/3d_report_generation/blob/main/documentation/nifti_inference.md) for masks, offline use, and batching. ## Expected input Chest CT volumes as NIfTI files (`.nii.gz` or `.nii`). The script prepares each volume as in training, so no settings have to be passed: it reorients the volume, crops it to the foreground of its [TotalSegmentator](https://github.com/wasserth/TotalSegmentator) `total` mask (made if missing), resizes the crop to 192³, and applies z-score normalization. ## Training | Setting | Value | |---|---| | Data | CT-RATE training split, with the report cleaning and scan exclusions of RMR (v2 dataset JSONs) | | Epochs | 16 | | Effective batch size | 24 | | Optimizer | AdamW, no weight decay | | Learning rate | Adapter `3e-3`, LoRA `3e-4`; the adapter first trains alone with a warmup, then all trained parameters warm up again, followed by a cosine decay | The released weights are the checkpoint with the best validation F1, which here is the final checkpoint. ## Evaluation Results on the 3,002 volumes of the CT-RATE test set (the official validation split), with greedy decoding. The clinical scores compare the findings that [RadBERT-CT](https://huggingface.co/IAMJB/RadBERT-CT) extracts from the generated and the reference reports, as macro averages over the 18 CT-RATE findings. | Metric | Value | |---|---| | F1 (macro) | **0.499** | | Precision (macro) | 0.555 | | Recall (macro) | 0.459 | | CRG | 0.467 | | BLEU-1 / BLEU-4 | 0.467 / 0.230 | | METEOR | 0.245 | | ROUGE-L | 0.338 | | CIDEr | 0.195 | The generated reports are in `test_predictions/inference_results.json`; join them with the dataset's reports by `image_id` to compute other metrics. ## Intended use and limitations - Intended for research on radiology report generation, not for clinical decision-making or diagnosis. Generated reports can contain findings that are not present and miss findings that are. - Trained only on chest CT from CT-RATE, with English reports; other body regions, scanners, and report styles have not been evaluated. - Volumes are expected to be cropped to their TotalSegmentator mask. Reports for whole volumes (`--allow_missing_masks`) are less reliable, since the model saw almost none in training. ## Repository contents | File | Purpose | |---|---| | `model.safetensors` | the trained adapter and LoRA weights | | `final_config.yml` | the training config, including the preprocessing and the encoder revision that `inference_nifti.py` reads | | `checkpoint_manifest.json` | checkpoint metadata | | `test_predictions/` | the generated test-set reports and their metrics | | `LICENSE` | CC BY-NC-SA 4.0 | ## Citation If you use this model, please cite the nnFoundation paper for the vision encoder and RMR for the report-generation recipe:
nnFoundation BibTeX ```bibtex @misc{harsy2026nnfoundation3dfoundationmodels, title = {nnFoundation: 3D Foundation Models for Radiology}, author = {Ulrich Harsy, Constantin and Wald, Tassilo and Gotkowski, Karol and others}, year = {2026}, eprint = {2609.26924}, archivePrefix = {arXiv}, primaryClass = {cs.CV}, url = {https://arxiv.org/abs/2609.26924} } ```
RMR BibTeX ```bibtex @misc{suprijadi2026resolutionmeetsreduction, title = {Resolution Meets Reduction: Efficient Visual Context for 3D Radiology Report Generation}, author = {Suprijadi, Jonathan and Stock, Raphael and Langenberg, Moritz and Zimmerer, David and Kahl, Kim-Celine and Denner, Stefan and Kirchhoff, Yannick and Gotkowski, Karol and Rokuss, Maximilian and Traub, Jeremias and Wald, Tassilo and Ulrich, Constantin and Maier-Hein, Klaus}, year = {2026}, eprint = {2608.08713}, archivePrefix = {arXiv}, primaryClass = {cs.CV}, url = {https://arxiv.org/abs/2608.08713} } ```
Please also acknowledge [CT-RATE](https://huggingface.co/datasets/ibrahimhamamci/CT-RATE) and [Qwen3-VL](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct). ## License The weights and this model card are licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/), following the license of the CT-RATE training data. The vision encoder ([nnFoundationViT](https://huggingface.co/MIC-DKFZ/nnFoundationViT), CC BY-SA 4.0) and the language model ([Qwen3-VL-2B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct), Apache 2.0) are not included and keep their own licenses.