KYC DeepScan is an AI-powered identity verification system built with Python and Streamlit. It automates the validation of Indian government ID cards (Aadhaar & PAN) using computer vision, optical character recognition (OCR), and cryptographic validation algorithms.
It is designed to handle real-world edge cases like low-resolution images, blurry photos, and worn-out cards where traditional scanners fail.
- Multi-Document Support: auto-detects and validates PAN Cards and Aadhaar Cards.
- Robust QR Detection:
- Stage 1: Standard Decoding (for clear images).
- Stage 2: Marker Detection (OpenCV).
- Stage 3: Visual Pattern Heuristic (Detects QR "square-in-square" patterns even in 7KB low-res or blurry images).
- Smart OCR & Repair: Uses fuzzy logic to fix common OCR errors (e.g., reading '5' as 'S' or '0' as 'O') to extract valid ID numbers.
- Cryptographic Validation: Implements the Verhoeff Algorithm to mathematically verify Aadhaar numbers.
- Face Forensics: Uses Haar Cascade classifiers to ensure a photo ID is present.
- Tamper Detection: Cross-references scanned text with expected government keywords ("GOVT", "INDIA", "INCOME TAX") to calculate a Trust Score.
- Frontend: Streamlit
- Computer Vision: OpenCV (cv2), NumPy
- OCR: EasyOCR
- Logic: RegEx, SequenceMatcher (Fuzzy Logic), Verhoeff Algorithm
-
Clone the repository:
git clone [https://github.com/your-username/kyc-deepscan.git](https://github.com/your-username/kyc-deepscan.git) cd kyc-deepscan -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
streamlit run app.py
The system assigns a Trust Score (0-100) based on 5 critical checks:
- ID Extraction (+30): Can we read a valid PAN/Aadhaar number? (Includes checksum validation).
- Face Detection (+30): Is there a visible face on the card?
- QR Code Presence (+20): Is a QR code detected (visually or digitally)? Critical for Aadhaar.
- Keyword Matching (+20): Do we see official government markers?
- Penalty System: Heavy score deductions for missing QR codes on Aadhaar or invalid checksums.
This project is open-source.
Vaibhavi Halloli