suitch commited on
Commit
ee11552
·
verified ·
1 Parent(s): e36f871

Upload thesis checkpoint

Browse files
Files changed (4) hide show
  1. README.md +39 -0
  2. adapter_config.json +48 -0
  3. adapter_model.safetensors +3 -0
  4. projector.pt +3 -0
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ base_model: Qwen/Qwen3.5-4B
4
+ library_name: peft
5
+ pipeline_tag: image-text-to-text
6
+ tags:
7
+ - medical
8
+ - radiology
9
+ - ct
10
+ - report-generation
11
+ - ct-rate
12
+ - lora
13
+ ---
14
+
15
+ # Positive weighting + oversampling decoder
16
+
17
+ Part of the master's thesis *From Scan to Report: Detecting, Segmenting and Reporting Findings in Chest CT* (code: https://github.com/Switchharsh/From_Scan_to_Report_Thesis).
18
+
19
+ Decoder trained with affirmative-only content weighting (weight 7.6) and label-balanced oversampling (power 1.0, cap 25), 24k samples / 1500 steps, embedding-norm matching and projector lr 1e-3. The best supervised training recipe in the thesis.
20
+
21
+ | condition | CRG | macro-F1 |
22
+ |---|---|---|
23
+ | real scan | 0.3957 | 0.2524 |
24
+ | another patient's scan | 0.3622 | 0.1391 |
25
+
26
+ Three-seed mean: CRG 0.3946 +- 0.0215, real-minus-mismatched gap +0.0325 +- 0.0209. The weighting only helps together with oversampling (matched-budget 2x2: interaction +0.0585 CRG, single seed per cell).
27
+
28
+ ## How it fits together
29
+ - Input: the 8x8x8 FlexiCT token grid of a chest CT (`flexict/tokens8`, 864-dim per token) from CT-RATE.
30
+ - `projector.pt`: MLP (864 -> 2560 -> 2560, LayerNorm) that maps the visual tokens into the LLM embedding space.
31
+ - `adapter_model.safetensors` + `adapter_config.json`: LoRA (r=16, alpha=32) on [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B).
32
+ - Loading and generation code (model wrapper, data, evaluation): https://github.com/Switchharsh/From_Scan_to_Report_Thesis (`ctbench/rgen/model.py`, `evaluate.py`). The adapter is not a stand-alone chat model: the projector and the FlexiCT tokens are required.
33
+ - Task instruction used in every run: `Write the findings and impression for this chest CT.` Greedy decoding, at most 512 new tokens.
34
+
35
+ ## Evaluation protocol
36
+ 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*.
37
+
38
+ ## Limitations / licence
39
+ 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.
adapter_config.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "Qwen/Qwen3.5-4B",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.1",
28
+ "qalora_group_size": 16,
29
+ "r": 16,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "q_proj",
34
+ "gate_proj",
35
+ "v_proj",
36
+ "k_proj",
37
+ "o_proj",
38
+ "up_proj",
39
+ "down_proj"
40
+ ],
41
+ "target_parameters": null,
42
+ "task_type": "CAUSAL_LM",
43
+ "trainable_token_indices": null,
44
+ "use_bdlora": null,
45
+ "use_dora": false,
46
+ "use_qalora": false,
47
+ "use_rslora": false
48
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dcfe4ebf63703d1835512da68c1ca27ade6489667d1b02079a8e952cbaa7d05f
3
+ size 84968408
projector.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:04958853725f7dd18c6b018eb4d01312673256560b130ca272ffd141ef7b410a
3
+ size 17554731