PHORENSICS: Physics-Based Deterministic Deepfake Detection Engine

PHORENSICS is a deterministic, open-source deepfake detection engine that bypasses traditional black-box deep learning. Instead, it utilizes structural physics—specifically Global Spectral Analysis via Fast Fourier Transforms (FFT) and spatial statistics (PRNU noise)—to mathematically verify digital media authenticity.

Model Details

Model Description

Unlike conventional Convolutional Neural Networks (CNNs) that rely on learned weights from static datasets, PHORENSICS is a zero-shot, physics-based verification engine wrapped in the Hugging Face transformers API.

By analyzing the physical diffusion of light (Spatial Frequency vs. Signal Energy) and the structural integrity of digital sensor noise (PRNU), the engine detects generative manipulation without needing to "see" prior examples of a specific deepfake architecture (e.g., Diffusion models, GANs).

To ensure seamless deployment in enterprise and academic pipelines, the spatial convolution kernels (such as the Laplacian noise extractor) and mathematical safety thresholds are serialized as PyTorch tensor buffers within the .safetensors format, allowing native integration with AutoModel.

  • Developed by: Anuran Bhattacharya
  • Model type: Deterministic Media Forensics / Signal Processing Model
  • Language(s) (NLP/CV): Python, PyTorch, OpenCV, NumPy
  • License: MIT
  • Methodology: Fast Fourier Transform (FFT) Decay Analysis, Error Level Analysis (ELA), and Vectorized Spatial Z-Score Distribution.

Model Sources

Uses

Direct Use

PHORENSICS is designed for researchers, journalists, and security engineers requiring highly explainable multimodal fact-checking. It is used to:

  1. Detect AI-generated generative media (Diffusion, GAN) by mapping non-physical spatial frequency decay curves.
  2. Detect localized spatial manipulation (splicing, inpainting) through structural sensor noise anomalies.
  3. Serve as an explainable metric for automated trust-and-safety pipelines.

Out-of-Scope Use

The engine evaluates structural physics and digital signal integrity. It is not intended for:

  • Facial recognition or biometric identity verification.
  • Analyzing heavily analog-degraded media (e.g., scanned physical photographs or 3rd-generation VHS rips) without recalibrating the optical coefficient bounds.

Bias, Risks, and Limitations

Technical Limitations

Because the engine relies on natural physical decay and sensor noise mappings:

  1. Aggressive ISP Sharpening: Modern smartphone Image Signal Processors (ISPs) apply artificial sharpening that disrupts natural noise. To counter this, the engine applies an Optical Calibration Coefficient (0.70) to raw signals to normalize real-time web imagery against theoretical bounds.
  2. Extreme Compression: Images compressed below JPEG Quality 40 may exhibit quantization blocking that degrades the natural PRNU noise signature, slightly lowering the spatial confidence score.

Recommendations

Downstream users should utilize the engine's bi-modal output (FFT Probability + Noise Z-Score) as a fused metric. An FFT decay score (alpha_value) between 2.0 and 3.5 combined with a max noise Z-score > 3.5 acts as a definitive mathematical proof of generative intervention.

How to Get Started with the Model

Because PHORENSICS registers its custom deterministic engine into the Hugging Face ecosystem, it can be loaded identically to a standard deep learning model.

from transformers import AutoModel
import torch

# 1. Download and load the deterministic physics engine
# trust_remote_code=True executes the spatial logic in phorensics_model.py
engine = AutoModel.from_pretrained("Anuran66/Phorensics-Engine", trust_remote_code=True)

# 2. Hardware mapping (Automatically loads .safetensors kernel to VRAM)
device = "cuda" if torch.cuda.is_available() else "cpu"
engine = engine.to(device)

# 3. Run Inference on a target asset
telemetry = engine("path_to_suspect_image.jpg")

print(f"Deepfake Detected: {telemetry['is_fake']}")
print(f"Threat Probability: {telemetry['threat_probability']}%")
print(f"FFT Alpha Decay: {telemetry['fft_alpha_value']}")
print(f"Max Noise Z-Score: {telemetry['max_noise_z']}")
Downloads last month
20
Safetensors
Model size
9 params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support