Compact models for patient-level histopathology MIL: baselines and controlled evaluation
For now, I found a few compact models and implementation examples that might be relevant:
* * *
## Short answers to the three questions
**1. Compact encoders and frozen features versus fine-tuning.** I would keep the project’s existing compact CNN or ViT as a reference and compare it with at least one released, pathology-pretrained small encoder. Three concrete ViT-S/16 candidates are Kaiko ViT-S, Lunit DINO ViT-S, and DistillPath-KS16-HOpt0. The first two offer different pathology-pretraining references; the third is a small student initialized from Kaiko and subsequently distilled from a larger pathology teacher. None is necessarily best for an unseen patient-level task. **Frozen crop embeddings followed by a small patient-level MIL head** are a particularly interpretable and inexpensive first comparison. End-to-end or partial fine-tuning can be a separate branch if the frozen representation appears limiting.
**2. Variable crop counts and heterogeneous tissue.** Start with **mean pooling and attention-based MIL** using identical cached embeddings and an explicit crop budget. The classic attention-based deep MIL paper provides a simple learnable set aggregator. Vary the number of crops per patient and repeat crop sampling with different seeds; this often tells you more than immediately adding a complex head. Max/top-k or class-aware selection are conditional alternatives when evidence is sparse. If a patient has several identifiable slides, compare flat crop-to-patient pooling with slide-first aggregation rather than assuming either hierarchy is universally better.
**3. Controls that separate methodological gains.** Hold **encoder and crop IDs fixed** when comparing aggregation methods; hold **MIL head, splits, crop budget, and evaluation protocol fixed** when comparing encoders. A released distilled checkpoint versus its released initialization is a practical comparison of _weights as distributed_ , not a clean causal estimate of a distillation loss: the distilled student also had additional training data and compute. To study the distillation objective itself, compare the same student initialized the same way under suitably matched training conditions, with and without the teacher signal. Report patient-level macro-F1 and class recall beside crop counts and costs, rather than treating parameter count alone as a compute control.
The earlier reply already suggests frozen pathology features and one-factor-at-a-time comparisons. To complement it, I have included specific weights, implementation references, conditional choices, and a bounded T4 engineering check. None requires access to unpublished methods or private results.
In a short **Colab Tesla T4 feature-extraction test** , all three public ViT-S checkpoints loaded through `timm` and yielded **384-dimensional pooled crop embeddings**. This checks compatibility and a limited cost reference, **not** patient macro-F1, clinical utility, or a distillation gain. The tested scope appears below.
## A practical low-compute route
1. **Keep the existing patient/source split.** Maintain an unambiguous mapping among patient, label, crop, tissue-source group, and slide ID if one exists. With patient labels, keep the patient as the prediction and evaluation unit even if feature files are stored by slide.
2. **Cache frozen embeddings** for the existing compact model and one or two pathology-pretrained candidates. Use identical source crops and patient membership but each checkpoint’s prescribed preprocessing. Record revisions and transforms.
3. **Compare mean pooling with a small attention head** on those same features. This avoids rerunning the encoder and tests aggregation against a simple permutation-invariant baseline.
4. **Change the crop budget, not everything at once.** Test a few feasible per-patient caps, repeat subsampling, and report patient macro-F1, per-class recalls, and variability. If results are stable at a small cap, that itself helps the efficiency objective.
5. **Spend additional compute only where the results point.** If encoder choice dominates, investigate fine-tuning or a better student. If crop sampling or aggregation dominates, focus there. If the objective or teacher signal is the claimed contribution, preserve the simple baselines and add matched training controls.
## Checks worth making before interpreting any gains
* **Compare predictions at the patient level.** If multiple slides belong to one patient, a split that is disjoint only by slide does not guarantee patient independence. Your post already identifies patient/source separation; the important point is to preserve it through feature extraction, MIL training, and reporting.
* **Define the crop policy.** “32 crops” could mean exactly 32 sampled, at most 32, or all available up to 32. A patient with fewer than 32 images needs an explicit policy; duplicating crops is not equivalent to keeping the smaller bag.
* **Keep crop identities stable across encoders.** Compare the _same underlying images_ with each checkpoint’s intended resize/normalization; forcing identical transforms is a separate ablation.
* **State which feature tensor enters MIL.** For these tested ViT-S weights, `model(x)` with `num_classes=0` gives `[B, 384]`; `forward_features(x)` gives `[B, 197, 384]`. Feeding tokens instead of one pooled vector per crop changes both the model and its compute. See the official timm feature-extraction guide.
* **Separate training convenience from inference cost.** A feature cache saves repeated encoder work during head training, but an unseen patient’s images still require preprocessing and encoding. Teacher computation for distillation is a third, separate cost.
The expanded sections provide details and references for the branches that turn out to matter.
Compact pathology encoders, feature extraction, and a small T4 check (click for more details) Variable crop counts, heterogeneous tissue, and patient-level MIL (click for more details) Controlled experiments: which conclusion does each comparison support? (click for more details) Compute accounting: cached training versus a new patient's inference (click for more details) Code and paper references organized by the question they answer (click for more details) Reproducibility, conditional risks, and what remains unknown (click for more details)