COVID CT β€” Demographically-Conditioned SD 2.1

End-to-end fine-tuned Stable Diffusion 2.1 generator for COVID-19 chest CT slices, conditioned on demographics through the text prompt. Main generator from the paper Demographically-Conditioned Synthetic Medical Images for Bias Mitigation and Bias Detection in Disease Classifiers.

Usage

import torch
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained(
    "mahmoudibra98/covid-ct-sd21", safety_checker=None, torch_dtype=torch.float16
).to("cuda")

prompt = "50 year old FEMALE. COVID-19 findings on chest CT scan"
img = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
img.save("sample.png")

Prompt format

The model was trained on prompts of the exact form:

"{age} year old {SEX}. {clinical}"
  • age ∈ {15, 30, 50, 70, 85} β€” representative integers for the training age bins (Under 20 β†’ 15, 20-40 β†’ 30, 40-60 β†’ 50, 60-80 β†’ 70, Over 80 β†’ 85).
  • SEX ∈ {MALE, FEMALE} (uppercase, as trained).
  • clinical ∈ {"Normal chest CT scan", "COVID-19 findings on chest CT scan"}.

Example: "70 year old MALE. Normal chest CT scan". Conditioning outside these values is untested; stay within the trained vocabulary for faithful demographic control.

Intended use & limitations

Research only. Synthetic COVID-19 chest CT for classifier training/augmentation and subgroup fairness auditing. Not a medical device; not for diagnosis. Trained on public COVID CT datasets (see the code repository). Outputs are 512Γ—512 grayscale chest CT slices rendered as 3-channel images.

License

Apache-2.0.

Downloads last month
28
Safetensors
Model size
0.9B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for mahmoudibra98/covid-ct-sd21

Finetuned
(57)
this model