Pathology foundation models turn a digitized tissue slide into a single vector and diagnose from it. A recent security study found that these slide-level vectors are fragile. Imperceptible noise on as few as 0.1% of a slide's image tiles, including tiles of perfectly normal tissue, can flip a tumor-bearing slide to "normal." The attacker needs no labels to do it. This proposal adds a second, independent reader of the same tiles. That reader is the classical cell-profiling pipeline from high-content microscopy: segment every nucleus, then measure its size, shape, stain intensity and texture. We then ask whether the foundation model's embedding of each tile is consistent with what those measurements say the tile contains. An imperceptible perturbation can move a deep embedding a long way while leaving nuclear shapes and chromatin texture essentially unchanged. The mismatch between the two readers is therefore a tamper signal. It also points to specific tiles a pathologist can look at, which makes it more usable in practice than a bare "adversarial" alarm.
The claim is testable and could be wrong. A defense-aware attacker can try to fool both readers at once. If the witness works, doing so should force the attacker to change visible morphology, so the attack stops being imperceptible. If the attacker can satisfy the witness within the same tiny noise budget, the idea fails, and we will know that cleanly.
Core Claim
Requiring a tile's foundation-model embedding to agree with an interpretable morphological profile of that tile raises the perturbation size an adaptive attacker needs to cause a slide-level misdiagnosis. The same check must stay quiet on clean slides from new hospitals and scanners. The two halves of the claim carry equal weight. A detector that fires on every slide from a new scanner would be ignored in a real laboratory, and the translation literature says alerts must drive a concrete action rather than add noise (Johnson et al.). Clinicians under load also over-trust wrong outputs (Gaube et al.), so a silent failure is the worst case, and a noisy alarm is the second worst.
Where This Sits
The motivating result is The Butterfly Effect in Pathology. That paper attacks the slide-level foundation models CHIEF, TITAN and PRISM by maximizing the squared distance between clean and perturbed slide embeddings. It finds that larger models are more fragile and that perturbing benign tiles can produce false negatives. Its defense is uniform noise of ±1/255 added at inference, which it tested only against single-step, non-adaptive attacks. We reuse its threat model and its models. We differ in two ways: we add an independent consistency check, and we evaluate against attackers who know about the defense.
The dynamic-threat literature constrains the design. Stealth Attacks Against Moving Target Defense shows that adversaries who anticipate randomized defenses route around them. Model-switching defenses for vision (Moving Target Defense for Deep Visual Sensing, Securing Deep Neural Nets with Moving Target Defense) were tested on small natural images and rely on the attacker not averaging over the randomness. We read this as a warning, not a template. Randomization alone is the thing an adaptive attacker defeats. We therefore make a fixed, physically grounded constraint the core of the design, and treat randomization of the witness as an ablation.
The method comes from cell profiling. Caicedo et al. define the per-cell feature families: shape (area, eccentricity, Zernike moments), intensity, and co-occurrence texture. They also define the practice of aggregating these features per sample and correcting batch effects. Way et al. show that such profiles predict downstream biological states, which is the "profile predicts something richer" relationship we exploit. These tools were built for fluorescent Cell Painting in cultured cells (Gustafsdottir et al.). We transfer the measurement methodology, not the stains, to the hematoxylin channel of routine H&E slides. How well that transfer works is itself an open question the file flags, and we test it.
The idea that structural grounding fixes "right answer, wrong tiles" comes from mixed-supervision attention MIL on Camelyon16. Grounding tile evidence in annotations there raised tile specificity from 0.864 to 0.999. We ask whether grounding in measured morphology, which needs no annotation, gives a similar protection against adversarially spoofed benign tiles.
Research Program
For each tile $x$, let $f(x)$ be the foundation model's tile embedding and $m(x)$ the aggregated morphological profile of its segmented nuclei. We train a small regressor $g$ on clean slides to predict the embedding from the profile. We then score each tile by
$$s(x) = \lVert P\,(f(x) - g(m(x))) \rVert_2 ,$$
where $P$ projects onto the embedding directions that morphology actually predicts well on held-out clean data. We restrict to those directions because morphology will not explain everything a foundation model encodes. Directions it cannot predict carry no witness signal, and including them would only inflate false alarms.
Alarm thresholds are calibrated per site with split-conformal quantiles on clean tiles, which gives a controlled false-alarm rate. At the slide level, we report the tiles whose scores exceed the threshold. We also recompute the diagnosis with those tiles removed, and flag the slide for review if the diagnosis changes.
The adaptive attacker solves
$$\max_{\delta,\ \lVert\delta\rVert_\infty \le \epsilon} \ \mathrm{MSE}\big(z(x), z(x+\delta)\big) - \lambda \sum_{\text{tiles}} s(x+\delta) .$$
Here $z$ is the slide embedding, $\delta$ is the perturbation restricted to a chosen fraction of tiles, and $\lambda$ trades attack strength against evading the witness. Nuclear segmentation is not differentiable, so gradients through it are obtained with a differentiable surrogate: backward-pass approximation through a soft segmentation network. The attacker also averages gradients over the defense's random inference noise, following expectation-over-transformation practice.
The central measurement is the attack-success curve against $\epsilon$. Alongside it we track how much the perturbation changes $m(x)$, in units of clean within-slide variation. That quantity is a direct, interpretable measure of whether the attacker had to alter visible morphology.
The dynamic-threat element enters as a secondary component. Each slide draws a secret feature subset and one of several segmentation models for its witness. We test whether this rotation adds anything beyond the fixed constraint once the attacker averages over the rotation distribution.
Baselines
The naive reference point is the undefended foundation model. The Butterfly Effect in Pathology reports its behavior on Camelyon16. TITAN reaches 98.32% clean accuracy and falls to 41.78% under FGSM. PRISM falls to about 58% under local perturbation. We reproduce these with their label-free attack before adding any defense.
The strongest existing defense is that paper's ±1/255 uniform inference noise, which restores PRISM to 95.64% on Camelyon16. This is the number to beat, and it was measured only against a non-adaptive attacker. We run the noise defense and the witness on identical slides, models and attack budgets. Every defense faces the same attacker: multi-step, averaging over the defense's randomness, with the same iteration count and restarts. Beating it means the witness plus noise keeps higher slide accuracy, or catches more attacked slides at a matched clean false-alarm rate, under that attacker. Matching 95.64% against the weak attack is not sufficient.
A second strong competitor is an embedding-space outlier detector: Mahalanobis distance of each tile embedding to the clean class-conditional distribution. It is calibrated with the same conformal procedure and attacked with the same joint objective.
For the translation side, the reference is a standard weakly supervised attention-MIL classifier. CLAM reports a slide AUC of 0.895 on Camelyon16 in the mixed-supervision study. We also train a morphology-only MIL classifier on $m(x)$ alone.
Two ablations isolate the key ingredient. The first replaces $m(x)$ with a second, independently trained deep encoder, which tests whether independence alone gives the benefit rather than physical grounding. The second removes the projection $P$, which tests whether restricting to morphology-predictable directions is what keeps false alarms low.
For the shift experiments, the no-defense false-alarm rate across TCGA sites is by construction zero alarms. We report it alongside the error the undefended model makes on those sites. No reported result was found on Lacuna for per-site TCGA accuracy of these foundation models.
Why not just…?
Why not just use the inference-noise defense that already restores 95.64%? That number comes from a single-step attacker who ignores the noise. The dynamic-threat literature (Stealth Attacks Against Moving Target Defense) predicts that such defenses collapse once the attacker averages over the randomness. Our first experiment tests exactly this. If the noise defense still holds against the adaptive attacker, the witness is unnecessary for accuracy, and its remaining value would be only the tile-level review list. We would report that outcome as such.
Why not just run an outlier detector in embedding space? This is the most serious threat to the proposal. The detector is cheap and needs no segmentation. Its weakness is that it lives in the same space the attacker already optimizes, so a penalty on it should be almost free for the attacker. Our claim predicts that the Mahalanobis detector's catch rate falls to near chance under the joint attack while the witness's does not. If both degrade equally, morphology adds nothing and the idea fails.
Why not just diagnose from morphology alone, or use the smaller, less fragile model? A morphology-only classifier is plausibly robust but likely less accurate. The file gives no reported number for it. Liu et al. show CHIEF is less fragile than PRISM, but the file does not show it is robust. We run both. If morphology-only MIL matches the foundation model's clean accuracy on Camelyon16 and TCGA, the simpler answer is to use it and drop the foundation model, and we would say so.
Why not just adversarially fine-tune the slide model? Adversarial fine-tuning of billion-scale slide encoders is expensive, and it needs labels the label-free threat model says the defender at a deployment site may lack. It also produces no tile-level explanation. We include a budget-matched adversarial fine-tuning of the slide-level aggregator only, as a reference.
Proposed Experiments
The experiments use Camelyon16 (270 training and 129 test slides) with CHIEF, TITAN and PRISM, mirroring Liu et al. They use TCGA diagnostic slides split by submitting site to measure false alarms under real pre-analytical shift, meaning differences in staining, fixation and scanners. A held-out endometrial biopsy cohort (endometrial WSI dataset) serves as an external check.
The metrics are:
- slide accuracy and AUC under attack, as a function of $\epsilon$ and of the fraction of perturbed tiles;
- detection rate at a 1% and a 5% clean false-alarm rate, per site;
- the morphological displacement the attacker needed;
- tile-level overlap between flagged tiles and truly perturbed tiles, specifically including the benign-tile "semantic paradox" attack.
A small reader study with pathologists checks one question: whether reviewing the flagged tiles lets them catch attacked slides without slowing clean reads. This addresses the automation-bias concern directly rather than rhetorically.
The decisive check is a single number. At $\epsilon = 4/255$ with 0.1% of tiles perturbed, can the adaptive attacker still cut PRISM's accuracy by more than 50% while keeping witness alarms at the clean rate? If yes, the proposal is refuted. If the attacker instead needs a morphological displacement comparable to natural between-slide variation, the witness has converted an invisible attack into a visible one, which is the claim.
A second check guards against a hollow success. If per-site clean false alarms on TCGA exceed the calibrated rate by more than a factor of two, the method fails clinically even if it detects attacks.
References
- Perspective Toward Machine Learning Implementation in Pediatric Medicine: Mixed Methods Study
- Do as AI say: susceptibility in deployment of clinical decision-aids
- The Butterfly Effect in Pathology: Exploring Security in Pathology Foundation Models
- Stealth Attacks Against Moving Target Defense for Smart Grid
- Moving Target Defense for Deep Visual Sensing against Adversarial Examples
- Securing Deep Neural Nets against Adversarial Attacks with Moving Target Defense
- Data-analysis strategies for image-based cell profiling
- Predicting cell health phenotypes using image-based morphology profiling
- Multiplex Cytological Profiling Assay to Measure Diverse Cellular States
- Attention-based Multiple Instance Learning with Mixed Supervision on the Camelyon16 Dataset
- Endometrial whole-slide images dataset for detection of malignancy in endometrial biopsies.