Add new scripts and configurations for model comparison and analysis

- Introduced `poster_model_comparison.py` for generating model comparison figures.
- Added `plot_poster_roc_comparison.py` for creating ROC comparison figures for PAPILA binary classification.
- Created new JSON configuration files for clinical solo models with and without geometry injection.
- Implemented batch dispatch updates in `batch_dispatch.py` to utilize run names from configurations.
- Added analysis scripts: `compare_grid.py`, `inspect_embeddings.py`, and `summarize_run.py` for evaluating model performance and feature embeddings.
- Created experiment configurations for various training scenarios, including warm sweeps and promoting successful runs.
- Added binary ROC comparison and model comparison figures to the results directory.
This commit is contained in:
rpotter6298
2026-05-14 13:43:30 +02:00
parent e2489a21e7
commit a721e52909
18 changed files with 1052 additions and 1 deletions
+78
View File
@@ -0,0 +1,78 @@
{
"_notes": [
"Diagnostic: cd tower alone, no geometry injection.",
"Pair to clinical_solo_geom_unet — same architecture but with geom_dim=0",
"and no img EPC supplier."
],
"run_name": "v4/clinical_solo",
"num_classes": 2,
"label_filter": [0, 1],
"split_identity_level": 1,
"eval_stage": "cd_fuse",
"save_predictions": true,
"save_features": 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 }
}
],
"training": {
"lr": 1e-4,
"batch_size": 16,
"tune_binary_threshold": true
}
}
+103
View File
@@ -0,0 +1,103 @@
{
"_notes": [
"Diagnostic: cd tower alone, with UNet-derived 5-feature CDR vector injection.",
"img tower is present only as an EPC supplier — its early_pass runs the UNet",
"fine-tune+inference pipeline and publishes geometry_vectors, but no stage",
"uses its embedding so its CNN body sits idle.",
"cd consumes the vectors via epc_requests and trains under MonoBridge."
],
"run_name": "v4/clinical_solo_geom_unet",
"num_classes": 2,
"label_filter": [0, 1],
"split_identity_level": 1,
"eval_stage": "cd_fuse",
"save_predictions": true,
"save_features": 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": "img",
"module": "v4.classes.towers.image_tower",
"class": "ImageEncoder",
"data_source": "image",
"epc_supplies": ["geometry_vectors"],
"args": {
"backbone": "refugelike",
"freeze_ratio": 1.0,
"augment": false,
"geometry_source": "unet",
"weights_path": "models/v2/refuge/segmentation/per_image/best.pt",
"contour_dir": "Papila/ExpertsSegmentations/Contours",
"unet_size": 512,
"normalize": "per_image",
"threshold": 0.5,
"finetune_epochs": 10,
"finetune_lr": 1e-5,
"finetune_batch_size": 4
}
},
{
"name": "cd",
"module": "v4.classes.towers.clinical_tower",
"class": "ClinicalEncoder",
"data_source": "matrix",
"epc_requests": ["geometry_vectors"],
"args": {
"hidden_dim": 128,
"geom_dim": 5
}
}
],
"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 }
}
],
"training": {
"lr": 1e-4,
"batch_size": 16,
"tune_binary_threshold": true
}
}