Paolo Bestagini commited on
Commit
6e860fb
1 Parent(s): e94a940

Update README.md

Browse files
Files changed (2) hide show
  1. .gitattributes +1 -0
  2. README.md +39 -6
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ *.ipynb linguist-language=Python
README.md CHANGED
@@ -1,21 +1,54 @@
1
  # GAN-image-detection
 
2
 
3
- ## Prerequisite
4
- 1. Create the conda environment
 
 
 
 
 
 
5
  ```bash
6
  conda env create -f environment.yml
 
7
  ```
8
- 2. Download the model's weights from [here](https://www.dropbox.com/s/g1z2u8wl6srjh6v/weigths.zip?dl=0) and unzip it under the main folder
9
  ```bash
10
- wget https://www.dropbox.com/s/g1z2u8wl6srjh6v/weigths.zip?dl=0
11
  unzip weigths.zip
12
  ```
13
 
14
- ## Test the detector on a single image
15
  We provide a simple script to obtain the model score for a single image.
16
  ```bash
17
  python gan_vs_real_detector.py --img_path $PATH_TO_TEST_IMAGE
18
  ```
19
 
20
- ## Performances
21
  We provide a [notebook](https://github.com/polimi-ispl/GAN-image-detection/blob/main/roc_curves.ipynb) with the script for computing the ROC curve for each dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # GAN-image-detection
2
+ This repository contains a GAN-generated image detector developed to distinguish real images from synthetic ones.
3
 
4
+ The detector is based on an ensemble of CNNs.
5
+ The backbone of each CNN is the EfficientNet-B4.
6
+ Each model of the ensemble has been trained in a different way following the suggestions presented in [this paper](https://ieeexplore.ieee.org/abstract/document/9360903) in order to increase the detector robustness to compression and resizing.
7
+
8
+ ## Run the detector
9
+
10
+ ### Prerequisites
11
+ 1. Create and activate the conda environment
12
  ```bash
13
  conda env create -f environment.yml
14
+ conda activate gan-image-detection
15
  ```
16
+ 2. Download the model's weights from [this link](https://www.dropbox.com/s/g1z2u8wl6srjh6v/weigths.zip) and unzip the file under the main folder
17
  ```bash
18
+ wget https://www.dropbox.com/s/g1z2u8wl6srjh6v/weigths.zip
19
  unzip weigths.zip
20
  ```
21
 
22
+ ### Test the detector on a single image
23
  We provide a simple script to obtain the model score for a single image.
24
  ```bash
25
  python gan_vs_real_detector.py --img_path $PATH_TO_TEST_IMAGE
26
  ```
27
 
28
+ ## Performance
29
  We provide a [notebook](https://github.com/polimi-ispl/GAN-image-detection/blob/main/roc_curves.ipynb) with the script for computing the ROC curve for each dataset.
30
+
31
+ ## How to cite
32
+ Training procedures have been carried out following the suggestions presented in the following paper.
33
+
34
+ Plaintext:
35
+ ```
36
+ S. Mandelli, N. Bonettini, P. Bestagini, S. Tubaro, "Training CNNs in Presence of JPEG Compression: Multimedia Forensics vs Computer Vision", IEEE International Workshop on Information Forensics and Security (WIFS), 2020, doi: 10.1109/WIFS49906.2020.9360903.
37
+ ```
38
+
39
+ Bibtex:
40
+ ```bibtex
41
+ @INPROCEEDINGS{mandelli2020training,
42
+ author={Mandelli, Sara and Bonettini, Nicolò and Bestagini, Paolo and Tubaro, Stefano},
43
+ booktitle={IEEE International Workshop on Information Forensics and Security (WIFS)},
44
+ title={Training {CNNs} in Presence of {JPEG} Compression: Multimedia Forensics vs Computer Vision},
45
+ year={2020},
46
+ doi={10.1109/WIFS49906.2020.9360903}}
47
+ ```
48
+
49
+ ## Credits
50
+ [Image and Sound Processing Lab - Politecnico di Milano](http://ispl.deib.polimi.it/)
51
+ - Sara Mandelli
52
+ - Nicolò Bonettini
53
+ - Paolo Bestagini
54
+ - Stefano Tubaro