# adithya262005/ai-based-real-time-fake-currency-detection-system architecture

> Architecture diagram of the GitHub repository adithya262005/ai-based-real-time-fake-currency-detection-system, 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/adithya262005/ai-based-real-time-fake-currency-detection-system
- Repository: https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system

## Overview

The product is a webcam-based currency detector with a Flask interface. The primary workflow is to start detection from the web app, run YOLO inference on webcam frames, display detected denominations with confidence and FPS, and announce stable detections through speech. The sampled code supports these runtime stages; model and class-file paths are documented in the README but were not inspected.

Main entry points: [`detect.py`](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py) (Detection Script), [`app.py`](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/app.py) (Flask App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web Interface"]
  node_web_app["Flask App<br/>[app.py]"]
  node_web_page["Web Page"]
end

subgraph group_vision["Detection Pipeline"]
  node_detector["Detection Script<br/>[detect.py]"]
  node_yolo["YOLO Model"]
  node_class_names["Class Names"]
  node_inference["Frame Inference<br/>[detect.py]"]
  node_filter["Confidence Filter<br/>[detect.py]"]
end

subgraph group_feedback["User Feedback"]
  node_annotation["Box Annotation<br/>[detect.py]"]
  node_overlay["FPS Overlay<br/>[detect.py]"]
  node_display["Video Display<br/>[detect.py]"]
  node_stability["Stable Detection<br/>[detect.py]"]
  node_speech["Voice Feedback<br/>[detect.py]"]
end

node_user(("User"))
node_webcam["Webcam"]
node_speaker["Text-to-Speech"]

node_user -->|"opens"| node_web_app
node_web_app -->|"renders"| node_web_page
node_user -->|"starts detection"| node_web_app
node_web_app -->|"runs script"| node_detector
node_detector -->|"captures frames"| node_webcam
node_detector -->|"loads weights and config"| node_yolo
node_detector -->|"reads labels"| node_class_names
node_detector -->|"processes frames"| node_inference
node_inference -->|"filters confidence"| node_filter
node_filter -->|"draws detections"| node_annotation
node_class_names -->|"labels boxes"| node_annotation
node_detector -->|"draws FPS"| node_overlay
node_overlay -->|"renders frame"| node_display
node_annotation -->|"shows frame"| node_display
node_filter -->|"tracks labels"| node_stability
node_stability -->|"announces stable value"| node_speech
node_speech -->|"speaks value"| node_speaker

click node_web_app "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/app.py"
click node_detector "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py"
click node_inference "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py"
click node_filter "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py"
click node_annotation "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py"
click node_overlay "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py"
click node_display "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py"
click node_stability "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py"
click node_speech "https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.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_web_app,node_web_page,node_user toneBlue
class node_detector,node_yolo,node_class_names,node_inference,node_filter toneAmber
class node_annotation,node_overlay,node_display,node_stability,node_speech toneMint
class node_webcam,node_speaker toneIndigo
```

## Components

### Web Interface

- [Flask App](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/app.py): `app.py`
- **Web Page**

### Detection Pipeline

- [Detection Script](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`
- **YOLO Model**
- **Class Names**
- [Frame Inference](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`
- [Confidence Filter](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`

### User Feedback

- [Box Annotation](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`
- [FPS Overlay](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`
- [Video Display](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`
- [Stable Detection](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`
- [Voice Feedback](https://github.com/adithya262005/ai-based-real-time-fake-currency-detection-system/blob/main/detect.py): `detect.py`

### Other components

- **User**
- **Webcam**
- **Text-to-Speech**

## Connections

- User → Flask App: opens (evidence: `README.md`)
- Flask App → Web Page: renders (evidence: `app.py`)
- User → Flask App: starts detection (evidence: `app.py`)
- Flask App → Detection Script: runs script (evidence: `app.py`)
- Detection Script → Webcam: captures frames (evidence: `README.md`)
- Detection Script → YOLO Model: loads weights and config (evidence: `detect.py`)
- Detection Script → Class Names: reads labels (evidence: `detect.py`)
- Detection Script → Frame Inference: processes frames (evidence: `detect.py`)
- Frame Inference → Confidence Filter: filters confidence (evidence: `detect.py`)
- Confidence Filter → Box Annotation: draws detections (evidence: `detect.py`)
- Class Names → Box Annotation: labels boxes (evidence: `detect.py`)
- Detection Script → FPS Overlay: draws FPS (evidence: `detect.py`)
- FPS Overlay → Video Display: renders frame (evidence: `detect.py`)
- Box Annotation → Video Display: shows frame (evidence: `detect.py`)
- Confidence Filter → Stable Detection: tracks labels (evidence: `detect.py`)
- Stable Detection → Voice Feedback: announces stable value (evidence: `detect.py`)
- Voice Feedback → Text-to-Speech: speaks value (evidence: `detect.py`)
