cd /news/neural-networks/opentraindnn-real-time-browser-neura… · home › topics › neural-networks › article
[ARTICLE · art-144317] src=github.com ↗ pub= topic=neural-networks verified=true sentiment=↑ positive

OpenTrainDNN – Real-time browser neural network training visualizer

OpenTrainDNN, an open-source client-side web application from developer MatiwosKebede, runs real backpropagation, Adam optimizer weight updates, and gradient clipping entirely in the browser to visualize neural network training step by step. The tool converts camera frames and microphone audio into 16×16 grayscale images or mel spectrograms — 256 numbers in the range −1 to +1 — and supports Dense and CNN architectures at resolutions from 4×4 to 64×64, with exact analytical gradients, a train/validation split holding out every fifth sample, and a live overfitting warning. It is positioned as a teaching tool rather than a framework, with trained weights savable as JSON and the repository runnable by opening index.html or serving locally via python3 -m http.server 8000.

read6 min views1 publishedOct 3, 2026
OpenTrainDNN – Real-time browser neural network training visualizer
Image: Michielbdejong (auto-discovered)

OpenTrainDNN: A Browser-Based Real-Time Neural Network Visualizer.

OpenTrainDNN is an open-source, client-side web application designed to render the step-by-step training mechanics of deep neural networks in real-time. It provides direct visibility into backpropagation, activation flows, and weight updates without requiring backend servers, specialized hardware drivers, or local installation.

No install. No build step. No framework. No backend.

Every machine learning framework hides the interesting part behind a single function call. You write model.fit(x, y) and a number goes down. You never see what happened.

OpenTrainDNN does not hide anything. It runs a real neural network — real backpropagation, real optimizer, real weight updates — entirely in your browser. Every layer is visible. Every weight is a wire you can watch move. Every activation is on screen at the moment it is computed.

It exists to answer one question: what does a neural network actually do?

It is a teaching tool, not a framework. If you want to build production models, use PyTorch or JAX. If you want to see what those models are actually doing, use this.

The camera turns each frame into a 16×16 grayscale image. The microphone turns each sound into a 16×16 mel spectrogram. Both produce 256 numbers in the range −1 to +1. The network does not know the difference. That is the point.

  • Dense — fully connected, small, fast, easy to reason about.
  • CNN — convolutional, learns spatial filters, shows you the feature maps as they form.

From 4×4 to 64×64. Small resolutions train in seconds. Large resolutions require more data. The tool makes the trade-off visible.

  • Every neuron is a glowing circle whose brightness tracks its activation.

  • Every weight is a curved wire whose thickness, brightness, and glow track its magnitude.

  • Every feature map updates every frame.

  • The input itself — image or spectrogram — is shown full-size.

  • Exact analytical gradients. No finite differences anywhere.

  • Adam optimizer. Same update rule as production frameworks.

  • Gradient clipping. Prevents divergence on large networks.

  • Train / validation split. Every fifth sample is held out.

  • Live overfitting warning. Fires the moment validation accuracy falls behind its peak.

Save the trained weights as JSON. Load them back later. Class names and colors survive the reload.

Download the repository. Open index.html in any modern browser.

Prefer to serve it? Run a local server from the project folder:

python3 -m http.server 8000

Then open http://localhost:8000/.

You can also use the live version hosted on GitHub Pages:

https://MatiwosKebede.github.io/OpenTrainDNN/

  1. Click Start camera . Allow the permission prompt.

  2. Hold a red object in front of the camera. Press1 fifteen times while moving it slightly.

  3. Hold a blue object . Press2 fifteen times, same motion.

  4. Press Train .

  5. Watch the DNN preview fill in. Wires thicken and glow. After about ten seconds, accuracy stops rising.

  6. Alternate the two objects. The prediction box flips.

  7. Switch the input source to 🎤 Microphone .

  8. Say "yes" twenty times. Press1 after each.

  9. Say "no" twenty times. Press2 after each.

  10. Press Train .

  11. Say "yes". The first bar fills. Say "no". It flips.

That is the entire system end-to-end: real signal → real numbers → real learning → real prediction.

✅ Works well ❌ Does not work
Distinct colors Pen vs pencil (if the tip is visible) Fine textures (wood vs metal)
Distinct brightness Letters A vs B (not A vs Å) Small details
Faces (you vs a wall) Two similar faces Full sentences
Hand gestures Cat vs dog
Simple shapes Anything requiring counting
Two short words Anything requiring reasoning

The rule. If a person could tell two things apart from a small grayscale thumbnail, the network can learn to do the same. If not, it cannot. No amount of training will help.

OpenTrainDNN/
├── index.html          — markup
├── style.css           — styling
├── README.md           — this file
├── CONTRIBUTING.md     — how to contribute
├── CODE_OF_CONDUCT.md  — community standards
├── SECURITY.md         — disclosure policy
├── CHANGELOG.md        — version history
├── LICENSE             — MIT
├── docs/
│   └── screenshot.png  — README image
├── .github/
│   ├── ISSUE_TEMPLATE/ — bug and feature templates
│   ├── workflows/      — Pages deployment
│   └── PULL_REQUEST_TEMPLATE.md
└── js/
    ├── math.js         — pure helpers, activations, MOSFET model
    ├── state.js        — every mutable global
    ├── input.js        — image + audio pipelines
    ├── network.js      — dense + CNN forward/backward
    ├── visualize.js    — live view, DNN preview, feature maps
    ├── classes.js      — class UI, capture, file handling
    └── main.js         — boot, save/load, event wiring, main loop

Load order matters. The script tags in index.html must load in exactly this sequence:

math  →  state  →  input  →  network  →  visualize  →  classes  →  main

Each module depends only on the ones before it.

Both input types are converted to a square grid of numbers in the range −1 to +1.

Camera Microphone
Frame drawn to offscreen canvas at SIZE×SIZE AnalyserNode computes spectrum at 40 Hz
Read luminance of each pixel Bin into log-spaced bands
Flatten to Float64Array(SIZE²) Write column into ring buffer
Flatten buffer to Float64Array(SIZE²)

Standard feed-forward stack. Either:

input → dense → dense → ... → output (softmax)

or:

input → conv → relu → pool → conv → relu → pool → flatten → dense → output

Stochastic gradient descent with:

  • Mini-batch size: 32 (Dense), 8 (CNN)
  • Optimizer: Adam, β₁ = 0.9, β₂ = 0.999
  • Learning rate: 0.01 (Dense), 0.008 (CNN)
  • Weight clip: ±6
  • Gradients: exact analytical derivatives

No finite differences. No autograd. Every derivative is written out by hand in network.js.

Lesson
🧠 Backpropagation is a coordinate transformation. The hidden layers re-parameterize the input so the final classification becomes linear in the new coordinates.
📈 Generalization is real. A network trained on 40 samples answers correctly for points it has never seen.
📉 Overfitting is real. Training accuracy goes up while validation accuracy goes down. The warning fires the moment the gap opens.
📊 Data determines learning. One image per class produces a network that reports 100% accuracy and fails on everything else. Forty images per class produces a network that works.
🔄 The medium does not matter. The same learning rule works whether the input is light or sound, and whether the unit is a smooth activation or a MOSFET.

Any modern browser with getUserMedia and Web Audio API support.

Browser Status
Chrome ✅ Tested
Firefox ✅ Tested
Safari ✅ Tested
Edge ✅ Tested

No plugins. No extensions. No install.

The microphone requires HTTPS in some browsers. GitHub Pages provides that automatically. Locally, a small HTTP server such as Python's built-in one is enough.

Contributions are welcome. See CONTRIBUTING.md for the full guide.

Short version:

  • Keep the modular structure intact.
  • Do not add new architectures (RNN, LSTM, Transformer, attention).
  • Do not add a build step or dependencies.
  • Test on at least two browsers.
  • Bug reports and honest criticism are more valuable than features.

See SECURITY.md for the disclosure policy.

MIT. See LICENSE for the full text.

Developed by Matiwos Kebede

The same learning algorithm runs in a browser tab and in a data center. The difference is only scale.

── more in #neural-networks 4 stories · sorted by recency
── more on @opentraindnn 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/opentraindnn-real-ti…] indexed:0 read:6min 2026-10-03 · —