V-187Temporal Patch Matching
Performs temporal patch matching across frames to detect spatiotemporal inconsistencies in AI-generated video.
Algorithm / Model
Spatiotemporal Patch Matching Forensics
How it works
This method detects AI-generated video by analyzing the consistency of image patches across time — checking whether small regions of the image maintain their appearance when tracked to corresponding locations in other frames:\n\n1. Dense Patch Extraction and Matching: The method extracts overlapping patches (16×16 pixels with 8-pixel stride) from each frame and matches them to corresponding patches in neighboring frames using motion-compensated search. For each patch P(x, y, t), the method: (a) estimates its displacement to frame t+1 using optical flow, (b) extracts the corresponding patch at the predicted location, (c) computes the normalized cross-correlation (NCC) between the original and corresponding patch. In authentic video, motion-compensated patches should show NCC > 0.9 for textured regions (the same physical surface viewed from a slightly different time should look very similar). AI-generated video often shows lower NCC (0.6–0.8) because each frame is synthesized semi-independently and textures are not perfectly consistent.\n\n2. Multi-Frame Patch Consistency: Beyond adjacent-frame matching, the method tests patch consistency across longer temporal gaps. For each patch, it is matched to frames at t±1, t±3, t±5, and t±10. In authentic video, the NCC should degrade gracefully with temporal distance (due to viewpoint change, occlusion, illumination variation) — following an approximately exponential decay: NCC(Δt) ≈ NCC₀ × exp(-λΔt) with λ ≈ 0.02–0.05 per frame. AI-generated video shows more erratic NCC patterns: some patches may have high NCC at Δt=5 but low NCC at Δt=3 (non-monotonic decay), or the decay rate varies widely across spatial locations (coefficient of variation of λ > 0.5 indicates AI generation, authentic: CV < 0.2).\n\n3. Texture Re-synthesis Detection: AI generators often re-synthesize texture details frame-by-frame rather than maintaining a persistent texture. The method detects this by comparing the high-frequency components of matched patches. Using a band-pass filter (retaining spatial frequencies between π/8 and π/2), the method computes: (a) high-frequency correlation — the correlation of the high-frequency component between matched patches (authentic: > 0.7; AI-generated: < 0.4 because high-frequency detail is independently generated each frame), (b) texture orientation consistency — the dominant texture orientation (from the structure tensor) should evolve smoothly across frames (standard deviation < 5° for authentic, > 15° for AI-generated), (c) texture energy stability — the total energy in the high-frequency band should remain constant for the same physical surface (CV < 0.08 for authentic).\n\n4. Patch Anomaly Heatmap: The method generates a per-pixel anomaly heatmap by aggregating the results from overlapping patches. For each pixel, the anomaly score combines: (a) mean NCC deficit (how much the NCC falls below the 0.9 threshold), (b) NCC temporal decay non-monotonicity, (c) high-frequency correlation deficit, (d) texture orientation instability. The heatmap reveals spatially localized generation artifacts — regions where the AI generator struggled to maintain temporal consistency. Common patterns include: face boundaries showing higher anomaly than face centers, hair regions showing high anomaly (complex texture is hardest to keep consistent), and background regions near moving objects showing elevated anomaly from inpainting artifacts.
Technical Parameters
Patch size: 16×16 pixels, stride 8\nNCC threshold: > 0.9 (authentic textured regions)\nTemporal gaps: Δt = 1, 3, 5, 10 frames\nExponential decay rate λ: 0.02–0.05 per frame (authentic)\nDecay rate CV: < 0.2 (authentic)\nHigh-frequency band: π/8 to π/2\nHF correlation threshold: > 0.7 (authentic)\nTexture orientation σ: < 5° (authentic)\nTexture energy CV: < 0.08 (authentic)\nOptical flow: RAFT for motion compensation
Accuracy & Reliability
81–89% accuracy detecting AI-generated video via temporal patch matching. Adjacent-frame NCC analysis achieves AUC of 0.87. Multi-frame consistency provides F1-score of 0.85. High-frequency texture analysis adds 4–6% improvement. Performance best for textured scenes — featureless or highly blurred regions reduce discriminability.
Strengths
• Dense patch analysis provides comprehensive spatiotemporal coverage\n• Multi-scale temporal gaps capture both short and long-range inconsistencies\n• High-frequency analysis exploits fundamental weakness of per-frame generators\n• Anomaly heatmap provides spatial localization of generation artifacts\n• Works for general video content without scene-specific assumptions
Limitations
• Textureless regions (sky, walls) provide no discriminative patches\n• Large motion or occlusion reduces valid patch matches\n• Heavy compression destroys fine texture details needed for high-frequency analysis\n• Computational cost scales with frame count and resolution\n• Video stabilization may create apparent consistency improvements
Use Case
Detecting AI-generated video through texture temporal inconsistency. Forensic localization of manipulated regions in composite video. Quality assessment of video generation models. Identifying inpainting artifacts in edited video.