Document Forensics
Detect document tampering, forgery, and manipulation using AI-powered forensic analysis with 15+ detection techniques.
Overview
The Document Forensics service provides comprehensive forensic analysis to detect tampered, forged, or AI-generated documents. Using advanced techniques including Error Level Analysis (ELA), noise analysis, clone detection, metadata inspection, and AI detection, the service identifies manipulation signs in identity documents, payslips, utility bills, and business registration documents.
Base Path: /v1/forensics
Key Features
- Tampering Detection - Error Level Analysis, noise analysis, clone detection
- Metadata Analysis - Software detection (Photoshop, GIMP), date manipulation
- AI Generation Detection - Identify AI-generated or deepfake documents
- Template Validation - Verify documents match expected formats
- Digital Signature Verification - Check PDF signatures and trust levels
- Document-Specific Analysis - Specialized checks for IDs, payslips, bills, business docs
- Fraud Scoring - Unified fraud score with PASS/MANUAL_REVIEW/REJECT decisions
Supported File Formats
- Images: JPEG, JPG, PNG, TIFF, WebP
- Documents: PDF (single and multi-page)
- Max file size: 10MB per file
API Endpoints
Full Forensic Analysis
Comprehensive document forensic analysis with all available detection techniques.
Endpoint: POST /v1/forensics/analyze
Request:
Code
Query Parameters:
| Param | Type | Default | Description |
|---|---|---|---|
mode | string | full | Analysis mode: full or quick |
document_type | string | unknown | Hint: identity, income, address, business |
Response:
Code
Quick Forensic Check
Fast metadata-only analysis for common tampering signs. Use for high-volume screening.
Endpoint: POST /v1/forensics/quick
Request:
Code
Response:
Code
Quick vs Full Analysis:
| Feature | Quick | Full |
|---|---|---|
| Metadata analysis | ✅ | ✅ |
| Software detection | ✅ | ✅ |
| Error Level Analysis | ❌ | ✅ |
| Noise analysis | ❌ | ✅ |
| Clone detection | ❌ | ✅ |
| AI generation check | ❌ | ✅ |
| Template validation | ❌ | ✅ |
| Digital signatures | ❌ | ✅ |
| Processing time | ~0.5s | ~3-5s |
| Cost | Lower | Higher |
ID Forensics - Detect Tampered IDs
Specialized forensic analysis for identity documents (Omang, Passport, Driver's License).
Endpoint: POST /v1/forensics/identity
Request:
Code
Additional Checks for Identity Documents:
- MRZ (Machine Readable Zone) validation
- ID format validation against known templates
- Photo area tampering detection
- Security feature verification (microprint, watermarks)
- Font consistency across fields
- Ghost layer detection
Income Forensics - Detect Altered Payslips
Specialized forensic analysis for income documents (payslips, tax returns, bank statements).
Endpoint: POST /v1/forensics/income
Request:
Code
Additional Checks for Income Documents:
- Salary figure manipulation detection
- Benford's Law analysis on numerical data
- Date chronology validation
- Employer details consistency
- Tax calculation verification
- Font and alignment analysis in amount fields
Address Forensics - Detect Altered Bills
Specialized forensic analysis for address proof documents (utility bills, bank statements).
Endpoint: POST /v1/forensics/address
Request:
Code
Additional Checks for Address Documents:
- Address field tampering detection
- Billing period consistency
- Account number format validation
- Provider logo and branding verification
- Date manipulation detection
Business Forensics - Detect Altered Registration Docs
Specialized forensic analysis for business registration documents and CIPA certificates.
Endpoint: POST /v1/forensics/business
Request:
Code
Additional Checks for Business Documents:
- Registration number format validation
- Official stamp/seal verification
- Director name consistency
- BIN certificate template matching
- CIPA document format validation
Service Health
Check forensics service health status.
Endpoint: GET /v1/forensics/health
Code
Response:
Code
Supported Formats
Get list of supported file formats and analysis techniques.
Endpoint: GET /v1/forensics/formats
Code
Response:
Code
Fraud Score Decision Matrix
The forensics service returns a unified fraud score with automated decisions:
| Score Range | Decision | Tampering Level | Recommended Action |
|---|---|---|---|
| 0-20 | PASS | UNLIKELY / LOW | Accept document |
| 21-50 | MANUAL_REVIEW | LOW / MODERATE | Flag for human review |
| 51-100 | REJECT | HIGH / VERY_HIGH | Reject and request new document |
Integration Workflow
Pre-Verification Forensics
Run forensics before document verification to catch fraud early:
Code
Python Example
Code
Analysis Techniques
| Technique | Description | What It Detects |
|---|---|---|
| Error Level Analysis | Compares JPEG compression levels | Pasted or edited regions |
| Noise Analysis | Checks noise consistency | Spliced or composited areas |
| Clone Detection | Finds duplicated regions | Copy-paste tampering |
| Metadata Analysis | Inspects EXIF/PDF metadata | Editing software, date changes |
| Font Consistency | Analyzes text rendering | Altered text fields |
| Template Validation | Matches against known formats | Fraudulent document layouts |
| Digital Signature | Verifies PDF signatures | Signature tampering |
| AI Detection | Detects AI-generated content | Deepfakes, synthetic docs |
| Camera Fingerprint | Checks JPEG compression patterns | Double compression |
| Benford's Law | Statistical analysis of numbers | Fabricated financial data |
| Text Skew | Analyzes text alignment | Cut-and-paste text |
| Security Features | Checks microprint/watermarks | Missing security elements |
| Structural Analysis | Ghost layers, wobbly text | Digital editing artifacts |
| Semantic Analysis | Date/number logic checks | Illogical data patterns |
Error Codes
| Code | Status | Message | Resolution |
|---|---|---|---|
| 200 | Success | Analysis completed | - |
| 400 | Bad Request | Invalid file or unsupported format | Check file type (JPEG, PNG, PDF) |
| 401 | Unauthorized | Invalid API key | Check your API key |
| 413 | Too Large | File exceeds maximum size | Reduce file size (max 10MB) |
| 429 | Too Many Requests | Rate limit exceeded | Implement backoff |
| 500 | Server Error | Analysis failed | Contact support |
Pricing
| Service | Price per Request |
|---|---|
| Quick Check | BWP 3-5 |
| Full Analysis | BWP 8-12 |
| Specialized (ID/Income/Address/Business) | BWP 5-8 |
Volume discounts available. Contact [email protected].
Support
- Email: [email protected]
- API Reference: Full API Docs
- Supported Formats: Call
GET /v1/forensics/formats
Related Documentation:

