TemporalConsistencyDetector<T>
Models & Types · AiDotNet.Safety.Video
Detects deepfake videos by analyzing temporal consistency between consecutive frames.
Inheritance: ModelBase<T, Vector<T>, Vector<T>> → SafetyModuleBase<T> → VideoSafetyModuleBase<T> → TemporalConsistencyDetector<T>
For Beginners
When someone creates a fake video (deepfake), the way objects and faces change between frames is often slightly “off” compared to real video. This module looks at how each frame differs from the previous one and flags videos where those differences look unnatural.
How It Works
Deepfake videos often exhibit subtle temporal inconsistencies that are not present in authentic video. This module analyzes frame-to-frame differences to detect anomalies in motion, color, and spatial coherence that are characteristic of AI-generated or manipulated video content.
Detection approach:
- Compute frame-to-frame difference statistics (mean absolute difference, variance)
- Analyze temporal smoothness — real video has consistent motion patterns
- Detect sudden discontinuities that may indicate frame manipulation
- Check for periodic artifacts from frame-by-frame generation
- Measure temporal jitter — variation in frame difference magnitudes
References:
- Spatio-temporal consistency for video deepfake detection (2025)
- NACO: Self-supervised natural consistency for face forgery detection (ECCV 2024)
- Generalizable deepfake detection across benchmarks (CVPR 2025)
- FakeFormer: Efficient vulnerability-driven face forgery detection (2024)
Constructors
| Constructor | Summary |
|---|---|
TemporalConsistencyDetector(double threshold) |
Initializes a new temporal consistency detector. |
Properties
| Property | Summary |
|---|---|
int MinimumFrames { get; } |
|
string ModuleName { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<SafetyFinding> EvaluateVideo(IReadOnlyList<Tensor<T>> frames, double frameRate) |