CoolFace
Apppublic

michaellemon/id-verification-vdolarapp

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

ID Verification App

A lightweight proof-of-concept app for verifying the authenticity of ID images using OpenAI's GPT-4o. The model analyzes the visual content of uploaded IDs and returns a structured assessment of their validity.


Features

  • Upload and analyze any government-issued ID image
  • Returns structured JSON output with:
  • Validity (valid or invalid)
  • Confidence score (1–10)
  • Issues found (e.g., placeholders, photo realism, formatting)
  • Extracted ID data (name, DOB, ID number, address, etc.)
  • Streamlit-based interface deployed on Hugging Face Spaces
  • Uses rule-based prompt design (rules.txt) and few-shot examples (examples.json) for consistency

Project Structure

plaintext
id-verification/
├── app.py             # Main Streamlit application logic
├── examples.json      # Few-shot examples to guide GPT responses
├── rules.txt          # Prompt rules for consistent structured output
├── requirements.txt   # Python dependencies
└── README.md          # Project documentation and usage guide

How It Works

  1. 1.Upload an image of a government-issued ID (JPG or PNG)
  2. 2.App converts the image to base64 and sends it to GPT-4o with a structured prompt
  3. 3.GPT-4o returns a JSON object with fields: validity, confidence, issues_found, and id_data
  4. 4.Output is displayed in a clean UI for interpretation and next actions

Next Steps: Production-Grade Improvements

1. Cross-check ID Data via Database

  • Match id_data against a secure database (e.g., PostgreSQL, Firebase)
  • Validate presence and accuracy of fields like name, DOB, ID number
  • Highlight inconsistencies or missing entries

2. Dynamic Feedback Loop

  • Log GPT responses and user-verification feedback
  • Append approved examples to examples.json
  • Save reviewer overrides in feedback_log.json
  • Improve future results by refining prompt context with real-world input

3. Notifications and Review

  • Flag uncertain or low-confidence results for manual review
  • Optional reviewer dashboard with accept/reject interface
  • Record final verdicts and decision explanations

4. Testing and Evaluation

  • Build test suite with diverse real/fake ID samples
  • Validate structure and JSON compliance of GPT responses
  • Track accuracy and false positive/negative rates