I-197Inpainting Boundary Detection

Pixel Analysisimage2019

Detects boundary artifacts from image inpainting — identifies seam lines between original and inpainted regions (Yu et al., 2019).

Inpainting Seam Analysis
This method detects the boundary artifacts left by image inpainting algorithms — both traditional patch-based and modern deep learning approaches — to identify regions where content has been removed and replaced:\n\n1. Noise Discontinuity Detection: At the boundary between original and inpainted regions, the noise characteristics change abruptly. The method estimates local noise variance using the Median Absolute Deviation (MAD) of wavelet coefficients (HH subband) on overlapping 32×32 blocks. Boundaries are detected where adjacent blocks show noise variance ratios exceeding 1.5:1, indicating a transition between authentic sensor noise and generated content.\n\n2. Texture Structure Break Analysis: Inpainting algorithms (both PatchMatch-based and neural network-based like Yu et al., 2019) struggle to perfectly continue texture patterns across the inpainting boundary. The method traces texture flow lines using the structure tensor and detects points where texture orientation changes by more than 20° across a 4-pixel boundary zone. These breaks are invisible to the human eye but statistically significant.\n\n3. JPEG Block Boundary Alignment: For JPEG-compressed images, the inpainting boundary rarely aligns with the 8×8 JPEG block grid. The method detects blocks that span the inpainting boundary by analyzing the DCT coefficient statistics — boundary-spanning blocks show bimodal coefficient distributions (mixing authentic and generated statistics). A sliding 8×8 analysis with 1-pixel stride detects these transitional blocks.\n\n4. Semantic Edge Irregularity: Deep inpainting models (DeepFill, LaMa) produce content that may have correct appearance but incorrect edge connectivity at the boundary. The method uses the Canny edge detector on both sides of candidate boundaries and measures edge matching using the Chamfer distance — genuine image edges show continuous paths across regions, while inpainting boundaries show edge misalignment exceeding 2 pixels.
Block size: 32×32 for noise estimation\nNoise variance ratio threshold: 1.5:1\nTexture orientation break: 20° threshold\nJPEG block analysis: 8×8 with 1-pixel stride\nEdge matching: Chamfer distance threshold 2 pixels\nMinimum image size: 128×128 pixels
80–88% boundary detection F1-score on standard inpainting forgery datasets. Noise discontinuity alone achieves 75%. Combined multi-cue analysis reaches 89% on traditional inpainting and 82% on deep learning-based inpainting. Performance drops to 72% when inpainting is followed by global noise addition or blurring.
• Multi-cue approach detects both traditional and deep learning-based inpainting\n• Noise discontinuity is robust to visual content manipulation\n• JPEG block analysis leverages compression grid alignment, which is hard to fake\n• Provides precise boundary localization for forensic evidence\n• Works on various inpainting methods (PatchMatch, DeepFill, LaMa, Stable Diffusion inpaint)
• Global post-processing (adding uniform noise, Gaussian blur) can mask boundary artifacts\n• Very small inpainted regions (<50×50 pixels) may lack sufficient boundary evidence\n• Images saved as PNG/BMP lack JPEG block alignment cues\n• Advanced inpainting with boundary blending (feathered edges) reduces detectability\n• False positives at natural texture boundaries (e.g., sky-ground horizon)
Detecting regions where objects have been removed from photographs using inpainting. Identifying AI-assisted retouching in portrait, fashion, and real-estate photography. Forensic analysis of images where evidence may have been inpainted out. Detecting content-aware fill operations in Photoshop and similar tools.