Manuscript Offprint

arXiv:2608.28302

FUSED: Forensic-Semantic Mixture-of-Experts for AI Inpainting Detection and Localization

Anton Nuzhdin, Marcel Worring, Ivona Najdenkoska

Abstract

Diffusion-based inpainting models modify only a localized part of an image, while many AI-image detectors rely on global artifacts and do not localize. These artifacts vary across generators, limiting detector transfer under distribution shifts. Recent work shows that restoring the authentic pixels outside the inpainted region removes these cues and can degrade pretrained detectors. To address this, we present FUSED, a unified framework for the joint detection and localization of AI-generated inpainting. FUSED combines low-level forensic cues with high-level semantic features using a sparsely-gated Mixture-of-Experts architecture, enabling the model to adaptively prioritize the most relevant signal for each token. For each input, FUSED predicts both an image-level manipulation score and a pixel-level mask of the inpainted area. On the OpenSDID cross-generator benchmark, FUSED achieves the best average detection and localization, with the largest gains on unseen generators. The same model transfers directly to the held-out AutoSplice and CocoGlide benchmarks, more than doubling localization performance. Evaluating each held-out benchmark with and without the global generator artifact further shows that all evaluated methods, ours included, partly read the artifact as evidence of manipulation, and FUSED remains the strongest under both conditions. Code and pretrained models are available at https://github.com/AntonNuzhdin/FUSED.

Introduction

Detecting and localizing AI-generated content has become a central problem in image forensics. Diffusion-based image inpainting has made AI-generated content rapid, accessible, and visually convincing (Rombach et al. 2021; Esser et al. 2024; Podell et al. 2024; Batifol et al. 2025; Zhao et al. 2026). In contrast to fully synthetic generation, AI inpainting modifies only a localized region of an image, removing, inserting, or replacing semantically important content while maintaining the realism of the surrounding areas (Verdoliva 2020). Consequently, a forensic system designed to detect such edits must address two interrelated questions: has the image been manipulated, and where is the manipulation located. Most detectors take a shortcut around the detection vs localization problem. Specifically, detectors tend to rely on the global cue that distinguishes real from synthetic images in their training data, such as JPEG compression and resolution (Grommelt et al. 2024), content and format bi-

Figure

Figure 1: Prior forensic-semantic detectors combine forensic and semantic features using a global image-level fusion. FUSED instead routes each token to a sparse set of experts, enabling token-level fusion and improving robustness to unseen generators.

ases (Guillaro et al. 2025), or frequency misalignment (Chen et al. 2025). In inpainting, the VAE trace is exactly such a cue: latent diffusion models process the entire image through a variational autoencoder (VAE) (Kingma and Welling 2013), leaving a spectral trace across the whole frame, including the background (Nebioglu, Bilgiç, and Popescu 2026). Recent work, such as the Inpainting-Exchange intervention (INP-X) (Nebioglu, Bilgiç, and Popescu 2026), investigates this by showing that restoring the authentic pixels outside the edited region reduces strong detectors to chance. Detection must, therefore, rest on the synthesized region itself.

Reliance on shortcuts becomes unsustainable under transfer, where new generators arrive without retraining, and there the two kinds of evidence fail in complementary ways. Low-level forensic cues localize accurately but generalize poorly across generators, while high-level semantic features sur-vive the generator change yet cannot point to the synthesized pixels, so localization suffers even when detection holds. Combining the two is by now standard (Guillaro et al. 2023; Yan et al. 2024; Cheng et al. 2025), from feature concatenation (Yan et al. 2024) to adaptive per-image weighting (Cheng et al. 2025). In all of them, a single blend serves the whole image, while the inpainting is local, so the mixture must instead be resolved token by token (Figure 1).

In this paper, we introduce FUSED, a Forensic-semantic Unified Sparse-Expert Detector for the joint detection and localization of AI inpainting (Figure 2). A trainable forensic branch suppresses semantic content and extracts low-level manipulation traces, while a frozen semantic branch provides object-level context that remains stable across generators. A sparsely-gated Mixture-of-Experts (MoE) (Shazeer et al. 2017) fuses the streams by routing each token to selected experts. Finally, a segmentation bridge decodes the tampering mask jointly from the forensic map and the post-fusion semantic tokens, extending localization supervision to the fusion and routing modules.

To evaluate our method, we conduct a series of transfer experiments under three increasingly severe distribution shifts from the training source. Following the OpenSDID protocol (Wang, Huang, and Hong 2025), all methods are trained on images by a single image generator and tested on five generators of the same latent-diffusion family, four of which are unseen. The same checkpoints are then evaluated, without any target-domain training, on AutoSplice (Jia et al. 2023) and CocoGlide (Guillaro et al. 2023), two independently constructed benchmarks whose pixel-space editors never pass the image through a latent VAE. Consequently, no global latent-VAE artifact is present, and successful transfer requires identifying evidence within the manipulated region itself. The INP-X benchmark (Nebioglu, Bilgiç, and Popescu 2026) provides the same manipulations with the artifact present and removed, allowing us to isolate how much each transferred decision depends on this cue. Together, these evaluations test cross-generator generalization, transfer across editing pipelines, and robustness to the removal of global artifacts. All three, however, start from a single training generator, leaving open both whether the gains of FUSED persist under heterogeneous training and whether the model remains effective against more recent high-fidelity generators. We therefore also retrain FUSED and MaskCLIP on the large-scale multi-generator So-Fake-Set (Huang et al. 2026) and evaluate them on So-Fake-OOD, which contains forgeries from held-out commercial generators.

In summary, our contributions are: (1) We propose FUSED, which couples a forensic branch with a semantic one through a sparsely-gated Mixture-of-Experts acting as a cross-stream, per-token fusion operator, and a joint segmentation bridge that extends localization supervision to the fusion itself. (2) We demonstrate state-of-the-art performance in detection and localization from a single training source across generator families and under both artifact conditions. Furthermore, we show that the advantage persists under large-scale multi-generator training and on a contemporary OOD benchmark containing held-out commercial generators.

References (45)