URICA: A Uniformity Region Affine Identifier Capture Algorithm for Arbitrary Region Retrieval in Pathology Images

Ri Su1, Zhao Chen1, Caleb Chen Cao2, Lei Chen1,2
1 MDI-HKUST(GZ), 2 HKUST

TL;DR: URICA enables robust arbitrary-region retrieval in whole-slide pathology images by representing a region as a semantic tessellation and matching regions via rotation/scale-consistent affine identifiers, providing a practical approximation to ideal mask-based retrieval and achieving strong, consistent performance across large TCGA benchmarks. Below is the animation explaining the process of URICA.

Abstract

Whole slide image (WSI) region retrieval remains an open challenge in computational pathology, as existing methods struggle to represent and preserve information of all possible regions. Current approaches that rely on fixed-size patches or slide-level retrieval are misaligned with real clinical workflows, where pathologists often examine WSI regions of arbitrary orientations and sizes rather than predefined patches or slides. In this work, we redefine WSI retrieval as a semantically optimal matching problem between arbitrary regions under spatial transformations, which necessitates a region-level representation that maintains semantic consistency. To fulfill this requirement, we introduce semantic tessellation, which organizes patch units into flexible, geometry-aware region descriptors. Building on this representation, we develop the affine identifier, a semantic signature that enables rotation- and scale-consistent region matching. We further derive theoretical bounds between the tessellation-derived descriptors and the ideal pixel-level semantic mask objective, showing that they reliably approximate mask-based region similarity. Together, these components form URICA, a theoretically grounded algorithm for robust WSI region retrieval. Experiments on large public datasets demonstrate that URICA achieves strong and consistent performance across diverse WSI retrieval tasks.

1. Motivation & Key Insight

Whole-slide image (WSI) analysis often reduces pathology to either patch classification or slide-level retrieval. However, real clinical reasoning happens at the region level: a pathologist searches for tissue areas that share both semantic meaning (e.g., tumor vs. normal) and structural context (e.g., boundary patterns, gland architecture), under arbitrary rotations and scales.

This makes WSI region retrieval fundamentally challenging. The “ideal” formulation would compare oracle semantic masks between regions, but such masks are rarely available and hard to generalize across cohorts. In practice, we only have encoder-derived patch embeddings, which are local, discrete, and lack an explicit notion of a region’s global geometry.

URICA is designed to bridge this gap: it reformulates arbitrary region retrieval as matching a set of region primitives that jointly preserve semantics and spatial structure, while remaining feasible with standard patch encoders.

WSI region retrieval challenge: patch methods lack spatial context, slide methods lose fine-grained morphology Ideal mask-based retrieval vs. practical tessellation-based retrieval using encoder patch embeddings
Figure 1: Left: Illustration of WSI region retrieval: given a query region, retrieve regions with similar semantics and structure. Right: Ideal mask-based retrieval vs. practical tessellation-based retrieval using encoder patch embeddings.

The key insight is that a region can be represented not as a single vector, but as a structured set of anchors sampled from the region. If we can assign these anchors transformation-consistent identifiers, then region retrieval becomes the problem of finding a candidate region whose anchors admit the most uniform affine alignment (rotation + scale), instead of relying on fragile global pooling.

This perspective leads to a retrieval pipeline that is both faithful to the mask-based ideal and compatible with embedding-based indexing.


2. Method Overview

URICA builds a region retrieval system in three stages: indexing, query decomposition, and affine-consistent matching.

First, source WSIs are processed into a foreground patch database with embeddings produced by a foundation encoder, enabling efficient nearest-neighbor access. Then, a query region is decomposed into tessellated anchors that cover the region at a chosen step size. Finally, URICA searches for candidate regions by matching anchor sets and selecting the subset that exhibits the most consistent rotation/scale agreement, which is then used to reconstruct the retrieved region representation.

This pipeline turns arbitrary region retrieval into a principled “set alignment” problem, making retrieval robust to rotation and scale variations while preserving structural cues.

URICA three-stage pipeline: offline indexing, query tessellation, and affine-consistent matching
Figure 2: URICA pipeline. (a) Index foreground patch embeddings. (b) Tessellate the query and assign affine IDs. (c) Match IDs and reconstruct $\phi_{res}$ via uniform affine alignment.

At the core of the matching step is the affine identifier: for each pair of anchors, URICA computes the angular difference and distance ratio between their query-side and retrieval-side embedding vectors. These pairwise signatures are invariant to rotation and scale, enabling the algorithm to identify the largest subset of anchors that share a consistent geometric transformation — effectively recovering the affine mapping between query and candidate regions.

Affine identifier evaluation showing query affine vectors and retrieved affine vectors with consistent subset highlighted
Figure 3: Affine identifier evaluation. Query vectors (solid arrows) and retrieved vectors (dashed arrows) are compared pairwise. The consistent subset (green box) reveals the rotation angle and scale ratio for region alignment.

As shown in Figure 3, with the target point as the shared starting point, each query affine (blue and purple solid arrows) yields several retrieved affine identifiers (dashed arrows). URICA validates uniformity in $\Delta\theta$ and $\Delta d$ across these pairs: for each tessellation vertex pair it computes angle and scale variation sets, then selects the consistent subsets $\{\theta\}^*$ and $\{d\}^*$ with minimal variance. When such a subset exists — i.e., the angle and scale shifts are uniform (arrows in the green box) — the average rotation $\theta^*$ and scale ratio $d^*$ over the consistent subset are used to relocate the retrieved region candidate. Specifically, the retrieved descriptor $\phi_{res}$ is computed as $w_{res} = w \cdot d^*$, $h_{res} = h \cdot d^*$, $\theta_{res} = \theta^*$, with its center obtained by rotating $(x^* - x_c,\, y^* - y_c)$ by $\theta^*$ and translating to the corresponding retrieved patch position $(x^*_{res}, y^*_{res})$. For a tessellation with $n$ anchors and patch queue length $k$, URICA generates $n \times k$ candidate regions, ranks them by similarity to the query embedding, and returns the top-$k$ most similar ones. Despite operating on sets, URICA remains practical at WSI scale by restricting computation to a compact anchor subset and aggregating alignment evidence efficiently.


3. Theoretical Foundation

A natural question arises: how faithfully does tessellation-based retrieval approximate the ideal pixel-level semantic mask comparison? URICA provides a theoretical answer.

Key Result: We derive tight upper and lower bounds relating the tessellation-based similarity to the ideal mask-based similarity. This guarantees that the tessellation approximation error is bounded and controllable.

Specifically, given an encoder with receptive field size $s^*$ and a measured semantic correlation decay rate $\alpha$, the optimal tessellation step size $t$ can be directly computed. The relationship between tessellation similarity and ideal mask similarity is governed by:

$$\frac{(2s)^{4\alpha}}{(2s-t)^{4\alpha}} - \frac{(2s-t)^{2\alpha}}{(2s)^{2\alpha}} = \frac{\psi^*(1+\xi)}{2(1-\psi^*)^4}$$

where $\psi^*$ is the ideal similarity threshold and $\xi$ captures boundary effects. This equation yields a closed-form solution for the optimal step $t$, balancing retrieval accuracy against computational cost.

Practical takeaway: With the empirically estimated $\alpha = 3$ and standard encoder size $s^* = 224$, the optimal step is $t \approx 60$ (coverage ratio $\eta = 0.7$). Compared to brute-force dense tessellation ($t = 50$), this reduces latency by 31.6% and storage by 30% with negligible accuracy loss.

This theory–practice alignment distinguishes URICA from purely empirical retrieval methods: the tessellation resolution is not an arbitrary hyperparameter but a principled design choice backed by formal analysis.


4. Experiment Results & Visualization

To evaluate WSI region retrieval, we measure whether the retrieved regions are consistent with the query in both semantic content (e.g., tissue type or lesion pattern) and spatial structure (e.g., boundaries and morphological arrangement), rather than matching only local textures. The tables below present URICA's quantitative results on TCGA region retrieval across all 10 anatomical sites and 29 cancer subtypes at top-1, top-3, and top-5 settings. Notably, URICA achieves the best mIoU on all 29 subtypes, demonstrating that it consistently recovers structurally faithful regions.

24,811 WSIs Evaluated
13.5 TB Total Data Volume
29 / 10 Subtypes / Sites
29/29 Best mIoU Subtypes
1st Region Retrieval

Inter-region retrieval experiment results of different methods on different subtypes of TCGA data with top-1 Results.

WSI
Site
Query
Num.
Slide Method Sample Method Adjacent Method URICA (ours)
mSim@1mIoU@1 mSim@1mIoU@1 mSim@1mIoU@1 mSim@1mIoU@1
Pul.27630.73300.19810.89640.47600.65020.12580.96150.7108
LUAD13200.73820.20020.89960.47380.67000.13650.94890.6302
LUSC13350.73160.19750.89370.48230.64550.12170.96150.7272
MESO1080.70470.18850.88940.42590.53710.08400.89070.5422
Liv./PB.8860.71420.18930.89530.44580.55290.09150.86560.6179
CHOL550.67860.15320.89140.44390.46460.07420.94790.6977
LIHC5200.72440.18580.90250.44030.54220.08560.80810.5514
PAAD3110.70350.20150.88400.45540.58650.10440.88190.6446
Uri.32090.73370.19620.89790.47330.61890.11540.94090.7261
BLCA5880.69440.17910.88390.43030.53580.08150.84760.6482
KIRC18050.74180.20080.90030.48790.63520.12210.96660.7461
KICH2650.75420.20190.90200.47800.66300.13850.97150.6551
KIRP5510.73960.19640.90290.46890.63290.11820.97120.7768
Gyn.25620.73240.19350.89690.46150.59260.10250.83180.6489
UCEC8110.72230.18030.89390.43350.53240.07670.80320.6444
CESC3580.68270.17960.88540.43650.49410.07430.65630.5111
UCS950.73430.18060.89110.43020.55550.06530.96450.7104
OV12980.75220.20650.90250.48810.66010.12920.96520.7363
Mel.6450.68480.18070.88390.42760.53330.08060.74140.5543
UVM970.68570.18330.88780.38890.50560.06030.96480.7394
SKCM5480.68290.18030.88320.43450.53820.08420.71340.5312
Pro./Tes.11260.68660.19320.88300.45620.57260.10670.87010.6573
TGCT2920.69720.19660.88360.45160.56140.10490.73590.5424
PRAD8340.68290.19200.88280.45780.57650.10740.91840.6986
Bra.29390.74180.19180.90550.46060.61770.10720.94730.7232
GBM17390.72970.19160.89950.46110.61010.10810.92430.6997
LGG12000.75940.19200.91420.45990.62880.10580.97630.7528
Hem.2860.72650.19070.89570.45440.55470.09270.89940.6948
DLBC770.71330.18100.89980.46440.59230.09860.96340.7117
THYM2090.73140.19430.89410.45070.54080.09050.88070.6899
Gl.26900.70560.19790.88800.47240.59680.11850.89010.6657
COAD11400.71620.20330.88950.47750.59730.11990.89530.6655
ESCA2150.68050.18480.88080.43690.48490.08130.63620.5595
READ3890.70520.19470.88800.46930.59260.11710.97020.6922
STAD9460.69870.19580.88770.47570.62330.12590.87400.6659
End.11630.71510.18060.89410.44350.56890.09180.89310.6396
ACC2290.74950.18790.89690.47440.63300.09480.96370.7611
PCPG2420.72030.17320.89980.42020.57800.09070.95970.7134
THCA6920.70190.18070.89120.44140.54450.09110.90560.7029
WSI
Site
Query
Num.
Slide Method Sample Method Adjacent Method URICA (ours)
mSim@3mIoU@3 mSim@3mIoU@3 mSim@3mIoU@3 mSim@3mIoU@3
Pul.27630.72530.19090.87440.38670.27740.04360.95490.6819
LUAD13200.73070.19330.87890.38810.28610.04780.95590.6698
LUSC13350.72440.19040.87050.38900.27360.04190.95690.6991
MESO1080.69000.17580.86720.34120.24870.02940.90050.5756
Liv./PB.8860.70070.17510.87200.34570.23280.03150.85820.5868
CHOL550.65930.13740.86700.33770.18010.02530.94200.6609
LIHC5200.70950.17080.88030.33610.23060.02960.80470.5201
PAAD3110.69350.18910.85900.36310.24580.03590.86970.6166
Uri.32090.72730.19620.87580.37910.25970.03990.93440.6856
BLCA5880.67990.16930.85870.32620.22100.02800.84290.6195
KIRC18050.73840.19690.87860.39510.26680.04230.95990.7073
KICH2650.75180.19940.88030.38650.28180.04770.95220.6049
KIRP5510.72950.18750.88280.37960.26720.04090.96540.7118
Gyn.25620.72160.18240.87530.36560.24680.03530.80790.6029
UCEC8110.70930.16740.87170.32770.21360.02620.75200.5825
CESC3580.66000.15700.86040.32990.21420.02570.65140.4689
UCS950.72250.16860.86780.34390.23640.02240.96340.6548
OV12980.74610.19980.88210.40070.27720.04460.95950.7075
Mel.6450.67520.16910.85900.32450.23130.02810.73460.5190
UVM970.68400.17180.86220.29070.21790.02110.96260.7291
SKCM5480.67360.16860.85840.33040.23370.02930.70610.4927
Pro./Tes.11260.68000.18570.85840.36630.23260.03680.86540.6212
TGCT2920.69030.18810.85920.36070.23030.03640.73340.5086
PRAD8340.67640.18490.85810.36820.23340.03690.91300.6617
Bra.29390.73310.18270.88610.36320.25810.03700.92880.6805
GBM17390.72070.18220.87900.36540.25420.03740.89440.6508
LGG12000.71120.15750.89640.36020.26360.03640.97230.7181
Hem.2860.71780.18300.87340.35110.24780.03230.89370.6545
DLBC770.70300.17470.87950.37190.26990.03470.95940.6719
THYM2090.72320.18600.87120.34340.23970.03150.87450.6494
Gl.26900.69740.19000.86300.37920.24420.04080.87160.6295
COAD11400.70880.19440.86480.38580.24260.04120.86750.6281
ESCA2150.66220.16810.85270.33390.20020.02810.60780.5283
READ3890.69290.18550.86530.37270.23940.04040.96540.6620
STAD9460.69340.19140.86230.38410.25810.04340.86930.6297
End.11630.70420.17050.87190.34310.24350.03160.90640.6739
ACC2290.74450.18280.87380.37400.27860.03290.90600.6986
PCPG2420.70760.16130.87940.32760.25600.03140.94670.6621
THCA6920.68970.16960.86860.33830.22760.03120.89810.6621
WSI
Site
Query
Num.
Slide Method Sample Method Adjacent Method URICA (ours)
mSim@5mIoU@5 mSim@5mIoU@5 mSim@5mIoU@5 mSim@5mIoU@5
Pul.27630.68120.16560.85820.31630.16710.02620.94020.6416
LUAD13200.68330.16730.86330.31870.17210.02870.94890.6302
LUSC13350.68460.16620.85360.31710.16470.02510.93460.6576
MESO1080.62080.14320.85060.27630.15340.01770.89070.5422
Liv./PB.8860.65720.15050.85570.27880.14010.01890.85250.5551
CHOL550.60030.11470.84930.26650.10810.01520.93910.6251
LIHC5200.66340.14570.86530.26760.13880.01780.80140.4930
PAAD3110.65700.16490.84090.29980.14810.02150.86030.5821
Uri.32090.69290.16840.86020.30650.15640.02390.93060.6485
BLCA5880.63250.14620.84240.25400.13320.01680.84020.5943
KIRC18050.71050.17480.86320.32000.16070.02540.95600.6706
KICH2650.72420.18150.86490.31720.17010.02870.94000.5571
KIRP5510.68460.16490.86710.31300.16070.02460.96170.6563
Gyn.25620.67520.15570.85990.29600.14860.02120.79930.5730
UCEC8110.65700.14240.85720.25560.12840.01570.73970.5539
CESC3580.59430.13060.84430.26250.12920.01540.64430.4366
UCS950.66110.13490.85220.27800.14330.01350.96010.6361
OV12980.70990.17250.86640.33180.16690.02680.95380.6764
Mel.6450.64140.14720.84220.25560.13910.01680.72950.4862
UVM970.63160.13930.84550.22270.13080.01270.95840.7000
SKCM5480.64320.14860.84160.26140.14050.01760.70090.4594
Pro./Tes.11260.65120.16330.84070.29780.13990.02210.85630.5864
TGCT2920.66140.16580.84150.36070.13820.02180.72960.4792
PRAD8340.64770.16240.84040.29890.14050.02210.90190.6250
Bra.29390.69190.15610.87270.28830.15510.02220.92230.6427
GBM17390.67860.15510.86490.29180.15280.02240.88630.6117
LGG12000.71120.15750.88410.28320.15850.02180.96780.6817
Hem.2860.68420.16050.85750.28460.14930.01940.88870.6160
DLBC770.66750.15220.86360.31120.16210.02080.95500.6317
THYM2090.69040.16350.85520.27480.14460.01890.86930.6114
Gl.26900.65460.16550.84560.30870.14680.02450.86370.5953
COAD11400.66420.16760.84750.31320.14580.02470.85730.5959
ESCA2150.60020.13880.83530.26660.12020.01690.59390.4923
READ3890.64020.16010.84830.30410.14410.02430.96190.6160
STAD9460.66130.17120.84440.31470.15520.02600.86460.5959
End.11630.66730.14910.85640.27410.14640.01890.89310.6393
ACC2290.71690.16470.85870.29960.16720.01970.89290.6662
PCPG2420.66860.14020.86510.26190.15400.01890.93870.6292
THCA6920.65050.14710.85270.26990.13680.01870.88360.6263

Across all three retrieval settings, URICA consistently outperforms existing methods on mIoU — the metric most reflective of structural fidelity. At top-1, URICA achieves the highest mIoU on all 29 subtypes, with particularly large gains on sites where competing methods struggle: for example, Pul. mIoU@1 improves from 0.48 (Sample Method) to 0.71, and Uri. from 0.47 to 0.73. As the retrieval depth increases to top-3 and top-5, the gap widens further: Slide and Adjacent methods degrade rapidly (e.g., Adjacent mIoU@5 drops below 0.03 on most sites), whereas URICA maintains strong performance — Pul. mIoU@5 remains at 0.64, Bra. at 0.64, and End. at 0.64. On mSim, URICA leads or is competitive across nearly all settings, confirming that its retrieved regions are both semantically similar and spatially faithful. These quantitative results are further corroborated by qualitative retrieval examples below.

Rank-1 and rank-5 region retrieval visualization across seven TCGA cohorts
Figure 4: Rank-1 and rank-5 region retrieval visualization of URICA across seven representative TCGA cohorts.

As shown in Figure 4, we visualize the rank-1 and rank-5 retrieval results across seven representative TCGA cohorts. Even at rank-5, URICA retrieves regions that faithfully reproduce the query’s tissue morphology, boundary structure, and staining distribution — despite variations in orientation, scale, and slide appearance. For instance, the retrieved regions for brain (GBM/LGG) and kidney (KIRC) cohorts closely mirror the spatial arrangement and cellular density of the query, whereas baseline methods tend to return regions with only superficial texture overlap. Overall, these results confirm that URICA can reliably retrieve clinically coherent regions by jointly capturing semantics and structure. For slide-level retrieval, URICA also achieves 98.38 ± 1.25% mMV@5, exceeding all prior methods. For additional metrics, ablations, and efficiency analysis, please refer to the main paper and appendix.

Human Study

We further conduct a human study to assess whether URICA's retrieved regions align with expert judgment beyond automatic metrics. Specifically, pathologists evaluate the top-5 retrieved candidates across 10 anatomical sites from two complementary perspectives: (1) the quality of the candidate set itself, measured by average expert-rated similarity and intra-top-5 consistency; and (2) the ranking accuracy, measured by order quality that compares the model's ranking against expert preference.

Human study accuracy across anatomical sites Human study ranking quality across anatomical sites
Figure 5: Human study results across 10 anatomical sites. Left: Average expert-rated similarity and intra-top-5 consistency (bar chart). Right: Order quality distribution (box plot), measuring ranking agreement with pathologists.

The human evaluation confirms that URICA's retrieved candidates are clinically meaningful and internally consistent. Averaged over 10 anatomical sites, the mean expert-rated similarity reaches 7.09 (out of 10), the mean intra-top-5 consistency reaches 0.911, and the mean order quality is 0.570. The high consistency score indicates that the top-5 candidates within each query are similarly relevant, rather than mixing strong and weak matches. Among individual sites, gastrointestinal (7.74) and gynecologic (7.59) achieve the highest similarity scores, while brain (0.655) and endocrine (0.655) show the strongest ranking agreement with pathologists. Melanocytic cases present the most challenging scenario, with the lowest similarity (5.96) and consistency (0.880), likely reflecting limited database coverage for this tissue type. Overall, the results demonstrate that URICA retrieves high-quality candidate sets across diverse anatomical sites, while also highlighting opportunities for further improvement in ranking accuracy.

Cite Us

@inproceedings{su2026urica,
    title={URICA: A Uniformity Region Affine Identifier Capture Algorithm for Arbitrary Region Retrieval in Pathology Images},
    author={Su, Ri and Chen, Zhao and Cao, Caleb Chen and Chen, Lei},
    booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
    pages={32777--32786},
    year={2026}
}