DeepScan β Deepfake Detector
DeepScan is a full-stack AI deepfake detection platform that analyses images and videos for signs of synthetic manipulation using a CNN (MobileNetV2) pipeline. Users upload a file through a Gemini-style chat interface and instantly receive a verdict β complete with fake probability scores, frame-by-frame analysis, timeline charts, Groq LLM explanations in plain English, and a downloadable multi-page professional PDF report. The platform runs on a Flask web gateway + FastAPI inference backend, with automatic fallback to a demo simulation mode when the server is offline.
Deepfakes β AI-generated images and face-swapped videos β are becoming increasingly indistinguishable from authentic media. Existing detection tools are either closed-source, expensive API-based services, or academic prototypes with no usable interface. DeepScan bridges this gap by combining a trained CNN classifier with a polished, user-friendly frontend, an LLM-powered explanation engine, and professional-grade PDF reporting β all deployable with a single command and usable without any prior technical knowledge.
- Model: MobileNetV2 fine-tuned as a binary deepfake classifier (
deepfake_model.h5), trained with sigmoid output where HIGH sigmoid = REAL and LOW sigmoid = FAKE - Inverted scoring:
fake_prob = 1.0 β raw_sigmoidβ this inversion aligns the probability scale so that higher fake_prob always means higher likelihood of manipulation - Decision threshold:
fake_prob β₯ 0.50 β FAKE, otherwise REAL β fixed and calibrated to the model's training distribution - Image inference: Single forward pass through MobileNetV2 on a 224Γ224 RGB input, returning label + confidence + fake_prob in under one second
- Video inference: Up to 20 frames sampled evenly across the video duration via OpenCV, scored in a single batched CNN pass β overall verdict derived from mean fake_prob across all sampled frames
- Thumbnail generation: Each sampled frame is resized to 240px max dimension and base64-encoded as JPEG for inline display in the frontend and PDF
- Flask web gateway (
flask_app.py): Serves the static frontend, proxies file uploads to FastAPI, exposes/api/status,/api/analyse/image,/api/analyse/video, and/api/groq/explainβ with CORS enabled for cross-origin frontends (Netlify, GitHub Pages) - FastAPI inference server (
video_api.py): Loads the Keras model at startup, handles image and video analysis requests with full Pydantic response schemas, and manages temporary file lifecycle for video processing - Startup sequence: FastAPI launches first (port 8000) to allow model warm-up, then Gunicorn/Flask starts (port 7860) after a 20-second delay β coordinated via a shell startup script
- Groq integration: Server-side Groq proxy in Flask accepts prompts and calls LLaMA 3.1-8b-instant (with llama3-70b-8192 as fallback) β API key stored in
.envand never exposed to the client - History persistence: Every analysis is appended to a local
history.jsonfile with filename, verdict, fake_prob, and timestamp β accessible via/api/history
- Chat interface: Gemini-inspired chat UI with bot/user message bubbles, typing indicators, and smooth scroll β built in pure vanilla JavaScript with zero frameworks
- File handling: Drag-and-drop + file picker with 5 MB size enforcement, MIME/extension validation, and live preview (image thumbnail or video icon chip)
- Mode switching: Image / Video mode pills auto-switch based on detected file type; mode also changes the placeholder text and analysis endpoint
- Result rendering: Verdict banner, fake probability bar, metric chip grid, signal detail table, frame grid (video), Canvas-based timeline chart (video), and collapsible frame data table β all rendered inline in the chat
- Demo mode: When the Flask server is unreachable, a simulated result is generated client-side using
buildDemoResult(), matching the real API schema exactly so all UI components render identically - Settings panel: Slide-in advanced panel for Flask server URL override and Groq API key entry β both persisted to localStorage
- Image explanation: Sends CNN label, confidence, fake_prob, and threshold context to Groq β receives 3β5 sentences describing the verdict, likely visual artefacts detected, and confidence caveats
- Video explanation: Sends overall verdict, fake frame ratio, and CNN stats β receives a 4β6 sentence video-level analysis
- Per-frame Groq analysis: Top 5 highest-probability fake frames are sent individually to Groq for 2β3 sentence per-frame explanations, displayed alongside thumbnails with probability bars
- Model fallback: Attempts
llama-3.1-8b-instantfirst; falls back tollama3-70b-8192on 400/404; handles 401 (invalid key), 429 (rate limit), and timeout errors gracefully with user-facing messages - Dual key path: Client-side Groq key (direct browser β Groq API call) or server-side key via Flask proxy β whichever is available takes priority
- Library: jsPDF (client-side, no server needed) β generates multi-page A4 PDF entirely in the browser
- Image report (2 pages): Dark-themed header with verdict banner, analysed image embed with aspect-ratio preservation, executive summary (Groq-written), fake probability bar with threshold marker, detection metrics chips, CNN signal detail table, artefact reference grid, recommendations section, and methodology disclaimer
- Video report (4+ pages): Cover page with verdict + frame statistics, executive summary, overall probability bar chart, technical methodology, CNN model results, frame-by-frame bar chart timeline, complete per-frame card grid (thumbnail + narrative + metrics), full frame data table, forensic conclusion, and methodology
- Design system: Custom dark colour palette (10 CSS variables mapped to jsPDF RGB arrays), rounded-rect chips, gradient probability bars, threshold tick lines, and per-frame verdict badges
- Groq-enriched content: All prose sections (executive summary, technical analysis, recommendations, per-frame narratives, conclusion) are generated by Groq at PDF download time, with plain-text fallbacks when Groq is unavailable
- Model sigmoid direction: MobileNetV2 was trained with HIGH sigmoid = REAL β without the inversion (
fake_prob = 1 β sigmoid), all verdicts would be flipped. This inversion is applied consistently in both FastAPI and all demo/fallback code paths - Video cold-start latency: Large videos caused 30β90 second wait times. Solved by capping at 20 sampled frames, using batched CNN inference, and displaying a clear "Extracting framesβ¦" typing indicator with time estimate
- jsPDF text encoding: jsPDF's
doc.text()silently fails on null/undefined values. Solved by building asafeStr()wrapper and aT()alias that coerce all values to strings before rendering - Aspect-ratio-aware frame cards in PDF: Fixed-height thumbnail rows caused face-cropping on non-16:9 frames. Solved by pre-decoding all thumbnails to their real pixel dimensions, computing per-row max heights, and rendering each thumbnail centred within its allocated area
- Canvas timeline rendering timing: Canvas elements inserted into the DOM via innerHTML weren't ready for drawing. Solved using a MutationObserver on the messages container that triggers
drawTimeline()only after the canvas is actually attached to the DOM
Python, Flask, FastAPI, Gunicorn, TensorFlow / Keras (MobileNetV2), OpenCV, Pillow, NumPy, Groq Cloud API (LLaMA 3.1-8b-instant / llama3-70b-8192), python-dotenv, Werkzeug, flask-cors, Vanilla JavaScript (ES2020+), HTML5 Canvas, jsPDF 2.5.1, CSS3 (Custom Properties, Grid, Flexbox, Animations)
Real-Time Entertainment Intelligence
A cinematic, single-page analytics dashboard that delivers deep intelligence on any movie or TV show in real time. Users search for a title and instantly see box office financials, revenue trend modelling, financial breakdown charts, genre radar profiles, audience score rings, cast & crew grids, season browsers, network info, and popularity metrics β all wrapped in a gold-on-dark responsive UI built entirely in vanilla HTML, CSS, and JavaScript.
Entertainment data exists across dozens of scattered sources β box office trackers, review aggregators, streaming databases β making it hard for a user to get a holistic picture of any title in one place. The challenge was to unify all of this into a single zero-backend dashboard that feels as polished as a native app, loads instantly, and works on any device.
- Dual Mode: Seamless switch between Movies and TV Shows with context-aware UI β profit bars for movies, season grids and network info for TV
- Live Autocomplete Search: Real-time suggestions via TMDB search API with full keyboard navigation (β β Enter Escape) and βK shortcut
- Revenue Trend Modelling: Cumulative and period-based revenue charts built using a theatrical decay curve β since TMDB does not provide weekly breakdowns, the distribution is modelled mathematically
- Financial Breakdown: Animated bar chart comparing budget, worldwide box office, and net profit/loss with colour-coded profit/loss states
- Genre Radar Chart: Six-axis radar mapping Action, Adventure, Drama, Thriller, Comedy, and Romance scores derived from a hand-crafted genre scoring matrix
- Audience Score Ring: Animated SVG stroke-dashoffset ring that fills dynamically, colour-coded green/gold/red by rating tier
- Cast & Crew Grid: Director/Creator highlighted in gold, full cast with profile photos, character names, and roles
- Season Browser: TV-only grid showing every season with poster, episode count, and air year
- Zero Backend: Pure static frontend β no server, no build step, no framework. HTML + CSS + vanilla JS only
- TMDB API v3: Two parallel fetch calls on search selection β
/movie/{id}+/movie/{id}/credits(or TV equivalents) β resolved withPromise.allfor speed - Chart.js 4.4: Six chart instances (cumulative line, period bar, financial bar, popularity bar, genre radar, episodes bar) with shared tooltip and scale defaults
- chartjs-adapter-date-fns: Enables time-axis charts with
type: "time"for the revenue trend panels - CSS Custom Properties: Full design token system (10 colour variables, layout variables) enabling consistent theming across all components
- No weekly box office data: TMDB only provides a lifetime revenue total. Solved by modelling distribution using an exponential decay function with a 120-day theatrical window and a 12% home-video tail
- Chart instance memory leaks: Each new search destroys all six previous chart instances via a
destroyChart()wrapper before re-creating them - Mobile image cropping: Fixed by replacing fixed-height poster containers with
aspect-ratio: 2/3+max-heightcaps per breakpoint
HTML5, CSS3 (Custom Properties, Grid, Flexbox, Animations), Vanilla JavaScript (ES2020+), TMDB API v3, Chart.js 4.4, chartjs-adapter-date-fns, Bebas Neue + DM Sans (Google Fonts)
AI Web Vulnerability Scanner
A full-stack, AI-powered web vulnerability scanner built with Streamlit and powered by a dual-intelligence engine: Groq Cloud AI (LLaMA 3.3 70B) for contextual threat analysis and a trained Random Forest ML model for pattern-based detection. Users authenticate via a login system, enter any URL or domain, and the scanner automatically discovers subdomains, crawls pages, and surfaces vulnerabilities across SQL Injection, XSS, CSRF, insecure headers, and security misconfigurations β all exported as JSON, Markdown, or CSV reports.
Manual penetration testing is slow, expensive, and hard to scale. Rule-based scanners miss context-dependent vulnerabilities and generate noisy false positives. This project combines a trained ML model with a real Groq LLM to create a scanner that understands page context, validates findings intelligently, and produces executive-grade reports.
- Layer 1 β Random Forest ML Model: A trained scikit-learn Random Forest classifier predicts SQL Injection, XSS, or Misconfiguration with per-class probability scores. Only predictions above 60% confidence are surfaced as findings
- Layer 2 β Traditional Pattern Detection: Regex and DOM heuristics scan page HTML for known dangerous patterns β
eval(),innerHTML=,document.write(), GET-method forms, POST forms without CSRF tokens - Layer 3 β Groq AI Analysis (LLaMA 3.3 70B): The
GroqOrchestratorsends HTML snippets, form structures, and script counts to Groq's API for deep contextual analysis, returning structured JSON vulnerability objects with CWE IDs, proof of concept, and remediation guidance
- SQL Injection (CWE-89), XSS (CWE-79), Missing CSRF Protection (CWE-352)
- Sensitive Data Exposure (CWE-200) via HTML comment scanning
- Insecure Protocol (CWE-319) and five missing security headers (CWE-16)
- ML-detected Misconfiguration based on CSP absence and script/form count thresholds
Python, Streamlit, Groq Cloud API (LLaMA 3.3 70B), Scikit-learn (Random Forest), Joblib, Pandas, NumPy, BeautifulSoup4, Requests, python-dotenv, lxml, concurrent.futures, socket
Cyber Threat Detection Suite
A machine learning-powered system designed to detect malicious network activity in real time, providing proactive cybersecurity through traffic pattern analysis and threat classification.
Modern networks face threats including malware, DoS attacks, and unauthorized access. Traditional rule-based tools struggle with unknown threats. This project applies ML to recognize attack patterns in network traffic.
Random Forest, SVM, and ensemble learners classify traffic as benign or malicious. Models are evaluated using accuracy, precision, recall, and F1-score metrics.
- Network traffic preprocessing and feature preparation
- Real-time inference through Flask API
- Confidence scores for predictions
- Attack category visualisation
Enhances traditional security tools by detecting complex attack patterns, supporting faster incident response and reducing false positives. Achieved 94% detection accuracy during the RedKross internship deployment.
Spotify Real-Time Recommendation System
A real-time music recommendation system built using Python and the Spotify Web API. Its goal is to help users discover new music tailored to their listening preferences by analyzing their historical listening behavior and track audio features.
With millions of songs available on streaming platforms, users often struggle to find tracks that match their tastes. This project creates a system that recommends songs dynamically based on listening patterns and audio characteristics.
- User Authentication: Secure login via Spotify OAuth 2.0
- Data Retrieval: Collects recently played tracks and audio features
- Feature Processing: Normalizes song vectors for similarity comparison
- Similarity Calculation: Uses cosine similarity for matching
- Recommendations: Real-time suggestions through web interface
- Real-time analysis enables highly personalized recommendations
- Audio feature-based similarity outperforms playlist matching
- API optimization significantly improves responsiveness
Python, Flask, Pandas, NumPy, Spotify Web API
Car Price Prediction
ML-powered car price prediction system estimating vehicle values based on mileage, manufacture year, brand, and other features through regression models.
Predicting fair market value for used cars is challenging. Buyers and sellers rely on rough estimates. This model learns from historical data to provide accurate predictions.
Data cleaning handled missing values and categorical encoding. Feature engineering created variables like vehicle age, enhancing the model's pattern recognition.
Regression models trained on historical car data. Evaluation using MAE and RΒ² score ensures generalisation to unseen data.
- Data preprocessing and transformation pipeline
- Real-time prediction via Flask API
- Cloud deployment ready
- Serialised model for quick inference
Movie Recommender System
A Python-based recommendation system providing personalized movie suggestions using content similarity algorithms and collaborative filtering.
Users struggle to find relevant movies among thousands of titles. Static charts don't cater to individual tastes. This system analyses metadata and similarity patterns for personalisation.
Precomputed similarity matrices enable fast recommendations. Cosine similarity between movie feature vectors (genres, ratings) drives the logic.
- Interactive web interface
- Fast real-time recommendations
- Personalised suggestions
- Lightweight Flask deployment
Enhances content discovery and user engagement by applying ML techniques for personalized recommendations in large catalogs.
IPL Data Analysis Dashboard
In-depth exploratory analysis of IPL cricket (2008β2019), uncovering patterns in team performance, player contributions, and match outcomes using historical data.
IPL generates massive datasets, but raw statistics don't explain performance trends. This project structures data to answer questions about consistency, toss influence, and venue effects.
- Team Performance: Win percentages and dominance patterns
- Toss Impact: Correlation with match outcomes
- Player Analysis: Strike rates and consistency metrics
- Venue Insights: Stadium influence on scoring
- Small group of teams showed long-term dominance
- Toss had limited impact on outcomes
- Individual performance influenced success more than conditions
- Venue characteristics affected scoring trends