Abstract
Histological whole slide images (WSIs) are frequently compromised by artifacts such as tissue folding and bubbles, which increase the difficulty of examination for both pathologists and Computer-Aided Diagnosis (CAD) systems. Existing restoration approaches are largely confined to Generative Adversarial Networks (GANs), which formulate restoration as an image-to-image transfer task. However, these methods are prone to mode collapse and unintended stain style mistransfer, leading to unrealistic results. In this work, we introduce ArtiFusion, the first denoising diffusion probabilistic model (DDPM) designed specifically for histological artifact restoration. ArtiFusion treats artifact restoration as a gradual regional denoising process. By utilizing a novel Swin-Transformer denoising architecture and a time token scheme, the model captures local-global correlations to reconstruct damaged regions while preserving the integrity of healthy tissue. Our evaluations demonstrate that ArtiFusion effectively maintains tissue structures and stain styles, significantly outperforming GAN-based baselines and improving the accuracy of downstream histology analysis.
Introduction
Histological whole slide images (WSIs) serve as the gold standard for cancer diagnosis. However, the complex process of tissue preparation—including cutting, staining, and scanning—often introduces physical artifacts like air bubbles, tissue folds, and pen marks. These defects are more than just aesthetic concerns; they can lead to clinical misdiagnosis and cause deep learning-based CAD systems to produce erroneous results.
While Generative Adversarial Networks (GANs) have been the primary tool for image restoration, they often struggle with medical data. GANs frequently suffer from "stain style mistransfer," where the model inadvertently alters the color or texture of healthy tissue while attempting to fix the artifact. To address these limitations, we propose ArtiFusion, a framework that leverages the stability and generative power of diffusion models to restore histological integrity.
The ArtiFusion Framework
ArtiFusion moves away from the traditional image-to-image translation paradigm. Instead, it formulates restoration as a regional denoising process. The framework is built upon three primary innovations:
1. Regional Denoising
Unlike standard diffusion models that regenerate an entire image, ArtiFusion focuses exclusively on the artifact regions. During the inference phase, the damaged area is replaced with Gaussian noise and then iteratively "denoised" back into clean tissue. By using the surrounding healthy tissue as context, the model ensures the restored region is spatially and stylistically consistent with the rest of the slide.
2. Swin-Transformer Backbone
To improve the model's ability to "hallucinate" realistic tissue structures, we replaced the standard U-Net architecture typically found in diffusion models with a U-shaped Swin-Transformer. This architecture is better suited for capturing both fine local details and broad global correlations, ensuring that the restored patch blends seamlessly into the larger histological landscape.
3. Time Token Scheme
To guide the Transformer through the iterative denoising process, we introduced a "time token" scheme. This auxiliary token is concatenated with feature tokens before the attention layers, allowing the model to dynamically adjust its restoration strategy based on the specific step of the diffusion process.
Notably, ArtiFusion is trained solely on artifact-free images. By learning the underlying distribution of healthy human tissue, the model gains the ability to reconstruct missing or damaged information without requiring perfectly paired "dirty" and "clean" training samples.
Experimental Results
We evaluated ArtiFusion using the Camelyon17 dataset and the NCT-CRC-HE-100K dataset for downstream tasks. Our results highlight several key advantages over traditional methods:
- Superior Accuracy: ArtiFusion outperformed CycleGAN across all quantitative metrics, achieving a reduction in L2 distance and Mean Squared Error (MSE) of more than 50%.
- Style Consistency: Qualitative analysis confirmed that while GAN-based methods often shifted the pink/purple stain style of the entire image, ArtiFusion preserved the original appearance of artifact-free regions.
- Downstream Performance: Restoring images with ArtiFusion led to a significant performance boost in tissue classification. Using models like ResNet and RexNet, we observed an accuracy increase of over 5% compared to using raw, artifact-laden images.
- Computational Efficiency: The Swin-Transformer architecture achieved a 72.6% reduction in parameters (29.67M vs. 108.41M) compared to standard U-Net diffusion implementations, making it more viable for practical deployment.
Conclusion
ArtiFusion represents a significant step forward in histological image preprocessing. By applying diffusion probabilistic models to the problem of artifact restoration, we provide a method that is more stable than GANs and more faithful to the underlying biological structures. While challenges remain regarding inference speed—a common trait of diffusion models—the ability to restore compromised WSIs while maintaining medical integrity offers great promise for the future of digital pathology.
Summary updated