--- license: cc-by-nc-sa-4.0 base_model: Qwen/Qwen3.5-4B library_name: peft pipeline_tag: image-text-to-text tags: - medical - radiology - ct - report-generation - ct-rate - lora --- # DPO-tuned report decoder Part of the master's thesis *From Scan to Report: Detecting, Segmenting and Reporting Findings in Chest CT* (code: https://github.com/Switchharsh/Switchharsh-From_Scan_to_Report_Master_Thesis; thesis: https://github.com/Switchharsh/Switchharsh-From_Scan_to_Report_Master_Thesis/tree/main/thesis). The baseline decoder (`scan2report-decoder-baseline`) further tuned with DPO on 1,899 preference pairs (beta 0.1, lr 2e-5, 2 epochs). | condition | CRG | macro-F1 | |---|---|---| | real scan | 0.3986 | 0.3162 | | another patient's scan | 0.3726 | 0.1994 | Three-seed mean (each DPO trained from its own baseline): CRG 0.3965 +- 0.0139, gap +0.0216 +- 0.0208; one of three seeds shows no CRG gap. ## How it fits together - Input: the 8x8x8 FlexiCT token grid of a chest CT (`flexict/tokens8`, 864-dim per token) from CT-RATE. - `projector.pt`: MLP (864 -> 2560 -> 2560, LayerNorm) that maps the visual tokens into the LLM embedding space. - `adapter_model.safetensors` + `adapter_config.json`: LoRA (r=16, alpha=32) on [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B). - Loading and generation code (model wrapper, data, evaluation): https://github.com/Switchharsh/Switchharsh-From_Scan_to_Report_Master_Thesis (`ctbench/rgen/model.py`, `evaluate.py`). The adapter is not a stand-alone chat model: the projector and the FlexiCT tokens are required. - Task instruction used in every run: `Write the findings and impression for this chest CT.` Greedy decoding, at most 512 new tokens. ## Evaluation protocol 1,000 patient-sampled CT-RATE validation cases; CRG (micro) and macro-F1 with the RadBERT label reader (`suitch/radbert-english-ctrate-classifier`, threshold 0.5). Control = another patient's scan tokens (mismatched). Numbers are from the thesis *From Scan to Report: Detecting, Segmenting and Reporting Findings in Chest CT*. ## Limitations / licence Research use only, not for clinical use. Trained on CT-RATE (CC BY-NC-SA 4.0), so the weights are released under the same non-commercial terms. Reports can contain false findings; see the thesis for the error analysis.