Employing Reinforcement Learning to Construct a Decision-making Environment for Image Forgery Localization
The widespread misuse of advanced image editing tools and deep generative techniques has led to a proliferation of images with altered content in real-life scenarios, often without any discernible traces of tampering. This has created a potential threat to security and credibility of images. Image forgery localization is an urgent technique. In this paper, we propose a novel reinforcement learning-based framework CoDE (Construct Decision-making Environment) that can provide reliable localization result of tampered area in forged images. We model the forgery localization task as a Markov Decision Process (MDP), where each pixel is equipped with an agent that performs Gaussian distribution-based continuous action to iteratively update the respective forgery probability, so as to achieve pixel-level image forgery localization.
- python 3.7.0
- torch 1.7.1+cu110
conda create -n env python=3.7.0
pip install -e requirement.txt
conda env create -f environment.yaml
Put the images in "dataset/forgery/" and the ground-truth of masks in "dataset/gt/", then generate the index "data.txt" under "dataset/".
We have given the template of "dataset/", please check in the directory for more details.
The pre-trained model can be downloaded from: Google Drive or Baidu Pan (Code:CoDE)
The downloaded file should be placed in "weights/".
python train.py --DATASET dataset --RATIO 0.7 --TRAIN-BATCH-SIZE 8
Here we only present the basic training setting, you can browse 'train.py' for more details.
python test.py --WEIGHT-PATH ./weights/pretrained_CoDE.pth --DATASET dataset --RATIO 0 --VISUALIZE 0
When --VISUALIZE is True (1), the results for action map, forgery probability map and predicted mask will be saved in the 'result/'.


