CLEAR-WSI: A Diagnosis-Driven Retrieval Framework for Whole-Slide Pathology Images

CLEAR-WSI enables scalable whole-slide image retrieval with fixed-length embeddings and diagnostic label refinement.
CLEAR-WSI is a scalable retrieval framework for digital pathology whole-slide images that bypasses inconsistent metadata and handcrafted indexing pipelines. It learns fixed-length slide embeddings to uniformly represent WSIs of varying sizes and magnifications, and refines retrieval candidates using predicted or ground-truth diagnostic labels to better align with clinical intent. New cases can be continuously added to a memory bank, expanding the retrieval archive without rebuilding the index. Precision@5 improves by 3.10, 2.75, 1.95, and 3.75 on CAMELYON16, BRACS-1, BRACS-2, and X-HER2, respectively. However, diagnostic label quality, latency, and limited improvement margins remain issues to validate before clinical deployment.
The Pain Points and Breakthroughs in Pathology Archive Retrieval
The rise of digital pathology has led to rapid growth in whole-slide image (WSI) collections, but efficiently navigating these archives is not easy. The reason is that metadata is often inconsistent or even missing, and manual annotation is difficult to scale. Content-based image retrieval offers a way out: it finds similar cases directly from visual representations without relying on manual annotations or metadata. However, most existing systems are built on handcrafted indexing pipelines and predefined sampling strategies, which limits their scalability and generalization ability.
A recent study from RSS proposed CLEAR-WSI (Constant-Length Embedding for Automatic Retrieval of Whole-Slide Images), a scalable, diagnosis-driven slide retrieval framework, and validated it on public and clinical data.

Whole-slide images (WSIs) are the fundamental data format in digital pathology, referring to ultra-large pixel images obtained by digitizing glass slides with high-resolution scanners. A single image can typically reach billions of pixels and requires multi-resolution pyramid storage. WSIs vary greatly in size and magnification, and using them directly for retrieval or analysis imposes an extremely heavy computational burden. Therefore, practical systems usually need to sample patches first and then extract features. This also explains why existing retrieval systems mostly rely on predefined sampling strategies and handcrafted indexing pipelines—they need to make trade-offs among massive numbers of pixels. Content-based image retrieval (CBIR) attempts to learn similarity directly from WSI visual representations, but how to compress variable-length slide representations into a fixed length without losing diagnosis-relevant information remains a technical challenge.
The Core Mechanism of CLEAR-WSI
Fixed-Length Embeddings and Diagnostic Label Refinement
The key design of CLEAR-WSI is to use fixed-length slide embeddings to represent an entire WSI. This embedding does not rely on handcrafted features but is learned from visual content. During retrieval, the framework refines candidate results using predicted diagnostic labels or ground-truth labels, depending on the retrieval setting. This diagnosis-driven refinement mechanism allows retrieval to go beyond visual similarity and align with clinical diagnostic intent.
A Scalable Memory Bank
Newly processed cases are added to an expanding memory bank, allowing the retrieval archive to grow over time. This is particularly important for the long-term accumulation of pathology archives—the system can continuously absorb new data without retraining or rebuilding the index. The paper's ablation studies and latency tests further examine the contribution of each component and highlight its potential for large-scale deployment.
A memory bank is a non-parametric data structure commonly used in retrieval and contrastive learning systems to store embeddings and labels of processed samples for similarity comparison during subsequent queries. Unlike models that require backpropagation to update parameters, a memory bank expands by appending new samples, which can be retrieved immediately after being written, without retraining or rebuilding the index. In the pathology archive setting, this means the system can continuously absorb new cases, and the retrieval scope expands as data accumulates. However, the memory bank also brings challenges in storage cost and retrieval latency: the larger the bank, the slower the nearest-neighbor search, and approximate nearest neighbor (ANN) indexes are usually needed to maintain response speed. The latency tests mentioned in the paper target exactly this engineering bottleneck.
Benchmarks and Performance
The study evaluated CLEAR-WSI on a comprehensive benchmark containing two public datasets and one private clinical dataset, covering four retrieval tasks. Compared with the strongest baseline, CLEAR-WSI improved Precision@5 across all tasks: by 3.10 on CAMELYON16, 2.75 on BRACS-1, 1.95 on BRACS-2, and 3.75 on X-HER2.
Although these gains are not dramatic in numerical terms, considering the difficulty of retrieval tasks themselves and the heterogeneity of clinical datasets, the consistent improvements demonstrate the robustness of the framework. In particular, the largest improvement was on the X-HER2 task, which may suggest that diagnosis-driven refinement has an advantage in specific subtype classification scenarios.
Precision@5 is a commonly used evaluation metric in retrieval tasks, referring to the proportion of relevant results among the top 5 returned results. In pathology image retrieval, "relevant" is usually defined by whether the diagnostic label or disease subtype matches. This metric focuses on the quality of top-ranked results and aligns well with clinical use cases—pathologists care more about whether the most similar cases are truly comparable. CAMELYON16 is a public dataset for breast cancer lymph node metastasis detection, BRACS focuses on subtype classification of breast lesions, and X-HER2 involves HER2 expression status assessment. The retrieval difficulty and class distributions of different datasets vary considerably, so improvements across tasks should not be directly compared horizontally; greater attention should be paid to the consistent gains relative to the baseline within the same task.
Implications for Digital Pathology Workflows
From an application perspective, CLEAR-WSI attempts to solve the dilemma of pathology archives being "stored but hard to find." Traditional retrieval relies on metadata, but in reality, coding practices for pathology reports vary widely, and missing or mislabeled data is not uncommon. Content-based retrieval bypasses this bottleneck, while diagnostic label refinement compensates for the possibility that purely visual retrieval may deviate from clinical relevance.
The fixed-length embedding design also brings engineering convenience: slides of different sizes and magnifications can be represented uniformly, and the complexity of the retrieval system no longer grows linearly with the number of slides. The continuous growth mechanism of the memory bank gives the system a "richer with use" property, which has practical value for long-term accumulated pathology department archives in hospitals.
Limitations and Open Questions
The paper validated the method on public and private data, but the specific scale and diversity of the private clinical dataset have not been fully elaborated in the abstract. Diagnostic labels depend on predicted or ground-truth labels; if the predicted labels themselves contain errors, retrieval quality may be affected. In addition, the Precision@5 improvements are in the single digits, still far from the reliability required for clinical deployment. Although latency studies are mentioned, specific numbers are not given in the abstract, and the actual cost of large-scale deployment still needs further evaluation.
Overall, CLEAR-WSI provides a clearly structured and scalable framework for content-based retrieval of pathology archives, and its diagnosis-driven approach is worth attention. If it can be validated on larger-scale clinical data in the future and more details on latency and robustness can be disclosed, this direction is expected to move toward practical use.
One-line Summary
CLEAR-WSI enables scalable whole-slide image retrieval using fixed-length embeddings and diagnostic label refinement.
Paragraph Summary
CLEAR-WSI is a scalable retrieval framework for whole-slide images in digital pathology, designed to bypass the bottlenecks of inconsistent metadata and handcrafted indexing pipelines. It learns fixed-length slide embeddings from visual content to uniformly represent WSIs of different sizes and magnifications, and uses predicted or ground-truth diagnostic labels to refine retrieval candidates so that results better align with clinical diagnostic intent. New cases can be continuously added to the memory bank, allowing the retrieval archive to expand over time without rebuilding the index. On the four tasks CAMELYON16, BRACS-1, BRACS-2, and X-HER2, Precision@5 improved by 3.10, 2.75, 1.95, and 3.75, respectively. The article also points out that diagnostic label quality, latency performance, and limited improvement margins remain issues that need further validation before clinical deployment.
Related articles
Tech FrontiersGoogle Omni 1.2 Flash: 15-Second AI Video at Just $0.07 per Second
Google DeepMind releases Gemini Omni 1.2 Flash: 15-second video, 720p at $0.07/sec (30% cheaper), multi-turn editing without regeneration, draft upscaling to 4K.
Tech FrontiersNo AI Ghostwriting: Writer's Quarter Reinvents Novel Writing with a Visual Workbench
The Writer's Quarter is an AI-free novel writing and planning tool that unifies character building, story planning, and manuscript writing in one visual workbench. This article analyzes its positioning, target users, and differentiated value amid the rise of AI writing tools.
Tech FrontiersFleeep: A Unified Inspiration Collection Notes App for Creatives
Fleeep is a notes app for creatives that unifies screenshots, bookmarks, saved posts, and inspiration into one calm, cross-device, offline-capable space. This article analyzes its positioning, differentiation, and target users.