The past five years have witnessed an unprecedented democratization of synthetic media generation. Generative adversarial networks [1], diffusion models [2], and neural rendering pipelines have collectively reduced the technical barrier for producing photorealistic manipulated images and videos to near zero. Tools such as FaceSwap, DeepFaceLab, Stable Diffusion, and Midjourney allow non-expert users to generate convincing face swaps, voice clones, and entirely fabricated scenes within minutes. The downstream consequences of this trend are well documented: fabricated celebrity endorsements, political disinformation campaigns, identity fraud targeting financial institutions, and non-consensual intimate imagery distributed across social networks.
Social media platforms present a particularly challenging deployment context for detection systems. Content shared via WhatsApp, TikTok, and Instagram undergoes multiple rounds of transcoding and recompression, which systematically degrades the fine-grained artifacts that classical forgery detectors rely upon. The sheer volume of media exchanged also matters: WhatsApp alone processes in excess of 100 billion messages per day, making server-side scanning both economically prohibitive and operationally impractical at the per-message level. End-to-end encryption further precludes server-side inspection entirely for private communications.
On-device inference offers a compelling alternative: detection occurs locally on the user's hardware, preserving end-to-end encryption guarantees, eliminating round-trip latency to a remote API, and enabling offline operation. The primary challenge is accommodating the forensic complexity required for reliable detection within the strict compute and memory budgets imposed by mobile devices. A single-layer approach that relies exclusively on, for example, facial boundary artifacts is demonstrably brittle against contemporary generators that have been explicitly optimized to suppress such signatures [3].
This paper makes the following contributions:
The remainder of this paper is organized as follows. Section 2 reviews related work in deepfake detection and on-device machine learning. Section 3 describes the system architecture of both deployment targets. Section 4 details the six-layer forensic analysis pipeline. Section 5 presents our experimental evaluation. Section 6 discusses the results and their broader implications. Section 7 concludes.
Early face-manipulation techniques, including splicing, morphing, and 2D warping, left conspicuous spatial artifacts that were detectable by convolutional neural networks trained on frequency residuals [7]. The introduction of autoencoder-based face-swap pipelines in 2017 (popularized by the pseudonymous "deepfakes" Reddit community) initiated the modern era of synthetic media. These systems exploit a shared encoder that learns a compact representation of human faces, combined with identity-specific decoders, to perform high-fidelity face replacement at video frame rates.
Subsequent advances in GAN training stability, including progressive growing [8], StyleGAN variants [9], and identity-preserving adversarial objectives, dramatically improved synthesis quality while simultaneously reducing the low-level artifacts that first-generation detectors exploited. The emergence of latent diffusion models in 2022–2024 introduced a qualitatively different generation paradigm: rather than adversarially suppressing artifacts, diffusion-based synthesis distributes frequency energy in a manner that closely mimics natural image statistics, making detection substantially harder for single-modality classifiers.
Detection methods can be broadly categorized along two axes: the signal domain they analyze, and whether they require temporal context. Spatial-domain approaches train CNNs on pixel-space features, often augmented with noise residuals extracted by high-pass filtering [10]. Frequency-domain approaches exploit the observation that GAN-generated images exhibit distinctive spectral footprints, including checkerboard artifacts arising from transposed convolution operations [11]. Temporal approaches exploit the fact that per-frame synthesis does not enforce inter-frame consistency with respect to head pose dynamics, gaze trajectories, or fine physiological signals such as remote photoplethysmography [12].
Face-specific biological signals have emerged as a promising detection modality. Li et al. [13] demonstrated that authentic human faces exhibit correlated color channel fluctuations corresponding to cardiac activity; synthetic faces generated frame-independently lack this physiological coherence. Rossler et al. [4] introduced the influential FaceForensics++ benchmark, which became the de facto standard for supervised detection evaluation, though subsequent work has highlighted its limited generalization to in-the-wild conditions [5].
The deployment of deep learning models on mobile hardware has matured considerably with the introduction of hardware-accelerated inference engines: Apple's Core ML and Neural Engine, Android's NNAPI, and cross-platform runtimes such as TensorFlow Lite and ONNX Runtime Mobile. Quantization-aware training [14] and structured pruning allow models to operate within the 10–50 MB asset budget that mobile application stores effectively impose through download size constraints. However, deepfake detection poses particular challenges because the forensically informative features (subtle boundary artifacts, compressed frequency residuals) are precisely the high-frequency signals that aggressive quantization tends to destroy.
No prior work has specifically addressed the challenge of deploying a multi-layer forensic ensemble for deepfake detection on consumer mobile devices while maintaining the sub-300 ms latency threshold required for a fluid user experience. DeepfakeShield addresses this gap.
DeepfakeShield is architected as two complementary deployment targets that share a common forensic analysis core. The mobile client (DeepfakeShield) is implemented in React Native and targets iOS and Android. It receives media from the device's share sheet, enabling direct analysis of content forwarded from WhatsApp, TikTok, Instagram, and the system camera roll, and performs all inference on-device using the ONNX Runtime React Native package. The web service (DeepfakeShield-Web) exposes a REST API implemented in Python with FastAPI, a React frontend, and server-side inference using PyTorch. It additionally accepts URLs as input, resolving link-based media for scam detection scenarios.
Both clients produce a structured ForensicReport object containing a binary authenticity verdict, a continuous confidence score, per-layer contributing scores, and a natural-language explanation suitable for display to non-expert users.
The mobile client's architecture follows a pipeline pattern. On receiving a media item, a preprocessing module performs face detection using a lightweight BlazeFace [15] model (1.4 MB) to locate and crop the primary face region. The cropped region, along with the original full frame and raw binary data, is forwarded to the ForensicEngine, which orchestrates the six analysis layers described in Section 4. Layer outputs are aggregated by a learned fusion module (a two-hidden-layer MLP trained to weight each layer's contribution according to media type and estimated compression level). The final verdict and confidence score are rendered by the ResultScreen component.
The web service exposes three endpoints. POST /api/analyze/upload accepts multipart file uploads of images and video clips. POST /api/analyze/url accepts a URL, resolves it (following redirects and bypassing common link-shorteners), downloads the media, and processes it through the same pipeline. GET /api/report/{job_id} returns a previously computed report, enabling asynchronous workflows for longer video processing jobs. Video analysis is decomposed into per-frame jobs submitted to a Celery worker queue backed by Redis, with results aggregated and temporally smoothed before being returned to the client.
The FastAPI backend uses Pydantic for request validation and produces OpenAPI documentation automatically. Authentication is handled via API key middleware, with rate limiting enforced at the Nginx reverse proxy layer. The React frontend uses Zustand for state management and renders the forensic report as a layered breakdown, allowing users to inspect individual analysis layer contributions.
Both clients share model weights trained on identical data and use the same ensemble fusion coefficients. The mobile ONNX models are directly exported from the PyTorch server-side models using torch.onnx.export, ensuring bit-exact equivalence between mobile and server inference. Model files are versioned and stored in a public GitHub Releases artifact to enable over-the-air updates without requiring a full app store release.
Face-swap and reenactment techniques blend a synthetic face region into a source frame, and the blending boundary is one of the oldest forensic signatures in the field. DeepfakeShield extracts a 16-pixel-wide annular region around the detected face mask boundary and computes a boundary consistency score using a fine-tuned MobileNetV3-Small (3.2 MB) classifier. The classifier was trained to distinguish authentic skin-background boundaries from synthetic blends, using hard negative mining against high-quality forgeries from FaceForensics++ [4]. On static images, this layer alone achieves 84.2% AUC on the FaceForensics++ test split; its contribution diminishes for heavily recompressed media, motivating the remaining layers.
Physically plausible illumination is notoriously difficult to synthesize. A swap generator that composites a face captured under frontal studio lighting onto a source frame taken in directional outdoor light will produce a subtly inconsistent illumination field. DeepfakeShield estimates the ambient light direction for both the face region and the surrounding scene using spherical harmonic decomposition [16] and computes the cosine distance between the two estimated light direction vectors. A distance exceeding an empirically calibrated threshold (0.31 radians, determined via grid search on a held-out validation set) raises the inconsistency flag for this layer. For full videos, consistency is computed on a per-clip basis and averaged across sampled frames.
Social platform transcoding pipelines apply JPEG (for images) and H.264/H.265 (for video) compression, often multiple times as content is shared across platforms. Authentic images exhibit spatially uniform compression artifact distributions when analyzed via block-level DCT coefficient histograms. Composited regions, where a synthetic face has been pasted at a different original quality factor than the background, exhibit a characteristic double-quantization signature [17]. DeepfakeShield extracts 8×8 DCT block coefficient histograms across a 256×256 central crop and a face-aligned crop, then computes the Kullback-Leibler divergence between their distributions. A convolutional localization map highlights grid-aligned regions of anomalous compression, providing interpretable spatial evidence for the verdict.
GAN-generated and diffusion-synthesized images exhibit distinctive spectral fingerprints. Convolutional upsampling operations introduce periodic peaks in the 2D Fourier spectrum (the "GAN fingerprint" [11]), while diffusion models suppress high-frequency spatial content in a manner inconsistent with natural lens optics and sensor noise. DeepfakeShield computes the 2D FFT of the face-aligned crop, extracts the magnitude spectrum in polar coordinates (log-polar binning with 72 angular bins and 64 radial bins), and classifies the resulting 4,608-dimensional feature vector with a gradient-boosted tree classifier (XGBoost, 1.1 MB). Frequency-domain analysis is particularly valuable for detecting fully synthetic "face generation" (as opposed to face swaps), where no real face is present at all.
For video inputs, temporal analysis is the most discriminative single layer. Frame-by-frame synthesis does not preserve the subtle inter-frame dynamics of authentic human faces: micro-expression trajectories, head-pose jitter statistics, and eyelid kinematics all exhibit characteristic statistics in real footage that are not enforced by per-frame generators. DeepfakeShield extracts 68-point facial landmarks using MediaPipe Face Mesh on each sampled frame (at 2 fps for efficiency), computes inter-frame landmark velocity fields, and applies a one-class isolation forest trained on authentic facial motion statistics. Anomaly scores are averaged across the clip. For image inputs, this layer is bypassed and its weight in the fusion module is redistributed proportionally to the remaining layers.
EXIF and container metadata provide low-cost forensic signals that are often overlooked by image-focused detection systems. DeepfakeShield extracts and cross-validates: (a) creation timestamp vs. last-modified timestamp consistency; (b) reported camera make and model against known sensor noise profiles (using a lightweight noise fingerprint database of 2,200 device models); (c) GPS coordinate plausibility relative to capture time; and (d) the software field for traces of known generation or editing tools (Stable Diffusion, Midjourney, DALL-E, ComfyUI, etc.). Metadata is also cross-referenced against the media's content hash when link-based inputs are processed by the web service, enabling detection of recycled or rehosted synthetic media. While metadata can be stripped or falsified, its absence or inconsistency raises the suspicion score for this layer without being treated as conclusive evidence.
The six layer scores are combined by a learned fusion MLP (64-32-1 hidden units, ReLU activations, sigmoid output) trained with binary cross-entropy loss on a held-out fusion training set of 45,000 items. The MLP receives the six raw scores alongside three meta-features: estimated compression level (JPEG quality factor or video bitrate per pixel), media type (image vs. video), and whether metadata was present. This conditioning allows the fusion module to down-weight layers known to degrade under heavy compression and to up-weight temporal analysis for video content. Ablation results (Table 2) confirm that learned fusion outperforms fixed-weight averaging by 2.1 percentage points in F1 score across the evaluation benchmarks.
We evaluate on four datasets. FaceForensics++ (FF++) [4] contains 1,000 original videos and 4,000 manipulated videos generated by four methods (DeepFakes, Face2Face, FaceSwap, NeuralTextures) at three compression levels (raw, HQ, LQ). Celeb-DF v2 [5] contains 590 real and 5,639 celebrity deepfake videos, and is widely regarded as more challenging than FF++ due to higher visual quality. DFDC [6] (DeepFake Detection Challenge) contains 119,154 clips across a diverse demographic spread, representing the most realistic large-scale benchmark. SocialDF-2026 is our newly collected corpus of 14,800 media items (8,200 authentic, 6,600 synthetic) sampled from public posts on Instagram Reels, TikTok, and WhatsApp Status updates, with synthetic items independently verified by two human annotators with inter-annotator agreement (Cohen's κ = 0.89).
We compare against five baselines: (1) Xception [4], the canonical supervised deepfake detector fine-tuned on FF++; (2) EfficientNet-B4 fine-tuned without our multi-layer augmentation; (3) RECCE [18], a reconstruction-based detector; (4) LipForensics [12], a temporal lip-motion detector; and (5) UniFace, a recent unified face forgery detector. All baselines are evaluated using publicly released weights without re-training, except where noted.
We report binary classification accuracy (ACC), area under the ROC curve (AUC), F1 score, and video-level AUC where applicable. For the mobile client, we additionally report mean inference latency (ms) measured across 500 runs on a Snapdragon 8 Gen 2 device and an Apple A16 Bionic device, and peak memory footprint (MB).
| Method | FF++ (LQ) ACC | Celeb-DF AUC | DFDC AUC | SocialDF-2026 F1 |
|---|---|---|---|---|
| Xception [4] | 89.2% | 73.3% | 70.9% | 71.4% |
| EfficientNet-B4 (no layers) | 90.4% | 76.1% | 72.8% | 74.2% |
| RECCE [18] | 91.0% | 77.4% | 73.5% | 75.8% |
| LipForensics [12] | 82.4% | 82.6% | 73.5% | 69.3% |
| UniFace | 91.8% | 79.2% | 74.1% | 76.0% |
| DeepfakeShield (ours) | 93.9% | 84.7% | 78.2% | 82.1% |
| Layer Configuration | SocialDF-2026 F1 | DFDC AUC |
|---|---|---|
| Boundary only | 70.3% | 69.1% |
| Frequency only | 72.8% | 71.4% |
| Temporal only (video) | 74.1% | 73.0% |
| Boundary + Frequency + Compression | 78.4% | 75.2% |
| All 6 layers, fixed-weight avg. | 80.0% | 76.8% |
| All 6 layers, learned fusion (ours) | 82.1% | 78.2% |
| Platform | Mean Latency (ms) | Peak Memory (MB) | Model Size (MB) | Battery Draw (mAh/100 inferences) |
|---|---|---|---|---|
| Apple A16 Bionic (iPhone 14 Pro) | 187 ± 22 | 94 | 12.3 | 8.4 |
| Snapdragon 8 Gen 2 (Samsung S23) | 241 ± 31 | 108 | 12.3 | 11.2 |
| MediaTek Dimensity 1200 (mid-range) | 298 ± 47 | 112 | 12.3 | 14.8 |
All three devices satisfy the sub-300 ms target for static images. For video clips, latency scales approximately linearly with sampled frame count; a 15-second clip at 2 fps sampling averages 1,840 ms on the A16 Bionic and 2,610 ms on the Dimensity 1200. These latencies are acceptable for the background-processing pattern employed by the React Native client, which displays a progress indicator while processing video.
The web service's URL input mode additionally evaluates link reputation against a database of 1.2 million flagged domains sourced from PhishTank, OpenPhish, and an in-house crawler. Of 3,400 scam-adjacent URLs submitted by beta testers over a 60-day evaluation period, 91.7% were correctly flagged as suspicious based on either domain reputation, resolved media authenticity, or both. The false positive rate on a matched set of legitimate news media URLs was 2.3%.
The mobile client and web service each offer distinct forensic capabilities that reflect the fundamental constraints of their deployment environments. The mobile client is optimized for low latency and privacy preservation: inference occurs entirely on-device, no media bytes leave the user's handset, and the application functions without network connectivity. These properties are essential for analyzing end-to-end encrypted media received via WhatsApp, where server-side scanning is architecturally precluded. However, the mobile client's model compression imposes a measurable accuracy cost: INT8 quantization of the backbone reduces SocialDF-2026 F1 by 1.9 percentage points relative to the full-precision server-side model (82.1% vs. 84.0%).
The web service trades latency and privacy for analytical depth. Server-side models run at full FP32 precision with no memory constraints, temporal analysis can be applied to longer clips, and the scam link resolution feature is only feasible with network access. The web service is best suited for professional fact-checking workflows, journalism, and legal evidence assessment, where the higher accuracy and detailed provenance reporting justify the privacy trade-off.
Any detection system deployed at scale becomes a target for adversarial adaptation. Generators whose training objective includes fooling DeepfakeShield's detection layers could, in principle, suppress the forensic signals that drive our ensemble. This concern is partially mitigated by the diversity of our six layers: simultaneously optimizing synthesis to suppress boundary artifacts, lighting inconsistencies, compression double-quantization, frequency fingerprints, temporal dynamics, and metadata anomalies constitutes a substantially harder adversarial objective than evading any single layer. We acknowledge, however, that sufficiently motivated adversaries (particularly state-level or well-resourced criminal actors) may eventually succeed in defeating the current ensemble.
The appropriate long-term response is not to treat detection as a solved problem but to design sociotechnical systems in which detection is one layer of a broader trust architecture. Content authenticity standards such as the C2PA (Coalition for Content Provenance and Authenticity) specification [19] complement detection by enabling cryptographic provenance verification at capture time, providing a complementary chain-of-custody signal that is independent of synthesis quality. DeepfakeShield's metadata layer already parses C2PA manifests where present, and we plan to expand this integration in future work.
Prior work has documented that deepfake detectors trained predominantly on Western celebrity datasets exhibit reduced accuracy on subjects with darker skin tones and on face types underrepresented in standard training corpora [5]. We partially address this through demographic-stratified sampling in our SocialDF-2026 corpus and by applying augmentation during training that simulates a range of skin tones via color jitter and histogram equalization. Preliminary analysis of our evaluation results stratified by Fitzpatrick scale shows that DeepfakeShield's false negative rate (missed deepfakes) is 7.3% for Fitzpatrick types I–II versus 9.8% for types V–VI. This disparity remains below that of all baselines but is nonetheless a priority area for improvement. We release our stratified evaluation splits to facilitate reproducible fairness auditing by the research community.
The conceptual framing of DeepfakeShield as a "Shazam for Deepfakes" reflects a deliberate user experience philosophy. Shazam's genius lies not in its signal processing algorithms, which build on decades of prior work in audio fingerprinting, but in its ambient, zero-friction interaction model: the user hears an unfamiliar song, raises their phone, and receives a definitive identification within seconds. The cognitive and behavioral barrier to use is nearly zero.
DeepfakeShield aims to achieve the same ambient quality for media authenticity. The share sheet integration means the user never needs to open a separate application, navigate to an upload interface, or wait for a server round-trip. The result is delivered as a binary verdict with an intuitive confidence meter and, where appropriate, a plain-language explanation of the most discriminative forensic signal. User studies with 42 participants during beta testing indicated that 89% found the one-tap workflow "very easy" or "easy" to use, and 76% reported that the explanations increased their trust in the verdict. However, 31% expressed concern about false negatives, cases where the system reported authentic for a media item they believed was manipulated, highlighting the importance of appropriate uncertainty communication in the UI.
Several limitations constrain the current framework. First, the system requires at least one detectable face region; purely text-based disinformation and non-face deepfakes (body swaps, voice synthesis without a visual component) fall outside its scope. Second, very short video clips (under 3 seconds) do not provide sufficient temporal signal for reliable Layer 5 analysis. Third, the metadata layer's utility degrades substantially for media that has been stripped of EXIF data, which is standard practice for all major social platforms. Finally, the SocialDF-2026 corpus, while more ecologically valid than prior benchmarks, was collected over a specific 90-day window; the distribution of synthesis methods will evolve as the generative ecosystem continues to advance.
We presented DeepfakeShield, a multi-layer forensic framework for on-device and server-side detection of AI-generated media, deployed as a React Native mobile application and a Python/FastAPI web service. By combining six complementary forensic analysis layers (face boundary analysis, lighting consistency, compression artifact detection, frequency domain fingerprinting, temporal coherence, and metadata verification) within a learned ensemble fusion module, DeepfakeShield achieved 93.9% accuracy on FaceForensics++ (LQ), 84.7% AUC on Celeb-DF, and 82.1% F1 on our novel SocialDF-2026 benchmark, outperforming all evaluated baselines. On-device inference on current flagship mobile hardware meets the sub-300 ms latency target required for ambient, zero-friction user experiences.
The "Shazam for Deepfakes" paradigm, where detection is passive, instantaneous, and integrated into the media consumption workflow rather than requiring deliberate forensic inquiry, represents a promising direction for democratizing media authenticity verification. We release the benchmark splits, model weights, and evaluation code to facilitate future research.