Back to Selected Projects
Fintech AI & Banking Compliance Project

e-KYC KTP Extraction & Forensic Anti-Fraud Platform

A local GPU-accelerated (PyTorch CUDA) banking identity verification engine combining OpenCV + EasyOCR (CRAFT + CRNN), MediaPipe 478-landmark EAR/MAR liveness, full 514-regency / 7,285-district Kemendagri NIK forensics, FaceNet 512-D biometrics, Error Level Analysis (ELA), and a persistent FAISS 384-D Hybrid POJK RAG Copilot.

Project Type Fintech AI & Compliance
My Role AI & Backend Engineer
Core Engine FastAPI + PyTorch (EasyOCR)
Security Standard Banking-Grade Anti-Fraud
Try Live Compliance Chatbot Core e-KYC Repo (FastAPI & RAG)
verif-ai.internal.bank :: compliance-operations-center Live Operations Center
e-KYC Compliance Operations Center
Operations Center & Audit Table: Real-time compliance monitoring dashboard tracking verification velocity, pass rates, fraud prevention counters, and audit logs.
Live Interactive Demo • No Setup Required

Ask the Sovereign POJK Compliance & RBAC Chatbot

Test role-based access control and POJK compliance guardrails right here. Pick a bank staff role (CS, Analyst, or Director), click any plain-language prompt below, or type your own question to see grounded citations, PII masking, and real-time access blocking in action.

Interactive Sovereign Compliance RAG Demo
Active Role:
Clearance: PUBLIC_INTERNAL NIK Sample: 9901********0001 Income PII: [REDACTED]
Bingung mau tanya apa? Coba urutkan begini: (1) Klik salah satu tombol ide pertanyaan di bawah sambil memakai role CS_BRANCH — lihat kenapa batas fraud otomatis ditolak; (2) Ubah role ke RISK_DIRECTOR lalu klik lagi pertanyaan yang sama; atau (3) Ketik bebas pakai bahasa sehari-hari!
Halo! Copilot Kepatuhan e-KYC siap dicoba.
Anda bisa bertanya tentang aturan data nasabah & 9 data error karantina, perbedaan hak akses CS vs Analis vs Direktur, contoh masker NIK/gaji, ambang batas skor fraud (FaceNet & ELA), hingga menguji serangan prompt injection. Pilih tombol ide di bawah atau ketik langsung pertanyaan Anda!
Prompt presets (or type your own question below):
Fintech Security Context

The High Stakes of Digital Identity Fraud

Financial institutions and fintech startups face severe compliance penalties and multi-billion rupiah credit default risks when fraudsters submit fabricated KTP images, stolen national identities, or replayed video selfies.

Legacy OCR tools frequently hallucinate indistinct digits on weathered Indonesian national ID cards, causing legitimate borrowers to be rejected while sophisticated Photoshop edits slip through without forensic examination.

Critical Banking Vulnerabilities
Replay attacks using printed photos or smartphone screens during video selfies
Stolen identity numbers (NIK) with altered physical birthdates and altered names
Digital manipulation and splice tampering of identity card photos
Manual reviewer fatigue resulting in high turnaround time (>24 hours)
Role & Responsibilities

My Contribution

I designed, built, and tested the complete identity verification system — from on-premise EasyOCR CUDA extraction and anti-spoof liveness checks to 512-D FaceNet biometrics, forensic NIK validation, Hybrid POJK RAG, and webhook dispatch.

Anti-Spoof Liveness Detection

Built 3-stage MediaPipe 478-landmark EAR/MAR & Blendshape liveness verification paired with FaceNet InceptionResnetV1 (512-D) biometrics
Implemented Error Level Analysis (ELA) JPEG compression forensics (std <= 12.0) to detect Photoshop edits and replay spoofs

Computer Vision Pipeline

Engineered OpenCV 4-point perspective warp to rectify tilted KTP cards into orthogonal 1280×808 planes for optimal OCR
Built CLAHE histogram equalization and auto-crop pipeline to extract official passport photo chip locally without cloud upload

Local EasyOCR (CRAFT + CRNN) & RAG

Built GPU-accelerated EasyOCR (CRAFT text detection + CRNN/BiLSTM) extracting 10 mandatory KTP fields strictly on-premise
Built persistent FAISS IndexFlatIP (384-D Multilingual MiniLM CUDA) + TF-IDF Hybrid Compliance RAG (Gemini 1.5 Flash / local fallback) isolated from customer PII

Forensic Engine & Backend

Built Dukcapil mathematical NIK decomposer cross-validating all 38 provinces, 514 regencies, 7,285 districts & birthdates (+40 female offset)
Designed FastAPI async backend with MySQL + SQLite automatic failover, ReportLab PDF certificates, and HMAC webhooks
End-to-End Architecture

Workflow & Data Flow

From real-time browser camera stream to immutable database ledger and core-banking webhook push, every millisecond is optimized for zero hallucination and mathematical tamper defense.

verif-ai.pipeline.core :: architecture-spec-v1 System & AI Architecture
e-KYC End-to-End Pipeline & Forensic Architecture Diagram
System Architecture Diagram: Layered on-premise pipeline mapping WebRTC liveness & MediaPipe 478-landmark EAR/MAR, OpenCV 4-point warp, EasyOCR CUDA local extraction, full Kemendagri (7,285 kec) + FaceNet 512-D + ELA forensics, and FastAPI/MySQL (+ SQLite) with FAISS 384-D Hybrid RAG and PII-isolated Gemini/Local synthesis.
01 / LIVENESS
Active Liveness Detection 3-stage MediaPipe 478-landmark EAR/MAR & Blendshape check, Laplacian texture test, and JPEG ELA splice detection. MediaPipe 478-LM + ELA
02 / CV PIPELINE
Computer Vision Preprocessing OpenCV 4-point perspective warp rectifies tilted ID cards, enhances contrast with CLAHE, and crops the official photo chip. OpenCV 4-Point Warp
03 / LOCAL OCR
EasyOCR CUDA (CRAFT + CRNN) On-premise PyTorch CUDA OCR pipeline (CRAFT text detection + CRNN BiLSTM) extracting 10 KTP fields locally with regex post-processing. PyTorch CUDA + EasyOCR
04 / FORENSIC
Mathematical Forensic & FaceNet 512-D Validates NIK digits 7-12 (+40 female offset), full 38-prov / 514-regency / 7,285-district Kemendagri master, and 512-D FaceNet L2 distance. Kemendagri Full + FaceNet 512-D
05 / DISPATCH
Enterprise Core, DB & FAISS RAG FastAPI async core persists to MySQL/SQLite, sends HMAC-SHA256 webhooks (masked + SHA-256 NIK), and powers persistent FAISS 384-D RAG. FastAPI + FAISS 384-D + HMAC
Operational Verification Workflow 1. Panduan Selfie & Liveness
Klik gambar untuk Zoom
e-KYC Operational Step
Live Selfie Capture Guide: Real-time browser guidance circle ensuring optimal facial alignment and natural ambient lighting before initiating active liveness tests.
MediaPipe 478-LM EAR/MAR Oval Guide Anti-Clone Check
Mathematical Deconstruction

Dukcapil 16-Digit Forensic NIK Dissector

How the system detects forged national ID numbers without needing direct external database access through algorithmic decomposition of Indonesia's national ID schema:

32 Prov
03 Kab/Kota
12 Kec
15 Tgl (+40 W)
03 Bulan
03 Tahun (YY)
0015 No. Seri
Segment Decoded Field Forensic Validation Rule
Digit 1–6 Administrative Geography Encodes Province (1-2), Regency/City (3-4), and District (5-6). Cross-referenced against the official Kemendagri spatial gazetteer (38 provinces, 514 regencies, 7,285 districts).
Digit 7–8 Birth Date & Gender Offset Male dates range from 01–31. Female dates receive a statutory mathematical offset of +40 (41–71). The system decrypts the offset to infer gender and verify exact day of birth.
Digit 9–10 Month of Birth Validates statutory Gregorian calendar range (01–12). Any value outside this range triggers an immediate automated fraud alert.
Digit 11–12 Year of Birth (YY) Extracts two-digit birth year, cross-compared with extracted OCR document text to detect altered age or falsified physical documents.
Digit 13–16 Computerized Registration System serial number generated chronologically by Dukcapil, ensuring unique population identification.
System Performance

Key Benchmarks & Reliability

Deterministic verification throughput, biometric precision thresholds, and sub-second multi-layer forensic execution metrics:

100%
Zero-Cloud KTP Privacy
Local EasyOCR + Regex & Pydantic V2 SSOT
512-D
Biometric FaceNet Match
Euclidean L2 <= 0.85 | Cosine >= 0.60
< 1.5s
End-to-End Latency
FastAPI async event-loop execution
4-Tier
Multi-Layer Defense
Liveness + ELA + NIK Math + FaceNet
AI Copilot & Regulation Grounding

AI Compliance Copilot & FAISS Vector RAG

An intelligent Retrieval-Augmented Generation (RAG) assistant grounded in statutory POJK banking regulations, internal fraud SOPs, and live MySQL audit records to provide zero-hallucination compliance verification.

verif-ai.copilot :: compliance-rag-engine 1. Knowledge Base PDF
Klik gambar untuk Zoom
e-KYC RAG Compliance Copilot
FAISS Persistent Vector Knowledge Base: Builds 384-D Multilingual MiniLM embeddings into a persistent FAISS IndexFlatIP store fused with TF-IDF lexical vectors over PDF/Markdown POJK guides.
FAISS 384-D + TF-IDF PDF Chunking POJK Grounding
Auditability & Architecture

Engineering Decisions, Data Validation & Access Governance

Architectural trade-offs, strict deterministic validation guardrails, and role-scoped access policies enforcing zero-hallucination compliance.

Data Validation & Deduplication Rules

Deterministic Checks
Regex + Dukcapil + Pydantic V2 (SSOT): Deterministic field parsing from local EasyOCR extracts all 10 mandatory KTP fields locally, paired with Pydantic V2 validation in the companion reconciliation warehouse.
Full National Kemendagri Verification (38/514/7,285): Decomposes birth digits (DD + 40 offset for females), enforces region match against all 38 provinces, 514 regencies/cities, and 7,285 districts, and flags duplicates.
Biometric & Forensic Thresholds: Enforces FaceNet InceptionResnetV1 512-D pass limit (L2 <= 0.85, Cosine >= 0.60) and JPEG ELA check (std <= 12.0) prior to webhook sign-off.

Key Engineering Decisions

Trade-Offs
On-Premise PyTorch CUDA + Failover DB: Running EasyOCR & FaceNet 512-D locally guarantees zero third-party PII image leakage, while MySQL automatically fails over to SQLite (ekyc_audit.db) under DB disruption.
Deterministic Forensics + Hybrid RAG Isolation: Mathematical NIK + ELA forensics validate identity documents offline; optional Gemini 1.5 Flash in the RAG module only touches POJK rules & masked telemetry, falling back safely to a local synthesizer.
PII-Isolated Vector RAG & Masked Webhooks: Individual customer records never leave local inference; external LLM prompts see only handbook chunks & anonymous totals, while webhooks transmit masked + SHA-256 NIKs with HMAC-SHA256 signatures.

Access Control & Data Privacy Governance

RBAC & Auditability
Role / Actor Authorized Data Scope Validation / Privacy Enforcement
Applicant Session Write-only capture session (KTP upload & 3-stage webcam frames) Zero access to internal forensic thresholds, cross-applicant records, or compliance ledger
Compliance Officer Read-only inspection of flagged audits, ELA maps, & POJK RAG Copilot Strict audit logging per review decision; RAG answers restricted to indexed POJK chunks & read-only SQL views
Core Banking Webhook Signed verification payload + tamper-proof ReportLab PDF summary Authenticated machine-to-machine dispatch storing immutable MySQL 3NF decision hashes
Auditable Open-Source Companion

Multi-Format Compliance Reconciliation & Automated Pytest Proofs

Because institutional banking codebases are confidential, this project is paired with a 100% synthetic open-source verification repository demonstrating CSV/Excel/JSON reconciliation, RapidFuzz deduplication, quarantine logging, PII masking, RBAC, and offline POJK RAG verified by 9/9 passing pytest assertions.

9 / 9 Pytest Passing 80 / 97 Valid SSOT (82.47%) 100% Synthetic Safe Data
Inspect Source, Data Dictionary & Tests on GitHub
e-KYC Validation & Offline POJK RAG Architecture Monochrome Tech Spec
e-KYC Validation, Reconciliation and Offline Sovereign RAG Architecture
Arsitektur Terbuka Pendamping: Unifikasi CSV + Excel + JSON → Deduplikasi 2-tahap + Pydantic V2 → Gudang SQLite + Karantina Error → Gerbang RBAC (CS_BRANCH, COMPLIANCE_ANALYST, RISK_DIRECTOR) → Sovereign POJK RAG offline.
AUDIT_REPORT.md :: Quality Reconciliation Chart 80 Valid / 97 Raw
e-KYC Multi-Format Data Quality Reconciliation Audit Chart
Bukti Kualitas Terukur: Dari 97 baris mentah lintas CSV (45), Excel (29), dan JSON (23), sebanyak 80 baris valid lolos SSOT, 8 duplikat dibersihkan, dan 9 anomali skema/foreign-key tercatat di quarantine_errors.csv.
Jump Back Up to Test the Interactive POJK Chatbot
Technologies Used

Tech Stack

Python 3.10+ PyTorch (CUDA) FAISS Vector DB (384-D) EasyOCR (CRAFT + CRNN) FastAPI (Async) MediaPipe FaceLandmarker (EAR/MAR) FaceNet (512-D InceptionResnetV1) OpenCV & CLAHE Error Level Analysis (ELA) SentenceTransformers + TF-IDF Kemendagri 38/514/7,285 Dataset MySQL 3NF + SQLite Failover Pydantic V2 & RapidFuzz HMAC-SHA256 Webhooks ReportLab PDF & Pytest