g
gcw_C8PI9e90/open-deepfake-detection-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Open Deepfake Detection - NPU 适配

Model Info

  • Original Model: prithivMLmods/open-deepfake-detection
  • Architecture: SiglipForImageClassification (SigLIP2 fine-tuned)
  • Parameters: 92,885,762
  • Labels: {0: "Fake", 1: "Real"}
  • Task: Open-set deepfake image classification

Environment

ComponentVersion
PyTorch2.9.0
torch_npu2.9.0.post1
Ascend CANN8.5.1
NPUAscend 910B4 (29.5GB)
Transformers4.57.6

Files

FileDescription
inference.pySingle-image inference + benchmark mode
accuracy_run.pyCPU vs NPU accuracy validation
accuracy_run_perf.pyNPU performance benchmark
result.jsonSample inference result
accuracy_report.jsonAccuracy validation report
perf_report.jsonPerformance benchmark report

Usage

Single Image Inference

python3 inference.py \
  --model_path /path/to/open-deepfake-detection \
  --image /path/to/face_image.jpg \
  --output result.json

Performance Benchmark

python3 accuracy_run_perf.py /path/to/open-deepfake-detection 10 perf_report.json

Accuracy Validation

python3 accuracy_run.py \
  --model_path /path/to/open-deepfake-detection \
  --output accuracy_report.json

Performance Results (Ascend 910B4)

MetricValue
Avg Latency10.37 ms
Median Latency10.28 ms
P90 Latency10.58 ms
P99 Latency11.40 ms
Min Latency10.13 ms
Max Latency11.93 ms
Throughput96.44 img/s

Sample Output

{
  "predicted_class_id": 1,
  "predicted_label": "Real",
  "probabilities": [0.4700, 0.5300],
  "inference_time_ms": 16409.99
}

First inference includes JIT compilation overhead (~16s). Subsequent inferences average ~10.4ms.

Notes

  • This model is the open-set variant of deepfake detection (vs. deepfake-detector-model-v1 which is the closed-set version)
  • Both models share identical architecture and parameter count
  • open-deepfake-detection shows marginally better throughput (~96 vs ~90 img/s on 910B4)