A Production-Grade Forensic Platform for Digital Media Verification
Varun β AI/ML Engineer specializing in computer vision, deep learning, and cybersecurity research.
TrueVision is a state-of-the-art deepfake detection forensic platform engineered for high-precision media verification. Built on a cutting-edge Tri-Model Ensemble Neural Network architecture, it combines specialized deep learning models with robust online active learning to detect sophisticated media manipulation attacks.
The platform seamlessly integrates:
Key Capabilities:
TrueVision operates across four interconnected stages, from raw media ingestion through final forensic assessment:
flowchart TB
%% Styling
classDef stage fill:#111,stroke:#7c3aed,stroke-width:2px,color:#fff;
classDef component fill:#1d1b26,stroke:#a78bfa,stroke-width:1px,color:#ddd;
classDef dataset fill:#062016,stroke:#10b981,stroke-width:1px,color:#10b981;
classDef aws fill:#2a1a08,stroke:#ff9900,stroke-width:1px,color:#ff9900;
subgraph STAGE1 ["Stage 1: Input Ingestion & Data Flow"]
A["User Media File<br/>(.jpg, .png, .mp4, .avi, .mov)"] --> B["Local API Proxy<br/>(FastAPI: Port 8000)"]
B -->|POST /process/| C["AWS EC2 Inference Server<br/>(Port 8000)"]
end
class STAGE1,A,B,C stage;
subgraph STAGE2 ["Stage 2: Pre-Processing & Feature Engineering"]
C --> D["Intelligent Frame Extraction<br/>(Skip: Every 15th, Max 30 Frames)"]
D --> E["Facial Detection Pipeline<br/>(Haar Cascade: Max 10 Faces)"]
end
class STAGE2,D,E stage;
subgraph STAGE3 ["Stage 3: Tri-Model Ensemble Classification"]
E -->|Raw Pixels| M1["Model 1: EfficientNet-B0<br/>CNN Architecture<br/>Weight: 33%"]
E -->|Laplacian Edges| M2["Model 2: ResNet50 + ViT<br/>Composite Vision<br/>Weight: 33%"]
E -->|Texture Analysis| M3["Model 3: ETCNN<br/>Texture + Semantic Fusion<br/>Weight: 34%"]
M1 --> F["Ensemble Calibration<br/>(Symmetric Square-Root)"]
M2 --> F
M3 --> F
end
class STAGE3,M1,M2,M3,F stage;
subgraph STAGE4 ["Stage 4: Forensic Output & Active Learning"]
F --> G["Final Classification<br/>(Real or Fake + Confidence %)"]
G --> H["Auto-Archive<br/>(user_dataset/auto/)"]
G -->|User Provides Feedback| I["POST /feedback/"]
I -->|Background Fine-Tune| J["ETCNN Dynamic Update<br/>(3 Epochs, Safeguards Active)"]
J -->|Validates Variance| M3
I -->|Accumulates 100+ Confirmed| K["Full Model Retraining"]
end
class STAGE4,G,H,I,J,K stage;
%% External Resources
subgraph DB ["Training Datasets"]
DATA1[("Celeb-DF v2")]
DATA2[("DFDC")]
DATA3[("FaceForensics++")]
end
class DB,DATA1,DATA2,DATA3 dataset;
M1 -.-> DATA3
M2 -.-> DATA2
M3 -.-> DATA1
subgraph AWS_SERV ["AWS Deployment"]
EC2["EC2 Instance<br/>(3.238.89.41)"]
SES["SES / SMTP Gateway"]
end
class AWS_SERV,EC2,SES aws;
C --- EC2
B -.->|Email Reports| SES
TrueVisionβs strength lies in its specialized tri-model architecture, where each model captures distinct forensic artifacts:
Detects raw-pixel level anomalies and color blending artifacts typical of face-swaps.
Captures structural inconsistencies via edge analysis and attention mechanisms.
Fuses high-frequency texture analysis with global semantic context via attention.
Raw ensemble scores often cluster near decision boundaries (0.5 = uncertain). TrueVision applies Symmetric Square-Root Calibration to push predictions toward actionable confidence levels while maintaining fairness:
\[\text{Calibrated Score} = \begin{cases} 0.5 + \sqrt{\frac{p_{fake} - 0.5}{0.5}} \times 0.5 & \text{if } p_{fake} > 0.5 \\ 0.5 - \sqrt{\frac{0.5 - p_{fake}}{0.5}} \times 0.5 & \text{if } p_{fake} < 0.5 \\ 0.5 & \text{if } p_{fake} = 0.5 \end{cases}\]Effect: A marginal raw prediction (0.65) β calibrated to 77.4% confidence, ensuring clear, decisive verdicts.
TrueVision learns from user feedback in real-time while protecting against adversarial βpoisoningβ attacks:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Upload & Inference Flow β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
[Inference Output]
β
[ Auto-saved to user_dataset/auto/ ]
β
[User Provides Feedback]
β
[ Face Copied to user_dataset/confirmed/ ]
β
[ ETCNN Fine-Tuning: 3 Epochs ]
lr=1e-5, weight_decay=1e-4
β
[ Variance Safety Check ]
β β
ΟΒ² < 0.0001? ΟΒ² β₯ 0.0001?
β β
[ REJECT ] [ COMMIT WEIGHTS ]
[ RESTORE ] [ Update Model ]
[ BACKUP ]
REAL or FAKE) via POST /feedback/user_dataset/confirmed/{real|fake}/After fine-tuning, the server validates model integrity:
etcnn_combined.pth.backup, alert administratorThis ensures 100% inference reliability even under adversarial feedback.
3.238.89.418000 (FastAPI Core Engine)9000 (Directory listing for frame previews & datasets)/home/ubuntu/truevision/models/8000 (User-facing FastAPI)TrueVision/
βββ README.md # This documentation
βββ .gitignore
β
βββ Dataset/ # Local test dataset
β βββ fake/ # Fake face samples
β βββ real/ # Real face samples
β
βββ backend/ # Local Proxy Server
β βββ app.py # FastAPI proxy & email engine
β βββ test_api.py # API endpoint tests
β βββ test_email.py # Email delivery tests
β βββ .env # Secrets (gitignored)
β βββ routes/ # Modular route handlers
β βββ services/ # Business logic
β βββ utils/ # Helpers & logging
β
βββ ec2_server/ # AWS EC2 Deep Learning Server
β βββ app.py # Core inference engine
β βββ inference.py # PyTorch model classes
β βββ inspect_checkpoints.py # Checkpoint diagnostics
β βββ deploy.sh # EC2 deployment automation
β βββ services/ # Preprocessing & face detection
β βββ utils/ # Model loaders
β
βββ frontend/ # Vanilla HTML/CSS/JS Dashboard
β βββ login.html # Authentication gateway
β βββ app.html # Main reporting UI
β βββ app.js # Interactive graphs & analysis
β βββ style.css # Dark-glass glassmorphism theme
β
βββ truevision-app/ # Premium React + Vite + Tailwind
βββ src/ # React components
βββ package.json
localhost:8000 | Remote: 3.238.89.41:8000)| Method | Endpoint | Payload | Description |
|---|---|---|---|
| GET | / |
β | System status & gateway availability |
| POST | /process/ |
file: MultipartFile |
Upload media β Extract frames β Run ensemble |
| POST | /feedback/ |
{"label": "FAKE"\|"REAL"} |
Submit user verification β Trigger fine-tuning |
| GET | /model/status/ |
β | Model metadata, dataset paths, limits |
localhost:8000)| Method | Endpoint | Payload | Description |
|---|---|---|---|
| POST | /send-welcome-email/ |
{"name": "Varun", "email": "user@example.com", "is_new_user": true} |
Welcome email |
| POST | /send-report-email/ |
{"name": "Varun", "email": "user@...", "file_name": "scan.mp4", "prediction": "FAKE", "confidence": 98.2, "explanation": "..."} |
Forensic report email |
| POST | /send-audit-report/ |
{"name": "Varun", "email": "user@...", "total_real": 12, "total_fake": 5, "history": [...]} |
Activity audit email |
3.238.89.41:8000)| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/retrain-status/ |
Check confirmed face count; ready: true when β₯ 100 |
| GET | /admin/feedback-log/ |
View feedback history, losses, variance metrics |
TrueVisionβs tri-model ensemble is pre-trained on three industry-leading forensics benchmarks:
# 1. Navigate to backend
cd backend
# 2. Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install fastapi uvicorn requests pydantic python-dotenv
# 4. Configure environment
cp .env.example .env
# Edit .env with your AWS SES & email credentials
# 5. Launch proxy server
python app.py
Server runs on http://localhost:8000
# Navigate to frontend
cd frontend
# Serve static files (lightweight HTTP server)
python -m http.server 5500
Open http://localhost:5500 in your browser.
TrueVision is designed exclusively for:
Use Policy: This tool is not intended for creating, distributing, or weaponizing deepfake content. Misuse is subject to legal liability under relevant jurisdictionsβ digital fraud and impersonation laws.
[Add your chosen license here]
Contributions, bug reports, and feature requests are welcome! Please open an issue or pull request.
Author: Varun
Project: TrueVision β Enterprise Deepfake Detection
Email: [varunvadlakonda4@gmail.com]
GitHub: @VisionStack-404
Last Updated: 2026-05-26