Deepfake Detection, Synthetic Document Check, Face Liveness — 3 types
Classification
Classification types run fraud checks on images. They return a verdict label and confidence score rather than extracted fields.
These types are used for identity fraud prevention, document fraud detection, and KYC liveness verification. For the full picture of what each check catches — and how to gate cases on the verdicts — see Deepfake Detection, Liveness, Synthetic & Tampered Documents, and Goal Rules.
deepfake_detection — Deepfake Detection
Analysis type: fraud check
Detects whether a face image or video frame has been synthetically generated or manipulated using deepfake techniques. Used to protect selfie / liveness flows from AI-generated faces.
Fields extracted
| Field | Type | Notes |
|---|---|---|
label | string | real or deepfake |
confidence | number | Float 0-1 — confidence in the predicted label |
manipulation_regions | list | Detected manipulation regions, or null |
Validation rules
| Field | Rule |
|---|---|
label | Required · Regex ^(real|deepfake)$ |
confidence | Required |
Example
const result = await client.verify.check({
check: "deepfake_detection",
file_url: "https://storage.example.com/selfie.jpg",
});
// result.output.label → "real"
// result.output.confidence → 0.97
// result.output.manipulation_regions → null
Reject the submission if label === "deepfake" or confidence < 0.80.
const { label, confidence } = result.output;
if (label === "deepfake" || confidence < 0.80) {
throw new Error("Face image failed deepfake check");
}
document_synthetic_check — Synthetic Document Check
Analysis type: fraud check
Detects whether a document image (ID card, passport, bank letter, etc.) has been digitally fabricated, template-filled, or edited. Complements OCR extraction by flagging suspicious documents before field validation runs.
Fields extracted
| Field | Type | Notes |
|---|---|---|
label | string | real or synthetic |
confidence | number | Float 0-1 |
risk_level | string | low, medium, or high |
Validation rules
| Field | Rule |
|---|---|
label | Required · Regex ^(real|synthetic)$ |
confidence | Required |
Example
const result = await client.verify.check({
check: "document_synthetic_check",
file_url: "https://storage.example.com/submitted_aadhaar.jpg",
});
// result.output.label → "synthetic"
// result.output.confidence → 0.91
// result.output.risk_level → "high"
Run this check before kyc_aadhaar extraction to reject digitally fabricated IDs:
async function analyzeAadhaar(fileUrl: string) {
// Step 1 — fraud gate
const check = await client.verify.check({
check: "document_synthetic_check",
file_url: fileUrl,
});
if (check.output.label === "synthetic") {
throw new Error(`Synthetic document detected (risk: ${check.output.risk_level})`);
}
// Step 2 — extraction
return client.verify.document({
doc_type: "kyc_aadhaar",
file_url: fileUrl,
});
}
face_liveness — Face Liveness Check
Analysis type: fraud check
Determines whether a face image was captured from a live person or is a spoof (printed photo, screen replay, 3D mask, or cut-out). Used in selfie + ID matching flows to prevent presentation attacks.
Fields extracted
| Field | Type | Notes |
|---|---|---|
label | string | live or spoof |
confidence | number | Float 0-1 |
spoof_type | string | Description of the spoof method detected, or null if live |
Validation rules
| Field | Rule |
|---|---|
label | Required · Regex ^(live|spoof)$ |
confidence | Required |
Example
const result = await client.verify.check({
check: "face_liveness",
file_url: "https://storage.example.com/selfie_capture.jpg",
});
// result.output.label → "live"
// result.output.confidence → 0.99
// result.output.spoof_type → null
Spoof example:
// result.output.label → "spoof"
// result.output.confidence → 0.88
// result.output.spoof_type → "printed photo"
Combining classification checks
A typical KYC flow runs all three checks in sequence before extracting identity fields:
async function kycOnboarding(selfieUrl: string, idDocUrl: string) {
// 1. Liveness
const liveness = await client.verify.check({
check: "face_liveness",
file_url: selfieUrl,
});
if (liveness.output.label !== "live") {
throw new Error("Liveness check failed");
}
// 2. Deepfake
const deepfake = await client.verify.check({
check: "deepfake_detection",
file_url: selfieUrl,
});
if (deepfake.output.label === "deepfake") {
throw new Error("Deepfake detected");
}
// 3. Synthetic document
const synthetic = await client.verify.check({
check: "document_synthetic_check",
file_url: idDocUrl,
});
if (synthetic.output.label === "synthetic") {
throw new Error(`Synthetic document (risk: ${synthetic.output.risk_level})`);
}
// 4. Extract identity fields
return client.verify.document({
doc_type: "kyc_aadhaar",
file_url: idDocUrl,
});
}