How divyaazz/ai-lie-detector works
Project Type & Purpose
• This is a full-stack, multi-modal AI application that ingests voice, video, or text input, processes it through ML pipelines (audio processing, facial recognition, NLP), classifies the response as “Truth” or “Lie,” and presents results via a web interface.
High-Level Architecture Components
a. Client Layer
• Web UI (Streamlit or Flask front-end)
b. Ingestion & Preprocessing Layer
• Audio Preprocessor (Librosa, OpenSMILE)
• Video/Facial Preprocessor (OpenCV, MediaPipe, dlib)
• Text Preprocessor (NLTK, spaCy, Transformers)
c. Feature Extraction Layer
• Audio Feature Extractor (MFCC, pitch, energy vectors)
• Facial Feature Extractor (landmarks, expression vectors)
• Text Embedding Generator (BERT embeddings)
d. Classification Layer
• Neural Network Model(s) (TensorFlow/Keras or PyTorch)
– Single unified classifier or separate per-modality with ensemble logic
• Decision logic to output “Truth” or “Lie” and confidence score
e. Data Storage Layer
• Local filesystem for raw input and feature caches
• MongoDB (optional) for storing labeled inputs, training/serving data
f. Deployment & Infrastructure
• Containerization (Docker)
• Cloud deployment: Heroku or AWS (EC2 for servers, Lambda for serverless inference)
• CI/CD pipelines (optional)
Relationships & Data Flows
• User uploads or streams input → Web UI
• Web UI calls ingestion endpoints → dispatches to appropriate Preprocessing service
• Preprocessed data forwarded to Feature Extraction modules
• Extracted features aggregated and sent to Classification service
• Prediction results returned to Web UI → display “Truth”/“Lie” + confidence
• All inputs, features, and predictions logged/stored in Data Storage for auditing or model retraining
Architectural Patterns & Design Principles
• Layered/microservices approach for each modality preprocessor
• Single Responsibility: each service (audio, video, text) does one thing
• Modular ML pipeline: easy to swap out models or add new modalities
• Stateless front-end; stateful or stateless back-end depending on chosen deployment
• Optional event-driven messaging (e.g., RabbitMQ or AWS SNS/SQS) if scaling async jobs