---
title: 'DTE-FDM: Domain Tag-Guided Forgery Detection'
url: https://www.emergentmind.com/topics/domain-tag-guided-explainable-forgery-detection-module-dte-fdm
type: topic
---

# DTE-FDM: Domain Tag-Guided Forgery Detection

A Domain Tag-guided Explainable Forgery Detection Module (DTE-FDM) is a central component in the FakeShield framework for explainable image forgery detection and localization. DTE-FDM addresses two critical limitations of existing image forgery detection and localization (IFDL) methods: the inherent black-box nature of detection models and the limited generalization across diverse manipulation methods, including Photoshop-style editing, DeepFake face manipulations, and AIGC-based inpainting. By integrating domain-aware classification with multimodal large language models (LLMs), DTE-FDM facilitates unified, interpretable detection and human-centric rationales for forensic analysis [2410.02761].

## 1. Functional Overview

DTE-FDM acts as the frontend of FakeShield, orchestrating three primary responsibilities: (1) classifying the input image into one of three forgery “domains” (Photoshop-style, DeepFake, or AIGC-inpainting), (2) fusing the assigned domain tag with image-derived features, and (3) providing both a binary authenticity verdict and a natural-language explanation that includes localized and evidence-based justification for the detection. This modular approach ensures that the system can not only flag manipulations but also rationalize its decisions for downstream analysts or end-users.

## 2. Architectural Components

DTE-FDM is composed of three tightly integrated submodules:

1. **Domain Tag Generator (DTG):**  
   Implements a lightweight convolutional neural network classifier, denoted $\mathcal{G}_{\mathrm{dt}}(\cdot)$, which receives the RGB image $I_{\mathrm{ori}}\in\mathbb{R}^{H\times W\times 3}$ and outputs a discrete tag $T_{\mathrm{tag}}\in\{\text{"Photoshop"}, \text{"DeepFake"}, \text{"AIGC"}\}$. The head consists of a small CNN with a terminal softmax over three classes.

2. **Image Token Encoder & Projector:**  
   Utilizes a frozen visual encoder $\mathcal{F}_{\mathrm{enc}}$ (ViT- or CLIP-style backbone) to map $I_{\mathrm{ori}}$ to a sequence of patch tokens, followed by a linear projection layer $\mathcal{F}_{\mathrm{proj}}$ that adapts the visual tokens to the LLM embedding space, producing image tokens $T_{\mathrm{img}}\in\mathbb{R}^{L\times D}$ (where $L$ is token count and $D$ the embedding dimension).

3. **LoRA-fine-tuned Multimodal LLM:**  
   A large language model, such as LLaVA, augmented via Low-Rank Adaptation (LoRA) to facilitate task-specific tuning. The LLM receives, sequentially, a textual prompt $T_{\mathrm{ins}}$, the domain tag $T_{\mathrm{tag}}$, and the image tokens $T_{\mathrm{img}}$. The output $O_{\mathrm{det}}$ comprises a real/fake decision, region localization, and an explicit rationale grounded in both pixel-level and semantic artifacts.

This pipeline enables structured data flow, as illustrated below:

| Input               | Module                        | Output          |
|---------------------|------------------------------|-----------------|
| $I_{\mathrm{ori}}$  | $\mathcal{G}_{\mathrm{dt}}$  | $T_{\mathrm{tag}}$   |
| $I_{\mathrm{ori}}$  | $\mathcal{F}_{\mathrm{enc}},\mathcal{F}_{\mathrm{proj}}$ | $T_{\mathrm{img}}$ |
| $\{T_{\mathrm{ins}}, T_{\mathrm{tag}}, T_{\mathrm{img}}\}$ | LLM | $O_{\mathrm{det}}$   |

## 3. Mathematical Formalism

DTE-FDM’s formulation is characterized by explicit mappings at every stage:

- **Domain Tag Assignment:**
  \[
  T_{\mathrm{tag}} = \mathcal{G}_{\mathrm{dt}}(I_{\mathrm{ori}}) \in \{\text{PS}, \text{DF}, \text{AIGC}\}
  \]
- **Image Tokenization:**
  \[
  T_{\mathrm{img}} = \mathcal{F}_{\mathrm{proj}}(\mathcal{F}_{\mathrm{enc}}(I_{\mathrm{ori}})) \in \mathbb{R}^{L\times D}
  \]
- **Multimodal LLM Decoding:**
  \[
  O_{\mathrm{det}} = \mathrm{LLM}\Bigl(\left[T_{\mathrm{ins}},\,T_{\mathrm{tag}}\right]\;|\;T_{\mathrm{img}}\Bigr)
  \]
where text tokens are concatenated, and cross-modal attention is adopted over image tokens.

## 4. Optimization Objectives

The training of DTE-FDM employs two primary loss terms:

1. **Domain Tag Classification Loss:**
   \[
   \ell_{\mathrm{tag}} = \mathrm{CrossEntropy}(\hat T_{\mathrm{tag}}, T_{\mathrm{tag}})
   \]
   which promotes correct assignment of domain tags by DTG.

2. **Explainable Detection Loss:**
   \[
   \ell_{\mathrm{det}} = \mathrm{CrossEntropy}(\hat O_{\mathrm{det}}, O_{\mathrm{txt}}) + \lambda\,\ell_{\mathrm{tag}}
   \]
   where $\hat O_{\mathrm{det}}$ is the LLM’s output token sequence, $O_{\mathrm{txt}}$ is the ground truth explanation from the MMTD-Set, and $\lambda$ is a balancing factor (typically $1$). The aggregate loss forces robust classification of the domain and accurate, faithful explanation with both binary verdict and human-consumable justification.

A combined expression for the total loss is:
\[
\ell_{\mathrm{total}} = \ell_{\mathrm{det}} + \alpha\,\ell_{\mathrm{tag}} = \mathrm{CE}(\hat O_{\mathrm{det}},O_{\mathrm{txt}}) + \alpha\,\mathrm{CE}(\hat T_{\mathrm{tag}},T_{\mathrm{tag}})
\]

## 5. Training Regime and Data Utilization

DTE-FDM is trained on the Multi-Modal Tamper Description Set (MMTD-Set), which aggregates:

- Photoshop-style tampering samples (Fantastic Reality, CASIAv2: copy-move, splicing, removal),
- DeepFake instances (FaceApp/FFHQ),
- AIGC-style inpainting (COCO + Stable Diffusion inpainting).

The dataset comprises approximately 50,000 tampered and 50,000 authentic images, with each image annotated by a triplet $\{I_{\mathrm{ori}}, M_{\mathrm{loc}}, O_{\mathrm{txt}}\}$, where $O_{\mathrm{txt}}$ (the explanation) is curated using GPT-4o prompt engineering. 

Training specifics include:
- Adam optimizer ($\text{lr}\!=\!2\times 10^{-4}$, weight decay $0$), batch size 24, $10$ epochs.
- Compute: $4\times$ NVIDIA A100 $40$GB GPUs.
- Only the DTG and LoRA weights are trained; the LLM and encoder remain frozen.
- No explicit augmentations are used beyond the inherent domain diversity.

## 6. Inference Process and Qualitative Behavior

At inference, a novel image $I_{\mathrm{ori}}$ undergoes DTG-based domain tagging:
\[
T_{\mathrm{tag}} = \mathcal{G}_{\mathrm{dt}}(I_{\mathrm{ori}}) \in \{\text{PS, DF, AIGC}\}
\]
The vision encoder and projector yield $T_{\mathrm{img}}$. These, together with an instruction prompt $T_{\mathrm{ins}}$ and the domain tag, are provided to the LLM. The LLM then autoregressively generates $O_{\mathrm{det}}$—typically structured as follows:

- **Detection:** Real/Fake determination
- **Location:** Region(s) of tamper
- **Basis:** Evidence citing pixel-level or semantic artifacts (e.g., “edge jaggies,” “local blurring,” “lighting inconsistencies”)

Because the LLM is primed with the domain tag, it prioritizes relevant artifact classes (e.g., blur for DeepFake), enhancing the fidelity and specificity of its explanations compared to generic multimodal LLMs.

## 7. Representative Outputs and Interpretability

Qualitative analysis demonstrates DTE-FDM’s ability to generate explanatory outputs, as exemplified below:

- **Photoshop-style Editing (CASIA1+, copy-move):**  
  - DTG: “This is a suspected Photoshop-style tampered picture.”  
  - LLM: “Detection: Tampered. Location: The two yellow petals at the center appear superimposed on the red rose bush in the mid-frame. Basis: The pasted petals’ edges are unnaturally sharp and exhibit pixel-level jaggies; resolution and color tone differ slightly from the background.”

- **DeepFake (FaceApp, glasses addition):**  
  - DTG: “This is a suspected DeepFake tampered picture.”  
  - LLM: “Detection: Tampered. Location: The subject’s glasses region (around the eyes) shows local blurring and unnatural reflections. Basis: Facial skin texture is inconsistent around the frames; the specular highlight on the lenses violates expected lighting.”

In both cases, the system leverages the domain tag to produce explanations that are not only technically grounded but also aligned to the specific tamper class, enhancing interpretability.

---

By disambiguating domain-specific artifacts, tightly coupling image features with domain labels, and generating LoRA-guided rationales, DTE-FDM elevates the capabilities of forensic AI for Photoshop-style, DeepFake, and AIGC-inpainting manipulations, setting a benchmark for explainable image forgery detection in the era of multimodal large language models [2410.02761].

Source: https://www.emergentmind.com/topics/domain-tag-guided-explainable-forgery-detection-module-dte-fdm