ForgePerceiver: Deepfake Detection Module
- ForgePerceiver is a specialized module in VLAForge that leverages learnable query tokens to capture diverse deepfake forgery cues while preserving CLIP’s pretrained vision-language alignment.
- It processes mid-level visual tokens from a frozen CLIP encoder using task-specific projections to generate both a global authenticity score and a coarse patch-level localization map.
- The module fuses coarse forgery localization with identity-aware semantic prompts, enabling robust frame- and video-level detection of deepfake manipulations.
ForgePerceiver is the component in VLAForge that enhances the visual perception of a pre-trained Vision-LLM for Deepfake Video Detection by acting as an independent learner that captures diverse, subtle forgery cues both granularly and holistically while preserving pretrained Vision-Language Alignment knowledge (Zhu et al., 25 Mar 2026). Within the overall framework, it receives mid-level visual tokens from the frozen CLIP visual encoder, uses learnable query tokens as forgery priors, produces both a global authenticity score and a coarse patch-level localization map, and supplies forgery-sensitive signals that are later coupled with identity-aware cross-modal semantics to form the Identity-Aware VLA score (Zhu et al., 25 Mar 2026).
1. Position within VLAForge
ForgePerceiver is introduced in a setting where existing Deepfake Video Detection approaches based on pre-trained Vision-LLMs such as CLIP are described as relying primarily on visual features while overlooking the rich vision-language semantics embedded in the latent space (Zhu et al., 25 Mar 2026). In that context, VLAForge is defined by two coordinated mechanisms: ForgePerceiver strengthens visual forgery perception, and the Identity-Aware VLA score provides a complementary discriminative cue derived from cross-modal semantics coupled to the forgery cues learned by ForgePerceiver (Zhu et al., 25 Mar 2026).
Its role is therefore not restricted to feature extraction in the conventional sense. The module is explicitly designed to preserve the frozen CLIP alignment while adding a task-specific learner for forgery artifacts. This suggests a division of labor in which CLIP retains general-purpose vision-language structure and ForgePerceiver injects deepfake-specific discrimination without altering the underlying visual or textual encoders.
The paper characterizes the resulting cue hierarchy in three levels: global cues through the global authenticity score , coarse spatial cues through the localization map , and fine-grained, identity-aware semantics through (Zhu et al., 25 Mar 2026). ForgePerceiver directly supplies the first two and conditions the third indirectly by refining the class-token representation used in identity prior-informed prompting.
2. Inputs, outputs, and parameterization
ForgePerceiver operates on visual tokens
described as patch embeddings taken from a mid-level layer of the frozen CLIP visual encoder , where is the patch grid and is the token dimension (Zhu et al., 25 Mar 2026). The consolidated description gives the example of a grid for ViT-L/14 and dimension $1024$.
It also uses learnable query tokens
with 0 independent “forgery priors,” where 1 by default (Zhu et al., 25 Mar 2026). These query tokens are central to the module’s attempt to cover multiple forgery manifestations. The paper states that multiple query tokens 2 and heads 3 ensure multi-scale, multi-view coverage of different artifact types (Zhu et al., 25 Mar 2026).
The outputs are twofold:
- a global authenticity score
4
defined as one real-vs.-fake logit;
- a localization map
5
defined as a coarse patch-level heatmap of forgery probabilities (Zhu et al., 25 Mar 2026).
The module first projects the visual and query tokens into task-specific spaces:
6
where 7 is the number of attention heads in the CLIP ViT, given as 8 in the example configuration (Zhu et al., 25 Mar 2026). A third projection,
9
is used for localization (Zhu et al., 25 Mar 2026).
These design choices distinguish ForgePerceiver from direct classifier heads over CLIP features. The module introduces a query-based latent interface that is neither a generic pooling operator nor an end-to-end finetuning scheme.
3. Forgery-aware masking and holistic authenticity estimation
A core mechanism in ForgePerceiver is the construction of forgery-aware masks. For each head 0, a head-specific mask is computed from the similarity between each query and each patch feature:
1
Each 2 is reshaped to size 3 and then averaged across heads to obtain
4
To encourage diversity among the 5 masks, the framework applies an orthogonality loss:
6
where 7 flattens a map to a vector (Zhu et al., 25 Mar 2026). This loss is intended to make different query-associated masks capture different artifacts. A plausible implication is that the query set functions as a structured basis over heterogeneous forgery cues rather than as redundant replicas.
In the holistic branch, the CLIP class token 8 is replicated into 9 copies 0, and each query-wise mask is injected into the CLIP self-attention bias at each ViT block (Zhu et al., 25 Mar 2026). After 1 layers, the refined class tokens 2 are pooled and passed through a small MLP 3 to produce the global forgery logit 4 (Zhu et al., 25 Mar 2026). Optimization of this branch uses cross-entropy loss 5 (Zhu et al., 25 Mar 2026).
Conceptually, this branch makes ForgePerceiver more than an auxiliary detector attached to frozen features. The masks intervene in the attention pathway that forms the final class-token representation, so the resulting global score aggregates forgery evidence holistically rather than merely summarizing already fixed token embeddings.
4. Coarse localization and interaction with identity-aware semantics
ForgePerceiver also provides coarse forgery localization. Using 6 and the same query tokens 7, the model recomputes 8 localization maps exactly as in the mask-construction step, then fuses them with a small 9 convolution head 0:
1
The map is upsampled to the original image resolution and supervised against the ground-truth mask 2 using the localization loss 3 (Zhu et al., 25 Mar 2026).
This coarse map is not the final local discriminative signal in VLAForge. Instead, it is combined with a distinct patch-level VLA attention map that arises from identity prior-informed prompts. The prompting mechanism uses two templates: “This is a real photo of <id> person.” and “This is a fake photo of <id> person.” These are tokenized into embeddings 4, and for each frame the 5-th token corresponding to <id> is replaced by the final CLIP class token 6:
7
The refined prompts 8 are passed through the frozen CLIP text encoder 9 to obtain identity-aware text features 0 (Zhu et al., 25 Mar 2026).
Patch tokens 1 are extracted from 2, projected via a small adapter 3, and converted into a two-class soft attention map:
4
This map is upsampled and supervised against 5 with a Dice loss 6 (Zhu et al., 25 Mar 2026).
The final local fusion stage multiplies the coarse ForgePerceiver localization with the identity-aware VLA map and passes the result through a small convolutional network 7:
8
A scoring head 9 then produces 0, trained with cross-entropy loss 1 (Zhu et al., 25 Mar 2026).
This arrangement makes ForgePerceiver foundational to the local branch: 2 supplies forgery-sensitive spatial structure, while 3 supplies semantics aligned to “real/fake of this person.” The paper explicitly describes the latter as fine-grained, identity-aware semantics (Zhu et al., 25 Mar 2026).
5. Training and inference recipe
The training pipeline begins by sampling a batch of frames 4 with batch size 5, each carrying a ground-truth label 6 and, when available, a mask 7 (Zhu et al., 25 Mar 2026). Frames are resized to 8 and fed into the frozen CLIP visual encoder 9 to extract the class token 0, patch tokens 1, and mid-layer visual tokens 2 for ForgePerceiver (Zhu et al., 25 Mar 2026).
The sequence of operations is specified explicitly in the consolidated description:
- compute 3 and 4;
- inject 5 into CLIP self-attention to refine 6;
- obtain 7 through 8 and compute 9;
- upsample $1024$0 and compute $1024$1;
- build identity-aware prompts, replace
<id>with $1024$2, and encode with $1024$3 to obtain $1024$4; - compute $1024$5 and $1024$6;
- fuse $1024$7 into $1024$8, score with $1024$9, and compute 0 (Zhu et al., 25 Mar 2026).
The total training objective is
1
Only ForgePerceiver and the associated lightweight heads and projections are updated: 2, 3, 4, 5, 6, 7, 8, and 9 (Zhu et al., 25 Mar 2026). Optimization uses Adam with 00 and 01 for 15 epochs on one RTX3090 (Zhu et al., 25 Mar 2026).
The hyperparameters listed for the configuration are batch size 02, image size 03, 04 query tokens, 05 CLIP heads, and fusion weight 06 (Zhu et al., 25 Mar 2026). The description also states that there is no fine-tuning of the CLIP 07 or 08 weights, so pretrained VLA knowledge is fully preserved (Zhu et al., 25 Mar 2026).
During inference, each test frame 09 yields both 10 and 11, which are combined into the final frame-level score
12
For video-level prediction, frame scores are averaged over 13 frames:
14
This makes ForgePerceiver relevant at both frame and video levels, since one of the two fused frame-level terms is generated directly by its global branch and the other depends on its coarse localization (Zhu et al., 25 Mar 2026).
6. Interpretation, scope, and common points of confusion
ForgePerceiver is specifically characterized as an independent learner. It is therefore not equivalent to finetuning CLIP, nor to attaching a standard classification head to frozen CLIP features. The description is explicit that CLIP visual and text encoders remain frozen and that only ForgePerceiver and associated lightweight modules are trained (Zhu et al., 25 Mar 2026). A common source of confusion is to treat the refined class token as evidence of end-to-end adaptation of CLIP itself; the architecture instead preserves pretrained Vision-Language Alignment knowledge while injecting forgery-aware masks into self-attention (Zhu et al., 25 Mar 2026).
Another potential misconception is to identify ForgePerceiver solely with localization. The module indeed outputs a coarse patch-level heatmap, but it also drives the global authenticity branch through class-token modulation and indirectly conditions the identity-aware text prompting by providing the final class token 15 used to replace the <id> token in the text templates (Zhu et al., 25 Mar 2026). Its contribution is therefore simultaneously global, local, and cross-modally consequential.
The framework further distinguishes between coarse localization and fine-grained semantics. 16 indicates which patches are more likely forged, whereas 17 explicitly aligns patches to “real/fake of this person” (Zhu et al., 25 Mar 2026). This separation matters methodologically: ForgePerceiver is responsible for forgery-sensitive perception, while identity-aware prompting supplies a semantic discriminator tailored to each identity.
Within the paper’s empirical framing, VLAForge is reported to substantially outperform state-of-the-art methods at both frame and video levels on video DFD benchmarks including classical face-swapping forgeries and recent full-face generation forgeries (Zhu et al., 25 Mar 2026). Since ForgePerceiver is one of the two principal mechanisms of VLAForge, this suggests that the module’s query-based masking and localization strategy are integral to the framework’s discriminability, although the consolidated description does not isolate a standalone metric for ForgePerceiver by itself.