# vivianaranha/quantum-convolutional-neural-network architecture

> Architecture diagram of the GitHub repository vivianaranha/quantum-convolutional-neural-network, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vivianaranha/quantum-convolutional-neural-network
- Repository: https://github.com/vivianaranha/quantum-convolutional-neural-network

## Overview

This is a local-first synthetic image-classification and benchmarking application: users generate or load 8×8 line images, then classify them with a QCNN and matched classical baselines. Its main workflow spans image generation and spatial compression, model training, repeated held-out evaluation and sensitivity analysis, artifact/report production, and saved-model inference. The dashboard and CLI are separate entry points. Benchmark internals were not excerpted, so orchestration links below rely on README workflow statements; other links cite shown callers.

Main entry points: [`src/quantum_cnn/benchmark.py`](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/benchmark.py) (Benchmark runner), [`src/quantum_cnn/cli.py`](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/cli.py) (Command line), [`app.py`](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/app.py) (Dashboard), [`src/quantum_cnn/inference.py`](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/inference.py) (Saved-model inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_dashboard["Dashboard<br/>[app.py]"]
  node_cli["Command line<br/>[cli.py]"]
  node_config["Run configuration<br/>[config.py]"]
end

subgraph group_inputs["Image inputs"]
  node_imagegen["Synthetic images<br/>[data.py]"]
  node_compression["Patch features<br/>[data.py]"]
end

subgraph group_learning["Models and evaluation"]
  node_benchmark["Benchmark runner<br/>[benchmark.py]"]
  node_qcnn["QCNN simulator<br/>[qcnn.py]"]
  node_baselines["Classical baselines<br/>[models.py]"]
  node_splits["Repeated holdouts<br/>[benchmark.py]"]
  node_metrics["Metrics and probes<br/>[metrics.py]"]
end

subgraph group_outputs["Results and inference"]
  node_artifacts[("Run artifacts<br/>[artifacts.py]")]
  node_plots["Plots and diagnostics<br/>[visualization.py]"]
  node_inference["Saved-model inference<br/>[inference.py]"]
end

node_user(("User"))
node_externalimage["Image file"]

node_user -->|"opens"| node_dashboard
node_user -->|"runs"| node_cli
node_dashboard -->|"configures"| node_config
node_dashboard -->|"runs"| node_benchmark
node_cli -->|"loads"| node_config
node_cli -->|"runs"| node_benchmark
node_dashboard -->|"generates sample"| node_imagegen
node_cli -->|"generates sample"| node_imagegen
node_cli -->|"loads"| node_externalimage
node_imagegen -->|"extracts features"| node_compression
node_benchmark -.->|"generates dataset"| node_imagegen
node_benchmark -.->|"uses features"| node_compression
node_benchmark -.->|"evaluates repeats"| node_splits
node_benchmark -.->|"trains QCNN"| node_qcnn
node_benchmark -.->|"trains baselines"| node_baselines
node_benchmark -.->|"computes metrics"| node_metrics
node_inference -->|"extracts features"| node_compression
node_inference -->|"scores models"| node_baselines
node_benchmark -.->|"persists results"| node_artifacts
node_artifacts -->|"saves plots"| node_plots
node_dashboard -->|"classifies image"| node_inference
node_cli -->|"predicts image"| node_inference

click node_dashboard "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/app.py"
click node_cli "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/cli.py"
click node_config "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/config.py"
click node_imagegen "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/data.py"
click node_compression "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/data.py"
click node_benchmark "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/benchmark.py"
click node_qcnn "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/qcnn.py"
click node_baselines "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/models.py"
click node_splits "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/benchmark.py"
click node_metrics "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/metrics.py"
click node_artifacts "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/artifacts.py"
click node_plots "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/visualization.py"
click node_inference "https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/inference.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_dashboard,node_cli,node_config,node_user toneBlue
class node_imagegen,node_compression toneAmber
class node_benchmark,node_qcnn,node_baselines,node_splits,node_metrics toneMint
class node_artifacts,node_plots,node_inference toneRose
class node_externalimage toneIndigo
```

## Components

### User entry points

- [Dashboard](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/app.py): `app.py`
- [Command line](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/cli.py): `src/quantum_cnn/cli.py`
- [Run configuration](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/config.py): `src/quantum_cnn/config.py`

### Image inputs

- [Synthetic images](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/data.py): `src/quantum_cnn/data.py`
- [Patch features](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/data.py): `src/quantum_cnn/data.py`

### Models and evaluation

- [Benchmark runner](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/benchmark.py): `src/quantum_cnn/benchmark.py`
- [QCNN simulator](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/qcnn.py): `src/quantum_cnn/qcnn.py`
- [Classical baselines](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/models.py): `src/quantum_cnn/models.py`
- [Repeated holdouts](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/benchmark.py): `src/quantum_cnn/benchmark.py`
- [Metrics and probes](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/metrics.py): `src/quantum_cnn/metrics.py`

### Results and inference

- [Run artifacts](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/artifacts.py): `src/quantum_cnn/artifacts.py`
- [Plots and diagnostics](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/visualization.py): `src/quantum_cnn/visualization.py`
- [Saved-model inference](https://github.com/vivianaranha/quantum-convolutional-neural-network/blob/main/src/quantum_cnn/inference.py): `src/quantum_cnn/inference.py`

### Other components

- **User**
- **Image file**

## Connections

- User → Dashboard: opens (evidence: `app.py`)
- User → Command line: runs (evidence: `src/quantum_cnn/cli.py`)
- Dashboard → Run configuration: configures (evidence: `app.py`)
- Dashboard → Benchmark runner: runs (evidence: `app.py`)
- Command line → Run configuration: loads (evidence: `src/quantum_cnn/cli.py`)
- Command line → Benchmark runner: runs (evidence: `src/quantum_cnn/cli.py`)
- Dashboard → Synthetic images: generates sample (evidence: `app.py`)
- Command line → Synthetic images: generates sample (evidence: `src/quantum_cnn/cli.py`)
- Command line → Image file: loads (evidence: `src/quantum_cnn/cli.py`)
- Synthetic images → Patch features: extracts features (evidence: `src/quantum_cnn/data.py`)
- Benchmark runner → Synthetic images: generates dataset (evidence: `README.md`)
- Benchmark runner → Patch features: uses features (evidence: `README.md`)
- Benchmark runner → Repeated holdouts: evaluates repeats (evidence: `README.md`)
- Benchmark runner → QCNN simulator: trains QCNN (evidence: `README.md`)
- Benchmark runner → Classical baselines: trains baselines (evidence: `README.md`)
- Benchmark runner → Metrics and probes: computes metrics (evidence: `README.md`)
- Saved-model inference → Patch features: extracts features (evidence: `src/quantum_cnn/inference.py`)
- Saved-model inference → Classical baselines: scores models (evidence: `src/quantum_cnn/inference.py`)
- Benchmark runner → Run artifacts: persists results (evidence: `README.md`)
- Run artifacts → Plots and diagnostics: saves plots (evidence: `src/quantum_cnn/artifacts.py`)
- Dashboard → Saved-model inference: classifies image (evidence: `app.py`)
- Command line → Saved-model inference: predicts image (evidence: `src/quantum_cnn/cli.py`)
