GithubHelp home page GithubHelp logo

thuyimingli / backdoorbox Goto Github PK

View Code? Open in Web Editor NEW
404.0 8.0 65.0 508 KB

The open-sourced Python toolbox for backdoor attacks and defenses.

License: GNU General Public License v2.0

Python 99.11% Jupyter Notebook 0.89%
backdoor-attacks backdoor-learning trustworthy-ai trustworthy-machine-learning backdoor-defenses

backdoorbox's People

Contributors

20000yshust avatar b34c0n5 avatar chengxiao-luo avatar cyndixxxxx avatar doris1007 avatar guanhaogan avatar hxzhong1997 avatar kuofenggao avatar landandland avatar persistz avatar snyk-bot avatar songsci1024 avatar spicy1007 avatar thuyimingli avatar uooga avatar yamengxi 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  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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backdoorbox's Issues

对输出结果的疑问

你好,后门攻击的输出结果的含义有点不明白,输出如何查看攻击成功率呀
ZWROFIV {EJ91P$C{YDAC S

Bug in example.py

Traceback (most recent call last):
File "/home/objdet/Desktop/backdoor/BackdoorBox/example.py", line 66, in
badnets = core.BadNets(
TypeError: init() got an unexpected keyword argument 'poisoned_transform_index'

When I ran the code example.py, the above error was thrown out. And I have checked the code in core/attacks/BadNets, it does not have the argument poisoned_transform_index in function init().

Could you fix the bug?

Thanks.

毒化数据的保存格式与位置

你好,在BackdoorBox-main/BackdoorBox-main/tests/test_BadNets.py中,毒化数据是如何保存的呢?因为在SCALE-UP-main/SCALE-UP-main/test_BadNets.py文件中保存的毒化样本似乎有着格式问题。

Bug in WaNET attack

Hi, this is some amazing work and is really helpful for people just starting out. I think I might have found a bug and wanted to let you know.

In attacks -> WaNET.py -> add_trigger(self, img, noise=False)

  • If there is noise, the grid is calculated as: grid = self.grid + ins / self.h
  • However, in the next line grid is recalculated as: grid = torch.clamp(self.grid + ins / self.h, -1, 1)

Im also attaching an image

Screenshot 2024-02-24 150651

Emprical study on effect of `poisoned transform train index` ?

Hi big brother, I'm a graduate student from sjtu doing research on backdoor learning, thank you for the project it is of great help to my study. I've experimented with different timing of injecting backdoor trigger in torchvision transforms previously, and I'm curious that do you have empirical results on the effect of injecting backdoor triggers at different stage of image augmentation?

Thank you very much for your time.

Cannot reproduce Sleeper-agent

The script "test_SleeperAgent.py" with cifar10 dataset achieves only 9.99% ASR after poisoning:

Epoch 100[2023-06-01_00:45:58] train_acc: 99.80, test_acc: 93.11, source_asr: 8.60, full_asr: 9.99

Bug in attacks base.py

当我想使用多 GPU 时,我将 scheduler 做了如下改动:'CUDA_VISIBLE_DEVICES': '0, 1', 'GPU_num': 2,然后出现了如下错误:

Traceback (most recent call last):
  File "example.py", line 146, in <module>
    badnets.train(schedule)
  File "/BackdoorBox-main/core/attacks/base.py", line 167, in train
    self.model = self.model.to(device)
UnboundLocalError: local variable 'device' referenced before assignment

我认为这个错误出现在使用多个 GPU 时,没有将 device 指定为 GPU,导致程序后续在移动数据到指定设备上时,发现之前并没有指定 device。
我的解决方案是添加指定 device 的一行代码,截图如下:
1692158471099

我不知道这样的解决方案是否是最佳的。我期待你们修复这个 bug 🥂

ModuleNotFoundError: No module named 'curves'

image

运行tests的一些example时,在core/models的resnet_curve.py中会报出如上错误。但IDE并没有警告或者报错,只有当运行时才会出现。 请问是否有人遇到该问题?谢谢。

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.