zhangsn-19 / PAN

Code and data for PAN and PAN-phys.
Apache License 2.0
10 stars 0 forks source link

是否可以提供一些更详细的说明文档?Can you provide some more detailed explanatory documents? #1

Open Shinya754 opened 9 months ago

Shinya754 commented 9 months ago

首先感谢你们的工作,我对于你们提出的DPA网络很感兴趣,想用它来评估对抗攻击的自然度。但是看起来你们仓库中的代码只提供的对于DPA网络的训练、验证和测试?我想知道应该如何使用DPA网络评估我某张图像的自然度呢? 顺便问一下model.py中VisualSimilarityModel(nn.Module)类的forward方法的返回值return classified, cam, sim_score分别代表什么意思?

https://github.com/zhangsn-19/PAN/blob/0bb115a076c1abede65ef1a3767e41742ca698ae/src/model.py#L99C42-L99C42

First of all, thank you for your work. I am very interested in the DPA network you proposed and would like to use it to evaluate the naturalness of adversarial attacks. But it seems that the code in your repository only provides training, validation, and testing for the DPA network? I want to know how to use the DPA network to evaluate the naturalness of my image?

By the way, may I ask the return value of the forward method of the VisualSimilarityModel(nn.Module) class in model.py, which isreturn classified, cam, sim_score. What do they represent respectively?

zhangsn-19 commented 9 months ago

Thank you for giving this feedback! We appreciate your time and kindly suggestions. To get the naturalness of an image, you can simply load the image you need and feed it into DPA (execute an inference process). The output of our DPA is a score that represents naturalness. However, note that our DPA is trained on autonomous driving dataset, so it might not generalize to other scenarios.

Shinya754 commented 9 months ago

@zhangsn-19 Okay, I tried to check the code you haven't written many annotations on. My current understanding of these codes is as follows: class VisualSimilarityModel in model.py is the definition of the DPA model, and classified in the return value of its forward function is the rating given by DPA for the naturalness of this image? cam represents Grad Cam, and sim_score is the softmax of DPA's output rating?

If that's right, according to your statement, when detecting the naturalness of other images that do not belong to the dataset, I only need to pass in the image x and not give the gaze_scoredistribution, and then check the classified and sim_score in the return value, right?

I know my question may be a bit verbose, I just want to confirm.