← Latest papers
💻 computer science

CompDiff enables fair and zero shot medical image generation across demographic intersections through compositional diffusion

The paper introduces CompDiff, a compositional diffusion model that encodes age, sex, and race separately to achieve fair, zero-shot medical image generation across unseen demographic intersections, outperforming existing methods in fidelity, anatomical realism, and downstream clinical utility.

Original authors: Mahmoud K. Ibrahim, Bart Elen, Chang Sun, Ahmad Jiblawi, Mohammed M. Saleh, Maryam Ibrahim, Gökhan Ertaylan, Michel Dumontier

Published 2026-11-13
📖 5 min read🧠 Deep dive

Original authors: Mahmoud K. Ibrahim, Bart Elen, Chang Sun, Ahmad Jiblawi, Mohammed M. Saleh, Maryam Ibrahim, Gökhan Ertaylan, Michel Dumontier

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). ✨ This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Medical imaging has long relied on artificial intelligence to help doctors spot diseases in X-rays and eye scans. These computer systems learn by studying thousands of real patient images, but they often struggle when the data they are fed is unbalanced. If a system sees mostly images of young white men, it may become very good at diagnosing them but fail when looking at older Asian women. This happens because the rare combinations of age, sex, and race simply do not appear often enough in the training data for the computer to learn what they look like. When these systems are used to generate new, synthetic images to fill those gaps, they often fail to create realistic pictures of the very groups that need them most. The result is a cycle where the computer reinforces its own blind spots, potentially making medical care less fair for underserved populations.

To address this, researchers at Maastricht University and other institutions developed a new method called CompDiff. Instead of treating a patient's demographic background as a single, messy block of text, this system breaks it down into separate, manageable parts. It learns the visual patterns of age, sex, and race independently, much like a musician learning to play individual notes before combining them into a chord. By keeping these elements distinct, the computer can mix and match them to create images of demographic groups it has never seen before. For example, if the system has learned what an elderly person looks like, what a woman looks like, and what an Asian person looks like, it can compose a realistic image of an elderly Asian woman, even if no such image existed in its original training set.

The team tested this approach on two types of medical scans: chest X-rays and images of the inside of the eye. They compared their new system against existing methods that try to fix data imbalances by simply weighting the training data differently or by mixing all demographic information into a single text prompt. The results showed that the new method produced images that were significantly more realistic and faithful to the requested medical conditions. When the researchers asked radiologists to judge the images without knowing which computer made them, the doctors consistently rated the new system's images as the most realistic and the most accurate to the clinical descriptions. The system was able to generate high-quality images for sixteen different demographic combinations that were completely absent from the training data, a feat the other methods could not match.

Beyond just creating pretty pictures, the study examined whether these synthetic images could actually help train better medical AI. When the researchers used the new system's images to teach a computer how to diagnose chest diseases, the resulting AI performed better than those trained with images from the older methods. This improvement was especially noticeable for the groups that were previously the hardest to diagnose, suggesting that the synthetic data helped the computer learn a more complete picture of human health. The new method also proved useful for auditing, or checking, how well medical AI works on rare groups. By generating large numbers of synthetic images for these rare intersections, the researchers could test the AI's performance with much greater precision than was possible using the tiny number of real images available.

The study also looked closely at how the system was built to ensure it was not just guessing. They found that separating the demographic information into its own dedicated pathway was crucial. If they tried to mix the age, sex, and race data back into the main text prompt, the quality of the images dropped, and the system lost its ability to control specific traits. They also discovered that the system needed to be explicitly taught to recognize the age, sex, and race of the images it created during the training process. Without this extra layer of supervision, the computer would generate images that looked good but did not match the intended demographic description.

While the results are promising, the researchers are careful to note that these synthetic images are tools for learning and testing, not replacements for real patient data. The system works by learning from the patterns in existing datasets, which include social and administrative labels for race rather than biological truths. This means the images reflect the associations found in the data, which can be influenced by factors like where the photos were taken or how diseases are treated in different communities. The researchers emphasize that their work is a step toward making medical AI more inclusive, but it does not solve the deeper issues of data scarcity or bias on its own.

Ultimately, this work demonstrates that by changing how a computer understands the building blocks of a person's identity, we can generate medical images that are fairer and more useful. The ability to compose realistic images of underrepresented groups opens the door to training better diagnostic tools and testing them more rigorously. It suggests that the future of medical AI may depend not just on having more data, but on having smarter ways to combine the data we already have.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →