Pathology Image Compression with Pre-trained Autoencoders

Srikar Yellapragada 1, Alexandros Graikos 1, Kostas Triaridis 1, Zilinghan Li 2, Tarak Nath Nandi 2, Ravi K Madduri 2, Prateek Prasanna 1, Joel Saltz 1, Dimitris Samaras 1 · 2025

Read Pathology Image Compression with Pre-trained Autoencoders by Srikar Yellapragada 1, Alexandros Graikos 1, Kostas Triaridis 1, Zilinghan Li 2, Tarak Nath Nandi 2, Ravi K Madduri 2, Prateek Prasanna 1, Joel Saltz 1, Dimitris Samaras 1 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-11591.txt.

Introduction

Srikar Yellapragada and co-authors squeeze pathology images with borrowed autoencoders in two thousand twenty-five. Whole slide images are huge, straining storage and transfer in digital pathology. Standard squeezing like JPEG saves space but blurs the fine traits that later tasks read.

Their trick: reuse autoencoders built for image generation models as learned squeezers. Three models at varied squeeze levels were rebuilt and scored by pathology foundation models. A fine-tuning step, guided by a pathology-tuned sense of likeness, sharpened the rebuilds. On sorting, segmentation, and case-level tasks, swapped-in reconstructions lost little accuracy. A clustering step shrinks the stored codes further, and the tuned weights are shared in public.

Catalog record

CREATORSrikar Yellapragada 1, Alexandros Graikos 1, Kostas Triaridis 1, Zilinghan Li 2, Tarak Nath Nandi 2, Ravi K Madduri 2, Prateek Prasanna 1, Joel Saltz 1, Dimitris Samaras 1
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE21 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2503-11591

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Pathology Image Compression with Pre-trained Autoencoders Srikar Yellapragada 1, Alexandros Graikos 1, Kostas Triaridis 1, Zilinghan Li 2, Tarak Nath Nandi 2, Ravi K Madduri 2, Prateek Prasanna 1, Joel Saltz 1, Dimitris Samaras 1 Abstract The growing volume of high-resolution Whole Slide Images in digital histopathology poses significant storage, transmission, and computational efficiency challenges. Standard compression methods, such as JPEG, reduce file sizes but often fail to preserve fine-grained phenotypic details critical for downstream tasks. In this work, we repurpose autoencoders (AEs) designed for Latent Diffusion Models as an efficient learned compression framework for pathology images. We systematically benchmark three AE models with varying compression levels and evaluate their reconstruction ability using pathology foundation models. We introduce a fine-tuning strategy to further enhance reconstruction fidelity that optimizes a pathology-specific learned perceptual metric. We validate our approach on downstream tasks, including segmentation, patch classification, and multiple instance learning, showing that replacing images with AE-compressed reconstructions leads to minimal performance degradation. Additionally, we propose a K-means clustering-based quantization method for AE latents, improving storage efficiency while maintaining reconstruction quality. We provide the weights of the fine-tuned autoencoders at this link . 1 Introduction With the increasing digitization of histopathology, large repositories of Whole Slide Images (WSIs), such as TCGA [ 3 ] , have been invaluable for the development of large-scale machine learning models [ 5 , 20 , 8 ] . However, the size of high-resolution pathology images presents a major bottleneck in storage, transmission, and computational efficiency. A large pathology center produces over 1 million digital slides per year [ 22 ] , which translates to petabytes of storage. Long-term retention of these slides, even in deep archival storage, could cost up to $100,000 per year. As the volume of pathology data grows, developing efficient compression techniques that reduce storage requirements while preserving information relevant for AI model ‘consumption’ remains a key issue. Figure 1: Examples of image reconstruction using JPEG, the vanilla DC-AE [ 4 ] and fine-tuned DC-AE. JPEG at quality 10, with a comparable file size to DC-AE, introduces severe compression artifacts, including deformed nuclei and blocky artifacts (highlighted in yellow and teal). Vanilla DC-AE fails to retain certain cell structures (green), which are largely recovered through our fine-tuning strategy. Figure 2: Left: Pre-trained autoencoders outperform JPEG in reconstruction fidelity, further improved by fine-tuning with a pathology-specific perceptual loss. Right: Using fine-tuned AE-compressed reconstructions results in minimal performance degradation. The width of each bar denotes the relative sizes of the compressed representation. Looking for ways to reduce image size, generative diffusion models [ 14 ] have employed autoencoders (AEs) for efficient high-resolution image synthesis. The Latent Diffusion Model (LDM) framework [ 21 ] introduced a trained autoencoder that first compresses images into a lower-dimensional latent representation before applying the diffusion model. These autoencoders are designed to maintain high reconstruction fidelity while preserving spatial locality and ensuring generalizability. While originally optimized for generative modeling, they are equally well-suited for image compression [ 23 , 11 ] , making pre-trained LDM autoencoders a promising choice across diverse image domains and sizes. In this work, we repurpose LDM autoencoders as efficient image compression models for histopathology. Conventional compression methods, such as JPEG, can significantly reduce image sizes but struggle to preserve the fine-grained pathology features critical for downstream tasks when aggressively compressing [ 6 ] . By leveraging the learned representations of LDM autoencoders, we achieve high compression rates while maintaining the essential pathology details. As shown in Fig. 1 , heavy JPEG compression leads to substantial artifacts, whereas comparable compression with the DC-AE autoencoder model gives coherent reconstructions. We systematically benchmark three AEs — Stable Diffusion 1.5 (SD-1.5) [ 21 ] , Stable Diffusion 3 (SD-3) [ 7 ] , and Deep Compression Autoencoder (DC-AE-f32) [ 4 ] – each offering different compression rates. We assess the perceptual similarity between original and reconstructed images using pathology foundation models [ 5 , 9 , 25 ] , finding that existing AEs perform surprisingly well (Fig. 2 left). To further improve the AE reconstructions, we propose a fine-tuning strategy that optimizes the decoder for a pathology-specific learned perceptual metric. This fine-tuning strategy further aligns pathology-specific features between the reconstructions and the original without altering the desirable properties (generalizability, locality) of the autoencoder. Beyond perceptual similarity, we validate our compression pipeline on multiple downstream tasks, including segmentation, patch and multiple instance learning classification. We show that replacing raw images with AE-compressed reconstructions results in minimal performance degradation, demonstrating the practical viability of our approach (Fig. 2 right). Finally, we introduce a K-means clustering-based quantization for the AE latents that considers the unique characteristics of the latent distribution. By mapping the continuous latent representations to a fixed set of discrete values, we further reduce storage while preserving high reconstruction fidelity, outperforming static 8-bit (int8) rounding-based quantization, which introduces artifacts and degrades image quality. Our contributions are as follows • We repurpose LDM autoencoders for pathology image compression, demonstrating their ability to achieve high compression rates while preserving essential phenotypical details. • We benchmark three AEs across multiple compression rates and evaluate their performance using pathology foundation models. • We introduce a fine-tuning strategy to enhance reconstruction fidelity by aligning AE latents with a pathology-specific learned perceptual metric. • We enhance storage efficiency with a K-means clustering-based quantization for AE latents, outperforming static int8 quantization, while preserving reconstruction fidelity. 2 Related Work Autoencoders for compression. Using autoencoders for data compression has been extensively studied with previous works showing that learned compression schemes can outperform standard compression algorithms [ 24 , 2 ] . However, only recently have autoencoders trained on large-scale datasets, such as those in LDMs, been explored for image compression. LDM autoencoders. The autoencoders used in LDMs embed the images into a structured, 2D latent space that downscales the image size. The AEs are trained with reconstruction, perceptual [ 28 ] and patch-based adversarial losses [ 16 ] to ensure the high fidelity of the outputs. To constrain the learned latent space, Stable Diffusion [ 21 ] employs KL regularization [ 18 ] that centers the latent embeddings around zero and imposes unit variance. In DC-AE [ 4 ] there is no explicit regularization on the learned latent space, but it still maintains similar properties to the latent spaces learned by the SD AEs. Image compression in digital pathology. The current go-to approach for image compression in digital pathology is JPEG [ 12 ] . Previous attempts at learned compression for pathology images have also used autoencoder models [ 23 , 11 ] with recent works proposing domain-specific decompositions for increased efficiency [ 10 ] . However, all existing learning-based compression schemes fail to generalize outside the training data distribution [ 12 ] . In contrast, the LDM autoencoders have been designed and trained to work with web images, allowing them to be used in a wider array of settings. 3 Pathology image compression with AEs 3.1 Compression ratio The starting point is the comparison of storage requirements and reconstruction fidelity between JPEG compression, with different quality settings, and the learned autoencoder compression schemes. We utilize 1000 256 \times 256 px image patches from the TCGA dataset to measure reconstruction fidelity.

Read the complete text