Abstract
To achieve high-quality results, diffusion models must be trained on large datasets. This can be notably prohibitive for models in specialized domains, such as computational pathology. Conditioning on labeled data is known to help in data-efficient model training. Therefore, histopathology reports, which are rich in valuable clinical information, are an ideal choice as guidance for a histopathology generative model. In this paper, we introduce PathLDM, the first text-conditioned Latent Diffusion Model tailored for generating high-quality histopathology images. Leveraging the rich contextual information provided by pathology text reports, our approach fuses image and textual data to enhance the generation process. By utilizing GPT’s capabilities to distill and summarize complex text reports, we establish an effective conditioning mechanism. Through strategic conditioning and necessary architectural enhancements, we achieved a SoTA FID score of 7.64 for text-to-image generation on the TCGA-BRCA dataset, significantly outperforming the closest text-conditioned competitor with FID 30.1.
Introduction: The Precision Gap in Pathology
Generative AI has revolutionized natural image domains, yet specialized fields like computational pathology face unique hurdles. Histopathology—the microscopic study of diseased tissue—demands extreme precision. Standard generative models often rely on simplistic class labels (e.g., "Tumor" vs. "Normal"), which fail to capture the nuanced clinical descriptions found in pathology reports.
These reports, while rich in information, are typically long (~2,800 characters), unstructured, and difficult for standard text encoders to process. Additionally, standard diffusion architectures like Stable Diffusion often employ aggressive compression that "smears" critical cellular structures vital for medical diagnosis.
Methods: Fusing Text and Vision
PathLDM addresses these challenges through a multi-modal approach that bridges clinical text and visual tissue data. The researchers at Stony Brook University developed a three-pillar strategy:
GPT-Powered Summarization
Raw pathology reports are often too verbose for direct conditioning. The team utilized GPT-3.5 with "chain-of-thought" prompting to distill complex reports into succinct, 75-word summaries. This process extracts key histological classifications, grades, and receptor statuses while removing filler words.
Multi-Modal Conditioning and Architecture
The model uses a combination of global GPT summaries and local patch-level statistics, such as the probability of tumor presence and tumor-infiltrating lymphocytes (TIL). This creates a highly descriptive conditioning prompt: "high tumor; low til; [GPT summary]".
To preserve cellular detail, PathLDM utilizes a Variational Autoencoder (VAE) with a downsampling factor of $f=4$, doubling the latent resolution compared to the standard $f=8$ used in models like Stable Diffusion. For text encoding, the team employed PLIP (Pathology Language-Image Pretraining), a domain-specific encoder that significantly outperforms general-purpose CLIP in medical contexts.
Results: State-of-the-Art Performance
PathLDM was trained and evaluated on the TCGA-BRCA (The Cancer Genome Atlas Breast Invasive Carcinoma) dataset, utilizing 3.2 million patches extracted from 1,136 Whole Slide Images.
Quantitative Excellence
The model achieved a state-of-the-art Fréchet Inception Distance (FID) of 7.64. This represents a massive improvement over the closest text-conditioned competitor, which scored 30.1. Ablation studies confirmed that the combination of the $f=4$ VAE and PLIP encoding was critical to this success, achieving an SSIM of 0.961.
Visual Fidelity
Qualitative analysis shows that PathLDM generates images with high morphological accuracy, avoiding the "blue stains" and blurry artifacts common in previous models like Medfusion or Moghadam et al.
Clinical Utility
To validate the biological realism of the generated images, a ResNet-34 classifier was trained solely on synthetic data. When tested on real-world samples, it achieved an accuracy of 83.32%, indicating that PathLDM successfully captures genuine diagnostic features.
Discussion and Future Directions
PathLDM demonstrates that text is a far more expressive guiding signal than discrete labels for medical image generation. By reducing the VAE compression bottleneck and utilizing domain-specific text encoders, the model sets a new standard for fidelity in computational pathology.
Future work will focus on scaling to higher magnifications (20x and 40x) and exploring the generation of rare disease edge cases from synthetic prompts. PathLDM serves as a foundational step toward multi-modal pathology models that can simultaneously integrate genomics, text, and imaging.
Summary updated