Skill 02 / 06
Neural networks that learn their own features from pixels, text and signals. Trained with TensorFlow, rebuilt from scratch, and small enough to run in your browser.
13
live demos
13
in the lab
6
step method
0
servers needed
How a neural network learns
Neurons, bends, and errors flowing backwards.
Before the projects: a tiny network trained live in your browser on real Jakarta air data, step by step.
How I do it
- 01
Frame & collect
Decide what goes in, what comes out and how it will be judged, then find data with a clear licence.
Public datasetsLicence check - 02
Prepare tensors
Scale, reshape and split, so the network sees clean numbers and the test set stays untouched.
NumPyTrain / val / test - 03
Start simple
A model with no hidden layer first: it sets the bar every deeper network has to clear.
KerasBaselines - 04
Build the network
Add the structure the data needs: convolutions for images, recurrence for sequences.
Conv2DPoolingDropout - 05
Train for the real world
Augment the training data and stop early, so the model survives inputs that don't look like the test set.
AugmentationBackground swapsEarly stopping - 06
Shrink & ship
Quantise the weights, re-test the small version, and run it where the user is.
8-bit weightsTypeScript
Every project in the lab goes through these steps. Pick one and try it.
Go to the projects13The toolkit
Networks are trained with Keras on TensorFlow, then every layer is re-implemented in TypeScript, so the demos need no TensorFlow.js and no server. The browser version is checked against Python on the full test set.
01 · Open data
Public image datasets with their licences, downloaded once and never committed.
hover or tap a logo ↑
02 · Train in Python
Networks built and trained with Keras on TensorFlow, compared against simpler baselines.
hover or tap a logo ↑
03 · Export
CNN weights stored as 8-bit integers with one scale per filter; LSTM weights as rounded floats.
hover or tap a logo ↑
04 · Run in your browser
Convolutions, pooling and dense layers written in TypeScript: no TensorFlow.js, no server.
hover or tap a logo ↑
The methodology
Split honestly
The test set is opened once, at the end.
Validation split for early stopping
Part of the training data decides when to stop; the test set never does
Official test set
Kept untouched until the end: different writers for digits, separate renders for gestures, held-out doodles
Official splits
Each text dataset's own train, validation and test split, test scored once
Grouped split
Near-identical samples kept on one side, so twins can't inflate the test score
Split by time
The newest stretch is the test set; no window ever sees its own future
Simple baselines first
Same as now, no change, last week, TF-IDF + logistic regression: the bar the network has to clear
Make it robust
Real inputs are messier than benchmarks.
Data augmentation
Random rotation, shift, zoom, flips and brightness while training
Stress tests
The same test set shifted, rotated, shrunk, darkened or on new backgrounds
Background swaps
Breaking the 'white = background' shortcut with random textures
Identity before counting
Boxes are tracked frame to frame and each track is counted once, so one car isn't counted thirty times
Smoothed and debounced
One Euro filtering for pointers; two thresholds for the pinch; a minimum and maximum blink length; notes and chords that only change once the hand clearly moves
Hand rules tested on real hands
Finger counting, fists and thumb taps checked on real hand landmarks before shipping
Calibrated to each face
Measured against the visitor's own relaxed face, open eyes or neutral head pose, so natural differences don't count
Same framing as training
Visitors' strokes are cropped, scaled and centred exactly like the dataset's bitmaps
Landmarks, not pixels
21 hand points carry the shape and nothing about the background
Shrink honestly
A smaller model is a different model: test it again.
8-bit weights, re-tested
Digits 99.25% → 99.24%; gestures 96.0% → 96.0%; sentiment agrees with full precision on 100.0% / 99.9%; doodles 89.1% → 89.1%
Browser = Python
The TypeScript forward pass is checked against NumPy on test data
Runs on the device
Camera frames are processed locally; nothing is uploaded or recorded
Speed vs size
Chose the detector from Google's benchmark: fast on a phone GPU at 7 MB
Look at the mistakes
Accuracy hides which errors happen and why.
Confusion matrix
Which classes get mixed up with which
Most confident mistakes
The errors the network was surest about, shown as images
Where it looks
Class activation maps for images, leave-one-word-out for text, action units for faces
Confidence threshold
Slide it and watch missed objects turn into false alarms
Live check
The forecast made one horizon ago, against what then happened, on today's data
Calibrated band
The rupiah's 80% band held 82.3% of test outcomes
The lab
Next skill
Data Analytics & BI
Questions answered with SQL, charts and dashboards.