# harshal696/deeptrace-deepfake-detection architecture

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

- Interactive diagram: https://gitdiagram.com/harshal696/deeptrace-deepfake-detection
- Repository: https://github.com/harshal696/deeptrace-deepfake-detection

## Overview

DeepTrace is a Flask web application for video deepfake detection. Its documented workflow accepts an upload, samples and preprocesses frames, classifies them with MobileNetV3, aggregates frame predictions by majority vote, and presents a video-level result with confidence metrics. The sampled source also contains temporal-signal analysis, but the excerpts do not show how it connects to the request workflow; that subsystem is shown separately. Links for unsampled implementation details rely on the README.

Main entry points: [`templates/index.html`](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/templates/index.html) (Upload and results UI), [`app.py`](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py) (Flask request handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_interface["Upload and results UI<br/>[index.html]"]
  node_request["Flask request handling<br/>[app.py]"]
end

subgraph group_analysis["Video analysis"]
  node_sampling["Uniform frame sampling<br/>[app.py]"]
  node_preprocessing["Frame preprocessing<br/>[app.py]"]
  node_classifier["MobileNetV3 classifier<br/>[app.py]"]
  node_voting["Majority voting<br/>[app.py]"]
  node_confidence["Confidence metrics<br/>[app.py]"]
end

subgraph group_signals["Signal analysis"]
  node_temporal["Temporal signal scoring<br/>[app.py]"]
end

node_user(("Video uploader"))

node_user -->|"uploads video"| node_interface
node_interface -->|"submits upload"| node_request
node_request -->|"analyzes video"| node_sampling
node_sampling -->|"selects frames"| node_preprocessing
node_preprocessing -->|"feeds frames"| node_classifier
node_classifier -->|"generates predictions"| node_voting
node_voting -->|"determines result"| node_confidence
node_confidence -->|"displays metrics"| node_interface

click node_interface "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/templates/index.html"
click node_request "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py"
click node_sampling "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py"
click node_preprocessing "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py"
click node_classifier "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py"
click node_voting "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py"
click node_confidence "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py"
click node_temporal "https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py"

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_interface,node_request toneBlue
class node_sampling,node_preprocessing,node_classifier,node_voting,node_confidence toneAmber
class node_temporal toneMint
class node_user toneIndigo
```

## Components

### Web interface

- [Upload and results UI](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/templates/index.html): `templates/index.html`
- [Flask request handling](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py): `app.py`

### Video analysis

- [Uniform frame sampling](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py): `app.py`
- [Frame preprocessing](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py): `app.py`
- [MobileNetV3 classifier](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py): `app.py`
- [Majority voting](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py): `app.py`
- [Confidence metrics](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py): `app.py`

### Signal analysis

- [Temporal signal scoring](https://github.com/harshal696/deeptrace-deepfake-detection/blob/main/app.py): `app.py`

### Other components

- **Video uploader**

## Connections

- Video uploader → Upload and results UI: uploads video (evidence: `README.md`)
- Upload and results UI → Flask request handling: submits upload (evidence: `README.md`)
- Flask request handling → Uniform frame sampling: analyzes video (evidence: `README.md`)
- Uniform frame sampling → Frame preprocessing: selects frames (evidence: `README.md`)
- Frame preprocessing → MobileNetV3 classifier: feeds frames (evidence: `README.md`)
- MobileNetV3 classifier → Majority voting: generates predictions (evidence: `README.md`)
- Majority voting → Confidence metrics: determines result (evidence: `README.md`)
- Confidence metrics → Upload and results UI: displays metrics (evidence: `README.md`)
