How alihamza-coder/deceptron-fyp-final-year-project works
Purpose and Entry Points
Deceptron is a local desktop research application for multi-modal deception cue analysis of live or uploaded interview media. The UI launches through Eel at Frontend/main.py; browser-oriented launch is Frontend/web_app.py. A separate FastAPI analysis service starts at backend/server.py, with a CLI-oriented pipeline entry at backend/modules/main.py.
Desktop UI and Local Application Layer
The Eel-hosted Vanilla JS UI provides authentication, session capture, uploads/evidence vault, analysis views, dashboards, and reports. Page scripts call the backend API and manage browser media capture/preview.
• Frontend/web/index.html
• Frontend/web/js/common/api.js
• Frontend/web/js/pages/start-session.js
Local account, session, report, and upload metadata persistence is handled through TinyDB, while verification/reset emails are sent through SMTP.
• Frontend/modules/database.py
• Frontend/modules/email_sender.py
• Frontend/config.py
API Boundary and Orchestration
FastAPI is the compute-service boundary, exposing isolated voice, emotion, face, and full-pipeline endpoints. The full pipeline route coordinates media processing and combines lower-level model outputs; this cleanly separates desktop/UI state from heavy ML execution.
• backend/server.py
• backend/api/routes/pipeline.py
• backend/api/routes/face.py
Media Intake, Speaker, and Segment Stage
Video/audio input is processed into analyzable speech turns: FFmpeg extracts audio, PyAnnote diarizes speakers and identifies the primary subject, then segmentation combines Whisper transcripts with silence/VAD splitting. These answer-level segments are the primary units for downstream voice, language, and time-aligned visual analysis.
• backend/modules/speaker_diarizer.py
• backend/modules/segment_manager.py
• backend/modules/forensic_voice_analyzer.py
Vision and Emotion Analysis
Concurrent video modules derive behavioral features such as gaze/blinking, head pose, lip/jaw tension, facial asymmetry, and hand-to-face gestures. A separate emotion model produces time-based facial-expression classifications. The system establishes an early-session behavioral baseline and evaluates later changes relative to it.
• backend/modules/eye_gaze_module.py
• backend/modules/head_pose_module.py
• backend/modules/emotion_detection_module.py
Voice and Language Analysis
For each speech segment, the forensic voice analyzer extracts acoustic stress features and Whisper transcription. The NLP component sends transcript/context to Groq-hosted Llama 3.3 for bilingual linguistic deception indicators and cross-segment contradiction analysis; this is the principal runtime network dependency.
• backend/modules/forensic_voice_analyzer.py
• backend/modules/nlp_deception_module.py
• backend/api/routes/voice.py
Fusion, Reasoning, and Outputs
The fusion engine is the decision layer: it weights face behavior, emotion control, voice stress, NLP, and cross-modal mismatch; applies clustering/confirmation rules; and assigns risk/verdict. The reasoning engine generates English/Roman Urdu explanation text. Results are persisted locally and may include annotated or composite videos under the user’s ~/.deceptron/ storage.
• backend/modules/fusion_engine.py
• backend/modules/reasoning_engine.py
• backend/modules/deception_pipeline.py
Runtime and Deployment Constraints
Core runtimes are Python 3.9+, Eel, FastAPI, and local TinyDB. ML/media dependencies include PyTorch, MediaPipe, HSEmotion, PyAnnote, Whisper, Praat/Parselmouth, OpenCV, and FFmpeg. Whisper/PyAnnote weights can be preloaded for offline operation via backend/download_models.py; Groq NLP remains online. Both application tiers support PyInstaller packaging.
• backend/requirements.txt
• Frontend/requirements.txt
• backend/download_models.py
Main entry points: deception_pipeline.py Deception pipeline · index.html Vanilla JS UI · forensic_voice_analyzer.py Forensic voice analysis · fusion_engine.py Fusion and verdict
Components 22
Desktop application
- Eel desktop launcher
Frontend/main.py - Browser launcher
Frontend/web_app.py - Vanilla JS UI · Capture, evidence, analysis, dashboard, and report views.
Frontend/web/index.html - API client
Frontend/web/js/common/api.js - Session capture
Frontend/web/js/pages/start-session.js - Local account and case data · Accounts, sessions, reports, and upload metadata.
Frontend/modules/database.py - Verification email
Frontend/modules/email_sender.py
Analysis service
- FastAPI service
backend/server.py - Full pipeline route
backend/api/routes/pipeline.py - Voice endpoint
backend/api/routes/voice.py - Face endpoint
backend/api/routes/face.py
Media analysis pipeline
- Speaker and segment stage · FFmpeg audio extraction, PyAnnote diarization, and answer-level segmentation.
backend/modules/speaker_diarizer.py - Forensic voice analysis · Extracts stress features and Whisper transcripts per segment.
backend/modules/forensic_voice_analyzer.py - Behavioral vision analysis · Gaze, blink, pose, facial tension, asymmetry, and gestures.
backend/modules/eye_gaze_module.py - Emotion analysis · Builds an early baseline and detects later expression changes.
backend/modules/emotion_detection_module.py - Linguistic deception analysis · Bilingual cues and cross-segment contradictions.
backend/modules/nlp_deception_module.py - Fusion and verdict · Weights modalities, applies confirmation rules, and assigns risk.
backend/modules/fusion_engine.py - Bilingual reasoning
backend/modules/reasoning_engine.py - Deception pipeline · Persists results and can generate annotated media.
backend/modules/deception_pipeline.py - Offline model preload · Preloads Whisper and PyAnnote weights.
backend/download_models.py
Other components
- Groq Llama 3.3 · Principal online runtime dependency.
- Analysis artifacts · Results and annotated/composite media under ~/.deceptron/.
Connections 28
- Eel desktop launcher → Vanilla JS UI: hosts
- Browser launcher → Vanilla JS UI: launches
- Vanilla JS UI → API client: uses
- Session capture → API client: submits media
- Vanilla JS UI → Local account and case data: manages local state
- Vanilla JS UI → Verification email: triggers verification
- API client → FastAPI service: calls
- FastAPI service → Full pipeline route: serves
- FastAPI service → Voice endpoint: serves
- FastAPI service → Face endpoint: serves
- Full pipeline route → Deception pipeline: runs
- Voice endpoint → Forensic voice analysis: runs
- Face endpoint → Behavioral vision analysis: runs
- Deception pipeline → Speaker and segment stage: prepares speech turns
- Speaker and segment stage → Forensic voice analysis: provides segments
- Deception pipeline → Behavioral vision analysis: analyzes video
- Deception pipeline → Emotion analysis: analyzes expressions
- Forensic voice analysis → Linguistic deception analysis: provides transcripts
- Linguistic deception analysis → Groq Llama 3.3: queries
- Forensic voice analysis → Fusion and verdict: voice stress
- Behavioral vision analysis → Fusion and verdict: behavior features
- Emotion analysis → Fusion and verdict: emotion changes
- Linguistic deception analysis → Fusion and verdict: linguistic cues
- Fusion and verdict → Bilingual reasoning: verdict and evidence
- Bilingual reasoning → Deception pipeline: explanations
- Deception pipeline → Analysis artifacts: writes artifacts
- Offline model preload → Speaker and segment stage: preloads PyAnnote
- Offline model preload → Forensic voice analysis: preloads Whisper