Skip to content

SuhasR3/VerifyID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VerifyID

AI-powered identity document verification for notarial compliance.

πŸ† Winner Β· VillageHacks 2026 (Notary Track) Β· Arizona State University

Upload a government-issued ID and get an instant authenticity verdict, extracted data fields with per-field confidence scores, and compliance flags against RULONA, NIST IAL2, and MISMO standards. Cross-reference a second document or verify a live selfie against the ID photo, with biometric matching running entirely in-browser.


demo

Full Video: link

App Live Link: link


What makes this interesting

Hybrid AI + deterministic architecture. The LLM extracts signals. Code computes the verdict. Five weighted signals are aggregated in TypeScript with hard caps for expired IDs, invalid state-specific ID number formats, and per-level failures. The model cannot hallucinate a passing score.

Two-step Gemini pipeline. Step 1 classifies the document (type, issuing state, side, under-21 flag, REAL ID star). That classification is injected into the Step 2 prompt, enabling state-specific field format rules and reducing hallucinations on ambiguous documents.

Privacy enforced architecturally. Face comparison runs entirely client-side via face-api.js. The 128-dim descriptor matching happens in the browser; the selfie never reaches the server.

Compliance-ready output. Results cite specific regulatory standards (RULONA Β§ 2(14), NIST SP 800-63-3 IAL2, MISMO) with expiration checks and out-of-state flags, directly usable in notarial documentation.


Architecture

Browser                                    Server
──────────────────────────────────         ──────────────────────────

  Upload ID image
  β”œβ”€β”€ (optional) 2nd document
  β”œβ”€β”€ (optional) Live selfie
  β”‚
  └── Promise.all([
        β”‚
        β”œβ”€β”€ POST /api/verify ──────────►   Route Handler
        β”‚                                    β”‚
        β”‚                                    β”œβ”€β”€ Gemini Step 1: Classify
        β”‚                                    β”‚   (type, state, side, orientation)
        β”‚                                    β”‚
        β”‚                                    β”œβ”€β”€ Gemini Step 2: Analyze
        β”‚                                    β”‚   (forensics, extraction, compliance)
        β”‚                                    β”‚
        β”‚                                    └── computeVerdict()
        β”‚                                        deterministic scoring
        β”‚   ◄──────── JSON result ─────────      in TypeScript
        β”‚
        └── runFaceComparison()
              face-api.js (client-side)
              TinyFaceDetector
              FaceRecognitionNet
              128-dim descriptor matching
      ])
  β”‚
  └── Render verification dashboard

Scoring

The LLM extracts signals. Code computes the score.

Signal Weight
Template conformance 25%
Data field validity 25%
Data consistency 20%
Image integrity 15%
Security feature presence 15%

Hard caps override the weighted score: invalid state-specific ID number format caps confidence at 40%, expired documents at 70%, any per-level failure at 77%.

Verdict thresholds: β‰₯ 78% AUTHENTIC, β‰₯ 50% SUSPICIOUS, < 50% FAKE.


Stack

Technology Purpose
Next.js 16 (App Router) Full-stack framework with API Route Handlers
React 19 + TypeScript 5 UI with state machine-driven flow
Tailwind CSS 4 Styling
Gemini 2.5 Flash Two-step document classification and forensic analysis
face-api.js Client-side face detection and 128-dim descriptor matching

Scope

Hackathon prototype. Verification logic works end to end; surrounding infrastructure is not production-grade.

Not implemented: authentication, rate limiting, persistent storage, structured logging, MIME type verification against image bytes, cache eviction, test suite.

Production roadmap: auth and per-tenant API keys, audit log persistence, edge rate limiting, integration tests for the scoring engine, structured logging with per-step latency metrics, bounded LRU cache.


Getting Started

git clone https://github.com/yourusername/VerifyID.git
cd VerifyID
npm install
cp .env.example .env.local
# add GEMINI_API_KEY to .env.local
npm run dev

Get a Gemini API key at aistudio.google.com/apikey. Optional GEMINI_API_KEY_FALLBACK is used on rate-limit errors.


Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ page.tsx                  # Client state machine, selfie capture, face comparison
β”‚   β”œβ”€β”€ api/verify/route.ts       # API route, validates input, calls Gemini pipeline
β”‚   └── layout.tsx                # App shell, font loading
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ gemini.ts                 # Two-step Gemini pipeline, scoring engine, cache
β”‚   └── types.ts                  # TypeScript interfaces for all verification levels
└── components/
    β”œβ”€β”€ VerificationResult.tsx    # Results dashboard (verdict, fields, compliance)
    β”œβ”€β”€ UploadZone.tsx            # Drag-and-drop file upload
    └── ScanAnimation.tsx         # Loading state
public/
└── models/                       # face-api.js model weights

About

πŸ† VillageHacks 2026 winner (Notary Track). AI ID verification: two step Gemini pipeline plus deterministic scoring, in browser face match.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors