CWCD was accepted as a full paper at Medical Imaging with Deep Learning (MIDL) 2026 and selected for an oral presentation (oral selection rate below 8%).
📖 Model Description
This repository contains the eight category-specific rank-1 LoRA adapters released with CWCD: Category-Wise Contrastive Decoding for Structured Medical Report Generation. CWCD generates a structured findings report through independent forward passes under eight anatomical categories.
At inference time, each adapter is used for both the normal X-ray and its corresponding category-masked X-ray. CWCD contrasts the resulting base and masked log-probabilities, applies Plausibility-Based Vocabulary Subselection, and greedily selects the next token. The eight category-wise findings are combined into the final structured findings report.
The complete inference implementation and usage instructions are available in the CWCD GitHub repository.
🤗 Available Adapters
Anatomical category
Adapter directory
LoRA rank
Target modules
Lungs and Airways
adapters/lungs
1
q_proj, v_proj
Musculoskeletal and Chest Wall
adapters/wall
1
q_proj, v_proj
Cardiovascular
adapters/cardiovascular
1
q_proj, v_proj
Pleura
adapters/pleura
1
q_proj, v_proj
Hila and Mediastinum
adapters/hila
1
q_proj, v_proj
Tubes, Catheters, and Support Devices
adapters/tubes
1
q_proj, v_proj
Abdominal
adapters/abdominal
1
q_proj, v_proj
Other
adapters/other
1
q_proj, v_proj
Each directory contains:
text
1adapter_config.json
2adapter_model.bin
🧠 CWCD Inference
For each anatomical category, the GitHub inference pipeline:
loads the corresponding category-specific adapter;
obtains the base distribution from the normal X-ray;
obtains the masked distribution after blacking out that category's bounding boxes;
contrasts the two distributions in log-probability space;
The adapters are downloaded automatically by inference.py through huggingface_hub.snapshot_download(). Only the adapter configuration and weight files are retrieved.
These adapters are intended strictly for research and educational use. CWCD has not been approved or validated for clinical or diagnostic deployment and must not be used to make medical decisions or inform patient care.
Generated findings can contain omissions, incorrect statements, or hallucinations. Performance depends on the base model, input image quality, category-specific bounding boxes, and the domain represented by the evaluation data. Users are responsible for protecting patient privacy and following all applicable data-use agreements.
1@inproceedings{srivastava2026cwcd,
2 title={CWCD: Category-Wise Contrastive Decoding for Structured Medical Report Generation},
3 author={Srivastava, Shantam and Bhosale, Mahesh and Doermann, David and Gao, Mingchen},
4 booktitle={Medical Imaging with Deep Learning},
5 series={Proceedings of Machine Learning Research},
6 volume={315},
7 pages={868--893},
8 year={2026},
9 publisher={PMLR}
10}