grip-unina / DMimageDetection

On the detection of synthetic images generated by diffusion models
Apache License 2.0
196 stars 19 forks source link

Networks weights and operations.csv file #4

Closed simoneVU closed 1 year ago

simoneVU commented 1 year ago

I was wondering why there are only 2 files in the weights.zip file for the model weights since in this paper that you cite, they evaluate on more than only 2 models. How should I interpret the model weights available in the weights.zip file?

I also wanted to ask you how you created the operations.csv file for your dataset. I do have some different data that I would like to test your models on. However, in order to use your code base I need the operations.csv file for my data as well.

Thanks in advance!

RCorvi commented 1 year ago

Hi thank you for your interest. We have decided to provide the best weights obtained in our training, so more specifically Grag2021 trained on Progan and Grag2021 trained on Latent Diffusion. As for the other weights, there are implementations available online, for example for Wang2020 there is the official repository of the paper which contains the weights https://github.com/PeterWang512/CNNDetection . As for the file operations.csv, it contains the file path alongside all the operations that should be applied to the image. Therefore to use the code on your data, the images should be inserted in a parent folder (which by default in the code is called TestSet) containing the data you want to test on. You should add to the csv file the sub-folder and file name in the src column, then you should add the operations you want to apply on the image. In order they should be: the cropsize; the x position of the starting pixel of the crop; the y position of the starting pixel of the crop; the quality factor for the jpeg compression. Finally, the typ column indicates the architecture, in our case is the same name of the folder containing the images, the label column should indicate whether the image is synthetic or real. I hope this information clears your doubt, let me know if there is still something you would like to know.

simoneVU commented 1 year ago

Hi, thank you for the thorough answer, that cleared some of my doubts. I was also wondering whether you used some sort of criteria in order to choose the cropsize; the x position of the starting pixel of the crop; the y position of the starting pixel of the crop; the quality factor for the jpeg compression.

Thank you in advance!

RCorvi commented 1 year ago

Hi, the quality factor of the jpeg compression is sampled randomly in a uniform range that goes from 65 to 100. As for the cropsize, it is sampled in between max(min(5/8 size of the image, 1280), 160) and min(size of the image, 2048) . Finally, the x position of the starting pixel of the crop is a value in the range between 0 and (size X of the image - cropsize), while the y position is a random value in the range between 0 and (size Y of the image - cropsize). Let me know if you need more information.

simoneVU commented 1 year ago

Thank you very much! Everything is clear now!