Bhat 2026 — HistoFID: Calibrating Fréchet Distance Across Pathology Foundation Models
The same pair of tile sets scores thirty-fold differently depending on which foundation model embeds it — and dividing by the encoder’s own within-cohort floor makes the numbers comparable again.
The problem it names
The Fréchet Inception Distance fits a Gaussian to the features of a fixed network for each of two image sets and measures the distance between those Gaussians. In pathology the Inception network is routinely swapped for a histology foundation model, on the reasonable-sounding assumption that a domain encoder gives a more meaningful score.
The paper’s observation is that this substitution is almost never examined, and that it changes the answer. The distance is computed entirely inside the encoder’s feature space, so it inherits that space’s scale, geometry and learned invariances — and encoders differ in all three.
For one fixed pair of tile sets, the raw Fréchet distance spans about thirty-fold across six encoders. The ordering does not follow embedding dimension, so it cannot be reasoned away as a dimensionality artefact. A raw score therefore cannot be read without naming the encoder, and two papers reporting “FID = 40” may not be comparing anything.
The fix, which is the reusable part
Divide the measured distance by the encoder’s own within-cohort floor — the distance between two disjoint halves of the same cohort at matched sample size, which is the value finite-sample estimation alone produces:
r_e = FD_test(e) / FD_floor(e), floor = FD_e(Φ_e(R_A), Φ_e(R_B)), R_A ∩ R_B = ∅, |R_A| = |R_B| = N
Numerator and denominator carry the same per-encoder feature scale, so the ratio cancels it. The paper is explicit that a difference would not — subtracting the floor leaves the scale intact, dividing removes it. Everything is evaluated at N = 25,000 per side, because FID’s finite-sample bias is itself encoder-dependent, so matching N removes sample size as a confound without equalising the bias.
Measured by the coefficient of variation across the six encoders’ values for one comparison:
| Raw | Normalised | Reduction | |
|---|---|---|---|
| Within cohort | CV 1.19 | 0.13 | ~89% |
| Across cohorts | CV 0.99 | 0.42 | ~58% |
The across-cohort residual is the honest part of the result: normalisation does not fully reconcile the encoders once a real distribution shift is present, only when the comparison is essentially null.
The four fields this repo always wants
| Field | Value |
|---|---|
| Dataset | In-house: 2,119 breast WSIs, H&E and IHC (ER, PR, Ki-67, HER2), supplied as pre-extracted 512×512 tiles in HDF5, ~500,000 tiles, with the archive’s own slide-disjoint train/val/test split. Public: TCGA-BRCA, 100 slides. |
| Scanner / magnification | Not stated for the in-house cohort. Tile size is given, µm/pixel is not. [unverified] — and for a paper about distribution shift this is a real omission. |
| Validation strategy | Slide-disjoint reference halves for the floor; comparisons at matched N; normalisation validated on independent comparisons. |
| External validation | Yes in the sense that matters here: TCGA-BRCA is an independent cohort, and the cross-cohort setting is one of the five evaluation settings rather than an afterthought. |
The two encoder groups
Once normalised, the six encoders split consistently — across cohort drift, stain shift and generative evaluation:
- Sensitive — CONCH (512-d, CLIP vision encoder), Phikon-v2 (1024-d, DINOv2), Inception-v3 (2048-d, ImageNet supervised)
- Invariant — UNI2-h (1536-d, DINOv2), Virchow2 (1280-d, DINOv2 mixed-magnification), Prov-GigaPath (1536-d, DINOv2)
The split does not reduce to the training objective, which is the interesting part: DINOv2 encoders appear in both groups. The paper attributes it jointly to feature scale, training-cohort breadth and augmentation strength. Strong augmentation during pretraining teaches an encoder to ignore exactly the nuisances — colour, focus, scanner — that a drift detector needs to see.
That yields a genuinely practical rule, and it is the sentence to remember:
“To detect scanner or cohort drift or to flag stain differences, a sensitive encoder is preferable. To measure a quantity that should be invariant to such nuisances, a strongly augmented DINOv2 encoder is appropriate, accepting that it will understate nuisance shift.”
And the choice changes conclusions. The same split decides which of two generative models (PixCell-256, a diffusion model conditioned on UNI embeddings; CytoSyn, flow-based) is judged more realistic. Their recommendation — report normalised distance under more than one encoder, and report recall alongside it — is the correct response to that and is cheap to follow.
The pathologist reader study, which is better than it needed to be
Two board-certified pathologists, blinded to encoder names and condition labels, ordered image variants by similarity to a reference and rated pairs on a 1–5 scale. Feature distance tracked perception closely: Spearman ρ = 0.96, and the reader’s most-similar variant matched the encoder’s nearest variant in 86% of fields. Concordance held at ρ = 0.95–0.96 across Phikon-v2 (sensitive), Virchow2 (invariant) and Inception-v3.
The interpretation is careful and worth adopting: the two-tier split is a property of feature geometry and sensitivity scale, not a sign that either family disagrees with a pathologist. Both tiers agree on the direction of difference and differ on its magnitude. That is a much more useful conclusion than “encoder X is better”, and it is what makes the sensitive/invariant framing a design choice rather than a quality ranking.
Methodological notes and reservations
- The codec result is vendor-run, and there is no competing-interests statement. The first affiliation is Turocrates.ai, Mumbai; the corresponding author is
founders@turocrates.ai; and the codec that wins is TuroCompress, described in the methods as “a proprietary compression codec from Turocrates.ai” running “the production Turocrates.ai pipeline”. The provenance is disclosed in the text and in a table caption, which is to the authors’ credit — but the paper carries no competing-interests declaration, no funding statement and no acknowledgements section at all. Verified by searching the full text. The claim itself: ~6.5 kB per tile at SSIM > 0.95, a 55-fold reduction, against roughly 15 kB for JPEG XL, 20 kB for JPEG 2000 and 50 kB for JPEG — so about 2.3× better than the best open codec tested, measured by the authors, using a protocol the authors designed, on a product the authors sell. Treat the methodological contribution and the codec benchmark as separate claims with different evidential weight. - No ethics or IRB statement. 2,119 patient slides with clinical IHC, and nothing in the paper records approval or consent. Verified by full-text search.
- No limitations section. Unusual for a methods paper, and the paper does have limitations worth stating — chiefly that the across-cohort CV only falls to 0.42.
- The release has no destination. “We release the normalization protocol, the per-encoder perturbation panel and the feature extracts” appears in the abstract and the conclusion, and no URL, repository or DOI for any of it appears anywhere in the paper. So the artefact that would make this reusable is promised and not located.
- No scanner or µm/pixel for the in-house cohort. For a paper whose subject is sensitivity to acquisition nuisances, the acquisition conditions of its main cohort are not reported.
- Phikon-v2’s training cohort includes TCGA, and TCGA-BRCA is the external cohort. The paper does not discuss whether that contaminates the cross-cohort comparison for that encoder. It plausibly should — an encoder that has seen the “external” cohort in pretraining is not in the same position as one that has not.
[unverified], and worth checking against the tables. - The slide-level result — an attention-pooling encoder raising the distance ~320-fold on matched cohorts, because it registers per-slide composition a pooled patch distance cannot see — is reported but not developed. It is arguably the most interesting number in the paper and gets a sentence.
Why it is relevant here
It supplies a measurement for something this wiki so far only describes qualitatively. Scanner and Stain Variability and sources/papers/khan-2026-stain-normalisation-benchmark.md establish that a foundation model’s feature space shifts under staining variation, but Khan’s evidence is t-SNE inspection, and Foundation Models in Pathology records explicitly that “the evidence is t-SNE inspection rather than a quantitative shift metric”. This is the quantitative shift metric, with a normalisation that makes it comparable across encoders and a floor that tells you what “no difference” looks like.
The encoders are the ones already on the drive. Foundation Model Cache holds UNI2-h, Virchow2, Phikon-v2, Prov-GigaPath and CONCH; PinkKidney already has UNI2-h, Virchow2, Phikon-v2 and CONCH wired into one extraction script with features cached one .pt per slide. Five of the paper’s six encoders are therefore already extractable here with no new engineering, which makes reproducing the floor on a local cohort a genuinely small job.
It answers an open question already on the books. Foundation Models in Pathology asks what the right discriminating metric for encoder choice is, having found that accuracy saturated and representation geometry separated encoders where AUC could not. The sensitive/invariant axis is a second such discriminator, measured differently and pointing the same way.
The cohort is breast with ER, PR, Ki-67 and HER2. That is this group’s material, which makes the tile-level numbers more transferable than a pan-cancer benchmark would be.
Open questions
- What is the within-cohort floor on the group’s own data? Computable today: pick two disjoint slide-level halves of the PinkKidney cohort, embed with the encoders already wired in, and read off the floor per encoder. That single number would say what “no difference” looks like locally, and everything else on this page is a ratio to it.
- Would a sensitive encoder (CONCH or Phikon-v2) detect the three-scanner batch structure in PinkKidney more cleanly than the silhouette and signal-to-batch statistics already used there? Same cohort, same cached features, different statistic — a direct comparison of two drift-detection approaches.
- Does the Phikon-v2 / TCGA pretraining overlap distort the cross-cohort result?
[unverified] - Where are the released protocol and feature extracts? Not stated in the paper; worth an email to the corresponding author, or a check for a repository appearing later.
- Is the ~320-fold slide-level gap reproducible, and does it mean pooled patch distances systematically understate cohort differences? If so it affects any use of this metric for cohort comparison, which is the use this group would have.