How dipesh10110n1/sensitive-document-flagging-system works
DocShield AI is a privacy-focused Aadhaar/PAN document screening platform. Users upload or capture an image in the dashboard; the API routes it through visual and spatial analysis, fuses classification evidence into a three-tier risk decision, and records scans for audit and analytics. The README also documents synthetic sample generation, human audit overrides, privacy redaction, and model retraining. The API, ML engine, database, and generator are identified in the source index; detailed internal calls were not excerpted, so the edges below rely on documented product behavior rather than claims about unseen code.
Main entry points: app.js Scanner dashboard · app.py REST API · ml_engine.py Visual embeddings · database.py Scan and audit store
Components 18
User experience
- Scanner dashboard
frontend/app.js - REST API
backend/app.py - Sample catalog
backend/app.py - Scan analytics
backend/app.py
Screening pipeline
- Image validation
backend/ml_engine.py - Visual embeddings
backend/ml_engine.py - Patch sequence
backend/ml_engine.py - K-means analysis
backend/ml_engine.py - HMM likelihoods
backend/ml_engine.py - Evidence fusion
backend/ml_engine.py - Risk decision gate
backend/ml_engine.py - PII redaction
backend/ml_engine.py
Records and review
- Scan and audit store
backend/database.py - Audit override
backend/app.py - Synthetic documents
backend/data_generator.py
Model development
- Model training
train.py - Inference models
backend/ml_engine.py
Other components
- Uploader / auditor
Connections 20
- Uploader / auditor → Scanner dashboard: uploads or reviews
- Scanner dashboard → REST API: submits scans
- REST API → Image validation: validates image
backend/app.py - Image validation → Visual embeddings: preprocesses image
backend/ml_engine.py - Visual embeddings → K-means analysis: provides embeddings
backend/ml_engine.py - Visual embeddings → Patch sequence: extracts patch grid
backend/ml_engine.py - Patch sequence → HMM likelihoods: scores sequences
backend/ml_engine.py - K-means analysis → Evidence fusion: supplies cluster metrics
backend/ml_engine.py - HMM likelihoods → Evidence fusion: supplies likelihoods
backend/ml_engine.py - Evidence fusion → Risk decision gate: fuses probabilities
backend/ml_engine.py - Risk decision gate → PII redaction: redacts flagged PII
backend/ml_engine.py - REST API → Scan and audit store: records scan
backend/app.py - Risk decision gate → Scan and audit store: stores decision evidence
- Scanner dashboard → Sample catalog: requests samples
- Sample catalog → Synthetic documents: uses synthetic catalog
backend/app.py - Scanner dashboard → Scan analytics: requests analytics
- REST API → Audit override: routes audit action
backend/app.py - Audit override → Scan and audit store: logs override
backend/app.py - Model training → Inference models: trains models
train.py - Inference models → Visual embeddings: extracts embeddings
backend/ml_engine.py