Downloads · 30 days
6
16% of all-time downloads
mahmoudibra98/covid-ct-sd21
covid-ct-sd21 is a text-to-image model from mahmoudibra98. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as apache-2.0.
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 Image…
Downloads · 30 days
6
16% of all-time downloads
All-time downloads
38
Public
Parameters
866M
5.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors5.2 GB · 100%
From the Hugging Face model README
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.
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")
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.
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.
Apache-2.0.