Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification

summary

Video file (mp4)

The gist

The gist The proposed method generates healthy counterfactuals by training a Denoising Diffusion Probabilistic Model exclusively on healthy mammograms and using RePaint-based inpainting within

In short

The method generates realistic, healthy versions of mammograms by training a Diffusion Model only on healthy images and using RePaint to fill in areas where lesions were annotated. This technique enriches the training data, leading to improved sensitivity in breast cancer detection models across various architectures, especially at an 80% specificity threshold.

Key concepts

Denoising Diffusion Probabilistic Model (DDPM)
A type of generative AI trained to learn how to reverse noise. In this study, it was specifically trained only on healthy mammograms. This allows the model to accurately represent the distribution and anatomy of normal breast tissue, which is crucial for creating realistic healthy replacements.
RePaint-based Sampling Strategy
This is a technique used for inpainting images. It takes an image with a masked area (the lesion) and uses the learned diffusion process to generate new content specifically within that masked region. It ensures the generated tissue looks realistic while respecting the surrounding, unmasked patient anatomy.
Counterfactual Augmentation
A data augmentation strategy where new, modified data points are created to improve model performance. Here, it means creating 'counterfactual' images—healthy versions of images with lesions—to teach the classifier what healthy tissue looks like without needing real healthy examples.
Sensitivity at 80% Specificity
Sensitivity measures how well a system correctly identifies positive cases (cancer). This metric shows that using the generated healthy counterfactuals consistently improved the model's ability to detect cancer, particularly when the system was set to only flag results with an 80% certainty.

Terminology used across episodes

This episode discusses

The paper

Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification · Read on arXiv

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

Institute for Systems and Robotics, Instituto Superior Técnico

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.

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: Today's paper: "Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification".

Jane: The gist The proposed method generates healthy counterfactuals by training a Denoising Diffusion Probabilistic Model exclusively on healthy mammograms and using RePaint-based inpainting within annotated lesion regions,

Tom: First, who's behind it and why it matters.

Title and authors: Tom: So we're talking about this paper today, "Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification." It sounds pretty technical, but basically they are trying to fix a big problem in breast cancer screening.

Jane: Exactly. The main issue is that false negatives are still a major limitation in computer-aided diagnosis systems because they can cause delays in detection and treatment.

Tom: Right, so what's the core idea behind this paper? It proposes a strategy to enrich the training data by generating healthy mammograms from anomalous ones by "erasing" the lesions.

Lu: The method involves training a Denoising Diffusion Probabilistic Model exclusively on BI-RADS one which are healthy mammograms, to learn how normal breast tissue looks <ref:2610.12147#pg1,a Denoising Diffusion Probabilistic Model>.

Meng: And then they use something called RePaint-based sampling to inpaint that realistic normal tissue back into the areas marked as lesions using bounding boxes.

Tom: So if I'm getting a scan with a lesion, this system creates a healthy version of that exact same patient's scan, keeping all the other patient anatomy intact.

Jane: That’s right, it’s about creating what-if scenarios for the AI to learn from. They are essentially generating counterfactual data augmentation.

Lu: The paper mentions they train a Denoising Diffusion Probabilistic Model with a U-Net backbone to model the distribution of healthy mammograms, following the standard diffusion framework where Gaussian noise is progressively added according to a predefined variance schedule, defining a forward noising process.

Tom: And then the network is trained to predict that injected noise at each timestep by minimizing a mean squared error objective. That’s how it learns what healthy tissue actually looks like on the image page.

Jane: Then they use RePaint to generate these healthy counterfactuals via mask-guided inpainting of lesion regions, using binary masks derived from bounding box annotations, which is described on Page three <ref:2610.12147#pg3,healthy counterfactuals via mask-guided inpainting of lesion regions, using binary masks>.

Meng: The goal there is to replace the annotated lesion regions with realistic healthy tissue while preserving the patient-specific anatomical structure, as supported by similarity metrics between real and generated images.

Title and authors: Tom: They tested this approach by incorporating these generated counterfactuals into the training set for classification, which means they're feeding the AI more examples of what healthy tissue looks like.

Jane: This whole strategy is designed to improve classifier performance by balancing the data distribution, especially when dealing with imbalanced samples.

Lu: They also used a specific data set called VinDr-Mammo, which has five thousand full-field digital mammography exams with four standard views, and they normalized the images using contrast limited adaptive histogram equalization across all mammograms.

Meng: And for training the DDPM on healthy images, they used an NVIDIA A100 GPU with eighty gigabytes of memory and an AdamW optimizer over one thousand diffusion timesteps.

Tom: So how do we know this actually works better than just using the original data set? What are these improvements they suggest?

Jane: They focused on counterfactual augmentation across four different classifiers: a convolutional neural network, a vision transformer, a mammography-specific image encoder, and an FPN-MIL framework.

Lu: They fine-tuned these models using binary cross-entropy loss and cosine annealing, making sure to use positive class weighting to handle the imbalance between healthy and anomalous samples.

Meng: For each annotated image they had one healthy counterfactual generated for it, which added one thousand four hundred negative samples to the training set.

Tom: The evaluation looked at realism using distributional metrics like the Fréchet Inception Distance and two variants of the Fréchet Radiomic Distance.

Jane: Those metrics showed low values, suggesting that the edits remain very close to the distribution of real healthy mammograms when you look at them through those measurements.

Lu: Expert reader studies also looked at seventy healthy counterfactual mammograms against thirty real ones, and they found the generated images were consistent with real healthy mammograms.

Meng: In terms of performance, Recall at eighty percent specificity improved consistently across all four models, with the largest recall gains observed for ConvNeXt and FPN-MIL.

Title and authors: Tom: That’s significant because it means this augmentation consistently improved sensitivity, especially at that clinically relevant operating point of eighty percent specificity.

Jane: It does introduce a slight reduction in specificity for some models, which is something we have to keep an eye on when we deploy these systems.

Lu: The conclusion is that they propose healthy counterfactual generation as a strategy for data augmentation because it produces realistic patient-specific lesion-free mammograms that consistently improve sensitivity across models with different inductive biases.

Meng: Essentially, they generate lesion-free counterfactuals by training a DDPM exclusively on healthy mammograms and applying RePaint-based inpainting within annotated lesion regions while preserving the surrounding patient-specific anatomy.

Tom: It’s a solid approach for creating data augmentation that actually adds value to the screening process. So what's the final word?

Jane: The results show these generated images are consistent with real healthy mammograms through distributional metrics and expert reader assessments.

Lu: When used for data augmentation, they consistently improved sensitivity, particularly at a clinically relevant operating point of eighty percent specificity, across diverse classification architectures.

Meng: The improvements in F1-score, balanced accuracy and ROC-AUC were more modest for some models, while specificity slightly decreased for some models.

Tom: So to wrap up the discussion on "Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification," this paper offers a way to produce realistic patient-specific lesion-free mammograms.

Jane: It achieves this by training a DDPM exclusively on healthy mammograms and applying RePaint-based inpainting within annotated lesion regions while preserving the surrounding patient-specific anatomy.

Lu: These findings suggest that creating data augmentation by synthesizing healthy counterparts can be highly effective for improving AI performance in medical imaging tasks like this.

Meng: It’s a method to generate data that is realistic enough to actually help the classification system perform better in a way that matters clinically.

Tom: We've seen how this works and what the numbers show regarding sensitivity gains at eighty percent specificity. That should give us a good idea of what this means for future work in medical AI.

The paper's summary: Tom: So, to recap this paper, they’re using diffusion to create healthy versions of mammograms from those with lesions by inpainting them back in.

Jane: Right, so instead of just training an AI on bad scans, they're making synthetic data that looks exactly like healthy tissue for the AI to learn from.

Tom: Exactly. They trained their diffusion model only on BI-RADS one images—the really healthy ones—so it learns what normal breast tissue is supposed to look like.

Jane: And then they use this RePaint thing, which is a kind of inpainting technique, to fill in the lesion spots with that learned healthy texture while keeping everything else on the patient's scan exactly as it was.

Tom: It’s about creating these patient-specific counterfactual images—images that are identical to a real patient but without any cancer visible.

Jane: The whole point is data augmentation, but specifically for improving breast cancer screening models by giving them more examples of what a normal breast looks like when a lesion is present.

Tom: They tested this augmentation across four different types of classifiers, so they’re checking if it works the same way whether you’re using a standard convolutional network or something more complex like a vision transformer.

Jane: And the results showed that this technique consistently boosted sensitivity across all those different AI architectures, especially when you were at eighty percent specificity.

Tom: That's the big win for me. It means we can potentially make existing screening tools catch more of those early cancers without necessarily making them more prone to false alarms.

Jane: It’s a really practical application of generative models in medicine, turning theoretical concepts into something that actually helps doctors and patients when they’re trying to screen for disease.

Tom: But there are caveats, right? The paper points out that while the realism looks good using metrics like Fréchet Inception Distance, the actual performance gains across other metrics like F1-score were a bit more modest for some models.

Jane: True. So it’s not just that the pictures look real; we have to watch how this affects other aspects of accuracy, like precision or overall balance in the training set.

Tom: Exactly. It shows that while generating these perfect healthy counterparts is a solid data strategy, we still need to carefully evaluate how much performance actually shifts across all possible metrics.

Jane: So it's not a magic fix for every single metric, but it definitely provides a consistent lift in sensitivity under those specific operating conditions where we care most about catching true cases.

Tom: It’s a powerful tool for augmenting rare or critical data scenarios in medical imaging, and I think seeing this kind of controlled augmentation is really important before we start pushing these things into clinical settings.

Jane: It sets a clear path for how we can use generative models to build more robust and reliable AI systems for diagnosis.

Tom: Now, if you’re interested in how other large language models are handling image classification, we’ve got a paper on multimodal LLMs coming up next.

The paper's improvements: Tom: So, we've covered how they create those healthy counterfactual images using diffusion and inpainting to augment their training data for mammography classification.

Jane: Right, but what are the actual suggested improvements they’re making to the overall system? What’s the bigger picture here?

Tom: The main improvement is that this method consistently boosts sensitivity across different AI models, especially when you hit that eight-zero percent specificity mark.

Jane: So it means we get better at catching true cases without necessarily hurting our ability to avoid false alarms in those critical screening zones.

Tom: That's the practical implication—we can improve recall reliably under a specific clinical constraint, which is exactly what radiologists need.

Jane: It’s about making the AI more reliable when it matters most for patient care, and that's a huge step forward in how we trust these tools.

Tom: But they also noted some trade-offs; for certain metrics like F1-score, the performance gains weren't as big as we hoped across all four classifier types.

Jane: That’s fair. They showed that while sensitivity goes up, other accuracy measures can see a little dip for some of those different AI structures they tested.

Tom: Exactly. It shows that data augmentation isn't always a simple win across the board; you gotta check all the performance numbers carefully to see where it actually helps the most.

Jane: So we’re not just looking for one big number to go up; we have to look at the whole picture of accuracy, including those lower score changes for some models.

Tom: The authors suggest that this approach is a really solid strategy because it produces images that look realistic—checked by things like Fréchet Inception Distance—so we’re not just training on random noise.

Jane: And the expert reader studies backs that up, showing the generated images are actually consistent with what real healthy mammograms look like to an experienced doctor.

Tom: That consistency is key; it proves that this isn't just some synthetic noise, it’s mimicking real anatomy in a way that matters for human interpretation.

Jane: It moves the goal from just "making data" to "making trustworthy, realistic data" for medical AI training, which is a significant step in how we build these systems.

Tom: It confirms that generative models can be used to create patient-specific scenarios that genuinely help the AI learn better patterns for detection.

Jane: So it’s about using diffusion and inpainting not just as a trick, but as a structured way to enhance the training set for high-stakes medical classification tasks.

Tom: And looking ahead, they haven't really talked about what comes next yet, but this success opens the door for more complex synthetic data generation in other imaging domains.

Jane: It definitely sets a precedent for how we approach creating realistic data when the underlying distribution is complex and hard to capture fully with real-world scans.

Tom: We've seen how this specific application works and where it lands on sensitivity gains, which should give us a good idea of what this means for future work in medical AI.

Jane: It’s a lot of careful work showing that when you use generative methods smartly, you can build more robust and clinically relevant detection systems.

Conclusion: Tom: So we're wrapping up this look at "Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification."

Jane: It sounds like a really solid piece of work for data augmentation in medical AI, to summarize the main idea.

Tom: Exactly. They show you how training a diffusion model only on healthy mammograms and then using RePaint inpainting helps you create realistic, lesion-free images that improve sensitivity in classifiers.

Jane: It’s a practical way to tackle data imbalance without needing thousands of perfectly labeled cancer cases right away.

Tom: Right, the implication is that we can get more reliable screening tools faster by synthetically enriching the training set with anatomically plausible examples.

Jane: I think it makes a real difference for how we train these models in high-stakes environments like healthcare, where every false negative has serious consequences.

Tom: And they did show that across different AI architectures, this technique consistently improved sensitivity at that eight-zero percent specificity point we talked about earlier.

Jane: It’s good to see a method that works well regardless of whether you're using a convolutional network or a vision transformer for the final prediction.

Tom: But remember what they flagged: the improvements in other metrics like F1-score were more modest for some models, so we need to be careful about expecting massive gains everywhere.

Jane: Yeah, it’s not a magic fix for every single accuracy number; you still have to balance the trade-offs between sensitivity and specificity.

Tom: So, "Healthy Counterfactual Generation via Diffusion Inpainting for Mammography Classification" offers a clear strategy for creating realistic patient-specific lesion-free mammograms.

Jane: It’s a good example of how generative AI can be used to create data that is actually helpful for improving the performance of other detection systems.

Tom: We've seen how this works and what the numbers show regarding sensitivity gains at eighty percent specificity, which should give us a good idea of what this means for future work in medical AI.

Jane: It’s a step toward building more robust and clinically relevant screening tools that are better equipped to handle real-world data variations.

Lu: From a generative perspective, I see this as really interesting because it proves that diffusion models can be conditioned so precisely on anatomical constraints that they produce highly plausible outputs for medical tasks.

Meng: As an engineer, I’m focused on the training stability; having the model learn only from clean data first is smart, even if the inpainting part adds complexity later.

Lalam: Lalam thinks this kind of realistic data synthesis could really help build a more empathetic and accurate cultural understanding of health screening across different populations.

Tom: Alright, that’s our wrap-up on this one. We've seen how this specific method helps boost sensitivity by generating healthy counterparts for mammography classification using diffusion inpainting.

Jane: It’s a promising technique for augmenting medical datasets with data that looks exactly like real patient anatomy when the disease is absent.

Tom: Thanks for tuning in to our paper review today, and we’ll be back next time to talk about those multimodal large language models as image classifiers.

More episodes

← Home