File size: 3,716 Bytes
851ca05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
  "model": {
    "visual_backbone": "convnext_base",
    "text_encoder": "emilyalsentzer/Bio_ClinicalBERT",
    "visual_feature_dim": 512,
    "scene_graph_dim": 134,
    "visual_embedding_dim": 646,
    "hidden_size": 768,
    "intermediate_size": 3072,
    "num_hidden_layers": 6,
    "num_attention_heads": 12,
    "hidden_dropout_prob": 0.1,
    "attention_probs_dropout_prob": 0.1,
    "sim_layers": 2,
    "num_regions": 30,
    "num_entities": 22,
    "region_embedding_dim": 64,
    "entity_embedding_dim": 64,
    "num_binary_classes": 2,
    "num_category_classes": 14,
    "num_region_classes": 26,
    "num_severity_classes": 4,
    "max_question_length": 128,
    "vocab_size": 30522,
    "qwen_model_id": null,
    "use_quantization": null,
    "lora_rank": 16,
    "lora_alpha": 32,
    "lora_target_modules": null,
    "num_sg_tokens": 8,
    "sg_generator": {
      "name": "txrv_detr",
      "num_entities": 22,
      "num_regions": 30,
      "num_relations": 10,
      "num_queries": 20,
      "d_model": 384,
      "num_decoder_layers": 2,
      "num_heads": 8,
      "dropout": 0.1,
      "input_size": 224,
      "checkpoint": "./checkpoints/mimic-cxr-vqa-stage1-sg-only/best_model",
      "frozen": true
    }
  },
  "data": {
    "mimic_cxr_jpg_path": "/root/code/MASTERS-WORK/data/mimic-cxr-jpg",
    "mimic_ext_cxr_qba_path": "/root/code/MASTERS-WORK/data/mimic-ext-cxr-qba",
    "chexpert_labels_path": "",
    "test_labels_csv_path": "",
    "quality_grade": "B",
    "view_filter": "frontal_only",
    "question_types": null,
    "use_exports": true,
    "export_grade": "B_frontal",
    "cache_dir": ".cache/dataset_samples",
    "image_size": 224,
    "normalize_mean": [
      0.485,
      0.456,
      0.406
    ],
    "normalize_std": [
      0.229,
      0.224,
      0.225
    ],
    "skip_question_types": null,
    "min_localization_quality": 0,
    "val_samples": 1000,
    "val_quality_grade": null
  },
  "training": {
    "output_dir": "./checkpoints/mimic-cxr-vqa",
    "phase": "alignment",
    "batch_size_per_gpu": 2,
    "gradient_accumulation_steps": 4,
    "learning_rate": 5e-05,
    "weight_decay": 0.01,
    "warmup_ratio": 0.05,
    "max_grad_norm": 1.0,
    "num_epochs": 2,
    "fp16": true,
    "gradient_checkpointing": false,
    "vqa_loss_weight": 0.0,
    "generation_loss_weight": 1.0,
    "chexpert_loss_weight": 0.05,
    "scene_graph_loss_weight": 0.0,
    "grounding_loss_weight": 0.0,
    "binary_head_weight": 0.0,
    "category_head_weight": 0.0,
    "region_head_weight": 0.0,
    "severity_head_weight": 0.0,
    "logging_steps": 100,
    "save_steps": 500,
    "save_total_limit": 3,
    "eval_steps": 2000,
    "metric_for_best_model": "classification_accuracy",
    "greater_is_better": true,
    "early_stopping_patience": 5,
    "dataloader_num_workers": 2,
    "dataloader_pin_memory": true,
    "dataloader_prefetch_factor": 2,
    "dataloader_persistent_workers": true,
    "hub_model_id": "KYAGABA/mimic-cxr-vqa-stage2-alignment",
    "hub_private_repo": true,
    "push_to_hub_strategy": "checkpoint",
    "push_every_save": false,
    "seed": 42,
    "ema_decay": 0.0
  },
  "wandb": {
    "enabled": true,
    "project": "mimic-cxr-vqa",
    "entity": "kyagabajonah",
    "name": "stage2-alignment",
    "group": "curriculum",
    "tags": [
      "ssg-vqa",
      "mimic-cxr",
      "stage2",
      "alignment",
      "b-grade"
    ],
    "notes": "Stage 2: SG-LLM alignment (gen=1.0 primary, SG frozen). Resumes from Stage 1 best_model.",
    "watch_model": false,
    "watch_log_freq": 1000,
    "log_model": true
  },
  "deepspeed": {
    "enabled": false,
    "config_path": "configs/deepspeed_config.json",
    "stage": 2
  }
}