Skip to content

Vbhhacl/document-verification-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ KYC DeepScan

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.

๐Ÿš€ Key Features

  • 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.

๐Ÿ› ๏ธ Tech Stack

  • Frontend: Streamlit
  • Computer Vision: OpenCV (cv2), NumPy
  • OCR: EasyOCR
  • Logic: RegEx, SequenceMatcher (Fuzzy Logic), Verhoeff Algorithm

โš™๏ธ Installation

  1. Clone the repository:

    git clone [https://github.com/your-username/kyc-deepscan.git](https://github.com/your-username/kyc-deepscan.git)
    cd kyc-deepscan
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the application:

    streamlit run app.py

๐Ÿง  How It Works (The "DeepScan" Logic)

The system assigns a Trust Score (0-100) based on 5 critical checks:

  1. ID Extraction (+30): Can we read a valid PAN/Aadhaar number? (Includes checksum validation).
  2. Face Detection (+30): Is there a visible face on the card?
  3. QR Code Presence (+20): Is a QR code detected (visually or digitally)? Critical for Aadhaar.
  4. Keyword Matching (+20): Do we see official government markers?
  5. Penalty System: Heavy score deductions for missing QR codes on Aadhaar or invalid checksums.

๐Ÿ“„ License

This project is open-source.

Author

Vaibhavi Halloli

About

A robust AI-powered KYC verification system for Indian Government IDs (Aadhaar & PAN). Uses OpenCV, EasyOCR, and Verhoeff algorithms to validate IDs, detect faces, and identify QR patterns even in low-resolution or blurry images.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages