WindVChen / DiffAttack

An unrestricted attack based on diffusion models that can achieve both good transferability and imperceptibility.
Apache License 2.0
115 stars 9 forks source link

[question] replace inception with resnet18 #13

Closed jS5t3r closed 7 months ago

jS5t3r commented 7 months ago

Can I just replace the inception with a pre-trained resnet18?

Would it run on the demo data seamlessly?

WindVChen commented 7 months ago

Hi @jS5t3r ,

Yes, you can seamlessly replace the Inception model with a pre-trained ResNet18. An easier way to achieve this is by adding your desired model to the model_selection function and the models_transfer_name list. Simply expand the script in other_attacks.py as follows:

def model_selection(name):
    ...
    elif name == "resnet_18":
        model = models.resnet18(pretrained=True)
    ...

def model_transfer(...):
    ...
        models_transfer_name = ["resnet_18", ...]
    ...
jS5t3r commented 7 months ago

Thanks for the fast response :)