Re-Read Stability: Shift-Invariant Wavelet Features for Borderline Pathology Calls

Pathologists disagree most on borderline cases. Typical examples are benign regenerative change versus low-grade dysplasia, or an early lesion versus healthy tissue. Computational pathology is usually sold as the fix: the model is supposed to give the same answer every time. That promise is rarely tested. A slide-level prediction is assembled from tiles cut on an arbitrary pixel grid. Convolutional networks are not shift-invariant. Stain and scanner differences move the input slightly. So the same tissue, re-tiled a few pixels over or re-scanned, can receive a different call, and this "re-read variability" likely clusters on the very cases where humans disagree. A model with that property does not remove subjectivity. It hides it.

This note proposes to measure that machine re-read variability directly, compare it case by case with human disagreement, and test a cheap way to suppress it. The method appends a second set of features to a frozen pretrained network's embedding. These features come from the dual-tree complex wavelet transform, a fixed filter bank whose coefficient magnitudes barely change when the image shifts and which separates six edge orientations. Both feature sets are compressed with principal component analysis (PCA), an unsupervised projection onto the directions of largest variance. A calibrated logistic regression then makes the call. The two-sentence version is this. Decision stability under trivial perturbations is a measurable property that should be reported next to accuracy. A wavelet-plus-PCA branch on top of standard embeddings should cut that instability on borderline cases at near-zero cost and without losing accuracy.

Core Claim

Our main claim concerns frozen-embedding classifiers with a linear head, the "hybrid" design shown to be accurate and well calibrated by Reliable Dental Radiograph Diagnosis via Calibrated Hybrid Representation Learning. We claim three things about them:

  1. Re-read variability exists. Their predicted labels flip under sub-tile shifts, small rotations and stain jitter at a rate that is not negligible.
  2. The flips track human disagreement. Flipping concentrates on items that pathologists themselves disagree on.
  3. The wavelet branch reduces flipping. Concatenating PCA-compressed, log-transformed dual-tree complex wavelet magnitude features reduces the flip rate substantially at matched accuracy.

A secondary claim concerns PCA itself. The top principal components of pathology embeddings partly encode stain intensity rather than diagnosis. Removing them helps cross-stain stability, in the way that removing dominant components helps word embeddings in Effective Dimensionality Reduction for Word Embeddings.

The novelty lies in the target, not the ingredients. Several prior papers combine pieces of this design:

All of these, and the hybrid dental work, report accuracy against a single label. None measures whether the model's own decisions are stable under perturbations that should not matter. None relates that stability to inter-observer disagreement.

Research Program

Wavelet branch. We follow the two-layer dual-tree scattering design of Efficient Convolutional Network Learning Using Parametric Log Based Dual-Tree Wavelet ScatterNet. That design takes complex wavelet magnitudes at six orientations (about ±15°, ±45°, ±75°) and two scales, cascades a second layer, applies a log transform to stabilize the coefficient distribution, and average-pools spatially. We compute this per color channel, because the pit-pattern study found color cues matter: RGB concatenation lifted 6-class accuracy from 83.9% to 93.2%. The magnitude operation removes the phase that oscillates under shifts, which is why the branch should be stable. The six orientations separate the opposite diagonals that the ordinary discrete wavelet transform merges. This matters for glandular and crypt boundaries.

Network branch. The embedding comes from a frozen ConvNeXt-Tiny, used both as an ImageNet-pretrained network and as a network fine-tuned once on the training split, mirroring the dental hybrid setup.

Compression and purification. Each branch is centered and projected with PCA fit on training data only. Optionally, the top $D$ components are nulled before the projection, following the post-processing algorithm of Raunak et al. The cutoff $k$ is chosen by validation accuracy. Prior work suggests where to look: Simple and Effective Unsupervised Redundancy Elimination to Compress Dense Vectors for Passage Retrieval found that information in 768-dimensional embeddings plateaus near 200 dimensions and that PCA beat supervised projections. The same paper warns that PCA fit on one distribution degrades under shift. We therefore test PCA fit on source data only against PCA refit on unlabeled target data.

Decision heads. We test two heads:

  • Logistic regression on the concatenated compressed features. This is the main head, chosen because it was already well calibrated in the dental work.
  • Per-class affine-subspace distance. Here the continuous score is the distance from a sample to each class's PCA subspace. Following Bruna and Mallat, the distance to class $c$ is

$$d_c(x) = \lVert (I - P_c)(\Phi(x) - \mu_c) \rVert,$$

where $\Phi(x)$ is the feature vector, $\mu_c$ is the class mean, and $P_c$ projects onto the leading principal components of class $c$. The margin $d_{\text{benign}} - d_{\text{abnormal}}$ is a natural borderline score.

Measuring re-read variability. For each test item $i$ we generate a set $T$ of nuisance perturbations: sub-crop offsets of 1–16 pixels, rotations within ±10°, hematoxylin-eosin stain jitter, and JPEG re-encoding. Our main stability metric is

$$\text{flip}(i) = \frac{1}{|T|}\sum_{t \in T} \mathbf{1}\big[\hat y(t(x_i)) \neq \hat y(x_i)\big],$$

averaged over the test set. We also report the standard deviation of predicted probability.

Human disagreement. For human disagreement we will collect new labels. Three pathologists will independently relabel about 600 images from GasHisSDB sub-database B. The images are stratified by baseline model score so that borderline items are over-represented. Per-item disagreement is the fraction of raters who deviate from the majority. This annotation is the main cost of the project. It is necessary because none of the public datasets in our file ships with per-item multi-rater labels.

Baselines

The naive reference is the classical pipeline reported with GasHisSDB: A New Gastric Histopathology Image Dataset for Computer Aided Diagnosis of Gastric Cancer: a random forest on color histograms, which reached 86.08% accuracy. Any proposed system must clear it by a wide margin, or the features are not doing diagnostic work.

The strongest end-to-end competitor is a fine-tuned convolutional network. On GasHisSDB sub-database B, the dataset paper reports 96.47% accuracy for VGG16 and 96.09% for ResNet50. We retrain VGG16 and ConvNeXt-Tiny end to end on the same splits, with the same augmentation and the same hyperparameter search budget as our heads. We do this so that flip rates can be measured, since accuracy alone was all that was published. No reported result was found on Lacuna for flip rate or re-read variability on any dataset in our file.

The strongest hybrid competitor is the frozen-embedding logistic-regression design of Shayeed et al. It reports 99.1% accuracy and expected calibration error below 0.009 on DentIRO, with caries, the subtle-boundary class, at 96.97% F1. We reproduce it on DentIRO first, to confirm we are near the published numbers, and then on GasHisSDB with identical splits. It is the most direct competitor because our proposal is literally this system plus a wavelet branch and PCA. Any gain is therefore attributable to those additions.

The strongest wavelet-only competitor is the dual-tree, RGB-concatenation, nearest-neighbor system on the Vienna zoom-endoscopy database. It reports 93.2% six-class and 99.4% two-class accuracy under leave-one-out cross-validation. We rerun it under the same protocol.

Ablations. These isolate the key ingredient:

  • Wavelet transform choice. We replace the dual-tree transform with the discrete wavelet transform and then the stationary wavelet transform, keeping everything else fixed. This tests whether shift-invariance plus orientation, rather than "any multiscale texture feature," drives stability.
  • PCA. We drop PCA entirely (raw concatenation), and separately drop the component nulling.
  • Wavelet branch alone, without the network branch.

What counts as beating the baselines. The proposal succeeds if it matches the best baseline's accuracy within 0.5 points on GasHisSDB and Vienna and at least halves the mean flip rate on the human-disagreement subset. The case also needs a positive, significant rank correlation between per-item flip rate and per-item human disagreement for the baseline models. Without that correlation, the motivating link fails.

Why not just…?

Why not just average predictions over many shifted crops at test time? This is the real threat. Test-time augmentation over the perturbation set directly suppresses flips and needs no new features. We include it as a baseline at two budgets: matched wall-clock compute, which allows roughly one or two extra forward passes since the wavelet branch is cheap, and unlimited compute (all of $T$). If unlimited augmentation matches our stability at equal accuracy, the wavelet contribution reduces to a cost saving, and we will say so. Two further checks distinguish the approaches. Averaging does not add orientation information, so we also report borderline-class accuracy, where the directional features are hypothesized to help. Averaging also cannot help when the slide pipeline fixes one tiling, a constraint we will make explicit.

Why not just use the ordinary discrete wavelet transform, which every library ships? The pit-pattern study found the dual-tree transform about ten points better in grayscale. It also found that the gap narrows sharply once color is added, so a reviewer could reasonably expect no difference in RGB pathology. The transform-swap ablation settles this on stability, not just accuracy. The prediction is specific: discrete wavelet features will flip more under one- to four-pixel offsets, because their coefficient energy moves between subbands under shift.

Why not just fine-tune the network with heavy shift and stain augmentation? Augmentation-trained end-to-end networks are included among the end-to-end baselines and measured on the same flip metric. The concern from prior evidence is data regime rather than capacity. Automatic and explainable grading of meningiomas from histopathology images found an image-only ResNet-18 correct on 25 of 43 cases, against 32 for logistic regression on mitotic count. That warns that high-capacity image heads can be less reliable on small graded cohorts. GasHisSDB is large, though, and there end-to-end training may well win on accuracy. We report the accuracy–stability trade-off rather than a single winner.

Why not just apply PCA to the network embedding and skip the wavelets? This ablation is run directly. If it achieves equal stability, then the instability came from redundant, nuisance-heavy embedding directions, not from the network's shift sensitivity. That would be a useful and simpler result. The component-nulling variant tests whether the top components carry stain. We check this by correlating component scores with a per-image stain-intensity measure.

Proposed Experiments

Run order. We first reproduce the Shayeed hybrid on DentIRO, confirming near-published accuracy. We then measure its flip rate, with caries expected to dominate. Next, we run the full comparison on GasHisSDB sub-database B and on the Vienna database under leave-one-out cross-validation.

Scale and stain transfer. GasHisSDB provides the same tissue at three sub-image sizes, which gives a scale-transfer test: train on sub-database B and evaluate on A and C. We add stain-jitter strength sweeps as a proxy for scanner drift. The proxy is acknowledged as weaker than the true two-hospital drift reported in Deep learning for automatic diagnosis of gastric dysplasia using whole-slide histopathology images in endoscopic specimens, where external macro-AUC fell from 0.97 to 0.67.

Metrics. We report accuracy, macro-F1, expected calibration error, mean flip rate, flip rate on the high-disagreement tercile, and the Spearman correlation between per-item flip rate and human disagreement.

Decisive checks. There are two.

  1. The motivating link. Do baseline flips concentrate on human-disputed items? If not, re-read variability is a robustness curiosity rather than a subjectivity problem, and the note's framing is wrong.
  2. The method claim. Does the dual-tree branch, beyond PCA-only and beyond discrete wavelets, halve that concentrated instability at matched accuracy and at lower cost than test-time averaging? If both checks pass, flip rate on disputed cases should become a standard evaluation for models that claim to reduce diagnostic subjectivity.