OPTML-Group / UnlearnCanvas

UnlearnCanvas: A Stylized Image Dataaset to Benchmark Machine Unlearning for Diffusion Models by Yihua Zhang, Chongyu Fan, Yimeng Zhang, Yuguang Yao, Jinghan Jia, Jiancheng Liu, Gaoyuan Zhang, Gaowen Liu, Ramana Kompella, Xiaoming Liu, Sijia Liu
https://unlearn-canvas.netlify.app
40 stars 1 forks source link

Unlearning algorithm check #3

Closed YuyangXueEd closed 1 month ago

YuyangXueEd commented 2 months ago

Hello, thank you for the great repository.

I am going through the code and start from mu_saliency_unlearn_salun, and I found that in generate_mask.py file, from line 56:

forget_batch = {
                    "edited": images,
                    "edit": {"c_crossattn": prompts}
                }

null_batch = {
                    "edited": images,
                    "edit": {"c_crossattn": prompts}
                }

and I double check the original repo of Salun, in line 44, it was:

forget_batch = {"jpg": images.permute(0, 2, 3, 1), "txt": prompts}

null_batch = {"jpg": images.permute(0, 2, 3, 1), "txt": null_prompts}

I wonder if there is any misunderstanding here.

Looking forward to your reply. Thank you very much.

Best

NormalUhr commented 2 months ago

Hi, thanks for your interest in our work! The difference is made in order to cutomize the code/model used from SalUn to the one in this repo, which was inherited from the InstructPix2Pix. They are just different names and should function similarly.

NormalUhr commented 2 months ago

Actually, if you go through other unlearning methods included in this work, similar modifications can be found as well, just in order to make it possible to load the DM checkpoint fine-tuned on our dataset correctly.