# nyn-05/major_project architecture

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

- Interactive diagram: https://gitdiagram.com/nyn-05/major_project
- Repository: https://github.com/nyn-05/major_project

## Overview

Deepfake Video Detection for KYC takes an uploaded video through frame sampling and quality filtering, rPPG and visual feature extraction, then fused quantum-classical classification to produce a REAL/FAKE verdict. The repository also includes a React UI and a standard-library API server. The README documents the main stage handoffs; some internal edges are based on SOURCE INDEX references, and the frontend-to-backend/runtime links are not confirmed by the sampled excerpts.

Main entry points: [`WORKING/quantum/pipeline.py`](https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/pipeline.py) (Quantum Pipeline), [`WORKING/run_pipeline.py`](https://github.com/nyn-05/major_project/blob/main/WORKING/run_pipeline.py) (Video Orchestrator), [`WORKING/RPPG/pipeline.py`](https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/pipeline.py) (rPPG Pipeline), [`WORKING/frame/pipeline.py`](https://github.com/nyn-05/major_project/blob/main/WORKING/frame/pipeline.py) (Frame Sampling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Experience"]
  node_ui["Review UI<br/>[App.jsx]"]
  node_api["HTTP API<br/>[api.js]"]
  node_server["API Server<br/>[server.py]"]
end

subgraph group_frames["Frame Intake"]
  node_frame_pipeline["Frame Sampling<br/>[pipeline.py]"]
  node_face_detector["YOLO Face Detection<br/>[detector.py]"]
  node_frame_quality["Frame Quality<br/>[processing.py]"]
end

subgraph group_evidence["Evidence Features"]
  node_rppg["rPPG Pipeline<br/>[pipeline.py]"]
  node_roi["Face ROI Tracking<br/>[face_roi.py]"]
  node_pulse["Pulse Reconstruction"]
  node_phys_features["Physiological Features<br/>[features.py]"]
  node_visual_pipeline["Visual Feature Pipeline<br/>[pipeline.py]"]
  node_visual_extractor["Visual Extractor<br/>[extractor.py]"]
end

subgraph group_decision["Quantum Decision"]
  node_fused_data["Fused Data Builder<br/>[data.py]"]
  node_qaoa["QAOA Selection<br/>[qaoa.py]"]
  node_vqc["Hybrid VQC<br/>[vqc.py]"]
  node_quantum_pipeline["Quantum Pipeline<br/>[pipeline.py]"]
  node_evaluation["Model Evaluation<br/>[evaluation.py]"]
  node_explanation["Verdict Explanation<br/>[explain.py]"]
end

node_user(("KYC Operator"))
node_runner["Video Orchestrator<br/>[run_pipeline.py]"]

node_user -->|"uploads video"| node_ui
node_ui -->|"requests analysis"| node_api
node_api -.->|"calls API"| node_server
node_server -.->|"invokes pipeline"| node_runner
node_runner -->|"samples frames"| node_frame_pipeline
node_frame_pipeline -->|"detects faces"| node_face_detector
node_frame_pipeline -->|"filters quality"| node_frame_quality
node_runner -->|"extracts rPPG"| node_rppg
node_rppg -->|"extracts ROIs"| node_roi
node_rppg -.->|"reconstructs pulse"| node_pulse
node_rppg -.->|"computes features"| node_phys_features
node_runner -->|"extracts visual features"| node_visual_pipeline
node_visual_pipeline -->|"extracts crops"| node_visual_extractor
node_runner -->|"runs fused decision"| node_quantum_pipeline
node_visual_pipeline -->|"builds fused set"| node_fused_data
node_quantum_pipeline -->|"loads fused data"| node_fused_data
node_quantum_pipeline -->|"selects features"| node_qaoa
node_quantum_pipeline -->|"scores features"| node_vqc
node_quantum_pipeline -.->|"evaluates model"| node_evaluation
node_quantum_pipeline -.->|"builds verdict"| node_explanation
node_quantum_pipeline -.->|"returns verdict"| node_ui

click node_ui "https://github.com/nyn-05/major_project/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/nyn-05/major_project/blob/main/frontend/src/api.js"
click node_server "https://github.com/nyn-05/major_project/blob/main/frontend/server.py"
click node_runner "https://github.com/nyn-05/major_project/blob/main/WORKING/run_pipeline.py"
click node_frame_pipeline "https://github.com/nyn-05/major_project/blob/main/WORKING/frame/pipeline.py"
click node_face_detector "https://github.com/nyn-05/major_project/blob/main/WORKING/frame/detector.py"
click node_frame_quality "https://github.com/nyn-05/major_project/blob/main/WORKING/frame/processing.py"
click node_rppg "https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/pipeline.py"
click node_roi "https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/face_roi.py"
click node_pulse "https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/signal_extraction.py"
click node_phys_features "https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/features.py"
click node_visual_pipeline "https://github.com/nyn-05/major_project/blob/main/WORKING/visual/pipeline.py"
click node_visual_extractor "https://github.com/nyn-05/major_project/blob/main/WORKING/visual/extractor.py"
click node_fused_data "https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/data.py"
click node_qaoa "https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/qaoa.py"
click node_vqc "https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/vqc.py"
click node_quantum_pipeline "https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/pipeline.py"
click node_evaluation "https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/evaluation.py"
click node_explanation "https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/explain.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_ui,node_api,node_server toneBlue
class node_frame_pipeline,node_face_detector,node_frame_quality toneAmber
class node_rppg,node_roi,node_pulse,node_phys_features,node_visual_pipeline,node_visual_extractor toneMint
class node_fused_data,node_qaoa,node_vqc,node_quantum_pipeline,node_evaluation,node_explanation toneRose
class node_user toneIndigo
class node_runner toneTeal
```

## Components

### Web Experience

- [Review UI](https://github.com/nyn-05/major_project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [HTTP API](https://github.com/nyn-05/major_project/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [API Server](https://github.com/nyn-05/major_project/blob/main/frontend/server.py): `frontend/server.py`

### Frame Intake

- [Frame Sampling](https://github.com/nyn-05/major_project/blob/main/WORKING/frame/pipeline.py): `WORKING/frame/pipeline.py`
- [YOLO Face Detection](https://github.com/nyn-05/major_project/blob/main/WORKING/frame/detector.py): `WORKING/frame/detector.py`
- [Frame Quality](https://github.com/nyn-05/major_project/blob/main/WORKING/frame/processing.py): `WORKING/frame/processing.py`

### Evidence Features

- [rPPG Pipeline](https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/pipeline.py): `WORKING/RPPG/pipeline.py`
- [Face ROI Tracking](https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/face_roi.py): `WORKING/RPPG/face_roi.py`
- [Pulse Reconstruction](https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/signal_extraction.py): `WORKING/RPPG/signal_extraction.py`
- [Physiological Features](https://github.com/nyn-05/major_project/blob/main/WORKING/RPPG/features.py): `WORKING/RPPG/features.py`
- [Visual Feature Pipeline](https://github.com/nyn-05/major_project/blob/main/WORKING/visual/pipeline.py): `WORKING/visual/pipeline.py`
- [Visual Extractor](https://github.com/nyn-05/major_project/blob/main/WORKING/visual/extractor.py): `WORKING/visual/extractor.py`

### Quantum Decision

- [Fused Data Builder](https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/data.py): `WORKING/quantum/data.py`
- [QAOA Selection](https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/qaoa.py): `WORKING/quantum/qaoa.py`
- [Hybrid VQC](https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/vqc.py): `WORKING/quantum/vqc.py`
- [Quantum Pipeline](https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/pipeline.py): `WORKING/quantum/pipeline.py`
- [Model Evaluation](https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/evaluation.py): `WORKING/quantum/evaluation.py`
- [Verdict Explanation](https://github.com/nyn-05/major_project/blob/main/WORKING/quantum/explain.py): `WORKING/quantum/explain.py`

### Other components

- **KYC Operator**
- [Video Orchestrator](https://github.com/nyn-05/major_project/blob/main/WORKING/run_pipeline.py): `WORKING/run_pipeline.py`

## Connections

- KYC Operator → Review UI: uploads video
- Review UI → HTTP API: requests analysis (evidence: `frontend/src/App.jsx`)
- HTTP API → API Server: calls API
- API Server → Video Orchestrator: invokes pipeline
- Video Orchestrator → Frame Sampling: samples frames (evidence: `WORKING/run_pipeline.py`)
- Frame Sampling → YOLO Face Detection: detects faces (evidence: `WORKING/frame/pipeline.py`)
- Frame Sampling → Frame Quality: filters quality (evidence: `WORKING/frame/pipeline.py`)
- Video Orchestrator → rPPG Pipeline: extracts rPPG (evidence: `WORKING/run_pipeline.py`)
- rPPG Pipeline → Face ROI Tracking: extracts ROIs (evidence: `WORKING/RPPG/pipeline.py`)
- rPPG Pipeline → Pulse Reconstruction: reconstructs pulse (evidence: `WORKING/RPPG/pipeline.py`)
- rPPG Pipeline → Physiological Features: computes features (evidence: `WORKING/RPPG/pipeline.py`)
- Video Orchestrator → Visual Feature Pipeline: extracts visual features
- Visual Feature Pipeline → Visual Extractor: extracts crops (evidence: `WORKING/visual/pipeline.py`)
- Video Orchestrator → Quantum Pipeline: runs fused decision (evidence: `WORKING/run_pipeline.py`)
- Visual Feature Pipeline → Fused Data Builder: builds fused set (evidence: `WORKING/visual/pipeline.py`)
- Quantum Pipeline → Fused Data Builder: loads fused data (evidence: `WORKING/quantum/pipeline.py`)
- Quantum Pipeline → QAOA Selection: selects features (evidence: `WORKING/quantum/pipeline.py`)
- Quantum Pipeline → Hybrid VQC: scores features (evidence: `WORKING/quantum/pipeline.py`)
- Quantum Pipeline → Model Evaluation: evaluates model (evidence: `WORKING/quantum/pipeline.py`)
- Quantum Pipeline → Verdict Explanation: builds verdict (evidence: `WORKING/quantum/pipeline.py`)
- Quantum Pipeline → Review UI: returns verdict
