ZhenrongShen / CellGAN

[MICCAI 2023] Official Pytorch Implementation for "CellGAN: Conditional Cervical Cell Synthesis for Augmenting Cytopathological Image Classification"
MIT License
27 stars 5 forks source link

Could I get the code for experiment in CellGAN #3

Open zhang373 opened 1 year ago

zhang373 commented 1 year ago

Thanks a lot for your research and kindness to share the GAN code. I wonder if I could get the code for experiments shown in your paper? Especially the code for proving that CellGan can better augment dataset in experiment 3.3.

zhang373 commented 1 year ago

I would be really happy if I can also get the code for other code for experiment. Again, thanks a lot for sharing the training code!

ZhenrongShen commented 12 months ago

Thanks for your interest in our work! For experiment 3.3, we trained the downstream classifiers with the combined real and synthetic data using MMClassification (https://github.com/open-mmlab/mmclassification). I would recommend that you refer to their documentation to adapt the code for the replication or your specific use case.

zhang373 commented 12 months ago

Thanks a lot for your kind reply! I will try to use the code! I have another question. Which repo does you use for LDM? Have you made any changes to the LDM code? How is category control implemented?

ZhenrongShen commented 11 months ago

The LDM official repository (https://github.com/CompVis/latent-diffusion) provides configurations for image generation using class labels. But for the sake of implementation convenience, I chose to develop my own LDM code following the tutorial at https://nn.labml.ai/diffusion/index.html. Given the constraints of GPU memory and dataset size, I made adjustments to LDM implementation by reducing the channels in both the autoencoder and the denoising U-Net. Both KL- and VQ-reg autoencoders with f=8 are trained and tested on our dataset. We found that the KL-reg autoencoder performed slightly better, and thus used it in LDM implementation. For category control, I adopted a similar approach to CellGAN, which first produces class embeddings from one-hot class labels using an MLP and then controls the denoising U-Net via cross-attention layers.