veralauee / dpatch Goto Github PK
View Code? Open in Web Editor NEWAn adversarial attack on object detectors
An adversarial attack on object detectors
Thanks for your contribution, here is my problem
My training loss do not change as I followed your doc
epoch 12[1308/5011], loss: 57.624, bbox_loss: 0.469, iou_loss: 56.200, cls_loss: 0.955 (0.05 s/batch, rest:0:03:09) image_size [416 416] epoch 12[1318/5011], loss: 57.321, bbox_loss: 0.394, iou_loss: 55.970, cls_loss: 0.957 (0.05 s/batch, rest:0:03:07) image_size [416 416] epoch 12[1328/5011], loss: 57.479, bbox_loss: 0.486, iou_loss: 56.038, cls_loss: 0.954 (0.05 s/batch, rest:0:03:07) image_size [416 416] epoch 12[1338/5011], loss: 57.593, bbox_loss: 0.430, iou_loss: 56.207, cls_loss: 0.957 (0.05 s/batch, rest:0:03:07) image_size [416 416] epoch 12[1348/5011], loss: 57.506, bbox_loss: 0.407, iou_loss: 56.136, cls_loss: 0.964 (0.05 s/batch, rest:0:03:10) image_size [416 416] epoch 12[1358/5011], loss: 57.482, bbox_loss: 0.372, iou_loss: 56.158, cls_loss: 0.952 (0.05 s/batch, rest:0:03:06) image_size [416 416] epoch 12[1368/5011], loss: 57.340, bbox_loss: 0.470, iou_loss: 55.912, cls_loss: 0.957 (0.05 s/batch, rest:0:03:05) image_size [416 416] epoch 12[1378/5011], loss: 57.373, bbox_loss: 0.427, iou_loss: 56.004, cls_loss: 0.942 (0.05 s/batch, rest:0:03:03) image_size [416 416] epoch 12[1388/5011], loss: 57.423, bbox_loss: 0.447, iou_loss: 56.018, cls_loss: 0.958 (0.05 s/batch, rest:0:03:04) image_size [416 416] epoch 12[1398/5011], loss: 57.304, bbox_loss: 0.419, iou_loss: 55.932, cls_loss: 0.953 (0.05 s/batch, rest:0:03:05)
could you give me a hand? thanks a lot
I have try to run train.py of the project, and run test.py of the project using the latest patch that saved by train.py (without using the untargetd_DPATCH which download from the url that given at the README.md file).
after 100 epoch, it got 0.7095 mAP, but after 9757 epoch, it still got 0.7040 mAP.
I just wander it there any parameters that I must modified before run train.py? I only modified max_epoch value in cfgs.exps.darknet19_exp1.py to run more epoch.
than you~
hello~ the untargetd code I don't seem to see it, or I just miss it?
When I run demo.py or train.py or test.py ,and I am getting this error:
initial model without patch
load model succ...
Traceback (most recent call last):
File "demo.py", line 65, in
bbox_pred, iou_pred, prob_pred = net(im_data, attack=args.attack)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/media/lubby/4Tdisk/DPatch/darknet.py", line 208, in forward
conv1s = self.conv1s(im_data)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/media/lubby/4Tdisk/DPatch/utils/network.py", line 35, in forward
x = self.conv(x)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/lubby/anaconda3/envs/dpatch/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDNN_STATUS_EXECUTION_FAILED
I want to know your CUDA version.
does anyone know, what is causing this?
My environment:
systerm ubuntu 18.04
gpu: NVIDIA RTX TITAN
python : 3.6.0
cuda: 9.0
cudnn:7.5.1
The paper says that for untargeted attack, target label is defined as 0,but 0 corresponds to aeroplane,is this still a targeted attack,What should I do
The same question with the first issue. Can you give some details about the training process?
thank you
The link to download the pretrained DPatch seems to be broken. Would it be possible to provide a new link, or share the file in another way?
run command :python demo.py
get the result:
train_output_dir /home/djy/Desktop/DPatch/models/training/darknet19_voc07trainval_exp3
--------------- patch saved in ----------------
trained_patch/1
Traceback (most recent call last):
File "demo.py", line 7, in
from darknet import Darknet19
File "/home/djy/Desktop/DPatch/darknet.py", line 9, in
from layers.reorg.reorg_layer import ReorgLayer
File "/home/djy/Desktop/DPatch/layers/reorg/reorg_layer.py", line 3, in
from ._ext import reorg_layer
File "/home/djy/Desktop/DPatch/layers/reorg/_ext/reorg_layer/init.py", line 3, in
from ._reorg_layer import lib as _lib, ffi as _ffi
ModuleNotFoundError: No module named 'layers.reorg._ext.reorg_layer._reorg_layer'
pytorch0.4.0 torchvision2.0.1
I have checked this code and found that the Dpatch was trained without limiting its value to the allowable range of (0,1) for image, and then filled in the mask of the image. The test result naturally looks good.
Download a trained DPATCH https://drive.google.com/open?id=1_G5xXWIJWNGuss4KZbBQ9pMvuthmL_wc
python 3.6
torch 0.4.1
cuda 9.0
How to solve it?
I followed this code but it seems like the Patch doesn't work, since the mAP are too high. Are there any tricks during training? I'd appreciate it if the author or anyone else could solve this problem.
I have checked the trained untargeted-patch that the author offerd and found that there're inf and -inf in the patch. It is weird and why does 'inf' appear in the patch? Or how does the author train this patch and get this result?
For instance, it seems like the training code doesn't apply the patch at all (train.py:97 does not specify attack
parameter to net
).
It's also not clear whether you were intending to modify the ground truth label in the dataset, since the bboxes are unmodified. (Training-wise this does not seem to matter as the ground truth is modified in imdb.py:74 anyway.)
For context, I'm trying to reproduce the results in your paper with the default configurations in this repo (after fixing the train.py
bug), but currently the fitted patch does not affect mAP very much -- similar mAP as compared to running test.py
without applying any patch -- even after ~500k iterations and using a much larger patch (120x120) than the paper (20x20 to 80x80). The provided untargetd_DPATCH.npy
has significantly lower mAP, but contains inf
and -inf
values -- it's unclear how those values surfaced given that the gradients for the patch seem generally pretty small.
So I'm guessing my training setup went wrong somehow. Any pointers for setting up the repo for training a patch would be greatly appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.