# Architecture decision tree (model-selection) Pick an architecture from the **research question + modality + data scale + label availability**, not from what is fashionable. Read this index, then open the matching family card (`classification.md`, `segmentation.md`, `foundation_models.md`) for the per-paper detail and the `/model-scaffold` template to instantiate. ## Step 1 — name the task | The research question is about… | Task | Family card | |---|---|---| | "is finding X present / which class" (per image / per patient) | **classification** (binary / multi-label) | `classification.md` | | "delineate / measure structure X" (pixel/voxel mask, volume, boundary) | **segmentation** | `segmentation.md` | | "find and localise lesions" (boxes / points, count, FROC) | **detection** | `detection.md` | | "I have few labels / want to pretrain on unlabelled scans" | **self-supervised pretraining → fine-tune** | `foundation_models.md` | | "adapt a released medical foundation model" | **transfer / prompt a foundation model** | `foundation_models.md` | | "synthesise / translate a modality" (MRI→CT, denoise) | **image-to-image / generative** | `synthesis.md` | | "classify from a brain connectome / graph" (ROI connectivity, DTI/fMRI) | **graph neural network** | `graph.md` | | "generate a report / answer a visual question" | **multimodal LLM** | *(use `/mllm-eval`; not a CNN choice)* | ## Step 2 — let the constraints narrow it - **Modality / dimensionality**: 2-D (CXR, fundus, path tiles, single CT/MR slices) → 2-D backbones / 2-D U-Net. 3-D volumes (CT, MR) → **3-D U-Net / SegResNet / nnU-Net** (3-D context matters; do not collapse to slices if the structure is volumetric). A **graph** (brain connectome, ROI-connectivity matrix — no pixel grid) → a **GNN** (`graph.md`); integrate PyTorch Geometric / DGL directly (`/model-scaffold` has no graph template). - **Labelled data scale** (events/structures, not just images): - **small** (hundreds) → a **pretrained** backbone fine-tuned (ImageNet / a medical foundation model), strong augmentation, heavy regularisation; prefer **nnU-Net** for segmentation (self-configuring, hard to beat with little data). - **medium** (thousands) → ResNet/DenseNet/EfficientNet (classification) or U-Net/SegResNet (segmentation), still pretrained. - **large** (tens of thousands+) → ViT / Swin become competitive; consider self-supervised pretraining on your own unlabelled pool first. - **Class imbalance / small structures** → segmentation: Dice/Tversky/boundary-aware losses + a boundary metric; classification: AUPRC alongside AUROC. (Metric choice is `/model-assessment`; it constrains the loss here.) - **Interpretability / deployment need** → simpler, well-understood backbones (ResNet + Grad-CAM) over a marginally better but opaque model. ## Step 3 — default picks (a safe starting point, then justify deviations) | Task + setting | Default | Why | |---|---|---| | 2-D multi-label CXR classification | **ResNet-50 / EfficientNet (pretrained, `timm`)** | strong, cheap baselines; check calibration before reporting probabilities (**ConvNeXt** for a modern CNN — `classification.md`) | | 3-D lesion detection (boxes, FROC) | **nnDetection** | self-configuring — the nnU-Net of detection (`detection.md`) | | 3-D organ / lesion segmentation | **nnU-Net (v2)** | self-configuring; the standard to beat | | 3-D segmentation, tensor-core GPU, max accuracy | **nnU-Net ResEnc (M/L/XL)** | the 2024 "Revisited" frontier; still self-configuring (`segmentation.md`) | | 2-D segmentation, custom pipeline | **U-Net / Attention U-Net (MONAI)** | transparent, controllable | | few labels, many unlabelled scans | **SSL pretrain (DINO/MAE) → fine-tune**, or **MedSAM/TotalSegmentator transfer** | label-efficient | | few labels, task in a covered domain (retina / path / CXR / CT) | **domain FM transfer (RETFound / UNI / CONCH / Merlin)** | domain-pretrained; most weights non-commercial — verify (`foundation_models.md`) | | zero-/few-shot organ masks on CT | **TotalSegmentator / MedSAM2** | released weights, no training | | accelerate expert 3-D labelling | **interactive FM (nnInteractive / VISTA3D)** | prompt-and-correct, not from-scratch; check the weight licence (`foundation_models.md`) | ## Step 4 — write the decision note Record the choice as a short note (`decisions/architecture_choice.md`): the **task**, the **chosen architecture**, the **source paper** it comes from, the **reason** (against the constraints above), the **runner-up + why not**, and the matching **`/model-scaffold` template**. Never recommend an architecture without naming its source paper, and never quote a benchmark number you have not cited. Then hand the choice to `/model-scaffold`. > The zoo describes **archetypes**, not a live leaderboard. SOTA churns; the task → > family → constraint logic does not. When a newer model claims to beat these, evaluate > it with `/model-assessment` rather than adopting it on the strength of a headline. The > canonical warning is *nnU-Net Revisited* (Isensee et al., *MICCAI* 2024): under matched > compute, Transformer- and Mamba-based segmentors did **not** beat a scaled CNN nnU-Net, > and U-Mamba's Mamba layers ablated to zero contribution — the "advance" was a bigger CNN.