Papers
Topics
Authors
Recent
Search
2000 character limit reached

End4: End-to-End Denoising Diffusion Detection

Updated 12 July 2026
  • The paper introduces End4, which jointly optimizes one-step denoising and binary classification to detect diffusion-based inpainting, achieving around 90% accuracy.
  • It employs a U-Net style denoiser (UpDM), a Scale-aware Pyramid-like Fusion Module (SPFM) with multi-head self and cross-attention, and a lightweight detection head for latent-space alignment.
  • The method demonstrates robustness under common image perturbations like JPEG compression and blur, setting a new benchmark in inpainting forensics and end-to-end diffusion systems.

Searching arXiv for the primary End4 paper and closely related end-to-end denoising diffusion work to ground the article. End-to-end Denoising Diffusion, abbreviated “End4,” denotes a design pattern in which denoising diffusion is integrated with the downstream objective inside a single trainable system rather than being used as a detached reconstruction or generation stage. In the specific formulation introduced for diffusion-based inpainting detection, End4 is a method for identifying whether an image has been locally manipulated by a diffusion-based inpainting model, and it does so by coupling denoising reconstruction and binary detection within one end-to-end trainable network (Wang et al., 16 Sep 2025). More broadly, the term also appears in adjacent literature as a label for end-to-end diffusion formulations in discriminative vision, planning, and restoration, where the shared theme is that diffusion is not merely a preprocessing or sampling module but part of the task-optimized computational graph (Shibli et al., 30 Apr 2026, Liao et al., 2024). This suggests that “End4” is best understood both as the title of a specific inpainting-forensics method and as a wider methodological tendency toward joint optimization of denoising and task prediction.

1. Definition and scope

In the inpainting-detection setting, End4 is positioned against prior two-stage pipelines that first reconstruct a candidate image using a frozen diffusion model and then train a separate classifier on reconstruction errors (Wang et al., 16 Sep 2025). Its central claim is that joint optimization aligns the latent spaces of the reconstruction and classification tasks, thereby producing reconstructed features more conducive to detection. The framework therefore treats reconstruction not as an end in itself but as a task-conditioned intermediate representation.

The paper’s full title, “End4: End-to-end Denoising Diffusion for Diffusion-Based Inpainting Detection” (Wang et al., 16 Sep 2025), gives the narrowest technical meaning of the term. The target problem is not generic image synthesis, nor generic forgery detection, but the detection of local manipulations created by diffusion-based inpainting systems. The method explicitly addresses the reported difficulty that existing approaches struggle to identify images generated by diffusion-based inpainting models, even when similar inpainted images are included in their training data.

At a broader level, related works reveal a recurring architecture principle. “Noise2Map” describes an “End⁴” discriminative system in remote sensing, where a diffusion process is repurposed for direct semantic segmentation and change detection without iterative generative sampling (Shibli et al., 30 Apr 2026). “DiffusionDrive” similarly describes an end-to-end truncated diffusion policy for autonomous driving, with denoising integrated into trajectory prediction rather than separated from the planning objective (Liao et al., 2024). These parallels indicate that End4 belongs to a wider class of end-to-end denoising-diffusion systems in which diffusion states are made task-relevant rather than merely generative.

2. Architectural composition of the End4 detector

The End4 pipeline for inpainting detection comprises three main components: an Updated Diffusion Model (UpDM), a Scale-aware Pyramid-like Fusion Module (SPFM), and a Detection Head (Wang et al., 16 Sep 2025). In pseudo-block form, the input image x0x_0 is first passed through UpDM to obtain a reconstruction y^0\hat y_0; ResNet50 features are then extracted from both the original and reconstructed images; those features are fused by SPFM through multi-scale attention, self-attention, and cross-attention; and the fused representation xSPFMx_{\mathrm{SPFM}} is passed to a fully connected classifier that outputs a binary real/fake prediction.

The UpDM is a U-Net-style denoiser with encoder-decoder structure and skip-connections, built from a combination of ResNet blocks, PixelCNN++-inspired convolutions, and Transformer attention layers (Wang et al., 16 Sep 2025). It takes a noisy sample xtx_t at time step tt and predicts noise ϵθ(xt,t)\epsilon_\theta(x_t,t). Reconstruction is performed by a direct one-step inversion to x^0\hat x_0, rather than through TT iterative denoising steps.

SPFM is the module that emphasizes localized artifacts. It operates on ResNet50 feature maps from both the original image and the reconstruction using two cascaded pyramid-like layers, denoted L1L_1 and L2L_2 (Wang et al., 16 Sep 2025). Layer y^0\hat y_00 uses an attention mask of size y^0\hat y_01 and dilated convolution with dilation y^0\hat y_02, while layer y^0\hat y_03 stacks on y^0\hat y_04’s output with mask size y^0\hat y_05 and dilation y^0\hat y_06. This produces multi-scale representations for the original and reconstructed branches, after which self-attention is applied at each scale and multi-head cross-attention is computed in both directions before concatenation.

The detection head is deliberately lightweight. The fused SPFM output y^0\hat y_07 is average-pooled along spatial dimensions and then passed through one fully connected layer that maps pooled features to two logits, corresponding to real versus inpainted classes (Wang et al., 16 Sep 2025). The final probability y^0\hat y_08 is obtained by softmax.

A compact summary of the End4 detector is useful for separating function from implementation detail:

Component Role Key implementation detail
UpDM Reconstruct input under denoising objective One-step denoising U-Net
SPFM Fuse original/reconstructed features Two-level attention pyramid with self- and cross-attention
Detection Head Binary classification Average pooling plus one FC layer

The significance of this decomposition is that reconstruction and detection are not parallel, loosely connected stages. Instead, the reconstruction branch is optimized jointly with the classifier, and SPFM explicitly mediates between the two feature spaces.

3. Diffusion formulation and training objective

End4 uses standard DDPM notation for the forward and reverse processes (Wang et al., 16 Sep 2025). The forward noising process is

y^0\hat y_09

The reverse process is parameterized by xSPFMx_{\mathrm{SPFM}}0 as

xSPFMx_{\mathrm{SPFM}}1

After predicting xSPFMx_{\mathrm{SPFM}}2 at a randomly sampled timestep xSPFMx_{\mathrm{SPFM}}3, End4 reconstructs the input by a direct one-step inversion:

xSPFMx_{\mathrm{SPFM}}4

The training objective contains two terms: a noise-prediction loss and a binary classification loss (Wang et al., 16 Sep 2025). The noise-prediction loss is applied only to inpainting samples:

xSPFMx_{\mathrm{SPFM}}5

where xSPFMx_{\mathrm{SPFM}}6 for inpainted images and xSPFMx_{\mathrm{SPFM}}7 for natural images. The classification loss is binary cross-entropy:

xSPFMx_{\mathrm{SPFM}}8

The combined objective is

xSPFMx_{\mathrm{SPFM}}9

The selective application of xtx_t0 to inpainted images is not incidental. An ablation reported in the paper states that noise-loss targeting only inpainting images yields best accuracy xtx_t1 versus applying it to both classes or to naturals only (Wang et al., 16 Sep 2025). This directly supports the paper’s claim that latent-space alignment should be driven by manipulations of forensic interest rather than by indiscriminate denoising.

From a conceptual standpoint, the objective differs from classical forensic pipelines based on post hoc residuals. In End4, the denoising branch is supervised as part of the detector itself. A plausible implication is that the reconstructed representation is task-shaped: it is not merely a cleaner image, but a representation optimized to expose inpainting artifacts.

4. Scale-aware Pyramid-like Fusion Module

SPFM is the most distinctive feature-engineering component of End4 (Wang et al., 16 Sep 2025). Its purpose is to refine local image features under the guidance of attention pyramid layers at different scales, thereby enhancing feature discriminability. The module begins from ResNet50 feature maps extracted from the original image xtx_t2 and the reconstructed image xtx_t3.

Its first stage is a two-level pyramid. If xtx_t4 and xtx_t5 denote the ResNet50 features from the original and reconstructed branches, the pyramid produces

xtx_t6

and

xtx_t7

Self-attention is then applied to the stacked features at each scale. For xtx_t8, if xtx_t9 are linear projections of the stacked features, the attention update is

tt0

The resulting scale-aware features are denoted tt1 and tt2. Multi-head cross-attention is then computed in both directions:

  • tt3
  • tt4

These are concatenated to form the fused representation tt5.

The ablation evidence makes the role of SPFM unusually clear. On the reported benchmark, replacing SPFM with absolute difference gives approximately tt6 accuracy, simple concatenation gives approximately tt7, and SPFM gives approximately tt8 (Wang et al., 16 Sep 2025). This is not merely a modest architectural refinement; within the reported setup, SPFM is responsible for a large fraction of the discriminative gain.

The likely reason, consistent with the paper’s framing, is that inpainting artifacts are region-specific and scale-dependent. SPFM’s bidirectional cross-attention between original and reconstructed features allows the detector to compare local structures across scales instead of relying only on global discrepancy measures. This suggests that End4’s notion of “end-to-end” is not limited to joining modules in one optimizer; it also entails a feature-fusion strategy explicitly matched to localized manipulation traces.

5. Data, training protocol, and benchmark design

End4 is trained and evaluated on InpaintingForensics, a COCO-based dataset comprising five mask types, each with tt9 images split into ϵθ(xt,t)\epsilon_\theta(x_t,t)0 train and ϵθ(xt,t)\epsilon_\theta(x_t,t)1 test (Wang et al., 16 Sep 2025). The five mask types are: center128, random128, centerRandom, randomRandom, and cocoMask. The benchmark is synthesized by three inpainting engines: SD v1.5, SD v2, and BrushNet with ϵθ(xt,t)\epsilon_\theta(x_t,t)2 DDIM steps.

The mask taxonomy is central to the evaluation because the paper’s stated objective is generalization to unseen masking patterns. The five mask types cover fixed central masks, random-location masks, random-size central masks, random-size random-position masks, and COCO segmentation masks with up to five categories (Wang et al., 16 Sep 2025). This benchmark design is intended to evaluate detection performance on inpainted images generated from distinct masked regions rather than on a single editing regime.

Training uses random horizontal flip, color jitter, grayscale conversion, and resize to ϵθ(xt,t)\epsilon_\theta(x_t,t)3 input (Wang et al., 16 Sep 2025). The batch size is ϵθ(xt,t)\epsilon_\theta(x_t,t)4, the learning rate is ϵθ(xt,t)\epsilon_\theta(x_t,t)5, the diffusion timesteps are ϵθ(xt,t)\epsilon_\theta(x_t,t)6 with one-step denoising, the optimizer is Adam, and training is performed on an NVIDIA A100. No explicit weight decay is reported.

These details place End4 within a class of computationally moderate diffusion-based forensic systems. Unlike generic diffusion generation pipelines that require iterative reverse sampling at inference, the detector uses one-step denoising as an internal feature-reconstruction mechanism. This choice is later discussed by the authors as a strength-speed tradeoff: one-step denoising improves efficiency, although the paper notes that very subtle artifacts might require multi-step inversion (Wang et al., 16 Sep 2025).

The benchmark itself is also a substantive contribution of the work. The paper states that it establishes a comprehensive benchmark comprising images generated from five distinct masked regions (Wang et al., 16 Sep 2025). In the context of inpainting forensics, this matters because overfitting to a narrow mask distribution could give a misleading impression of robustness.

6. Empirical results, robustness, and limitations

End4’s main reported experiment trains on the cocoMask subset of SD v1.5 inpainting and evaluates general detection performance across the five mask types (Wang et al., 16 Sep 2025). The reported accuracies and AUCs are:

Method center128 (ACC/AUC) cocoMask (ACC/AUC)
NPR 65.90/71.07 73.62/82.09
DIRE ~50/50 53.18/54.47
FIRE ~50/51 51.23/50.73
End4 87.80/95.00 89.96/96.32

The full table in the paper also reports strong performance for End4 on random128, centerRandom, and randomRandom, with all AUCs near ϵθ(xt,t)\epsilon_\theta(x_t,t)7 and all accuracies around ϵθ(xt,t)\epsilon_\theta(x_t,t)8 to ϵθ(xt,t)\epsilon_\theta(x_t,t)9 (Wang et al., 16 Sep 2025). Within this setting, End4 clearly outperforms the listed baselines.

Robustness results indicate that End4 maintains x^0\hat x_00 AUC under JPEG compression with x^0\hat x_01, Gaussian blur with x^0\hat x_02, saturation changes with factor in x^0\hat x_03, and contrast shifts with factor in x^0\hat x_04 (Wang et al., 16 Sep 2025). The paper states that it outperforms all baselines at each perturbation level. Because practical forensic deployment almost always involves post-processing or recompression, these perturbation results are methodologically important.

The ablation findings further isolate key mechanisms. Fusion strategy strongly affects accuracy, with SPFM outperforming absolute difference and simple concatenation by a wide margin (Wang et al., 16 Sep 2025). Likewise, constraining the noise-prediction loss to inpainted images yields the best result. These ablations support the authors’ argument that both latent-space alignment and multi-scale cross-modal comparison are necessary.

The paper also states several limitations (Wang et al., 16 Sep 2025). One-step denoising trades off reconstruction fidelity for speed, and SPFM adds computation compared to simple concatenation, potentially limiting real-time deployment on edge devices. The authors mention possible extensions including integrating explicit segmentation losses to localize inpainted regions, exploring lightweight attention approximations such as Linformer or Performer for faster SPFM, and extending the benchmark to other editing scenarios such as object removal, style transfer, and other generative backbones.

7. Position within end-to-end diffusion research

Although End4 is specifically an inpainting detector, related arXiv work shows that its underlying principle—embedding denoising diffusion directly into the task loss—has emerged across several subfields. “Noise2Map” describes a unified diffusion-based framework for semantic segmentation and change detection that directly predicts semantic or change maps using task-specific noise schedules and timestep conditioning, and collapses inference to one forward pass (Shibli et al., 30 Apr 2026). Its summary explicitly characterizes the framework as an “End⁴” discriminative system. “DiffusionDrive” presents a truncated diffusion policy for end-to-end autonomous driving, where prior multi-mode anchors and a truncated diffusion schedule enable only x^0\hat x_05 denoising steps at inference while achieving x^0\hat x_06 PDMS and real-time speed of x^0\hat x_07 FPS on an NVIDIA 4090 (Liao et al., 2024). “E2EDx^0\hat x_08” goes further in generative modeling by training the full multi-step denoising trajectory end-to-end with final-output supervision, reconstruction, adversarial, and perceptual losses (Tan et al., 2024).

These works are technically heterogeneous. End4 uses one-step denoising as a reconstruction-aligned forensic feature learner (Wang et al., 16 Sep 2025). Noise2Map avoids iterative sampling and directly predicts discriminative maps from noisy inputs (Shibli et al., 30 Apr 2026). DiffusionDrive uses truncated denoising from anchored Gaussian mixtures for planning (Liao et al., 2024). E2EDx^0\hat x_09 treats the entire diffusion chain as a differentiable function from isotropic Gaussian noise to data (Tan et al., 2024). Yet they share a common rejection of the classical separation between diffusion and downstream inference.

A common misconception is that end-to-end denoising diffusion always implies full iterative reverse diffusion during inference. The surveyed literature does not support that interpretation. End4 uses one-step inversion internally (Wang et al., 16 Sep 2025), Noise2Map performs one-shot inference (Shibli et al., 30 Apr 2026), and DiffusionDrive reports superior diversity and quality in just TT0 steps (Liao et al., 2024). Another misconception is that end-to-end diffusion is only relevant for generative synthesis. The cited works show applications in forensics, segmentation, change detection, and autonomous planning.

Taken together, the literature suggests that End4 represents a broader transition from diffusion as a standalone sampler to diffusion as an optimizable task mechanism. In the inpainting-detection paper, that transition takes the concrete form of joint denoising reconstruction, multi-scale fusion, and binary forensic classification inside one network (Wang et al., 16 Sep 2025). In that sense, End4 is both a specific method and an instance of a wider methodological realignment in diffusion-based learning.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to End-to-end Denoising Diffusion (End4).