Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runing Error #2

Open
hustweiwan opened this issue Sep 20, 2023 · 1 comment
Open

Runing Error #2

hustweiwan opened this issue Sep 20, 2023 · 1 comment

Comments

@hustweiwan
Copy link

Hello, author. When I ran "python poison_model.py," I encountered the following error. Later, I tried running the code without data conversion (lines 105-106) and commenting out lines 74-77, and the code ran successfully. However, the final task accuracy is only around 50%, and the backdoor accuracy is also only about 70%. I need your assistance.
image
1O(S5WYOC4@AT2Y7I4(XX

@lvpeizhuo
Copy link
Owner

We generate the backdoored model with good performance on the main task and the backdoor task by training with more epochs (not only 100 epochs). We will train the backdoored model by 1000 epochs, and save a checkpoint by 100 epochs. Then we continue to inject t the backdoor based on the previous saved checkpoint. Specifically, in each 100 epochs, we need to adjust the value of poison_rate. And the value is 0.01(0-100 epoch), 0.01(100-200 epoch), 0.001(200-1000 epoch). Thus, you can obtain a backdoored model with an ASR above 90% and an accuracy of 88%. You can also try other values of poison_rate and learning rate to obtain better performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants