arXiv:2610.12147cs.CVOct 2026

Manuscript Offprint

arXiv:2610.12147

Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification

Inês Cruchinho Garcia, Mariana Mourão, Francisco Maria Calisto, Carlos Santiago, Jacinto Nascimento

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Inês Cruchinho Garcia, Mariana Mourão, Francisco Maria Calisto, Carlos Santiago, and Jacinto Nascimento

Institute for Systems and Robotics, Instituto Superior Técnico, Lisbon, Portugal

ines.cruchinho.garcia@tecnico.ulisboa.pt

Abstract. False negatives remain a critical limitation of computer-aided diagnosis (CAD) systems for breast cancer screening due to delayed detection and treatment. To address this issue, we propose a counterfactual data augmentation strategy that generates healthy mammograms by "erasing" lesions from anomalous images, thereby enriching the training distribution. We train a Denoising Diffusion Probabilistic Model on BI-RADS 1 (healthy) mammograms and use a RePaint-based sampling strategy to inpaint realistic normal tissue within annotated lesion bounding boxes. The resulting healthy counterfactuals replace annotated lesion regions with realistic healthy tissue while preserving patient-specific anatomical structure, as supported by similarity metrics between real and generated images. Image realism was further assessed by radiologists and found to be consistent with the original dataset quality. We evaluate counterfactual augmentation across four representative classifier architectures: a convolutional neural network (ConvNeXt), a vision transformer (ViT), a vision-language model pre-trained on mammogram-report pairs (Mammo-CLIP) and a multi-scale attention-based multiple-instance learning framework (FPN-MIL). Experiments conducted on the VinDr-Mammo dataset show improvements in sensitivity across all architectures, particularly at 80% fixed specificity, contributing towards more reliable CAD systems for breast cancer. Code is available at: https://github.com/ines03garcia/diffusion-based-counterfactual-generation.

Keywords: Counterfactual Generation · Diffusion Models · Inpainting · Data Augmentation · Mammography

1 Introduction

False negatives in breast cancer detection systems are associated with delayed diagnosis and worse patient outcomes. Although mammography remains the primary modality for early breast cancer screening, its sensitivity is affected by multiple factors, including inter-patient anatomical variability [1]. Beyond missed detections, an additional concern in computer-aided diagnosis (CAD) is whether predictions are driven by clinically meaningful evidence. Deep learning models may achieve strong aggregate performance while relying on spurious correlations rather than lesion-specific cues [13]. Such effects have been observed

I. Garcia et al.

in breast imaging settings [24]. For clinical deployment, CAD systems must not only improve sensitivity but also ensure that predictions are based on regions of interest (ROI) [22].

Counterfactuals represent 'what-if' scenarios, such as: how would this patient's mammogram look if there were no findings? Diffusion models have emerged as a leading approach for high-fidelity image generation [2]. Building on the Denoising Diffusion Probabilistic Model (DDPM) framework, these methods iteratively learn to reverse a gradual noise corruption process, enabling the sampling of images from random Gaussian noise. Commonly used to synthesize medical images [27], including X-rays [25] and breast MRIs [11], diffusion models have been recently explored for mammogram generation [18]. Focusing on counterfactuals, their applications include data augmentation [8], explainability [6] and classifier performance enhancement [4], but a critical challenge remains the unintended modification of unrelated morphology [16]. To address this, our approach restricts modifications to previously annotated lesion regions by employing masked diffusion inpainting. The inpainted area is iteratively conditioned on the surrounding tissue, ensuring anatomical coherence while preventing unintended modifications outside the annotated bounding box. Rather than generating lesions, an approach hindered by data scarcity, high anomaly variability, and complex distributional patterns [26], we generate healthy counterfactuals, i.e., anatomically plausible normal counterparts of originally abnormal images. Although healthy counterfactuals have previously been explored in mammography [21], their use as a data augmentation strategy remains largely underexplored. By incorporating these counterfactuals into the training set of four diverse classifier architectures, we aim to enhance the robustness of CAD systems for breast cancer detection. Specifically, we select architectures with distinct inductive biases: a convolutional neural network (ConvNeXt) [14], a transformer-based vision model (ViT) [3], a mammography-specific image encoder (Mammo-CLIP) [7] and a multiple-instance learning classifier (FPN-MIL) [17].

Comparative evaluation on the VinDr-Mammo dataset against standard augmentation baselines demonstrates consistent sensitivity gains, particularly at a clinically relevant operating point of 80% specificity, supporting healthy counterfactual augmentation as a strategy for reducing missed detections in mammography classification.

References (27)