Opponent Expectile Codes for Detecting When a Biopsy Has Missed the Tumor

A needle biopsy sees a sliver of a tumor that varies from place to place, and a model trained on a few dozen patients sees a sliver of the disease. Both failures have the same structure: a decision is made from a small, possibly unrepresentative sample of a heterogeneous distribution. The brain faces this problem all the time. Recent recordings show that the striatum does not track only the average reward. It keeps two opposing populations of neurons. One population learns quickly from good surprises and slowly from bad ones, so it becomes an "optimist" that tracks the upper part of the reward distribution. The other does the reverse and tracks the lower part. The gap between the optimist and pessimist estimates is a built-in measure of how spread out, and how uncertain, the outcome is.

We propose to use this opponent code to summarize tissue. Each slide or biopsy gets a small vector of optimistic and pessimistic summaries of its patch-level tumor scores. The optimist–pessimist gap is then used for a question current pathology models do not answer: is this particular sample good enough to trust, or did the sampling probably miss a small malignant region? The application is digital pathology under simulated needle sampling and deliberately small training cohorts. The neuroscience supplies the mechanism and a testable claim about how much of the code a downstream readout actually needs.

Core Claim

An expectile is a summary of a distribution that generalizes the mean. Instead of one value, it gives a family of estimates indexed by $\tau \in (0,1)$, where $\tau=0.5$ is the mean, values near 1 are pulled toward the upper tail, and values near 0 toward the lower tail. It is exactly what an asymmetric learner converges to. Consider the update $e \leftarrow e + \alpha^+[\delta]^+ - \alpha^-[\delta]^-$, where $\delta = x - e$ is the error on a new patch score $x$, $[\delta]^+$ and $[\delta]^-$ are its positive and negative parts, and $\alpha^+,\alpha^-$ are the learning rates for good and bad news. Its fixed point is the expectile

$$e_\tau = \arg\min_e \; \mathbb{E}\big[\,|\tau - \mathbf{1}(x<e)|\,(x-e)^2\,\big], \qquad \tau = \frac{\alpha^+}{\alpha^+ + \alpha^-}.$$

This equivalence is what An opponent striatal circuit for distributional reinforcement learning uses to explain why optogenetic shifts of D1 ("optimist") and D2 ("pessimist") striatal neurons move behavior as an expectile model predicts. It is also what Learning Reward Uncertainty in the Basal Ganglia formalizes: in that model, the difference of the two pathways' weights encodes the mean and their sum encodes the spread.

Our claim has three parts, in decreasing order of confidence.

First, when only $k$ patches are available, as in a needle-like strip through a slide, high expectiles of patch scores are more stable tail summaries than empirical quantiles or the maximum. The reason is statistical. An upper quantile computed from 16 patches is almost always zero when tumor covers 2% of the tissue. A maximum responds to a single noisy patch. An expectile responds to the size of every exceedance, so its sampling variance depends on second moments rather than on the density in a sparsely populated tail.

Second, the gap between optimistic and pessimistic expectiles, computed on the biopsy alone, predicts when the biopsy-level diagnosis disagrees with the whole-slide diagnosis. It does so better than bootstrap or ensemble uncertainty. The bootstrap is known to be unreliable for extreme statistics like the maximum, and ensembles measure model uncertainty, not sampling uncertainty.

Third, and as the more speculative neuroscience-facing result, a linear readout restricted to the two pathway summaries the basal-ganglia model predicts (mean-like and spread-like combinations) will recover most of the accuracy of a readout over the full expectile vector. This bears on the open question of how prefrontal cortex reads out striatal distributional codes.

What is new is not pooling by distribution statistics. Quantile pooling already exists. The new parts are an asymmetric-rate population with an opponent structure, evaluated in the regime where sampling bias and small cohorts actually bite, and used to produce a per-case biopsy-sufficiency flag.

Research Program

Prior work defines the space. Multiple Instance Learning for Heterogeneous Images: Training a CNN for Histopathology sorted patch predictions into fixed quantiles (10th–90th percentile) rather than max-pooling. On Carolina Breast Cancer Study tissue cores this raised histologic subtype accuracy from 89.8% to 95.2%. That motivates distributional pooling, but it is post-hoc sorting with no notion of a sample being insufficient. Navigating the MIL Trade-Off: Flexible Pooling for Whole Slide Image Classification showed that a small domain encoder with Maxsoft pooling (hard max going forward, a smooth Log-Sum-Exp gradient going backward) beats the Prov-GigaPath foundation model in low-data regimes, at about 1,000x less compute. This constrains us: whatever we build must stay small, and a smooth max is our nearest competitor.

On the neuroscience side, Rutledge et al. (2015) found that raising dopamine increases risk-taking only for gains, not losses. That suggests a "gain" control acting on the optimistic channels alone, rather than a global change in utility. Asymmetric REINFORCE shows that weighting toward positive outcomes stabilizes learning from limited off-policy data, and that over-pessimism causes collapse. We take it as a warning about extreme pessimistic weighting, not as a method we reuse.

Architecture. We use a frozen pathology patch encoder of the kind used in the Maxsoft study. A one-layer patch scorer produces a score per patch. Per slide or biopsy, we compute a population of $M=9$ expectiles at asymmetric ratios spanning $\tau \in [0.05, 0.95]$. These are solved exactly by a few Newton steps and differentiated implicitly, so we do not simulate the online update. The online rule fixes the parameterization and interpretation, and we verify numerically that it reaches the same fixed points. A linear readout maps the expectile vector to the label. The whole thing has a few thousand trainable parameters on top of the frozen encoder.

Biopsy flag. The flag is the scaled gap $e_{0.95}-e_{0.05}$ together with the position of the readout's decision relative to the threshold. It is used directly to defer cases to "sample more."

Gain knob. This is a scalar multiplier on the readout weights of the $\tau>0.5$ channels only. It is the analog of the gain-selective dopamine effect.

Regimes. We study two kinds of scarcity. The first is sampling scarcity: $k \in \{4, 8, 16, 32, 64\}$ patches drawn as contiguous strips that mimic a needle track, plus random scattered patches as a control. The second is cohort scarcity: training on $N \in \{25, 50, 100\}$ slides plus the full training set. $N=25$ matches the size of the biliary trial in Combined immune checkpoint inhibition with durvalumab and tremelimumab with and without radiofrequency ablation, where patient heterogeneity swamped the effect being tested. Every subsample is repeated over 20 seeds with feature selection and tuning nested inside the training folds. This avoids the selection leakage that inflates small-sample results.

Baselines

The naive reference is mean pooling of patch scores with the same encoder and scorer. It represents treating a biopsy as an average, which the ADC parametric response map study shows lets necrotic and proliferating regions cancel. Max pooling is the classical multiple-instance assumption and the natural reference for sparse tumor.

The strongest existing distributional method is fixed-quantile aggregation over the same nine levels, as in the Carolina study. It reports 95.2% histologic subtype accuracy and 85.6% ER status accuracy on Carolina Breast Cancer Study cores.

The strongest low-data pooling method is Maxsoft from the flexible pooling paper. It reports that Maxsoft with a small domain encoder outperformed Prov-GigaPath, which itself reached a WSI-level AUC of 1.000 and a patch-level AUC of 0.948 on CAMELYON17. No reported Maxsoft number on TCGA-Lung or SICAP-MIL was found on Lacuna. We also run a multi-temperature Log-Sum-Exp family, from soft-min to soft-max at nine temperatures, as the closest smooth competitor. Attention-based pooling is included because it is the field default, even though the Maxsoft paper reports that it struggles at small $N$.

For the flag, the baselines are bootstrap intervals of the pooled score over the $k$ sampled patches, a five-member deep ensemble, and the quantile interquartile range.

Fairness rules apply throughout. All methods share the frozen encoder, patch-sampling seeds, training subsets, and early-stopping rule. Each receives the same hyperparameter budget of 30 trials on an inner validation split.

The key ablations isolate one ingredient each. One replaces the asymmetric expectiles with quantiles at matched $\tau$, which isolates magnitude weighting. One collapses the population to only the 0.5 expectile, which isolates the distributional code. One restricts the readout to the two pathway summaries (mean-like and spread-like), which tests the basal-ganglia readout prediction.

The pooling result counts as beating the field if expectiles exceed both quantiles and multi-temperature LSE by at least 2 AUC points at $k \le 16$, with seed-level confidence intervals excluding zero. The flag result counts if its miss-detection AUROC exceeds the bootstrap and the ensemble by a similar margin.

Why not just…?

Why not just use quantile pooling, which already captures the distribution? This is the most direct threat, and the decisive experiment is built around it. Our prediction is specific. At large $k$, expectiles and quantiles should tie. At small $k$ with low tumor fraction, quantiles above the median sit at background level, while upper expectiles still move with any high-scoring patch. If quantiles match expectiles at $k=16$ on CAMELYON positives, the pooling claim fails, and the proposal reduces to the flag analysis.

Why not just use a smooth max (Log-Sum-Exp or Maxsoft) at several temperatures? A high-temperature Log-Sum-Exp behaves much like a high expectile, so pooling accuracy may well tie. What the soft-max family lacks is a matched pessimistic side whose distance from the optimistic side has a defined meaning as spread. We therefore expect any advantage to show up in the miss-detection task more than in raw accuracy. The multi-temperature baseline is run on both tasks to settle this.

Why not just bootstrap the biopsy to get uncertainty? Bootstrapping the maximum or an upper tail from a handful of patches is known to be unreliable. With 16 patches and one tumor patch, the resamples mostly reproduce the same few values. Expectile gaps are smooth functionals computed in a single pass. The flag experiment compares the two directly, and if the bootstrap ties, we will report the gap only as a cheaper equivalent.

Why not just shift the decision threshold instead of a "dopamine gain" on the optimistic channels? For a single score, shifting the threshold traces the full ROC curve, so the gain knob is only interesting if it changes how cases are ranked. We test this at fixed sensitivities of 90% and 95%. If specificity is no better than threshold shifting, we will drop the knob and keep it only as a descriptive analogy.

Proposed Experiments

Primary experiment. We use CAMELYON16 and CAMELYON17, where metastases are sparse and the needle-in-a-haystack sampling problem is explicit. Positive slides are stratified by tumor area fraction. We report slide AUC under strip biopsies at each $k$ and each training size $N$. The decisive cell is $k=16$, $N=50$, on positives with less than 5% tumor area. That is where our efficiency argument predicts expectiles beat quantiles and max, and where a tie would falsify claim one.

Flag experiment. On the same splits, we label a biopsy a "miss" when its prediction disagrees with the whole-slide label. We report the AUROC of each flag for detecting misses, and risk-coverage curves showing whole-slide-level accuracy as the hardest cases are deferred.

Heterogeneity transfer. On Carolina Breast Cancer Study tissue cores, we ask whether the gap tracks heterogeneity rather than tumor detection. ER status is the most heterogeneous task there, with the reported 68.6% to 85.6% context effect. Subsampling within cores tests whether the gap predicts ER errors. TCGA-Lung and SICAP-MIL serve as secondary generalization checks, with no reported baseline numbers on Lacuna.

Readout test. We compare the two-summary readout against the full nine-expectile readout across all tasks. Retaining 95% or more of the full readout's AUC supports the basal-ganglia readout prediction. A large drop on skewed tasks would be informative too, because that model assumes Gaussian rewards and pathology score distributions are heavily skewed.

Radiomics extension. If the pathology results hold, the natural next step is to apply the same code to voxel-level summaries within the three radiomic habitats of the habitat radiomics RFA study. That study reports a test AUC of 0.870 for its habitat-plus-peritumoral model. It is a separate cohort we do not yet have access to.