AI Content Detector: Explainable Multi-Vector Forensic Intelligence Suite
Multi-Tier Forensic System
Designed for academic and professional evaluators to detect, quantify, localize, and explain generative AI text across 7 document formats while rigorously preventing false accusations.
π Core Architecture & Solution Mapping
| Problem Requirement | Evaluator Scenario & Need | VeritasDoc Architectural Solution |
|---|---|---|
| 1. Ingest Documents | Diverse file formats (.pdf, .docx, .doc, .pptx, .ppt, .rtf, .txt) |
Unified parsing pipeline preserving document structural hierarchy and computing SHA-256 checksum. |
| 2. Detect AI Content | Separate machine-generated text from authentic human prose | Tri-Layer Neural Consensus combining Syntactic Discourse (Core Alpha), Generative Cadence (Core Beta), and Adversarial Evasion (Core Gamma). |
| 3. Quantify AI Usage | Mixed/hybrid documents with both human and AI sections | Character-weighted token attribution with 3-sentence Gaussian boundary smoothing ($\tilde{S}i = 0.70 S_i + 0.15 S{i-1} + 0.15 S_{i+1}$). |
| 4. Localize & Explain | Point directly to flagged sentences with transparent reasoning | 3-Color Visual Heatmap (Red $\ge 70%$, Yellow $45-69%$, Green $< 45%$) paired with a Diagnostic Explainability Card for every sentence. |
| 5. Minimize False Positives | Avoid wrongful accusations against innocent authors | Platt-scaled calibration, 3-Zone Academic Decision Matrix (Green $<25%$, Yellow $25-65%$, Red $>65%$), ESL Safeguard, and sensitivity modes (Conservative, Balanced, Aggressive). |
| 6. Evaluator UI & Export | Intuitive inspection and tamper-evident audit export | Modern split-screen dashboard with live heatmaps and 1-click SHA-256 hashed PDF audit certificate. |
π All 4 Bonus Innovators Implemented
- AI Platform Origin Attribution:
- Detects generating platform (ChatGPT-4o, Claude 3.5, Google Gemini, Microsoft Copilot) with empirical confidence scores and stylistic token markers (
delve,tapestry,furthermore, etc.).
- Detects generating platform (ChatGPT-4o, Claude 3.5, Google Gemini, Microsoft Copilot) with empirical confidence scores and stylistic token markers (
- Humanizer / QuillBot Evasion Detector:
- Detects bypass tools (Undetectable.ai, HideMyAI) via Semantic Dissonance Detection and Perturbation Anomaly analysis.
- LMS Plugin Hook & Chrome Extension (Manifest V3):
- Canvas / Moodle Webhook endpoint (
POST /api/lms/webhook). - Ready-to-load Manifest V3 Chrome Extension in
extension/directory for zero-friction browser overlay inspection.
- Canvas / Moodle Webhook endpoint (
- Multilingual & Regional Support:
- Cross-lingual support for Hindi, Spanish, French, and German.
ποΈ Project Structure
ai-detector/
βββ app/
β βββ main.py # FastAPI application, routes (/analyze, /recalculate, /health, /history, /pdf, LMS webhook)
β βββ config.py # Zero-configuration defaults from environment (.env)
β βββ database.py # Native SQLite (WAL mode) with automatic migrations
β βββ extractor.py # Multi-format parser (.pdf, .docx, .doc, .pptx, .ppt, .rtf, .txt) & Hierarchical Tree
β βββ sanitizer.py # Zero-width stripping, NFKC normalization, homoglyphs, ligatures & SHA-256
β βββ detector.py # Tri-Layer Neural Consensus Engine (Alpha, Beta, Gamma cores)
β βββ forensics.py # Perplexity (PPL), Burstiness (B), Zipfian, Stylometrics, ESL Safeguard
β βββ analyzer.py # Gaussian smoothing, character weighting, 3-zone matrix, explainability
β βββ reporter.py # Tamper-evident ReportLab PDF audit certificates with SHA-256
β βββ utils.py # Sentence tokenizers & confidence calculation
βββ extension/ # Chrome Extension Manifest V3 (Bonus 3)
β βββ manifest.json # Manifest V3 configuration
β βββ content.js # Floating inspector overlay on any webpage / LMS
β βββ popup.html # Evaluator popup inspection UI
β βββ popup.js # Local consensus inspection client
βββ static/
β βββ index.html # Evaluator split-screen dashboard with Tailwind CDN
β βββ app.js # Vanilla JavaScript client (dropzone, heatmaps, diagnostic cards, PDF export)
βββ data/ # Auto-created on startup (persists across reboots)
β βββ analyses.db # SQLite database file (WAL mode)
β βββ uploads/ # Saved uploaded documents
βββ requirements.txt # Python dependencies
βββ run.bat # Windows 1-click launcher
βββ start.bat # Alternative Windows launcher
βββ main.py # Root Python launcher
βββ README.md
β‘ Quickstart Guide
1. Launch the Server (Single Command)
On Windows:
run.bat
or
python main.py
- Web UI: http://localhost:8000
- Health endpoint: http://localhost:8000/health
π§ͺ 5-Minute Evaluator Demo Script
Step 1: Inspect System Health
- Open
http://localhost:8000/health. - Confirm active multi-vector neural cores:
{ "status": "ok", "model": "Multi-Vector Neural Consensus (3/3 Cores Active)", "model_loaded": true, "device": "cpu", "model_type": "neural_consensus" }
- Open
Step 2: 1-Click Instant Evaluation
- Click
π€ Pure AI Essayon the dashboard. - In 1 second, the radial gauge renders with Red Zone (>65%), highlighting monotonous sentence cadence, low Perplexity ($PPL < 20$), and attributing to ChatGPT-4o (89% confidence).
- Click
Step 3: Test Interactive Split-Screen & Diagnostic Drawer
- Click any sentence in the left document text.
- The Diagnostic Explainability Card on the right instantly inspects that specific sentence, showing its smoothed score, sentence perplexity, clichΓ©s found, and linguistic reasoning.
Step 4: Export Official Tamper-Evident PDF Certificate
- Click "Export PDF Certificate" to download the institutional audit certificate containing the cryptographic SHA-256 checksum, 3-Zone Academic Verdict, Neural Consensus Matrix, and Evaluator Disclaimers.