polimi-ispl / cnn-fast-sdi

CNN-based fast source device identification
MIT License
18 stars 2 forks source link

CNN-based fast source device identification

This is the official repository of CNN-based fast source device identification, accepted to IEEE SIGNAL PROCESSING LETTERS, VOL. 27, 2020 and currently available on arXiv.

Code

Prerequisites

Extract image noise residuals and device PRNU and save them

You can extract them using the Python implementation available here.
For each device, create a train-validation-test split, dividing the image noise residuals in 50% training, 25% validation, 25% evaluation.
Create 3 lists for each device reporting the paths to the noise residuals:

Train

Run train_cnn.py to train a CNN for image-PRNU matching. Please refer to the comments in the script for hints on the usage. For instance, to train the PCN architecture on image-patches of 224 x 224 pixels, you can run:

$ python3 train_cnn.py --model_dir ./models/Pcn_crop224 --crop_size 224 --base_network Pcn

Test

Run test_cnn.py to test a CNN for image-PRNU matching. Please refer to the comments in the script for hints on the usage. For instance, to test the PCN architecture on image-patches of 224 x 224 pixels, you can run:

$ python3 test_cnn.py --model_dir ./models/Pcn_crop224 --output_file ./outputs/Pcn_crop224_test.npz--crop_size 224 --base_network Pcn

Test pretrained CNN models

Pretrained CNN models can be downloaded here. For instance, to load the PCN model pretrained on image-patches randomly cropped to 224 x 224 pixels and then test it on image-patches of 224 x 224 pixels, you can run:

$ python3 test_cnn.py --model_dir ./downloaded_pretrained_models/cropr224_Pcn --output_file ./outputs/cropr224_Pcn_test.npz--crop_size 224 --base_network Pcn

Supplementary materials

In supplementary_materials you can find more detailed results. Precisely, supplementary_materials.pdf reports the list of results for the closed-set problem, i.e., identifying the image source among a finite pool of devices, and for the open-set problem, i.e., tackling source identification in case of unknown cameras. MATLAB .fig files used to generate these results are reported as well.

Credits

ISPL: Image and Sound Processing Lab - Politecnico di Milano

GRIP: Image Processing Research Group - University Federico II of Naples