SafePaint: Anti-forensic Image Inpainting with Domain Adaptation
Dunyun Chen, Xin Liao, Xiaoshuai Wu, Shiwei Chen
TL;DR
SafePaint addresses the security risk of forensic traces in image inpainting by proposing an end-to-end anti-forensic framework that decouples content completion from region-wise, domain-adaptive refinement. It introduces a domain-pattern extractor and a region-wise separated attention (RWSA) module to align foreground and background distributions, quantified via a domain distance loss and KL-divergence formulation. Empirical results demonstrate competitive traditional inpainting metrics while significantly improving detector evasion across multiple forensic detectors, with RWSA also offering plug-in benefits to other inpainting models. This work advances secure, forensic-aware inpainting and provides practical mechanisms for anti-forensic optimization and potential defenses against tampering detectors.
Abstract
Existing image inpainting methods have achieved remarkable accomplishments in generating visually appealing results, often accompanied by a trend toward creating more intricate structural textures. However, while these models excel at creating more realistic image content, they often leave noticeable traces of tampering, posing a significant threat to security. In this work, we take the anti-forensic capabilities into consideration, firstly proposing an end-to-end training framework for anti-forensic image inpainting named SafePaint. Specifically, we innovatively formulated image inpainting as two major tasks: semantically plausible content completion and region-wise optimization. The former is similar to current inpainting methods that aim to restore the missing regions of corrupted images. The latter, through domain adaptation, endeavors to reconcile the discrepancies between the inpainted region and the unaltered area to achieve anti-forensic goals. Through comprehensive theoretical analysis, we validate the effectiveness of domain adaptation for anti-forensic performance. Furthermore, we meticulously crafted a region-wise separated attention (RWSA) module, which not only aligns with our objective of anti-forensics but also enhances the performance of the model. Extensive qualitative and quantitative evaluations show our approach achieves comparable results to existing image inpainting methods while offering anti-forensic capabilities not available in other methods.
