You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

These weights were fine-tuned on CBIS-DDSM patient images without differential privacy. By requesting access you agree to use them for research only, not to attempt to identify or re-identify patients or to recover training images, not to use the model or its outputs for clinical diagnosis, and to follow the CreativeML Open RAIL++-M license and its use restrictions.

Log in or Sign Up to review the conditions and access this model content.

CC-NET: class-conditioned latent diffusion for breast-mass patches (CBIS-DDSM)

The generator from Understanding the Utility of Synthetic Images for Breast Mass Classification under Differential Privacy (MIDL 2027 submission). Code: https://github.com/hajarlachheb/mammography-diffusion-dp.

Stable Diffusion 2.1-base U-Net fine-tuned to generate 256ร—256 grayscale patches of benign or malignant breast masses. A learned class embedding replaces text conditioning as the cross-attention input.

Files

File Contents
ccnet_cbis_ddsm_epoch22_unet.pt state dict of the class-conditioned U-Net (U-Net + 2-class embedding), 687 tensors, 3,463,893,379 bytes, sha256 a255e932f3f7fff8c21e7bb16fcc5160f645343aacfcdc6fa9375b6dcaa9784a
ccnet_cbis_ddsm_epoch22_unet.json export record: epoch, loss, latent scale, base model and source-checkpoint hash

No VAE and no text encoder are included: the frozen VAE is loaded from the base model. The file holds tensors only and loads with torch.load(..., weights_only=True).

Usage

git clone https://github.com/hajarlachheb/mammography-diffusion-dp.git && cd mammography-diffusion-dp
pip install -r requirements.txt diffusers==0.30.3 transformers==4.45.2 accelerate==1.0.1
python generation/ccnet/generate_ccnet.py \
    --model_path ccnet_cbis_ddsm_epoch22_unet.pt \
    --output_dir synthetic_ccnet \
    --num_samples_per_class 1500 --num_inference_steps 50 --scheduler ddim \
    --scale_factor 0.1 --batch_size 1 --seed 42

Pass --scale_factor 0.1. Images are written to is_benign_true/ and is_benign_false/.

Training

Data 1,104 CBIS-DDSM mass patches (579 benign, 525 malignant) from 578 patients; the mammo_dp training split
Base model Manojb/stable-diffusion-2-1-base (a third-party upload of SD 2.1-base)
Settings 256ร—256, latent scale 0.1, 25 epochs, batch 4 ร— 64 gradient accumulation, learning rate 1e-4, fp16, seed 2
Selected checkpoint epoch 22, lowest mean training loss (0.1068)
Sampling in the paper 1,500 patches per class, 50 DDIM steps, seed 42

The source training checkpoint (with optimizer state) has sha256 822f9f205d99ee146bfbe7204a8449ce0f8a97a5b2f12cecc7953e3260d5d6d6; this file is its model state dict.

Intended use and limitations

  • Research only. Studying synthetic data for breast-mass classification. Not a medical device; generated images must not be used for diagnosis.
  • No privacy guarantee. The model was trained without differential privacy on patient images. In the paper's nearest-neighbour check, 5.2 % of 3,000 generated patches were closer in pixel distance to a training patch than the test-set threshold, while almost none were in DINOv3 feature space. This does not show the absence of memorisation. Do not treat the model or its outputs as anonymised data.
  • Scope. Trained on mass patches from one public dataset (digitised film mammograms). It does not generate full mammograms and may not transfer to other populations or devices.
  • Provenance. The training configuration is verified from the original log and checkpoint metadata. That this checkpoint produced the paper's 3,000-patch pool is strongly supported but not proven.

License

CreativeML Open RAIL++-M, inherited from Stable Diffusion 2.1, including its use restrictions. The CBIS-DDSM data (TCIA, CC BY 3.0) is not distributed here; cite Lee et al., Scientific Data 2017 when using derived models.

This work builds on ccnet and mammo_dp (Osuala et al.).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for QamarHajar/ccnet-cbis-ddsm

Finetuned
(15)
this model