DEEPGUARD AI - quantized ONNX detectors
CPU-friendly int8 ONNX exports of two public checkpoints, packaged for the DEEPGUARD AI platform (graduation project, Faculty of AI, Menoufia University).
| File | Source checkpoint | Task | Size |
|---|---|---|---|
image_int8.onnx |
Organika/sdxl-detector | real photograph vs AI-generated image (Swin) | ~95 MB |
audio_int8.onnx |
mo-thecreator/Deepfake-audio-detection | real vs synthetic speech (wav2vec2) | ~122 MB |
The *_config.json and image_preprocessor_config.json files are copied from
the source checkpoints; the labels, preprocessing and input shapes are the
original authors'.
Preprocessing (image)
Resize to 224x224 using the model's own preprocessor (bicubic), rescale by
1/255, normalize with ImageNet mean/std, NCHW float32. Labels:
{0: artificial, 1: human}.
Preprocessing (audio)
16 kHz mono float32, per-clip zero mean / unit variance, 4-second windows
averaged. Labels: {0: fake, 1: real}.
Quantization
onnxruntime.quantization.quantize_dynamic, QInt8 weights, restricted to
MatMul/Gemm (the ViT patch-embedding Conv stays float because the CPU
execution provider has no ConvInteger kernel). On our test files the int8
outputs stay within about one point of the float32 torch pipeline.
Limits - read before using
- The image detector separates SDXL/Flux-style generated images from real photographs well (18/18 on our check set) but is not a general-purpose forensic tool: heavy re-compression or upscaling can push a real photo towards fake.
- The audio detector flagged 4 of 5 synthetic samples (gTTS en/ar, Edge neural ar) and the real human recording correctly; one English neural voice passed as real.
- Neither model is a forensic proof. Scores are model outputs, not calibrated probabilities.
- Licenses follow the source checkpoints; check both model cards before commercial use.
Usage
import onnxruntime as ort, numpy as np
from PIL import Image
sess = ort.InferenceSession("image_int8.onnx", providers=["CPUExecutionProvider"])
img = Image.open("photo.jpg").convert("RGB").resize((224, 224), Image.BILINEAR)
x = (np.asarray(img, dtype="float32") / 255.0 - 0.5) / 0.5
x = np.transpose(x, (2, 0, 1))[None, ...]
logits = sess.run(None, {sess.get_inputs()[0].name: x})[0][0]
print(logits) # [artificial_logit, human_logit]