Abstract
Deep image inpainting aims to restore damaged or missing regions in an image with realistic contents. While having a wide range of applications such as object removal and image recovery, deep inpainting techniques also have the risk of being manipulated for image forgery. A promising countermeasure against such forgeries is deep inpainting detection, which aims to locate the inpainted regions in an image. In this paper, we make the first attempt towards universal detection of deep inpainting, where the detection network can generalize well when detecting different deep inpainting methods. To this end, we first propose a novel data generation approach to generate a universal training dataset, which imitates the noise discrepancies exist in real versus inpainted image contents to train universal detectors. We then design a Noise-Image Cross-fusion Network (NIX-Net) to effectively exploit the discriminative information contained in both the images and their noise patterns. We empirically show, on multiple benchmark datasets, that our approach outperforms existing detection methods by a large margin and generalize well to unseen deep inpainting techniques. Our universal training dataset can also significantly boost the generalizability of existing detection methods.
TL;DR
Deep image inpainting can be maliciously used for photorealistic image forgery, but current detectors struggle to identify manipulated regions if they were created by an unseen inpainting algorithm. This paper introduces a universal detection framework that leverages the inherent noise discrepancies between real camera sensors and neural network-generated content. By simulating these discrepancies with a generic autoencoder and using a novel Noise-Image Cross-fusion Network (NIX-Net), the approach achieves state-of-the-art generalization across multiple inpainting techniques.
What Problem Does This Paper Address?
Deep image inpainting uses Generative Adversarial Networks (GANs) to fill in missing or damaged regions of an image with highly realistic, semantically appropriate content. While useful for photo restoration, it can easily be weaponized to remove people or objects from images to spread misinformation or fabricate evidence.
To combat this, researchers have developed deep inpainting detectors that predict a mask over the forged regions. However, existing detectors suffer from a major flaw: they are inpainting-method-aware. They tend to overfit to the specific visual artifacts of the GAN they were trained on. If a bad actor uses a new or different inpainting technique, the detector's performance drops drastically. This paper tackles the challenge of universal deep inpainting detection—creating a model that can accurately locate forged regions regardless of the specific deep learning algorithm used to create them.
Methods
The authors propose a two-pronged approach to achieve universal detection:
- Universal Training Dataset Generation: Instead of training on images altered by specific inpainting GANs, the authors create a method-agnostic dataset. They train a standard autoencoder to reconstruct real images. Then, using random masks, they splice the autoencoder's reconstructed pixels into the original real images. This simulates the core forensic signal—the boundary between real camera sensor noise and neural network-generated noise—without introducing the specific quirks of any single inpainting algorithm.
- Noise-Image Cross-fusion Network (NIX-Net): To exploit this data, the authors design a two-stream neural network.
- Stream 1 (Image): Processes standard RGB pixel data.
- Stream 2 (Noise): Processes the noise residual of the image, extracted using a Spatial Rich Model (SRM) filter.
- Multi-scale Cross Fusion: At three different spatial scales, the network fuses the feature maps from the image stream and the noise stream. This allows the network to contextualize low-level noise discrepancies with high-level semantic image features before outputting a final binary mask of the forged region.
Datasets
- Source Images: The models were trained and evaluated using images from the Places2 and CelebA datasets.
- Evaluation Inpainting Methods: To test generalization, the authors used three distinct, state-of-the-art deep inpainting algorithms: GL (Iizuka et al., 2017), CA (Yu et al., 2018), and GC (Yu et al., 2019).
- Universal Training (UT) Dataset: A newly introduced dataset generated by the authors' autoencoder splicing method, featuring irregular masks of arbitrary shapes and locations.
Key Insights and Ideas
- Noise Doesn't Lie: The fundamental insight is that GAN-generated pixels lack the natural, high-frequency noise patterns (hardware fingerprints) left by real camera sensors. This discrepancy is a universal characteristic of deep inpainting.
- Method-Agnostic Training Prevents Overfitting: By training on a generic "real vs. autoencoder" dataset, the network is forced to learn the fundamental boundary between real and synthetic noise, rather than memorizing the specific blending artifacts of a particular GAN.
- Synergy of RGB and Noise: Relying solely on noise or solely on RGB isn't enough. Fusing them at multiple spatial scales allows the network to use semantic context (RGB) alongside low-level forensic clues (noise), leading to highly accurate mask boundaries.
Key Results
The performance was measured using mean Intersection over Union (mIoU) for the predicted forgery masks.
- Massive Generalization Leap: When trained only on the Universal Training (UT) dataset, NIX-Net achieved mIoU scores of 91.33% (GL), 88.46% (CA), and 84.71% (GC) on the Places2 dataset.
- Baseline Failure on Unseen Data: In contrast, a state-of-the-art baseline (LDICN) trained specifically on GL data plummeted from 83.47% on GL to just 66.70% on CA and 56.24% on GC, proving that existing methods fail on unseen algorithms.
- Ablation Success: Removing the noise stream from NIX-Net dropped performance by ~3-5%. More importantly, removing the multi-scale fusion modules caused a massive drop (e.g., down to 79.36% on GL), proving the cross-stream architecture is crucial for extracting rich forensic features.
Limitations and Future Work
While the authors do not explicitly detail limitations, the method's reliance on high-frequency noise residuals suggests that heavy post-processing—such as severe JPEG compression, downscaling, or adversarial noise—could degrade performance by destroying these fingerprints. Future work may involve refining noise extraction and fusion to enhance robustness against such attacks.
Summary updated