# zhiyi1214/neuronetwork architecture

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

- Interactive diagram: https://gitdiagram.com/zhiyi1214/neuronetwork
- Repository: https://github.com/zhiyi1214/neuronetwork

## Overview

NeuroStudio is a browser-based MNIST experimentation platform with two main user workflows: compare saved models on hand-drawn digits, and assemble/train networks while observing metrics and learned features. The graph includes the documented MLP, CNN, and autoencoder training paths, plus offline evaluation. Source excerpts show overlapping WebUI backends; exact frontend-to-backend wiring and some training internals are not fully visible, so uncertain links are omitted.

Main entry points: [`weights`](https://github.com/zhiyi1214/neuronetwork/tree/main/weights) (Saved models), [`backend/app.py`](https://github.com/zhiyi1214/neuronetwork/blob/main/backend/app.py) (Studio API), [`templates/index.html`](https://github.com/zhiyi1214/neuronetwork/blob/main/templates/index.html) (Studio interface), [`webui_server.py`](https://github.com/zhiyi1214/neuronetwork/blob/main/webui_server.py) (WebUI service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser studio"]
  node_frontend["Studio interface<br/>[index.html]"]
  node_drawn["Digit pixels<br/>[index.html]"]
end

subgraph group_serving["Inference and models"]
  node_webui["WebUI service<br/>[webui_server.py]"]
  node_api["Studio API<br/>[app.py]"]
  node_predict["Model inference<br/>[webui_server.py]"]
  node_features["Feature maps<br/>[app.py]"]
end

subgraph group_training["Training studio"]
  node_trainer["Training worker<br/>[trainer.py]"]
  node_compiler["Architecture compiler<br/>[compiler.py]"]
  node_mlp["MLP trainer<br/>[train.py]"]
  node_cnn["CNN trainer<br/>[train_cnn.py]"]
  node_evaluation["Offline evaluation<br/>[evaluate.py]"]
end

subgraph group_data["Datasets and artifacts"]
  node_weights[("Saved models")]
  node_manifest["Run metadata<br/>[manifest.json]"]
  node_data_loader["MNIST loading<br/>[datasets.py]"]
  node_train_data[("Training images")]
  node_test_data[("Test images")]
end

node_user(("Experimenter"))

node_user -->|"uses"| node_frontend
node_frontend -->|"edits pixels"| node_drawn
node_frontend -->|"sends actions"| node_api
node_frontend -.->|"requests inference"| node_webui
node_api -->|"starts and controls"| node_trainer
node_api -->|"serves maps"| node_features
node_api -->|"lists and deletes"| node_weights
node_api -->|"updates records"| node_manifest
node_webui -->|"dispatches prediction"| node_predict
node_webui -->|"loads models"| node_weights
node_webui -->|"reads metadata"| node_manifest
node_predict -->|"loads parameters"| node_weights
node_trainer -->|"builds networks"| node_compiler
node_trainer -->|"requests batches"| node_data_loader
node_data_loader -->|"reads"| node_train_data
node_data_loader -->|"reads"| node_test_data
node_mlp -->|"reads"| node_train_data
node_mlp -->|"saves model"| node_weights
node_cnn -->|"reads"| node_train_data
node_cnn -->|"saves model"| node_weights
node_evaluation -->|"reads"| node_test_data
node_evaluation -->|"loads model"| node_weights
node_evaluation -->|"evaluates batches"| node_predict

click node_frontend "https://github.com/zhiyi1214/neuronetwork/blob/main/templates/index.html"
click node_webui "https://github.com/zhiyi1214/neuronetwork/blob/main/webui_server.py"
click node_api "https://github.com/zhiyi1214/neuronetwork/blob/main/backend/app.py"
click node_predict "https://github.com/zhiyi1214/neuronetwork/blob/main/webui_server.py"
click node_features "https://github.com/zhiyi1214/neuronetwork/blob/main/backend/app.py"
click node_weights "https://github.com/zhiyi1214/neuronetwork/tree/main/weights"
click node_manifest "https://github.com/zhiyi1214/neuronetwork/blob/main/weights/manifest.json"
click node_drawn "https://github.com/zhiyi1214/neuronetwork/blob/main/templates/index.html"
click node_trainer "https://github.com/zhiyi1214/neuronetwork/blob/main/backend/trainer.py"
click node_compiler "https://github.com/zhiyi1214/neuronetwork/blob/main/backend/compiler.py"
click node_mlp "https://github.com/zhiyi1214/neuronetwork/blob/main/train.py"
click node_cnn "https://github.com/zhiyi1214/neuronetwork/blob/main/train_cnn.py"
click node_data_loader "https://github.com/zhiyi1214/neuronetwork/blob/main/backend/datasets.py"
click node_train_data "https://github.com/zhiyi1214/neuronetwork/tree/main/train"
click node_test_data "https://github.com/zhiyi1214/neuronetwork/tree/main/test"
click node_evaluation "https://github.com/zhiyi1214/neuronetwork/blob/main/evaluate.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_frontend,node_drawn toneBlue
class node_webui,node_api,node_predict,node_features toneAmber
class node_trainer,node_compiler,node_mlp,node_cnn,node_evaluation toneMint
class node_weights,node_manifest,node_data_loader,node_train_data,node_test_data toneRose
class node_user toneIndigo
```

## Components

### Browser studio

- [Studio interface](https://github.com/zhiyi1214/neuronetwork/blob/main/templates/index.html): `templates/index.html`
- [Digit pixels](https://github.com/zhiyi1214/neuronetwork/blob/main/templates/index.html): `templates/index.html`

### Inference and models

- [WebUI service](https://github.com/zhiyi1214/neuronetwork/blob/main/webui_server.py): `webui_server.py`
- [Studio API](https://github.com/zhiyi1214/neuronetwork/blob/main/backend/app.py): `backend/app.py`
- [Model inference](https://github.com/zhiyi1214/neuronetwork/blob/main/webui_server.py): `webui_server.py`
- [Feature maps](https://github.com/zhiyi1214/neuronetwork/blob/main/backend/app.py): `backend/app.py`

### Training studio

- [Training worker](https://github.com/zhiyi1214/neuronetwork/blob/main/backend/trainer.py): `backend/trainer.py`
- [Architecture compiler](https://github.com/zhiyi1214/neuronetwork/blob/main/backend/compiler.py): `backend/compiler.py`
- [MLP trainer](https://github.com/zhiyi1214/neuronetwork/blob/main/train.py): `train.py`
- [CNN trainer](https://github.com/zhiyi1214/neuronetwork/blob/main/train_cnn.py): `train_cnn.py`
- [Offline evaluation](https://github.com/zhiyi1214/neuronetwork/blob/main/evaluate.py): `evaluate.py`

### Datasets and artifacts

- [Saved models](https://github.com/zhiyi1214/neuronetwork/tree/main/weights): `weights`
- [Run metadata](https://github.com/zhiyi1214/neuronetwork/blob/main/weights/manifest.json): `weights/manifest.json`
- [MNIST loading](https://github.com/zhiyi1214/neuronetwork/blob/main/backend/datasets.py): `backend/datasets.py`
- [Training images](https://github.com/zhiyi1214/neuronetwork/tree/main/train): `train`
- [Test images](https://github.com/zhiyi1214/neuronetwork/tree/main/test): `test`

### Other components

- **Experimenter**

## Connections

- Experimenter → Studio interface: uses
- Studio interface → Digit pixels: edits pixels
- Studio interface → Studio API: sends actions
- Studio interface → WebUI service: requests inference
- Studio API → Training worker: starts and controls
- Studio API → Feature maps: serves maps
- Studio API → Saved models: lists and deletes
- Studio API → Run metadata: updates records
- WebUI service → Model inference: dispatches prediction
- WebUI service → Saved models: loads models
- WebUI service → Run metadata: reads metadata
- Model inference → Saved models: loads parameters
- Training worker → Architecture compiler: builds networks
- Training worker → MNIST loading: requests batches
- MNIST loading → Training images: reads
- MNIST loading → Test images: reads
- MLP trainer → Training images: reads
- MLP trainer → Saved models: saves model
- CNN trainer → Training images: reads
- CNN trainer → Saved models: saves model
- Offline evaluation → Test images: reads
- Offline evaluation → Saved models: loads model
- Offline evaluation → Model inference: evaluates batches
