BMVC 2026 Accepted paper

GatedSRP

Gated Spatial Redundancy Projection for Pathology Transformer Attentions

A lightweight attention correction that adapts each patch-token update to the tissue context around it.

Zhiyuan Yang · Jiahao Cheng · Vincent Quoc-Huy Trinh · Mahdi S. Hosseini

~0.02% additional trainable parameters
+0.0269 mean C-index gain over base attention across five TCGA survival cohorts
GatedSRP pipeline from spatial patch neighborhoods through signed gated redundancy projection and slide-level prediction

How GatedSRP works

Nearby WSI patches often repeat the same tissue pattern. GatedSRP separates that shared local component from the attention update, then learns whether it should be reduced, retained, or reinforced.

Whole-slide examples showing spatially varying local redundancy across tissue regions
Local feature similarity varies within and across slides, motivating a context-dependent intervention.

Local reference. For each patch token, GatedSRP averages the detached value vectors in its valid 3x3 neighborhood and normalizes the result into a local tissue-redundancy axis, r̂ᵢ = normalize(meanj∈N(i) vⱼ).

Adaptive signed correction. A token- and head-specific gate predicts βᵢ = δ tanh(gᵢ) and updates the attention contribution as zᵢ = yᵢ − βᵢ ⟨yᵢ, r̂ᵢ⟩ r̂ᵢ. A negative β reinforces useful local context, β = 0 preserves the original update, 0 < β ≤ 1 reduces the redundant component, and 1 < β ≤ 2 reflects it beyond full projection. Zero initialization starts from the preserve case.

Results

Five-seed evaluation across survival, classification, MIL models, design choices, and measured resource use.

TCGA overall survival

Case-level C-index, mean across five seeds. GatedSRP improves over the no-adaptation baseline on all five cohorts; the across-cohort paired estimate is +0.0269, 95% CI [0.0148, 0.0389], p = 0.0035.

Green indicates an increase and red a decrease relative to NA.

MethodKIRCKIRPLUADSTADUCEC
NA0.71100.72470.55130.59100.6756
XSA0.71920.67950.53590.60350.6233
Diff0.72410.70200.55460.58470.6489
GatedSRP0.72570.76480.58320.61710.6973

Learned gate behavior

Most token-level means lie between zero and one, but the model can preserve the original update, apply weak negative correction, or move beyond full projection when the context supports it.

Learned gate coefficient distributions across classification and survival datasets
Learned coefficient distributions vary by dataset and slide rather than collapsing to one fixed value.
Examples of weak negative, identity-like, projection, and amplification coefficient regimes
Representative signed-gate regimes. None of 410 evaluated checkpoint exports had a mean coefficient above 1.5.
Attention heatmaps comparing baseline and GatedSRP across pathology slides
Attention remains slide-specific while the local correction changes how redundant evidence contributes to the representation.

How to use

Add one correction between the patch-token attention update and the residual connection. The attention operator, positional encoding, CLS token, and task head can remain unchanged.

Your model needs three things

  • Patch coordinatesBuild a 3x3 graph aligned with the patch-token order.
  • Patch attention updatesCorrect patch tokens only; special tokens pass through unchanged.
  • A pre-residual insertion pointApply GatedSRP after attention and train normally from its identity initialization.
Minimal integration
import torch

from slide_level_srp.src.srp_correction import PatchSRPCorrection

self.gated_srp = PatchSRPCorrection(
    dim, hidden_dim=32, delta_scale=2.0,
)

update = self.attn(self.norm(x))
patches = self.gated_srp(
    update[:, 1:],
    neighbor_index,
    neighbor_mask,
)
update = torch.cat((update[:, :1], patches), dim=1)
return x + update

Citation

BibTeX
@misc{yang2026gatedspatialredundancyprojection,
  title={Gated Spatial Redundancy Projection for Pathology Transformer Attentions},
  author={Zhiyuan Yang and Jiahao Cheng and Vincent Quoc-Huy Trinh and Mahdi S. Hosseini},
  year={2026},
  eprint={2608.08374},
  archivePrefix={arXiv},
  primaryClass={cs.CV},
  url={https://arxiv.org/abs/2608.08374}
}