
How the course is structured, what you need installed, how the hands-on lectures work, and how to get the most out of it.
Who this course is written for, what you will have built by the end, where its boundaries are - and a lab that verifies your copy of the invented dataset and the five model variants against the published figures.
The three arguments for moving inference onto the user's device, each one taken seriously and each one costed. Client-side inference does not remove a cost; it moves it onto hardware you do not own and cannot see.
Browser, Android, constrained edge hardware and packaged desktop. What ships in each case, who controls the runtime, who pays for the download, how an update reaches the user, and what you can actually debug.
Three toolchains, what each one is actually for, and a lab that checks all of them and names whichever is missing. Get the failures now, when they cost five minutes rather than an afternoon.
Four budgets a device imposes that a server never did, the arithmetic of where a model's bytes actually are, and why a model that has already been quantised can still be far too large to ship politely.
Storing weights in a smaller numeric type, measured on this course's classifier: float16 at half the size for no cost, and int8 at 3.95x smaller for a cost indistinguishable from noise. Why that is a property of this model rather than a law.
Quantise the teacher to float16 and int8 yourself, in about forty lines of numpy, and assert every byte count and every accuracy against the published figures so a mismatch fails loudly rather than quietly.
What QAT simulates during training, how the gradient problem is solved, and the one decision rule that tells you whether to pay for it. This course publishes no QAT figure, because QAT was not run - and that boundary is stated rather than filled in.
Two techniques that change the model rather than its number format. Pruning to 50 per cent saved exactly zero bytes here - by arithmetic, not by accident - and pruning without fine-tuning cost 5.36 points, most of which fine-tuning recovers. Distillation is the only technique in this section that is both genuinely smaller and genuinely costly.
Score all five variants on the same 2,500 examples, recompute both pruning accuracies including the one you must never ship, and assert every byte count, ratio and cost against the published figures.
What is actually inside an ONNX file, why an exported graph is a trace rather than your code, what the opset version governs, and the four things that do not travel with the weights.
Rebuild the published classifier in PyTorch, export it with a pinned opset and a named dynamic batch axis, then prove the exported graph agrees with the original before you trust it anywhere.
Reading an exported graph as a text object: nodes, initialisers, declared shapes and the opset. Where shape inference makes your disagreement with the graph visible, and the five signatures that mean the export stopped meaning what you meant.
What ONNX Runtime Web actually is, everything the browser has to download before a first prediction, the three backends and what each one requires, and the bills that come with moving inference onto the visitor's machine.
A static page, a Web Worker and the model exported in 3.2: scaffold it, serve it, prove the JavaScript preprocessing matches the Python it was trained with, and print your own timings rather than mine.
The three families of export failure, how to read the error and locate the offending node, and the four real options once you have - change the model, replace the operator, pin an opset, or implement a custom op - with what each one costs.
A library built for the browser rather than ported to it: two APIs, four backends, manual tensor memory, its own sharded model format, and an honest comparison against ONNX Runtime Web.
Define, compile and fit a small regression with the Layers API in a page: where the four compile-and-fit choices bite, why normalisation is not optional here, and how to recover the coefficients you planted.
Two halves: load the course's published weights into a TensorFlow.js model and reproduce 85.40% exactly, then train an equivalent classifier in the page and see what your own run gets.
What you adopt when you load somebody else's weights into your page: the licence and provenance question, where the bytes come from at run time, why the preprocessing must match the original exactly, and when a small purpose-built model beats a large general one.
Why full training in a tab is almost always the wrong choice, the narrow case where on-device learning genuinely wins - a small head over frozen features, on data that must not leave the device - and how to build and persist it.
Build the same feature twice - once in ml5.js and once in raw TensorFlow.js - then audit exactly what the friendly wrapper hid, and decide deliberately which version you ship.
What TF Lite actually is, the file format it reads, why the model is memory-mapped rather than loaded, what the runtime deliberately cannot do, and the two contracts a quantised interpreter imposes on your buffers.
Rebuild this course's classifier as a Keras graph from the published weights, convert it to TF Lite in float and int8, and assert parity against the NumPy reference and against figures.json before anything touches a phone.
The structure of an on-device classifier: the asset and why it must stay uncompressed, the mapped file, the interpreter lifecycle, the buffer arithmetic a quantised model imposes, and the four mistakes that make a correct model produce wrong answers.
Install the classifier on a device or emulator, have it score a fixed set of rows from the test split, pull the results back and assert row-for-row agreement with the NumPy reference - with a desktop fallback for anyone without hardware.
A delegate is a different implementation of your arithmetic, not a faster one. What partitioning costs, why the GPU path reduces precision by default, why a vendor driver cannot be enumerated, and why you must re-measure accuracy on the delegate you ship.
The measurement lecture: four stages timed separately, why run one differs from run ten and run ten from run one thousand, why a median beats a mean on a throttled phone, what the word memory actually means here, and how to report a result somebody else can reproduce.
Putting inference at the point of collection is a decision about what counts as a result. What a result record must carry, why the device's clock cannot be trusted, why a bounded queue is a drop policy, and what you can no longer see once you stop sending the inputs.
Four classes of target and the runtime each implies, why operator support is the first gate and the wheel that does not exist is the second, atomic model installation with a checksum, and the fail-open or fail-closed decision nobody writes down.
A long-running inference loop with a bounded queue, an explicit drop policy, a checksummed model and a graceful shutdown - runnable on a single-board computer or against a simulated constrained target with no extra hardware.
You do not control when a device updates, so several model versions are permanently live. What a bundle version covers, why the prediction must carry it, pull rather than push, verify-then-switch, and when an old version may finally be deleted.
The four situations where a packaged desktop application is the right client for a model, the bills that choice sends you - per-platform builds, an update path you own, signing and install friction - and the four questions that settle the argument in a meeting.
The architecture of a small window around a model: why the toolkit that ships with Python wins on a packaging job, the four states every inference interface must show, the single-threaded event loop and the one rule about which thread may touch a widget.
Wire the quantised weights into the window: one predict function shared by the interface and a headless self-test, the worker and queue from lecture 7.2, and an assertion against the published int8 accuracy so the lab proves itself.
What freezing actually does, then the defect this course's own source material carries: a spec file with three absolute paths into one person's desktop, which builds on exactly one computer and silently produces a broken bundle everywhere else - and the portable rewrite using SPECPATH.
Generate a portable spec from the lab, lint it and a deliberately path-locked fixture for absolute paths, freeze the application, then run the packaged self-test from inside the bundle to prove the model travelled.
A client-side model site is files on a web server and nothing else - so the whole job is response headers: the media types that let a WebAssembly binary compile, cache rules that make the second visit free, integrity you can verify, and the isolation headers threading needs.
What a first-time visitor actually pays for, why bytes are quotable and seconds are not, the four caching layers and which two you control, and a measurement method that produces numbers you can defend on your own hardware.
You cannot protect it - anything the device can run, the user can copy. What each countermeasure actually costs an attacker and costs you, the one approach that works and what it gives back, and the risk nobody asks about: the training data behind the weights.
The brief: one set of weights, unchanged, shipped to the browser, to Android and to the desktop, held to one set of acceptance criteria checked by a harness, and compared on five named dimensions before you argue for one of them.
My three builds, the comparison they produced, and the three places the answer was not what I expected: parity needed a tolerance rather than equality, the update path decided it rather than speed, and the smallest model shipped inside the largest artefact.
A short audit rather than a lecture: score what you actually built against what this course covered, see which of four directions your gaps point in, and get an honest list of what this course never taught you.
What you have actually built over this course, the habits worth keeping, and an honest word on what to do next.
This course contains the use of artificial intelligence.
Running a model on the client sounds like a cost decision and turns out to be an accounting one. Every technique that makes a model smaller charges you something, and most courses quote the compression and leave the bill off the page. This course publishes both, for every method, and the data is synthetic and seeded so you can reproduce each figure on your own machine to the digit.
Here is the table the course is built around. The float32 teacher scores 85.40 per cent. Convert it to float16 and it is exactly half the size - 33,676 bytes against 67,352 - and still scores 85.40. Quantise it to int8 and it is 3.95 times smaller at 17,056 bytes, and scores 85.36. That is a cost of 0.04 points, which on a 2,500-row test set is one item. Not a gain. A cost so small it is noise, which is the honest way to say that int8 is nearly free.
Then prune half the weights away and measure the file. It is 67,352 bytes. Exactly the same. Pruning to 50 per cent sparsity in a dense format saves nothing at all, and not by accident - a kept float32 plus the int32 index saying where it belongs costs eight bytes where dense storage costs four, so 50 per cent density is precisely break-even. The compression ratio is 1.0 by arithmetic. Most courses show you pruning, show you a smaller zip file, and never mention that it was zlib squeezing the zeros rather than pruning doing anything.
Distillation is the one that actually charges you. A student with 12 hidden units against the teacher's 64 is 5.33 times smaller at 12,648 bytes and scores 77.12 - a cost of 8.28 points. Whether that is a good trade is your call to make, but you cannot make it without both numbers, and you now have both.
Then the runtimes, one per destination. ONNX as the format that lets a model leave the framework it was trained in - exporting it, reading the graph when the export is wrong, and the operator that is not supported. TensorFlow.js in the browser, including an honest answer to whether training in the browser is ever the right call. TF Lite on a real Android device, with the delegate question nobody asks: not how fast GPU and NNAPI are, but whether they give you the same answer. Edge hardware that cannot page and cannot wait. And a desktop app packaged with PyInstaller into something a colleague can install.
You will write an inference loop under a fixed memory ceiling, with a queue and a drop policy, and watch it meet that ceiling the way a small board would - by failing an allocation rather than by reading a configuration value and pretending. You will lint a PyInstaller spec for the hardcoded paths that make a build work on exactly one machine. You will deliberately feed a model a 16 by 16 grid read down the columns instead of across the rows, and watch it run, return confident logits, and be wrong by about thirty points with nothing complaining anywhere.
Sixteen hands-on labs. Each runs top to bottom with no edits, needs no GPU and no network, and exits 0 when every assertion passed, 1 on a failure and 2 when a dependency is missing - printing the exact install line. Browser labs vendor their JavaScript locally after a single npm install, so they keep working offline. Every figure a lab asserts against is read from the shipped data file at run time, so a lab and its lecture cannot drift apart.
What this course will not do. IT WILL NOT QUOTE YOU A LATENCY, A FRAME RATE, A MEMORY HIGH-WATER MARK, A BATTERY FIGURE OR A COLD-START TIME AS FACT. Those are properties of a device, and a mobile-AI course that publishes them is telling you about a phone somebody else owned. The labs measure them on your hardware, print them, label them as yours, and assert nothing about them. What gets asserted is what is reproducible: bytes, shapes, dtypes, opset versions, quantisation scales and accuracies. It will also not walk you through a cloud console that will look different by the time you watch it.