Skip to content

Repository files navigation

AI-Content Detection & Forensic Text Analysis Platform

A high-precision, full-stack forensic text analysis and AI content detection system. Powered by an ensemble machine learning architecture, the platform extracts stylometric, perplexity, and structural features to deliver high-confidence text classification with interactive sentence-level probability maps.


Model Performance & Benchmark

Our stacked ensemble classification engine achieves 99.57% accuracy across benchmark validation sets.

  • Stacking Meta-Learner: Synthesizes probability scores from XGBoost, LightGBM, Random Forest, and Logistic Regression base models.
  • Stylometric & Linguistic Profiling: Analyzes over 60 granular text features, including sentence burstiness, type-token ratio, discourse markers, readability indices, and regional code-switching patterns.
  • Sentence-Level Granularity: Computes per-sentence AI probabilities for pinpoint accuracy across hybrid human-AI documents.

Interface Showcase

Hero & Platform Overview

Platform Hero Overview

Secure Document Dropzone

Document Import Interface

Developer API & Key Management

API Keys Dashboard


Architecture Overview

+-------------------------------------------------------------------------+
|                        Frontend (Vite / React 19)                       |
|   AppShell  |  Analysis Workspace  |  Dashboard  |  Developer Portal    |
+------------------------------------+------------------------------------+
                                     | REST API (JSON)
+------------------------------------v------------------------------------+
|                         Backend (FastAPI Engine)                        |
|   /api/analyze    |    /api/health    |    /api/model    |  /api/apikeys|
+------------------------------------+------------------------------------+
                                     |
           +-------------------------+-------------------------+
           |                                                   |
+----------v-------------------------+            +------------v------------+
|  ML Inference Engine (99.57% Acc)  |            | SQLite Data Stores      |
|  - Feature Extractor & Scaler      |            | - Chatbot & Session Logs|
|  - Base Classifiers (XGB/LGBM/RF)  |            | - API Keys Database     |
|  - Stacking Meta-Learner           |            +-------------------------+
+------------------------------------+

Key Capabilities

  • Ensemble Machine Learning Engine: Combines multiple base estimators with a meta-classifier for stable, robust predictions.
  • Visual Probability Overlay: Sentence-by-sentence color highlighting differentiates human writing from synthesized segments.
  • Native Document Processing: Parse and analyze .docx and .pdf files directly within the browser client.
  • Exportable Reports: Generate highlighted .docx and .pdf summary reports for auditing and verification.
  • Developer API: Issue and revoke API keys with custom rate limits for programmatic integration.
  • Embedded Assistant: AI chatbot providing metric explanations and detection methodology insights.

System Requirements

  • Python: 3.10+
  • Node.js: 18.0+
  • npm: 9.0+

Local Setup & Quickstart

1. Clone the Repository

git clone https://github.com/ahmadkhanalm/AI-Content-Detection-Forensic-Text-Analysis-Platform.git
cd AI-Content-Detection-Forensic-Text-Analysis-Platform

2. Backend Setup (FastAPI)

Navigate to backend/backend, configure environment settings, and launch Uvicorn:

cd backend/backend
cp .env.example .env
python -m uvicorn main:app --host 127.0.0.1 --port 8000 --reload

The REST API will be available at http://127.0.0.1:8000 with interactive Swagger docs at http://127.0.0.1:8000/docs.

3. Frontend Setup (React 19 / Vite)

In a separate terminal, install node packages and launch the frontend client:

cd frontend
npm install
echo "VITE_API_BASE_URL=http://127.0.0.1:8000/api" > .env
npm run dev -- --host 127.0.0.1 --port 5173

Open http://127.0.0.1:5173 in your browser.


Environment Configuration

Backend (backend/backend/.env)

Variable Default Description
FRONTEND_URL http://localhost:5173 Allowed CORS frontend origins
PORT 8000 FastAPI server port
ML_USE_STUB false Enable stub predictor for offline development
ML_ARTIFACTS_PATH ../artifacts/artifacts Path to trained .joblib model artifacts
GROQ_API_KEY "" Optional API key for extended LLM responses

Frontend (frontend/.env)

Variable Default Description
VITE_API_BASE_URL http://127.0.0.1:8000/api API endpoint URL for backend requests

Deployment

  • Backend: Containerized via backend/Dockerfile or deployed using render.yaml.
  • Frontend: Standard static build via npm run build deployed on Vercel or Netlify.

License

Distributed under the MIT License. See LICENSE for details.

About

AI-Content Detection & Forensic Text Analysis Platform

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages