Diffusion-Driven Distillation and Contrastive Learning for Class-Incremental Semantic Segmentation of Laparoscopic Images
DDDC-CL addresses class-incremental semantic segmentation (CISS) for laparoscopic images with three key components:
- Unconditional DDPM — generates synthetic laparoscopic images for privacy-preserving generative replay
- Knowledge Distillation (DADA) — dense alignment distillation across intermediate layers and output logits
- Contrastive Learning — image-level contrastive loss using real vs. synthetic image pairs
- Python 3.8+
- PyTorch >= 1.12
- Additional:
tensorboardX,omegaconf,opencv-python,pandas,tqdm
Dresden Surgical Anatomy Dataset (DSAD) — 13,195 annotated laparoscopic images with 11 abdominal anatomical structures.
See run_example.sh for complete command examples. Key steps:
python main.py --data_root /path/to/Dresden --model deeplabv3_resnet101 --gpu_id 0 \
--lr 0.01 --batch_size 16 --train_epoch 50 --loss_type wce_loss \
--dataset dresden --task offline --lr_policy poly --name offline-baselinepython main.py --data_root /path/to/Dresden --model deeplabv3_resnet101 --gpu_id 0 \
--lr 0.01 --batch_size 16 --train_epoch 50 --loss_type wce_loss \
--dataset dresden --task 7-4 --overlap --lr_policy poly \
--name exp-KDDGCL-ddpm \
--use_KD_layer_weight --pseudo --pseudo_thresh 0.7 --KD_loss_type KD_loss \
--generate --contrastive_learning --ddpm_root './generated-512' \
--load_step 1 --load 'checkpoints/base_model_weight.pth'Supported tasks: 7-2, 7-2-2, 7-4.
# Edit dresden.yaml to set data_root, then:
CUDA_VISIBLE_DEVICES=0 python -m torch.distributed.launch --nproc_per_node=1 \
main-vit.py --config ./dresden.yaml --log ./logs/vit_exppython eval.py --data_root /path/to/Dresden --model deeplabv3_resnet101 --gpu_id 0 \
--dataset dresden --task 7-4 --overlap --test_only \
--ckpt 'checkpoints/your_checkpoint.pth'MIT License. See LICENSE.