Central Detective Training Institute, Jaipur
Bureau of Police Research & Development (BPRD)
तेजस्वि नावधीतमस्तु
Advanced Digital Forensics Platform - An anomaly-first, evidence-driven forensic investigation tool designed for law enforcement to detect deepfakes, AI-generated content, analyze fraud messages, and track digital evidence.
- Features
- System Architecture
- Installation
- Usage Guide
- API Documentation
- Location Tracking
- Fraud Analyzer
- Technical Details
- Legal Compliance
- Credits
- Anomaly-First Analysis - Detects irregularities before making conclusions
- Evidence-Driven Approach - Every finding backed by measurable data
- 20+ Detection Algorithms - Comprehensive visual forensics
- Explainable AI - Scientific reasoning for all verdicts
| Category | Algorithms | Purpose |
|---|---|---|
| Visual | 5 algorithms | Pattern, texture, artifact analysis |
| Frequency | 4 algorithms | DCT, FFT, wavelet analysis |
| Statistical | 3 algorithms | Noise, histogram, entropy analysis |
| Forensic | 3 algorithms | Compression, EXIF, consistency checks |
| Semantic | 2 algorithms | Face, object coherence analysis |
- Temporal Analysis - Frame-to-frame consistency
- Motion Forensics - Optical flow anomalies
- Face Tracking - Identity persistence across frames
- Lip-Sync Detection - Audio-visual synchronization
- SMS/WhatsApp Fraud Detection - Lottery, OTP, job scams
- URL Deep Scan - Phishing, malware, suspicious domains
- Phone Number Analysis - Spam, fraud caller identification
- Instagram Scam Detection - Fake giveaways, impersonation
- Pattern Recognition - 50+ fraud patterns database
- Pseudonymous User IDs - SHA-256 hashed, non-reversible
- Consent-Based Tracking - Separate handling for Allow/Deny
- Distance-Based History - 100m threshold for location reuse
- No Raw IP Storage - Legal compliance ensured
- Device Fingerprinting - Canvas, WebGL, Audio fingerprints
- Media Dashboard - All analyzed content with verdicts
- Fraud Dashboard - Fraud patterns, risk distribution
- Location Analytics - User visit patterns (privacy-safe)
- Export Reports - PDF generation for legal proceedings
FakeTrace/
├── backend/ # Python FastAPI Backend
│ ├── main.py # Main API server
│ ├── modules/
│ │ ├── forensic_anomaly_engine_v7.py # Core forensic engine
│ │ ├── ai_generation_detector_v3.py # AI detection algorithms
│ │ ├── advanced_explainable_ai.py # Gemini AI integration
│ │ ├── fraud_analyzer.py # Fraud detection
│ │ ├── location_database.py # Privacy-compliant location DB
│ │ ├── content_database.py # SQLite content storage
│ │ └── video_ai_detector.py # Video analysis
│ ├── uploads/ # Analyzed media storage
│ ├── location/ # Location JSON files
│ ├── database.db # Main content database
│ └── location_database.db # Location tracking database
│
├── frontend/ # React + Vite Frontend
│ ├── src/
│ │ ├── App.jsx # Main application
│ │ ├── index.css # CDTI theme styles
│ │ └── main.jsx # React entry point
│ ├── public/
│ │ └── cdti-logo.png # CDTI logo
│ └── package.json
│
└── README.md # This file
- Python 3.10+ with pip
- Node.js 18+ with npm
- Windows 10/11 or Linux
cd FakeTracecd backend
# Create virtual environment (recommended)
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac
# Install dependencies
pip install -r requirements.txt
# Configure API keys
copy .env.example .env
# Edit .env with your API keys (see below)cd frontend
# Install dependencies
npm installEdit backend/.env:
# Required APIs
GOOGLE_API_KEY=your_gemini_api_key
SERPAPI_KEY=your_serpapi_key
# Optional APIs (enhance accuracy)
HIVE_API_KEY=your_hive_ai_key
SIGHTENGINE_USER=your_sightengine_user
SIGHTENGINE_SECRET=your_sightengine_secret| API | Purpose | Get Key |
|---|---|---|
| Google AI (Gemini) | AI analysis & explanations | aistudio.google.com |
| SerpAPI | Reverse image search | serpapi.com |
| Hive AI | Deepfake detection | thehive.ai |
| SightEngine | Content moderation | sightengine.com |
Minimum Required: Google AI + SerpAPI
Terminal 1 - Backend:
cd backend
python main.pyBackend starts at: http://localhost:8000
Terminal 2 - Frontend:
cd frontend
npm run devFrontend starts at: http://localhost:5173
- Go to Analyze tab
- Drag & drop or click to upload image/video
- Wait for forensic analysis (10-30 seconds)
- Review detailed findings:
- Verdict: Authentic/Suspicious/Manipulated
- AI Detection: Human-made vs AI-generated
- Visual Forensics: 20+ anomaly checks
- Origin Tracking: Reverse image search results
- Go to Fraud Analyzer tab
- Paste suspicious message (SMS/WhatsApp/Email)
- Click "Analyze for Fraud"
- Get detailed risk assessment:
- Risk Level (Critical/High/Medium/Low)
- Fraud Type (Lottery, OTP, Phishing, etc.)
- Suspicious Elements highlighted
- Safe/Unsafe indicators
- View all analyzed fraud messages
- Filter by risk level
- Export for reporting
- Browse all analyzed media
- Filter by verdict
- View detailed analysis history
http://localhost:8000
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/analyze |
Analyze image/video |
| GET | /api/dashboard |
Get dashboard stats |
| GET | /api/dashboard/content |
List analyzed content |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/fraud/analyze |
Analyze suspicious message |
| GET | /api/fraud/dashboard |
Fraud statistics |
| GET | /api/fraud/messages |
List analyzed messages |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/location/track |
Track user location |
| GET | /api/location/stats |
Location statistics |
| GET | /api/location/all |
List all locations |
curl -X POST http://localhost:8000/api/analyze \
-F "file=@suspicious_image.jpg"curl -X POST http://localhost:8000/api/fraud/analyze \
-H "Content-Type: application/json" \
-d '{"content": "Congratulations! You won Rs 50 Lakhs lottery. Send Rs 5000 to claim."}'-
User Visits Website → Location permission popup appears
-
If User ALLOWS:
- GPS coordinates captured (or IP fallback on Desktop)
- Pseudonymous User ID generated:
USR-XXXXXXXX - Location saved with city, country, coordinates
- File created:
LOC-XXXXXXXX.json
-
If User DENIES:
- NO coordinates stored
- Anonymous ID generated:
ANON-XXXXXXXX - Only timezone-based region saved
- File created:
ANON-session.json
| Feature | Implementation |
|---|---|
| User ID | SHA-256 hash of device fingerprint (non-reversible) |
| IP Address | Never stored |
| Coordinates | Only with explicit consent |
| Fingerprint | Hashed, not raw |
| Distance Threshold | 100m (same location reuse) |
-- Users (pseudonymous)
CREATE TABLE users (
user_id TEXT PRIMARY KEY,
consent_status TEXT,
fingerprint_hash TEXT
);
-- Locations (allowed users only)
CREATE TABLE location_records (
location_id TEXT PRIMARY KEY,
user_id TEXT,
latitude REAL,
longitude REAL,
city TEXT,
country TEXT
);
-- Anonymous visits (denied users)
CREATE TABLE anonymous_visits (
anonymous_id TEXT,
session_id TEXT,
approximate_region TEXT,
denial_reason TEXT
);| Type | Detection Patterns |
|---|---|
| Lottery Scam | Prize money, claim now, winner selected |
| OTP Fraud | Share OTP, verify account, bank alert |
| Job Scam | Work from home, easy money, Rs/day |
| Loan Fraud | Instant loan, no documents, low interest |
| KYC Scam | Update KYC, account blocked, verify |
| Investment Fraud | Double money, guaranteed returns |
| Phishing | Suspicious URLs, fake domains |
| Delivery Scam | Package pending, pay charges |
- 🔴 CRITICAL (80-100): Definite fraud
- 🟠 HIGH (60-79): Very likely fraud
- 🟡 MEDIUM (40-59): Suspicious
- 🟢 LOW (0-39): Probably safe
- ELA (Error Level Analysis) - Compression artifact detection
- Noise Analysis - Inconsistent noise patterns
- Edge Detection - Unnatural edge artifacts
- Clone Detection - Copy-paste regions
- Metadata Analysis - EXIF inconsistencies
- GAN Fingerprint - StyleGAN, ProGAN patterns
- Diffusion Artifacts - DALL-E, Midjourney, SD signatures
- Face Analysis - Asymmetry, eye reflection
- Texture Analysis - Unnatural smoothness/patterns
- Frequency Analysis - FFT, DCT anomalies
- Temporal Consistency - Frame-to-frame changes
- Motion Vectors - Optical flow anomalies
- Face Tracking - Identity persistence
- Lip Sync - Audio-visual mismatch
- Compression Analysis - Re-encoding detection
| Component | Technology |
|---|---|
| Backend | Python 3.10, FastAPI, SQLite |
| Frontend | React 18, Vite, TailwindCSS |
| AI/ML | Google Gemini, OpenCV, NumPy |
| OCR | EasyOCR (English + Hindi) |
| Database | SQLite (content + location) |
- ✅ No personally identifiable information stored
- ✅ Pseudonymous user identification
- ✅ Consent-based data collection
- ✅ No raw IP addresses stored
- ✅ Hashed fingerprints (non-reversible)
- ✅ SHA-256 file hashes for integrity
- ✅ Timestamped analysis records
- ✅ Chain of custody maintenance
- ✅ PDF report generation for legal use
- Information Technology Act, 2000 (India)
- IT (Reasonable Security Practices) Rules, 2011
- GDPR compliance (for international use)
Central Detective Training Institute (CDTI)
- Bureau of Police Research & Development
- Ministry of Home Affairs, Government of India
- Jaipur, Rajasthan
- Google Gemini AI
- SerpAPI
- OpenStreetMap Nominatim
- IP Geolocation APIs
For technical support or queries:
- Website: https://bprd.nic.in/cdti
This software is developed for law enforcement training and investigation purposes under CDTI, BPRD. Unauthorized commercial use is prohibited.
🔍 FakeTrace v7.0
Trace Deepfakes, Expose Truth
तेजस्वि नावधीतमस्तु
