Code Monkey home page Code Monkey logo

optml-group / unlearn-saliency Goto Github PK

View Code? Open in Web Editor NEW
76.0 0.0 9.0 8.08 MB

[ICLR24 (Spotlight)] "SalUn: Empowering Machine Unlearning via Gradient-based Weight Saliency in Both Image Classification and Generation" by Chongyu Fan*, Jiancheng Liu*, Yihua Zhang, Eric Wong, Dennis Wei, Sijia Liu

Home Page: https://www.optml-group.com/posts/salun_iclr24

License: MIT License

Python 100.00%
unlearning machine-unlearning data-removal diffusion diffusion-models forgetting generative-model data-deletion data-privacy membership-inference

unlearn-saliency's People

Contributors

a-f1 avatar ljcc0930 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unlearn-saliency's Issues

Erase nudity in Stable diffusion

Hello~

I notice that the training script for erasing nudity is not given in SD/README.md. Could you share it?

Besides, to repoduce the results for erasing nudity, I encountered some problems:

  1. generate mask for nudity involves a dataset named "data/nsfw". How to get this dataset?
  2. Saliency unlearning needs remain_dl for training. How to get the remain data for erasing nudity?

Thank you very much~๐Ÿ˜

Cannot reproduce results in your paper with provided weights

Hi, what an amazing work!
I am trying to reproduce the algorithm recently but I encounter some problems. I use the weights you provided in SD/README.md and it is a file ends with ".ckpt". I try to load it but the keys are incorrect with SDv1.4 no matter I use torch.load(ckpt) or torch.load(ckpt)['state_dict']. Then I use the convertModels.py to convert it into "xx.pt". I use extract_ema=True but it produces exactly same weights as the original SD unet. So I use extract_ema=False and it successfully produces edited weights. However, when I generate I2P images with this weights, the results is far worse than the results in your paper.
So could you help me address this issue? Thanks for your reply!

Regarding GPU Information

Hi,

I really liked your work!!!
Could you clarify the GPU requirements needed to train the models?

Thanks,
Kartik

Train Conditional DDPM on all 10 classes of CIFAR10?

Hi there,

Thank you for sharing your great work! I have a quick question regarding the training of CIFAR10 conditional diffusion. Based on the code:

parser.add_argument(
"--label_to_forget",
type=int,
default=0,
help="Class label 0-9 to forget. Only for forgetting training.",
)

and runner.train()
def train(self):
args, config = self.args, self.config
D_remain_loader, D_forget_loader = get_forget_dataset(
args, config, args.label_to_forget
)
D_remain_iter = cycle(D_remain_loader)
D_forget_iter = cycle(D_forget_loader)

for step in range(0, self.config.training.n_iters):
model.train()
x, c = next(D_remain_iter)

The label 0 is forgotten even for standard training. Consequently,

CUDA_VISIBLE_DEVICES="0,1" python train.py --config cifar10_train.yml --mode train

does not yield a complete conditional model on all 10 classes. Is my understanding correct?

If so, could the authors verify that their results of CIFAR-10 class-wise unlearning in the paper are unaffected and based on the correct implementation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.