Digital Pathology & AI

Image compression artifacts in digital pathology diagnostics

Whole slide imaging produces files that are difficult to treat like ordinary images.

Image compression artifacts in digital pathology diagnostics

The storage problem nobody warns you about

A single slide can range from roughly 150 megabytes to 28 gigabytes, depending on the tissue area, scanner optics, image pyramid, bit depth, and compression profile selected by the vendor. At high volume, the challenge is no longer simply finding disk space. It becomes a question of how the laboratory preserves diagnostic information while moving images through scanners, archives, viewers, AI pipelines, and research environments.

Storage cost is only the visible symptom. The less obvious risk appears when files are compressed aggressively to keep infrastructure manageable. That is where blocking, blurring, ringing, and subtle texture shifts enter the workflow. They may be difficult to notice during routine visual review, yet still affect image analysis, model calibration, or the reproducibility of a case several years later.

The central problem is not whether compression is acceptable. Digital pathology cannot operate at scale without it. The real question is where compression remains an efficient engineering decision and where it begins to alter the information that a pathologist or algorithm needs. That distinction sits at the heart of digital pathology image compression artifacts in diagnostic accuracy.

The data burden: scaling whole slide imaging infrastructure

Modern scanners commonly capture tissue at approximately 0.25 microns per pixel. That resolution is sufficient to represent structures such as nuclei, mitoses, glandular lumens, and fine stromal patterns across very large fields. A modest biopsy may produce an image around 100,000 × 80,000 pixels, while a larger resection can extend to approximately 100,000 × 200,000 pixels. Even before the image is assembled into a multiresolution pyramid, the underlying raster is already in the gigapixel range.

Keeping every slide as an uncompressed raster is rarely practical outside narrowly defined archival or processing stages. The clinical record, working copies, disaster-recovery tiers, teaching collections, and research datasets do not necessarily require identical storage policies. A laboratory therefore has to decide which representations are authoritative, which are operational, and which can be regenerated from a retained source.

A few anchors make the scale easier to understand:

  • A typical uncompressed WSI may occupy roughly 4 to 16 GB, depending on dimensions and bit depth.
  • Lossless compression can reduce that size by approximately three to five times. A 10 GB slide may become a file in the range of 2 to 3 GB.
  • Lossy JPEG can reduce the same slide to roughly 500 to 700 MB, representing approximately a 15-to-20-fold reduction.
  • Lossy JPEG 2000 can push the reduction further, in some workflows reaching approximately 30 to 50 times and producing files in the range of 200 to 350 MB.

These figures are not promises. The result depends on tissue composition, background area, scanner settings, tile structure, color depth, and the exact implementation of the codec. A largely empty slide and a densely cellular slide do not compress in the same way. Nor does a file that is visually acceptable at one magnification necessarily preserve the same information at another.

Storage is a deployment constraint, not a research variable. The slide you compress today may be the one an algorithm grades years later.

The temptation is easy to understand. A laboratory can reduce storage requirements substantially by moving from lossless compression to a lossy profile. That may make a multi-year retention strategy easier to finance and operate. But the reduction in bytes is not the only change. A compression profile also becomes part of the slide's technical history: it affects what the viewer displays, what the AI model receives, and what another institution can reproduce when the case is shared.

This is why whole slide imaging quality control cannot stop at scanner calibration or focus assessment. The file that leaves the scanner is already entering a chain of transformations. Compression should be documented alongside magnification, staining, scanner model, and other image-acquisition parameters.

Lossy versus lossless: balancing storage costs and diagnostic integrity

Lossless methods preserve the original pixel information while reducing redundancy. In practice, this includes LZW- or PNG-class approaches and other lossless profiles supported by the relevant container. The file becomes smaller, but decoding reconstructs the same image data. For primary diagnostic material, that predictability is the main advantage.

Lossy methods discard information that the codec estimates to be less important. JPEG and JPEG 2000 are the formats most often discussed in deployed pathology environments, but they do not produce the same artifact profile and should not be treated as interchangeable merely because both reduce file size.

ParameterLossless compressionLossy JPEGLossy JPEG 2000
Approximate compression ratio3×–5×15×–20×30×–50×
Typical size for a 10 GB slideAbout 2–3 GBAbout 500–700 MBAbout 200–350 MB
Main advantagePixel-level fidelityBroad compatibility and substantial size reductionHigh compression efficiency
Common artifact patternNo codec-induced lossBlocking, ringing, and edge distortion at high ratiosSmoothing or blurring at aggressive settings
Main operational concernStorage burdenVariable quality across implementationsViewer, decoder, and validation compatibility

The visual effect depends on both the codec and the content. JPEG divides image data into fixed blocks and can create visible discontinuities when the compression level becomes aggressive. Fine boundaries may show ringing, and high-frequency details can be softened. JPEG 2000 uses a different transform and can avoid some of the block structure associated with JPEG, but it is not immune to loss. At sufficiently high compression, fine texture and local contrast can still be attenuated.

For routine visual examination, published evaluations have reported that JPEG at ratios up to approximately 20:1 and JPEG 2000 at ratios up to approximately 50:1 can retain sufficient diagnostic detail in many settings. That does not mean every tissue type, task, scanner, viewer, or clinical decision is equally protected. It means that visual acceptability cannot be reduced to a universal number detached from the use case.

A pathologist also brings a great deal of contextual information to the image. The observer can change magnification, compare neighboring regions, inspect an entire tissue fragment, and interpret a compression-related irregularity as an imaging issue rather than a biological feature. That flexibility can make modest artifacts tolerable during a human read.

An algorithm has a different relationship with the image. Its behavior depends on the data distribution used during training, validation, and deployment. A model may be robust to one type of quality variation and unexpectedly sensitive to another. It may also produce a plausible output without revealing that its confidence has been affected.

This is why lossy compression impact on histopathology cannot be summarized as a single safe ratio. The relevant threshold depends on the diagnostic task, the tissue, the image pyramid, the model, and the way quality is measured.

What a compression policy should distinguish

A workable policy usually separates at least three classes of material:

  • Primary diagnostic images, where the laboratory needs a stable and defensible representation for clinical interpretation.
  • Operational derivatives, such as viewing copies, remote-access versions, or images used for routine navigation.
  • Research and development data, where aggressive compression may be acceptable if the profile is recorded and the data is not silently reused as a reference standard.

The mistake is to treat the smallest file as the best file. A smaller file can improve transfer times and reduce infrastructure pressure, but it can also make later validation harder if the original acquisition settings are unknown. A compression policy should therefore record the codec, quality setting or ratio where available, pyramid level, color information, and any conversion performed before analysis.

Computational sensitivity: how compression artifacts alter AI predictions

AI systems often inspect features that are difficult to describe in ordinary visual language. A model trained to detect tumor-infiltrating lymphocytes, identify metastases, segment glands, or grade prostate tissue may use local texture, boundary sharpness, color relationships, and small-scale spatial patterns. These features can be meaningful biological signals, but they can also be altered by compression.

The same softening that appears negligible to a pathologist may reduce the separation between nuclear chromatin patterns. A slight color shift can change the relationship between hematoxylin-rich and eosin-rich regions. A block boundary can introduce a repeated structure that was never present in the tissue. None of these changes needs to be obvious for the model's output to move.

Benchmark work associated with Camelyon17-style evaluations has reported that deep learning systems retained at least 95% of their uncompressed task performance when exposed to JPEG-compressed slides at quality levels up to approximately 85%. In practical terms, that provides a useful reference point for certain detection and segmentation tasks. It is not a universal guarantee for every algorithm or pathology domain. Performance below that range becomes increasingly dependent on how the model was trained and how the compressed images differ from its validation data.

There are several ways the failure can present itself.

1. Texture drift. Aggressive compression smooths fine chromatin and cytoplasmic texture. A model trained on uncompressed or lightly compressed material may interpret the altered pattern as lower-confidence evidence, even when the pathologist considers the region readable.

2. Blocking artifacts. JPEG's block structure can create repeated boundaries or seams. If these patterns occur consistently in the training data, a model may learn them as a shortcut. If they appear only at inference time, the same patterns can disturb feature extraction or increase false detections around block edges.

3. Boundary degradation. Segmentation models depend on local contrast and edge information. When a tissue boundary, glandular lumen, or small focus of tumor is softened, the model may shift the contour, merge adjacent structures, or miss a small region entirely.

4. Color and stain interaction. Compression is applied to image channels whose errors may not be equally important for a specific task. A model that uses color as a proxy for morphology can be affected even when the image still looks acceptable at the overview level.

5. Calibration drift. The model may continue to classify cases correctly often enough to preserve a headline accuracy metric while becoming less reliable in its confidence scores. That matters when the output is used for triage, prioritization, quality review, or a human-in-the-loop threshold.

6. Codec dependence. A system trained on JPEG artifacts may not behave the same way when presented with JPEG 2000, an SVS-derived image, or a re-encoded derivative. The model can learn properties of the image-production pipeline rather than the pathology itself.

The model does not know it is looking at a compressed image. It only sees the version of the tissue that the workflow gives it.

The operational consequence is straightforward: compression must be treated as a model input, even when it is not listed among the model's formal features. A laboratory running computational pathology in production should know which codec and quality profile are present at inference time and should validate the model against that profile.

That validation should include more than a single aggregate score. Useful checks may include:

  • performance by tissue type and specimen category;
  • sensitivity to small or borderline findings;
  • changes in segmentation boundaries;
  • calibration and confidence distributions;
  • behavior at different magnifications and pyramid levels;
  • comparison between the original image and its operational derivative;
  • failure review by a pathologist who can distinguish biological difficulty from image degradation.

A pathologist can adapt during review. An algorithm does not adapt unless it was designed and validated to do so. That asymmetry is one reason digital pathology diagnostic reliability cannot be inferred from visual inspection alone.

Standardization and interoperability in modern pathology workflows

Compression is also an interoperability problem. The file format determines how image tiles, pyramid levels, metadata, color information, and compression settings are represented. Proprietary formats such as Aperio SVS, Hamamatsu NDPI, and 3DHISTECH MRXS remain important in real-world scanner and viewer environments, but their internal behavior and metadata conventions differ.

The discussion of JPEG 2000 versus SVS file compression is therefore not only a codec comparison. It is also a question of whether a slide can be opened, interpreted, validated, and moved through the intended workflow without losing metadata or creating an undocumented derivative.

Two standards are particularly relevant:

  • DICOM WSI extends the medical imaging standard to whole slide imaging and can support exchange with enterprise imaging environments and PACS-oriented infrastructure.
  • OME-TIFF provides a TIFF-based approach widely used in research and microscopy workflows, particularly where Bio-Formats-compatible tooling is involved.

Standards-based exchange improves portability, but it does not eliminate every conversion risk. A DICOM WSI object and an OME-TIFF file can represent the same case while differing in metadata organization, tile layout, pyramid construction, color handling, and supported compression profiles. A viewer may display both successfully while an AI pipeline extracts them through different code paths. Successful opening is not the same as technical equivalence.

The same caution applies to vendor ecosystems. A slide may travel between a scanner, a viewing application, an enterprise archive, and a research compute environment, but the workflow may involve an export, a repackaging step, a transcoding operation, or a derived image even when the user experience feels seamless. Each step should be visible in the audit trail when the image is used for clinical or validated computational work.

A standards-based workflow should answer several practical questions:

  • Which file is considered the source of record?
  • Does the receiving system preserve the original pixel data or create a derivative?
  • Are all pyramid levels transferred, or only selected levels?
  • Does the receiving viewer apply additional rendering or color transformations?
  • Is the compression profile retained in metadata?
  • Can the laboratory reproduce the exact image supplied to an AI model?
  • Does a re-export change tile boundaries, image dimensions, or decoding behavior?

For multi-site operations, federated learning networks, and cross-institutional case sharing, these questions are not administrative detail. They determine whether a result can be audited and whether a model trained at one site is receiving comparable data at another.

Interoperability should therefore be defined at two levels. The first is syntactic: can the receiving system read the file? The second is semantic and diagnostic: does the receiving system preserve the image properties that matter for interpretation and analysis? DICOM WSI and OME-TIFF can support the first step and help with the second, but local validation is still necessary.

Future horizons: neural autoencoders and adaptive compression

The next generation of image compression will not necessarily be built around a better hand-designed codec. Learned compression uses neural networks to model image structure and encode information according to the patterns represented in the training data. In pathology, that raises the possibility of allocating more information to diagnostically important regions while compressing visually repetitive or low-information areas more aggressively.

Work presented at MICCAI 2025 explored neural autoencoder architectures trained specifically on pathology images. The general concept is attractive: the codec learns regularities in H&E-stained tissue and attempts to preserve information that matters for perception or downstream tasks. Early results suggest that learned approaches may exceed conventional JPEG 2000 compression while retaining performance on selected computational tasks.

The promise is real, but the deployment questions are more demanding than the compression benchmark.

Generalization across tissue and task

A neural codec trained on breast biopsies may not behave the same way on dermatopathology, gastrointestinal specimens, hematopathology, or heavily necrotic tissue. Tissue composition, staining patterns, cellular density, and clinically relevant structures vary. A codec can preserve the statistics it has learned while weakening an uncommon but important feature outside that distribution.

Validation must therefore cover the material the laboratory actually handles. A visually convincing reconstruction is not enough. The question is whether the output preserves the features needed for the intended clinical and computational tasks.

The decoder becomes part of the workflow

With conventional formats, the organization usually has established tools for viewing and processing the image. A learned codec introduces another dependency: the decoder. If the viewer, LIS, archive, or inference stack cannot load the encoded representation reliably, the storage saving may be outweighed by integration friction.

Versioning also becomes important. A change to the encoder or decoder can alter the reconstructed image even when the slide, scanner, and clinical case remain the same. That creates a reproducibility problem for longitudinal studies and validated AI systems. The codec version should be treated as part of the data-processing record, not as an invisible infrastructure detail.

Clinical validation and regulatory scrutiny

A learned compression method is effectively a preprocessing step. If it changes the input to a diagnostic algorithm, its influence must be evaluated in the same disciplined way as other preprocessing operations. The relevant evidence should cover not only average image quality, but also worst-case behavior, rare findings, small lesions, stain variation, and model performance across sites.

For regulated clinical workflows, it is reasonable to expect scrutiny around changes in model behavior caused by codec updates, retraining, or revised compression settings. The more adaptive the codec becomes, the more carefully the laboratory must define what is fixed and what is allowed to change.

Neural compression is promising, but it is not yet a simple replacement for established JPEG 2000 or lossless workflows in regulated diagnostic practice. Its strongest near-term role may be in research environments, controlled image distribution, or task-specific pipelines where the codec and model can be validated together.

The practical line

Compression artifacts in digital pathology are not a hypothetical concern. They are a deployment variable that can enter the archive at acquisition, during export, through a viewer, or inside an AI preprocessing pipeline.

The most defensible policy is not to ban lossy compression everywhere. It is to assign compression profiles to defined uses and document the consequences.

For primary diagnostic reads, lossless or visually lossless workflows remain the conservative choice. Existing evidence supports the visual acceptability of JPEG at ratios up to approximately 20:1 and JPEG 2000 up to approximately 50:1 in many routine settings, but those values should be treated as evidence boundaries rather than automatic permissions. A laboratory should validate the profile against its scanners, tissue mix, viewing system, and diagnostic use.

For AI inference, compression should be handled as part of the model input. The codec, ratio or quality setting, pyramid level, and any re-encoding step should be known. The algorithm should be tested on the same image representation it will receive in production. JPEG quality around 85% is a useful reference point from the Camelyon17 family of benchmarks, not a universal safety threshold. Below that point, performance may remain acceptable for one task and deteriorate for another.

For multi-site workflows, DICOM WSI and OME-TIFF can provide a stronger foundation for exchange than relying exclusively on proprietary formats. But interoperability should be tested end to end. A file that opens in the receiving viewer may still have changed in a way that matters to an algorithm, a metadata audit, or a future reanalysis.

The most reliable laboratories will keep three things aligned: the image a pathologist reviews, the image an algorithm receives, and the record of how that image was produced. That means documenting compression profiles, preserving a suitable source representation, testing derivatives rather than assuming equivalence, and reviewing model behavior after changes to scanners, viewers, archives, or codecs.

The technology is ready for disciplined use. What it is not ready for is silent variation. When compression is treated as an invisible storage setting, artifacts can become part of the diagnostic workflow without anyone explicitly accepting the risk. When it is treated as a measurable and validated property of the image, storage efficiency becomes an engineering choice rather than a threat to diagnostic reliability.

FAQ

How much space can I save using different compression methods?
Lossless compression typically reduces file size by three to five times. Lossy JPEG can achieve a 15-to-20-fold reduction, while lossy JPEG 2000 can reach a 30-to-50-fold reduction.
Is there a universally safe compression ratio for pathology images?
No, there is no universal number. While some studies suggest JPEG at 20:1 and JPEG 2000 at 50:1 may be visually acceptable for many settings, safety depends on the specific tissue, scanner, diagnostic task, and AI model.
How does image compression affect AI diagnostic models?
Compression can cause texture drift, blocking artifacts, and boundary degradation. These changes can alter the features an AI model uses for detection or segmentation, potentially leading to reduced reliability or confidence scores.
Should I use the same compression settings for all pathology images?
No, a workable policy should separate images into classes, such as primary diagnostic images, operational viewing copies, and research data, applying different compression standards to each.
Are neural autoencoders a reliable replacement for current compression methods?
While promising for research, neural compression is not yet a standard replacement for regulated clinical practice. It requires careful validation because changes to the encoder or decoder can alter images in ways that affect reproducibility and diagnostic outcomes.

Worth a read