# praveen24sriv/deepfake-video-detection-system architecture

> Architecture diagram of the GitHub repository praveen24sriv/deepfake-video-detection-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/praveen24sriv/deepfake-video-detection-system
- Repository: https://github.com/praveen24sriv/deepfake-video-detection-system

## Overview

DeepGuard is a video deepfake-analysis product: users select a video, submit it for server-side inspection and face-based inference, then receive a verdict, suspicious timeline, statistics, and a heatmap. The graph captures the documented training/preprocessing capability as well as the web and API runtime. Some frontend API wiring and backend route/service details are unsampled, so those links are omitted rather than inferred.

Main entry points: [`backend/app/services/analysis_service.py`](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/analysis_service.py) (Analysis orchestration), [`backend/app/main.py`](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/main.py) (API application), [`ml_pipeline/deepguard.py`](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/ml_pipeline/deepguard.py) (DeepGuard inference), [`frontend/vite-project/src/App.jsx`](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/App.jsx) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web_app["Web application<br/>[App.jsx]"]
  node_upload["Video upload<br/>[UploadZone.jsx]"]
  node_analysis_page["Analysis page<br/>[AnalyzePage.jsx]"]
  node_results["Result display<br/>[ResultCard.jsx]"]
end

subgraph group_api["Backend API"]
  node_api_entry["API application<br/>[main.py]"]
  node_analysis_route["Analysis endpoint<br/>[analysis.py]"]
  node_analytics_route["Analytics endpoint<br/>[analytics.py]"]
  node_health_route["Health endpoint<br/>[health.py]"]
  node_analysis_service["Analysis orchestration"]
  node_request_schema["Analysis schemas<br/>[analysis.py]"]
  node_config["Runtime settings<br/>[config.py]"]
  node_storage["Upload storage<br/>[storage_service.py]"]
end

subgraph group_inference["Detection runtime"]
  node_video_inspection["Video inspection<br/>[video_service.py]"]
  node_face_service["Face processing<br/>[face_service.py]"]
  node_quality_service["Frame quality<br/>[quality_service.py]"]
  node_detector["Model detector<br/>[detector.py]"]
  node_deepguard["DeepGuard inference<br/>[deepguard.py]"]
  node_heatmap["Debug heatmap<br/>[heatmap_service.py]"]
end

subgraph group_model_dev["Model development"]
  node_training["Model training"]
  node_preprocessing["Dataset preparation"]
end

node_user(("Video analyst"))

node_user -->|"opens"| node_web_app
node_web_app -->|"renders"| node_analysis_page
node_analysis_page -.->|"offers upload"| node_upload
node_api_entry -->|"registers"| node_analysis_route
node_api_entry -->|"registers"| node_analytics_route
node_api_entry -->|"registers"| node_health_route
node_api_entry -->|"initializes"| node_analysis_service
node_analysis_service -->|"inspects video"| node_video_inspection
node_analysis_service -->|"requests prediction"| node_detector
node_analysis_service -->|"creates fallback"| node_heatmap
node_analysis_service -->|"builds response"| node_request_schema
node_analysis_service -.->|"uses shared inference"| node_deepguard
node_detector -.->|"delegates prediction"| node_deepguard
node_training -->|"uses shared module"| node_deepguard
node_preprocessing -->|"defines matching inputs"| node_deepguard

click node_web_app "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/App.jsx"
click node_upload "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/components/UploadZone.jsx"
click node_analysis_page "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/pages/AnalyzePage.jsx"
click node_results "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/components/ResultCard.jsx"
click node_api_entry "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/main.py"
click node_analysis_route "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/routes/analysis.py"
click node_analytics_route "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/routes/analytics.py"
click node_health_route "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/routes/health.py"
click node_analysis_service "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/analysis_service.py"
click node_request_schema "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/schemas/analysis.py"
click node_config "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/config.py"
click node_storage "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/storage_service.py"
click node_video_inspection "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/video_service.py"
click node_face_service "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/face_service.py"
click node_quality_service "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/quality_service.py"
click node_detector "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/detector.py"
click node_deepguard "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/ml_pipeline/deepguard.py"
click node_heatmap "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/heatmap_service.py"
click node_training "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/ml_pipeline/DeepGuard_Training_v3.ipynb"
click node_preprocessing "https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/preprocessing/FFpp_c40_Preprocessing.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_app,node_upload,node_analysis_page,node_results toneBlue
class node_api_entry,node_analysis_route,node_analytics_route,node_health_route,node_analysis_service,node_request_schema,node_config,node_storage toneAmber
class node_video_inspection,node_face_service,node_quality_service,node_detector,node_deepguard,node_heatmap toneMint
class node_training,node_preprocessing toneRose
class node_user toneIndigo
```

## Components

### Web client

- [Web application](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/App.jsx): `frontend/vite-project/src/App.jsx`
- [Video upload](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/components/UploadZone.jsx): `frontend/vite-project/src/components/UploadZone.jsx`
- [Analysis page](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/pages/AnalyzePage.jsx): `frontend/vite-project/src/pages/AnalyzePage.jsx`
- [Result display](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/frontend/vite-project/src/components/ResultCard.jsx): `frontend/vite-project/src/components/ResultCard.jsx`

### Backend API

- [API application](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/main.py): `backend/app/main.py`
- [Analysis endpoint](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/routes/analysis.py): `backend/app/routes/analysis.py`
- [Analytics endpoint](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/routes/analytics.py): `backend/app/routes/analytics.py`
- [Health endpoint](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/routes/health.py): `backend/app/routes/health.py`
- [Analysis orchestration](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/analysis_service.py): `backend/app/services/analysis_service.py`
- [Analysis schemas](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/schemas/analysis.py): `backend/app/schemas/analysis.py`
- [Runtime settings](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/config.py): `backend/app/config.py`
- [Upload storage](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/storage_service.py): `backend/app/services/storage_service.py`

### Detection runtime

- [Video inspection](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/video_service.py): `backend/app/services/video_service.py`
- [Face processing](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/face_service.py): `backend/app/services/face_service.py`
- [Frame quality](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/quality_service.py): `backend/app/services/quality_service.py`
- [Model detector](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/detector.py): `backend/app/services/detector.py`
- [DeepGuard inference](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/ml_pipeline/deepguard.py): `ml_pipeline/deepguard.py`
- [Debug heatmap](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/backend/app/services/heatmap_service.py): `backend/app/services/heatmap_service.py`

### Model development

- [Model training](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/ml_pipeline/DeepGuard_Training_v3.ipynb): `ml_pipeline/DeepGuard_Training_v3.ipynb`
- [Dataset preparation](https://github.com/praveen24sriv/deepfake-video-detection-system/blob/dev/preprocessing/FFpp_c40_Preprocessing.ipynb): `preprocessing/FFpp_c40_Preprocessing.ipynb`

### Other components

- **Video analyst**

## Connections

- Video analyst → Web application: opens (evidence: `frontend/vite-project/src/App.jsx`)
- Web application → Analysis page: renders (evidence: `frontend/vite-project/src/App.jsx`)
- Analysis page → Video upload: offers upload
- API application → Analysis endpoint: registers (evidence: `backend/app/main.py`)
- API application → Analytics endpoint: registers (evidence: `backend/app/main.py`)
- API application → Health endpoint: registers (evidence: `backend/app/main.py`)
- API application → Analysis orchestration: initializes (evidence: `backend/app/main.py`)
- Analysis orchestration → Video inspection: inspects video (evidence: `backend/app/services/analysis_service.py`)
- Analysis orchestration → Model detector: requests prediction (evidence: `backend/app/services/analysis_service.py`)
- Analysis orchestration → Debug heatmap: creates fallback (evidence: `backend/app/services/analysis_service.py`)
- Analysis orchestration → Analysis schemas: builds response (evidence: `backend/app/services/analysis_service.py`)
- Analysis orchestration → DeepGuard inference: uses shared inference (evidence: `README.md`)
- Model detector → DeepGuard inference: delegates prediction (evidence: `README.md`)
- Model training → DeepGuard inference: uses shared module (evidence: `README.md`)
- Dataset preparation → DeepGuard inference: defines matching inputs (evidence: `README.md`)
