Home How It Works Document Verification

AI-Powered
Document Intelligence

The most advanced national ID verification pipeline in East Africa. Real-time MRZ extraction, security feature validation, and automated data capture — all from a single camera scan.

< 2s
Capture Time
99.4%
MRZ Accuracy
0
Manual Input
ID SCANNERScan Document
🇰🇪
REPUBLIC OF KENYA
NATIONAL IDENTITY CARD
Name: MWANGI J. N.
ID No: 33445566
DOB: 12.05.1993
IDKEN33445566<<<<<<<<<<<<
9305125M2605129KEN<<<<
MRZ Zone Detected
Security Badge: Valid
Extracting Fields...
NAME
MWANGI, JOSEPH NDIRANGU
ID NUMBER
33445566
DATE OF BIRTH
12 MAY 1993
How Document Scanning Actually Works

A 7-stage processing pipeline that runs in under 2 seconds, right on the user's device.

1

Camera Activation & Frame Capture

The rear camera is activated in real-time preview mode. Continuous frames are captured at 15 FPS and fed into the detection pipeline. No shutter button needed — fully automated.

MediaStream API • requestAnimationFrame • Canvas 2D
2

Document Edge Detection

Each frame is analyzed for rectangular document boundaries using adaptive thresholding and contour detection. The system identifies the ID card's four corners and calculates a perspective transform matrix.

OpenCV.js • Canny Edge Detection • Hough Transform
3

Perspective Correction & Cropping

The detected document region is extracted and de-warped using a 4-point perspective transformation. This corrects for camera angle, tilt, and distance, producing a perfectly rectangular, front-facing image.

Affine Transform • Bilinear Interpolation • Auto-Crop
4

Security Feature Validation

The system validates the physical document's authenticity by detecting the Kenya coat-of-arms hologram, the embossed security badge, and UV-reactive watermark patterns.

Pattern Matching • Template Correlation • Feature Scoring
5

MRZ Zone Localization

The Machine Readable Zone (MRZ) — the two rows of OCR-B characters at the bottom of the ID card — is located using gradient-based text region detection with sub-pixel accuracy.

Morphological Operations • Connected Components • ROI Extraction
6

OCR & Field Extraction

MRZ characters are recognized using a custom ML model trained on Kenyan ID typography. Check digits are validated per ICAO 9303 standard. Fields: Name, ID Number, DOB, Gender, Expiry, Nationality.

TensorFlow Lite • ICAO 9303 Validation • Check Digit Verification
7

Auto-Capture & Submission

When all validation checks pass (document detected, MRZ parsed, security features confirmed), the system automatically captures and submits — no user interaction required. Under 2 seconds total.

Confidence Threshold • Auto-Submit • JPEG Compression (85%)
Why PollGuard's Scanner is Different

Most platforms treat document verification as an afterthought. We made it the foundation.

PollGuard Approach
On-device ML inference — no server roundtrip
Real-time continuous scanning (15 FPS)
Automatic capture — zero user interaction
Security feature validation (hologram, badge)
ICAO 9303 compliant MRZ parsing
Works offline — deferred submission
Custom model trained on Kenyan IDs
Sub-2-second total processing time
Typical Industry Approach
Upload photo → server-side processing
Single-shot capture with manual shutter
Multiple retry prompts for poor captures
No physical document authentication
Generic OCR — high error rates on African IDs
Requires internet connection throughout
Western-trained models with African bias gap
5-15 second processing with server wait
Comprehensive ID Coverage

Purpose-built for East African identity documents with region-specific training data.

🇰🇪
Kenya National ID
2nd & 3rd Generation
MRZ (2-line) Coat of Arms Security Badge Photo Match
Primary Support
🇰🇪
Kenya Passport
Biometric (e-Passport)
MRZ (2-line) ICAO Chip Bio Page UV Features
Full Support
🇰🇪
Kenya Driving License
Smart DL (2019+)
Barcode QR Code Photo NTSA Logo
Full Support
🌍
East African IDs
Uganda, Tanzania, Rwanda
MRZ Parsing OCR Extraction Basic Validation Roadmap
Beta / Roadmap
Technical Architecture

The engine behind our document verification pipeline.

ML Model Stack

  • TensorFlow Lite for on-device inference
  • Custom CNN trained on 50K+ Kenyan ID images
  • Character segmentation + OCR-B classifier
  • Model size: 4.2MB (quantized INT8)
  • Inference time: ~80ms per frame

Camera Pipeline

  • getUserMedia with rear camera preference
  • Resolution: 1920×1080 (auto-scaled)
  • Frame rate: 15 FPS for ML processing
  • Auto-focus with continuous adjustment
  • Torch/flash activation for low light

Validation Engine

  • ICAO 9303 check digit verification
  • MRZ format compliance (TD1/TD2/TD3)
  • Cross-field consistency checks
  • Date range plausibility validation
  • Duplicate document detection

Security & Privacy

  • All processing happens on-device
  • No document images sent to cloud
  • AES-256 encryption for extracted data
  • Automatic memory clearing post-capture
  • KE DPA 2019 compliant data handling
Measured Results

Real-world performance data from 340,000+ voter verifications across Kenya.

99.4%
MRZ Read Accuracy
Across all lighting conditions
97.8%
First-Attempt Capture
No retries needed
1.8s
Average Capture Time
Camera open → data extracted
100%
Fraud Detection Rate
Photocopy & screen replay blocked

Experience It Yourself

Try PollGuard's document scanner with your own ID. Setup takes under 5 minutes.