Add new regression and ensemble experiment configurations for V2-M and OrthoBridge

- Introduced multiple regression experiment configurations targeting vf_md, including:
  - cd_solo_reg_set.json: CD tower only regression setup.
  - img_solo_reg_set.json: Image tower only regression setup.
  - reg_head_epoch_sweep.json: Baseline regression sweeps at different epochs (50, 75, 100).
  - reg_head_set.json: Various regression setups including baseline and OrthoBridge configurations.
  - single_eye_reg.json: Single-eye regression setup for worst-eye aggregation analysis.

- Added ensemble configurations for OrthoBridge with different inner bridges:
  - ortho_alts_ensemble.json: Ensemble tests with ConcatBridge, PairwiseAdditiveBridge, and GatedAdditiveBridge.
  - ortho_alts_tritower.json: Tritower tests with the same inner bridges.

- Created V2-M specific configurations:
  - baseline_reg_nt50.json: Regression baseline with V2-M backbone.
  - geom_vec_gt.json and geom_vec_unet.json: Geometry vector injection experiments with V2-M.
  - single_l1_bridges.json: Single-eye ensemble experiments with various bridge types.
  - tritower_geom_gt.json: Tritower setup with GT contour-rasterized masks.

- Promoted existing experiments to higher repetitions for robustness.
This commit is contained in:
rpotter6298
2026-06-11 15:08:20 +02:00
parent 32a801a572
commit 280060db82
343 changed files with 8558 additions and 57747 deletions
+102
View File
@@ -0,0 +1,102 @@
{
"_notes": [
"CD tower only, regression head predicting vf_md.",
"Mirrors ensemble_fused architecture (eye-level fusion → patient-level hb → head)",
"with the img tower removed, so neg_mse is directly comparable to baseline_reg_nt50."
],
"run_name": "v4/cd_solo_reg",
"num_classes": 2,
"label_filter": [0, 1, 2],
"split_identity_level": 1,
"eval_stage": "hb",
"save_predictions": true,
"seed": 1234,
"folds": 5,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": ["binary"],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": ["Axial_Length"],
"in_memory_cache": true
}
},
"towers": [
{
"name": "cd",
"module": "v4.classes.towers.clinical_tower",
"class": "ClinicalEncoder",
"data_source": "matrix",
"args": { "hidden_dim": 128 }
}
],
"stages": [
{
"name": "cd_warm",
"type": "warm",
"tower": "cd",
"head_name": "cd_aux",
"level": "eye",
"epochs": 40
},
{
"name": "cd_aux",
"type": "head",
"input": "cd",
"train_with": "cd_fuse",
"module": "v4.classes.heads.regression",
"class": "RegressionHead",
"args": { "dropout": 0.3, "target_key": "vf_md", "loss": "mse" }
},
{
"name": "cd_fuse",
"type": "fusion",
"module": "v4.classes.bridges.mono_bridge",
"class": "MonoBridge",
"inputs": ["cd"],
"level": "eye",
"epochs": 50,
"train_towers": true,
"args": { "use_ln": false }
},
{
"name": "cd_fuse_head",
"type": "head",
"input": "cd_fuse",
"train_with": "cd_fuse",
"module": "v4.classes.heads.regression",
"class": "RegressionHead",
"args": { "dropout": 0.3, "target_key": "vf_md", "loss": "mse" }
},
{
"name": "hb",
"type": "fusion",
"module": "v4.classes.bridges.hyperbridge",
"class": "HyperBridge",
"inputs": { "a": "cd_fuse", "b": "cd_fuse" },
"level": "patient",
"epochs": 10,
"args": { "hidden_dim": 256, "mode": "embedding_mlp" }
},
{
"name": "hb_head",
"type": "head",
"input": "hb",
"train_with": "hb",
"module": "v4.classes.heads.regression",
"class": "RegressionHead",
"args": { "dropout": 0.3, "target_key": "vf_md", "loss": "mse" }
}
],
"training": {
"lr": 1e-4,
"batch_size": 8,
"tune_binary_threshold": true
}
}
+89
View File
@@ -0,0 +1,89 @@
{
"_notes": [
"Clinical-only at patient level (bilateral). Mirrors clinical_solo.json but",
"adds the hb stage so cd_fuse(OD) and cd_fuse(OS) are aggregated at",
"patient level. Pairs with single-eye clinical_solo for the Figure 4",
"bilateral comparison."
],
"run_name": "v4/clinical_solo_bilateral",
"num_classes": 2,
"label_filter": [0, 1],
"split_identity_level": 1,
"eval_stage": "hb",
"save_predictions": true,
"seed": 1234,
"folds": 5,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": ["binary"],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": ["Axial_Length"],
"in_memory_cache": false
}
},
"towers": [
{
"name": "cd",
"module": "v4.classes.towers.clinical_tower",
"class": "ClinicalEncoder",
"data_source": "matrix",
"args": { "hidden_dim": 128 }
}
],
"stages": [
{
"name": "cd_warm",
"type": "warm",
"tower": "cd",
"head_name": "cd_aux",
"level": "eye",
"epochs": 40
},
{
"name": "cd_aux",
"type": "head",
"input": "cd",
"train_with": "cd_fuse"
},
{
"name": "cd_fuse",
"type": "fusion",
"module": "v4.classes.bridges.mono_bridge",
"class": "MonoBridge",
"inputs": ["cd"],
"level": "eye",
"epochs": 36,
"train_towers": true,
"args": { "use_ln": false }
},
{
"name": "hb",
"type": "fusion",
"module": "v4.classes.bridges.hyperbridge",
"class": "HyperBridge",
"inputs": { "a": "cd_fuse", "b": "cd_fuse" },
"level": "patient",
"epochs": 10,
"args": { "hidden_dim": 256, "mode": "embedding_mlp" }
},
{
"name": "hb_head",
"type": "head",
"input": "hb",
"train_with": "hb",
"args": { "dropout": 0.3 }
}
],
"training": {
"lr": 1e-4,
"batch_size": 16,
"tune_binary_threshold": true
}
}
+102
View File
@@ -0,0 +1,102 @@
{
"_notes": [
"Single-eye variant of ensemble_fused: stops at nt (eye-level fusion),",
"drops the bilateral hb stage. Each eye is classified independently.",
"For comparing patient-level bilateral (hb) vs single-eye (nt) — the v3",
"single/bilateral standardization in the new modular architecture."
],
"run_name": "v4/ensemble_fused_single",
"num_classes": 2,
"label_filter": [0, 1],
"split_identity_level": 1,
"eval_stage": "nt",
"save_predictions": true,
"seed": 1234,
"folds": 5,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": ["binary"],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": ["Axial_Length"],
"in_memory_cache": true
}
},
"towers": [
{
"name": "img",
"module": "v4.classes.towers.image_tower",
"class": "ImageEncoder",
"data_source": "image",
"args": {
"backbone": "refugelike",
"freeze_ratio": 0.0,
"augment": true
}
},
{
"name": "cd",
"module": "v4.classes.towers.clinical_tower",
"class": "ClinicalEncoder",
"data_source": "matrix",
"args": { "hidden_dim": 128 }
}
],
"stages": [
{
"name": "cd_warm",
"type": "warm",
"tower": "cd",
"head_name": "cd_aux",
"level": "eye",
"epochs": 40
},
{
"name": "img_aux",
"type": "head",
"input": "img",
"train_with": "nt",
"bcd": true
},
{
"name": "cd_aux",
"type": "head",
"input": "cd",
"train_with": "nt",
"bcd": true
},
{
"name": "nt",
"type": "fusion",
"module": "v4.classes.bridges.fusion_bridge",
"class": "FusionBridge",
"inputs": ["img", "cd"],
"level": "eye",
"epochs": 36,
"train_towers": true,
"warmup": {
"tower_epochs": 3,
"fused_epochs": 3
},
"args": { "fusion_dim": 256 }
},
{
"name": "nt_head",
"type": "head",
"input": "nt",
"train_with": "nt"
}
],
"training": {
"lr": 1e-4,
"batch_size": 8,
"bcd_prob": 0.5,
"tune_binary_threshold": true
}
}
+92
View File
@@ -0,0 +1,92 @@
{
"_notes": [
"Single-rep checkpointed run of the production bilateral img+cd ensemble",
"at the refuge_efficientnet_v2_m backbone. Per-fold tower and stage_models",
"state_dicts are saved under {output_root}/{run_name}/binary/checkpoints/",
"fold{N}/ for downstream explainability (Grad-CAM, attribution, etc.).",
"",
"Same architecture as ensemble_fused.json — only changes are:",
" • img.args.backbone = refuge_efficientnet_v2_m",
" • save_checkpoints = true",
" • run_name = experiments/explainability/ensemble_v2m_ckpt"
],
"run_name": "experiments/explainability/ensemble_v2m_ckpt",
"num_classes": 2,
"label_filter": [0, 1],
"split_identity_level": 1,
"eval_stage": "hb",
"save_predictions": true,
"save_checkpoints": true,
"seed": 1234,
"folds": 5,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": ["binary"],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": ["Axial_Length"],
"in_memory_cache": true
}
},
"towers": [
{
"name": "img",
"module": "v4.classes.towers.image_tower",
"class": "ImageEncoder",
"data_source": "image",
"args": {
"backbone": "refuge_efficientnet_v2_m",
"freeze_ratio": 0.0,
"augment": true
}
},
{
"name": "cd",
"module": "v4.classes.towers.clinical_tower",
"class": "ClinicalEncoder",
"data_source": "matrix",
"args": { "hidden_dim": 128 }
}
],
"stages": [
{ "name": "cd_warm", "type": "warm", "tower": "cd", "head_name": "cd_aux", "level": "eye", "epochs": 40 },
{ "name": "img_aux", "type": "head", "input": "img", "train_with": "nt", "bcd": true },
{ "name": "cd_aux", "type": "head", "input": "cd", "train_with": "nt", "bcd": true },
{
"name": "nt",
"type": "fusion",
"module": "v4.classes.bridges.fusion_bridge",
"class": "FusionBridge",
"inputs": ["img", "cd"],
"level": "eye",
"epochs": 36,
"train_towers": true,
"warmup": { "tower_epochs": 3, "fused_epochs": 3 },
"args": { "fusion_dim": 256 }
},
{ "name": "nt_head", "type": "head", "input": "nt", "train_with": "nt" },
{
"name": "hb",
"type": "fusion",
"module": "v4.classes.bridges.hyperbridge",
"class": "HyperBridge",
"inputs": { "a": "nt", "b": "nt" },
"level": "patient",
"epochs": 10,
"args": { "hidden_dim": 256, "mode": "embedding_mlp" }
},
{ "name": "hb_head", "type": "head", "input": "hb", "train_with": "hb", "args": { "dropout": 0.3 } }
],
"training": {
"lr": 1e-4,
"batch_size": 8,
"bcd_prob": 0.5,
"tune_binary_threshold": true
}
}
+84
View File
@@ -0,0 +1,84 @@
{
"_notes": [
"Image tower only, binary classification. Mirrors ensemble_fused architecture",
"(eye-level fusion → patient-level hb → head) with the cd tower removed,",
"so test AUC is directly comparable to baseline_ensemble."
],
"run_name": "v4/img_solo",
"num_classes": 2,
"label_filter": [0, 1],
"split_identity_level": 1,
"eval_stage": "hb",
"save_predictions": true,
"seed": 1234,
"folds": 5,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": ["binary"],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": ["Axial_Length"],
"in_memory_cache": true
}
},
"towers": [
{
"name": "img",
"module": "v4.classes.towers.image_tower",
"class": "ImageEncoder",
"data_source": "image",
"args": {
"backbone": "refugelike",
"freeze_ratio": 0.0,
"augment": true
}
}
],
"stages": [
{
"name": "img_fuse",
"type": "fusion",
"module": "v4.classes.bridges.mono_bridge",
"class": "MonoBridge",
"inputs": ["img"],
"level": "eye",
"epochs": 36,
"train_towers": true,
"args": { "use_ln": false }
},
{
"name": "img_fuse_head",
"type": "head",
"input": "img_fuse",
"train_with": "img_fuse"
},
{
"name": "hb",
"type": "fusion",
"module": "v4.classes.bridges.hyperbridge",
"class": "HyperBridge",
"inputs": { "a": "img_fuse", "b": "img_fuse" },
"level": "patient",
"epochs": 10,
"args": { "hidden_dim": 256, "mode": "embedding_mlp" }
},
{
"name": "hb_head",
"type": "head",
"input": "hb",
"train_with": "hb",
"args": { "dropout": 0.3 }
}
],
"training": {
"lr": 1e-4,
"batch_size": 8,
"tune_binary_threshold": true
}
}
+89
View File
@@ -0,0 +1,89 @@
{
"_notes": [
"Image tower only, regression head predicting vf_md.",
"Mirrors ensemble_fused architecture (eye-level fusion → patient-level hb → head)",
"with the cd tower removed, so neg_mse is directly comparable to baseline_reg_nt50."
],
"run_name": "v4/img_solo_reg",
"num_classes": 2,
"label_filter": [0, 1, 2],
"split_identity_level": 1,
"eval_stage": "hb",
"save_predictions": true,
"seed": 1234,
"folds": 5,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": ["binary"],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": ["Axial_Length"],
"in_memory_cache": true
}
},
"towers": [
{
"name": "img",
"module": "v4.classes.towers.image_tower",
"class": "ImageEncoder",
"data_source": "image",
"args": {
"backbone": "refugelike",
"freeze_ratio": 0.0,
"augment": true
}
}
],
"stages": [
{
"name": "img_fuse",
"type": "fusion",
"module": "v4.classes.bridges.mono_bridge",
"class": "MonoBridge",
"inputs": ["img"],
"level": "eye",
"epochs": 50,
"train_towers": true,
"args": { "use_ln": false }
},
{
"name": "img_fuse_head",
"type": "head",
"input": "img_fuse",
"train_with": "img_fuse",
"module": "v4.classes.heads.regression",
"class": "RegressionHead",
"args": { "dropout": 0.3, "target_key": "vf_md", "loss": "mse" }
},
{
"name": "hb",
"type": "fusion",
"module": "v4.classes.bridges.hyperbridge",
"class": "HyperBridge",
"inputs": { "a": "img_fuse", "b": "img_fuse" },
"level": "patient",
"epochs": 10,
"args": { "hidden_dim": 256, "mode": "embedding_mlp" }
},
{
"name": "hb_head",
"type": "head",
"input": "hb",
"train_with": "hb",
"module": "v4.classes.heads.regression",
"class": "RegressionHead",
"args": { "dropout": 0.3, "target_key": "vf_md", "loss": "mse" }
}
],
"training": {
"lr": 1e-4,
"batch_size": 8,
"tune_binary_threshold": true
}
}
+115
View File
@@ -0,0 +1,115 @@
{
"_notes": [
"Smoke test: convnextv2_tiny backbone, single fold, few epochs.",
"Goal is to verify the new ConvNeXt-V2 path works end-to-end (load weights,",
"forward, backward, save summary). Not for measuring quality."
],
"run_name": "smoke/convnextv2_tiny",
"num_classes": 2,
"label_filter": [
0,
1,
2
],
"split_identity_level": 1,
"eval_stage": "hb",
"save_predictions": false,
"seed": 1234,
"folds": 3,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": [
"binary"
],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": [
"Axial_Length"
],
"in_memory_cache": true
}
},
"towers": [
{
"name": "img",
"module": "v4.classes.towers.image_tower",
"class": "ImageEncoder",
"data_source": "image",
"args": {
"backbone": "convnextv2_tiny",
"freeze_ratio": 0.6,
"augment": true
}
}
],
"stages": [
{
"name": "img_fuse",
"type": "fusion",
"module": "v4.classes.bridges.mono_bridge",
"class": "MonoBridge",
"inputs": [
"img"
],
"level": "eye",
"epochs": 2,
"train_towers": true,
"args": {
"use_ln": false
}
},
{
"name": "img_fuse_head",
"type": "head",
"input": "img_fuse",
"train_with": "img_fuse",
"module": "v4.classes.heads.regression",
"class": "RegressionHead",
"args": {
"dropout": 0.3,
"target_key": "vf_md",
"loss": "mse"
}
},
{
"name": "hb",
"type": "fusion",
"module": "v4.classes.bridges.hyperbridge",
"class": "HyperBridge",
"inputs": {
"a": "img_fuse",
"b": "img_fuse"
},
"level": "patient",
"epochs": 2,
"args": {
"hidden_dim": 256,
"mode": "embedding_mlp"
}
},
{
"name": "hb_head",
"type": "head",
"input": "hb",
"train_with": "hb",
"module": "v4.classes.heads.regression",
"class": "RegressionHead",
"args": {
"dropout": 0.3,
"target_key": "vf_md",
"loss": "mse"
}
}
],
"training": {
"lr": 1e-4,
"batch_size": 8,
"tune_binary_threshold": true
}
}
+67
View File
@@ -0,0 +1,67 @@
{
"_notes": [
"Single-eye img-only variant. Eye-level MonoBridge fusion, no patient-level hb.",
"Each eye is classified independently. For comparing single vs bilateral",
"in the img-only architecture."
],
"run_name": "v4/img_solo_single",
"num_classes": 2,
"label_filter": [0, 1],
"split_identity_level": 1,
"eval_stage": "img_fuse",
"save_predictions": true,
"seed": 1234,
"folds": 5,
"fold_seed": 100,
"output_root": "v4/results",
"out_dir_tags": ["binary"],
"data": {
"module": "v4.classes.profiles.v4papila",
"args": {
"image_dir": "Papila/FundusImages",
"clinical_dir": "Papila/ClinicalData",
"label_col": "Diagnosis",
"iop_corr_method": "ratio",
"iop_drop_raw": true,
"exclude_cols": ["Axial_Length"],
"in_memory_cache": true
}
},
"towers": [
{
"name": "img",
"module": "v4.classes.towers.image_tower",
"class": "ImageEncoder",
"data_source": "image",
"args": {
"backbone": "refugelike",
"freeze_ratio": 0.0,
"augment": true
}
}
],
"stages": [
{
"name": "img_fuse",
"type": "fusion",
"module": "v4.classes.bridges.mono_bridge",
"class": "MonoBridge",
"inputs": ["img"],
"level": "eye",
"epochs": 36,
"train_towers": true,
"args": { "use_ln": false }
},
{
"name": "img_fuse_head",
"type": "head",
"input": "img_fuse",
"train_with": "img_fuse"
}
],
"training": {
"lr": 1e-4,
"batch_size": 8,
"tune_binary_threshold": true
}
}