Skip to content

Face X-ray for More General Face Forgery Detection

arXiv · 2019

In brief

This paper proposes face X-ray, a novel image representation for detecting face forgery by identifying blending boundaries between the manipulated face and background. The key insight is that most face manipulation methods (DeepFakes, Face2Face, FaceSwap, NeuralTextures) share a common blending step that leaves detectable image discrepancies. Critically, the model can be trained on blended composites of real images without access to forged images generated by actual manipulation methods, achieving strong generalization to unseen manipulation techniques.

Contributions

  • A novel greyscale image representation (face X-ray) that reveals blending boundaries in forged images and produces blank output for real images.
  • A training data generation pipeline that creates labeled face X-ray pairs using only real images and synthetic blending, without requiring fake images from any specific manipulation algorithm.
  • Demonstration that detecting blending artifacts generalizes better than detecting manipulation-specific artifacts, with high accuracy on unseen face manipulation techniques.
  • Extensive benchmarks on FaceForensics++, DeepfakeDetection, DFDC, and Celeb-DF showing significant improvements in cross-method generalization compared to state-of-the-art detectors like Xception.

Method

The paper is motivated by observing that each image carries distinctive marks from hardware (sensor, CFA interpolation, noise) and software (compression, synthesis algorithm). When two images are blended, intrinsic discrepancies appear at the blending boundary due to these different acquisition characteristics.

Face X-ray is formally defined for an input image I as a greyscale image B where B_ij = 4 · M_ij · (1 − M_ij), with M being the blending mask. For real images, M is trivial (all 0s or all 1s), yielding a blank face X-ray. For forged images, the boundary region exhibits peaks in this computation, revealing the blending location.

Training data generation creates synthetic blended images from real images only: (1) given a background face I_B, find a foreground face I_F via landmark-based nearest neighbor search, (2) generate a mask as the convex hull of face landmarks plus random deformation and blur, (3) blend the images using color correction. This produces training pairs {I, B, c} where c indicates real/blended.

The detection framework uses HRNet as the backbone to predict the face X-ray B̂ from input I, then applies global average pooling and a fully connected layer to output the real/fake classification. Training uses cross-entropy loss on both the face X-ray prediction and the binary classification, with a loss weight λ=100 favoring the X-ray prediction.

Results

On FaceForensics++ test sets (unseen manipulation types), the method achieves 97.97% AUC when trained on combined FaceForensics++ and blended images. More notably, training on blended images only (no actual forged images) still achieves 99.17% AUC on DeepFakes, 98.57% on Face2Face, 98.21% on FaceSwap, and 98.13% on NeuralTextures—vastly outperforming baseline classifiers that drop to 39–80% AUC on unseen manipulations.

On external datasets (DFD, DFDC, Celeb-DF), the method trained on blended + real images achieves 95.40% AUC on DFD, 80.92% on DFDC, and 80.58% on Celeb-DF, compared to Xception's 87.86%, 48.98%, and 36.19% respectively. Visualizations confirm that predicted face X-rays reliably match groundtruth blending boundaries across all manipulation types.

Limitations and Discussion

The method relies on the existence of a blending step, so entirely synthetic images (without blending) may not be detected. Additionally, adversarial attacks can be crafted against the detector. The framework also suffers on heavily compressed videos (LQ version of FaceForensics++ achieves 61.6% AUC vs. 87.35% on HQ), as blending evidence becomes less significant.

Notes

This is a key contribution to deepfake detection due to its generalization ability. The insight that training on synthetic blended pairs (real+real) matches the generalization performance of training on actual forged images is significant and counterintuitive. The method cleverly bypasses the need for access to manipulation-specific artifacts by focusing on the universal blending step. The loss weighting (λ=100) heavily favors X-ray prediction quality, demonstrating that explicit intermediate representation learning improves both interpretability and robustness.

How it connects

Similar papers

Summarized from the full text. Added 2026-11-10 from a submission by reza. Every statement on this page traces back to the source.