Learning binary and sparse permutation-invariant representations for fast and memory efficient whole slide image search

Sobhan Hemati, Shivam Kalra, Morteza Babaie, Hamid R. Tizhoosh

TL;DR

This paper introduces a novel framework for converting massive Whole Slide Images (WSIs) into compact, searchable binary and sparse vectors. By combining deep generative modeling (VAEs) with Fisher Vector theory and new "double backpropagation" loss functions, the researchers achieved faster, more memory-efficient histopathology image retrieval that outperforms current state-of-the-art search engines like Yottixel.

What Problem Does This Paper Address?

Digital pathology relies on Whole Slide Images (WSIs)—gigantic files often exceeding 50,000 x 50,000 pixels. To analyze them, researchers typically break them into thousands of small "patches." However, this creates two major bottlenecks:

  1. Memory Constraints: Most current Multiple Instance Learning (MIL) methods require processing a "bag" of patches all at once, which quickly exhausts GPU memory.
  2. Search Inefficiency: Existing methods produce high-dimensional embeddings in Euclidean space. Searching through a database of millions of these slides using standard distance metrics is prohibitively slow and storage-intensive.

The authors set out to create a "single-vector" representation of a slide that is both permutation-invariant (the order of patches doesn't matter) and compact (binary/sparse) for lightning-fast searching.

Methods

The authors propose a framework called Conditioned Deep Sparse/Binary Fisher Vectors. Here’s the breakdown of their approach:

  • Conditioned Variational Autoencoder (CVAE): They use a VAE with a frozen DenseNet-121 backbone. Unlike standard VAEs, this one is "conditioned" on known metadata like tumor type. It also includes a classification layer to predict cancer subtypes, injecting diagnostic knowledge directly into the latent space.
  • Fisher Vector (FV) Theory: Instead of just using the latent features, they calculate the Fisher Score—the gradient of the model’s log-likelihood with respect to its parameters. This captures how a specific slide "evolves" or deviates from the general generative model.
  • Instance-Based Training: Because the model learns from individual patches rather than entire bags, it is significantly more memory-efficient than traditional MIL.
  • Novel Loss Functions: To make the resulting vectors useful for search, they introduced two specific constraints:
  • Sparsity Loss: Encourages the model to use fewer parameters to represent a slide, making the embedding "sparse."
    • Quantization Loss: Pushes the gradients toward binary values (-1 or 1).
  • Double Backpropagation: To optimize these gradient-based losses, the team used "double backpropagation," essentially calculating the gradient of a gradient during training.

Datasets

The framework was validated on two major benchmarks:

  1. The Cancer Genomic Atlas (TCGA): A massive repository of diagnostic slides. The authors used 3,770 test slides across 29 cancer subtypes for the retrieval experiments.
  2. Liver-Kidney-Stomach (LKS): A public benchmark dataset used specifically for WSI classification tasks to compare against other state-of-the-art (SOTA) methods.

Key Insights and Ideas

  • Gradients as Features: The core "aha" moment is that the gradient of a generative model provides a richer description of a set of patches than the latent variables alone. It tells you exactly which parts of the model need to change to "fit" that specific slide.
  • Metadata Matters: By conditioning the VAE on the tumor type, the model learns more discriminative features. Since every tumor type has specific subtypes, this "apriori" knowledge acts as a powerful form of self-supervision.
  • Efficiency through Sparsity: The researchers found that they could drop a huge percentage of the dimensions in their Fisher Vectors (keeping only high-variance dimensions) and still maintain—or even improve—search accuracy. This allows for a massive reduction in the "bits" required to store a slide's signature.

Key Results

  • Superior Retrieval: The proposed method (C-Deep-SBFV) outperformed Yottixel, a leading histopathology search engine, across almost all 29 cancer subtypes in terms of F1-measure.
  • Massive Speedup: In a "leave-one-patient-out" search, the proposed method was significantly faster than Yottixel and GMM-based Fisher Vectors. Using just 4,000 bits (sparse/binary), it achieved high accuracy while being computationally trivial to compare.
  • Competitive Classification: On the LKS dataset, the method achieved an accuracy of 90.73%, performing on par with specialized classification models like SOS (Selective Objective Switch) while using a much simpler architecture.

Limitations and Future Work

  • Backbone Dependency: The method relies on a frozen, pre-trained CNN (DenseNet-121). While effective, the authors note that fine-tuning the backbone specifically for histopathology might yield even better results.
  • Metadata Requirement: The "Conditioned" aspect of the VAE requires knowing the tumor type beforehand. While this is usually available in clinical settings, it might limit the model's use in completely "blind" exploratory scenarios.
  • Future Directions: The authors suggest exploring more complex generative models beyond VAEs and further refining the "double backpropagation" process to handle even larger parameter sets.

Summary updated

BibTeX
@article{hemati2023learning,
  author = {Sobhan Hemati and Shivam Kalra and Morteza Babaie and Hamid R. Tizhoosh},
  title = {{Learning binary and sparse permutation-invariant representations for fast and memory efficient whole slide image search}},
  journal = {Computers in Biology and Medicine},
  year = {2023},
  doi = {10.1016/j.compbiomed.2023.107026},
}
Figure