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.
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.
+-------------------------------------------------------------------------+
| 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 | +-------------------------+
+------------------------------------+
- 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
.docxand.pdffiles directly within the browser client. - Exportable Reports: Generate highlighted
.docxand.pdfsummary 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.
- Python: 3.10+
- Node.js: 18.0+
- npm: 9.0+
git clone https://github.com/ahmadkhanalm/AI-Content-Detection-Forensic-Text-Analysis-Platform.git
cd AI-Content-Detection-Forensic-Text-Analysis-PlatformNavigate 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 --reloadThe REST API will be available at http://127.0.0.1:8000 with interactive Swagger docs at http://127.0.0.1:8000/docs.
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 5173Open http://127.0.0.1:5173 in your browser.
| 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 |
| Variable | Default | Description |
|---|---|---|
VITE_API_BASE_URL |
http://127.0.0.1:8000/api |
API endpoint URL for backend requests |
- Backend: Containerized via
backend/Dockerfileor deployed usingrender.yaml. - Frontend: Standard static build via
npm run builddeployed on Vercel or Netlify.
Distributed under the MIT License. See LICENSE for details.


