UTSJiyaoLi / Adversarial-Image-Captioning-Attack

4 stars 0 forks source link

Missing files #1

Closed TheLiao233 closed 1 month ago

TheLiao233 commented 1 month ago

Hello, I would like to ask how should I get the attens_10samples.json file of pick_atten.pyand the attens_100samples_255.json of perturb_att.py. If you can, Could you please provide the BEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar and WORDMAP_coco_5_cap_per_img_5_min_word_freq.json of get_att.py Sincerely hope for your reply, thank you!

UTSJiyaoLi commented 1 month ago

The files attens_10_samples.json and attens_100samples_255.json can be generated from get_att.py. The exact file names depend on the settings you configure in the get_att.py.

To help you run the code, I have also uploaded some sample attens_... .json files. Additionally, I have updated the README.md to include a link for downloading the model file BEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar.

The WORDMAP_coco_5_cap_per_img_5_min_word_freq.json file has also been uploaded for your convenience.

You can use the following steps to generate or use these files:

  1. Configure and run the get_att.py script based on your desired settings.
  2. Refer to the uploaded .json files for sample attention results.
  3. Download the pre-trained model from the link provided in README.md.

Please ensure that you have the following dependencies set up before running the codes:

TheLiao233 commented 1 month ago

The files attens_10_samples.json and attens_100samples_255.json can be generated from get_att.py. The exact file names depend on the settings you configure in the get_att.py.

To help you run the code, I have also uploaded some sample attens_... .json files. Additionally, I have updated the README.md to include a link for downloading the model file BEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar.

The WORDMAP_coco_5_cap_per_img_5_min_word_freq.json file has also been uploaded for your convenience.

You can use the following steps to generate or use these files:

1. Configure and run the `get_att.py` script based on your desired settings.

2. Refer to the uploaded `.json` files for sample attention results.

3. Download the pre-trained model from the link provided in `README.md`.

Please ensure that you have the following dependencies set up before running the codes:

* `BEST_checkpoint_coco_5_cap_per_img_5_min_word_freq.pth.tar` (pre-trained model)

* `WORDMAP_coco_5_cap_per_img_5_min_word_freq.json` (word map file)

Thank you very much for your timely reply. There are still some problems:

1.Does each samples.json used in the code differ only in num_input, and what are the implications of using different files? The flicker8k dataset is used by default in get_att.py and the generated file has 384 in its name, but several other json files don't have enough information in their names to make it impossible to determine how to generate with the appropriate parameters. In particular, whether files with 255 in their names need to adjust the code of get_att.py

Specific documents are as follows:

2.After I generated the above files myself, the running result of attack_blip_test.pyis as follows. The loss and generated text are basically unchanged, is there any problem?

图片

UTSJiyaoLi commented 1 month ago

The BLIP model takes an input image size of 384 384, and SAT takes 255 255. Check the parameters you used for attacking BLIP, such as pixels.