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

Image-scaling Attack: How to save output image? #9

Closed
michaelTJC96 opened this issue Jul 18, 2021 · 1 comment
Closed

Image-scaling Attack: How to save output image? #9

michaelTJC96 opened this issue Jul 18, 2021 · 1 comment

Comments

@michaelTJC96
Copy link

I was thinking of saving the output image from the attack by using the function found in your code: “save_jpeg_image”. However, I do not understand the format of parameters to be used in the function. For instance, what is the format for “out_img”? And what does the “quality” parameter means?

image

Is the following example correct when I am using it in the tutorial code?

image

Also, I would like to enquire on whether how do you measure the effectiveness of the image-scaling attack against machine learning (i.e. federated learning)?

@EQuiw
Copy link
Owner

EQuiw commented Jul 21, 2021

The function takes a respective numpy array which represents one image.

Regarding your code, just submit one image with each call. For example:

tardir = "DIRECTORY-where-you-want-to-save-the-images" # please replace!
save_jpeg_image(src_image_example, os.path.join(tardir,'src_image_example.jpg'), quality=80)
save_jpeg_image(result_attack_image, os.path.join(tardir,'result_attack_image.jpg'), quality=80)

Quality refers to the JPEG quality of the saved image.

Regarding the question about the measurement: the experimental setup is described in our paper.

Thanks for your questions.

@EQuiw EQuiw closed this as completed Jul 21, 2021
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