Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Browser, Mobile and Edge AI: ONNX, TensorFlow.js, TF Lite
New
2 students

Browser, Mobile and Edge AI: ONNX, TensorFlow.js, TF Lite

Shrink a model, export it to ONNX or TF Lite, and run it in the browser, on Android, on edge and desktop.
Created byReal Numbers
Last updated 11/2026
English
English

What you'll learn

  • Quote a compression result with its accuracy cost attached, every time - the habit the whole course is built to instil
  • Choose between float16, int8, pruning and distillation on measured evidence rather than on which one sounds most advanced
  • Know why pruning a dense format saves nothing, and be able to show the arithmetic that makes it break-even
  • Export a model to ONNX, read the graph when the export is wrong, and recognise an unsupported operator for what it is
  • Run a model in the browser with ONNX Runtime Web or TensorFlow.js, vendored locally so it works offline
  • Convert to TF Lite, run it on a real Android device, and prove the device agrees with the desktop row for row
  • Write an inference loop under a fixed memory ceiling with a queue and a drop policy you chose deliberately
  • Package a model into a desktop app, and lint the spec for the hardcoded paths that make it build on one machine only
  • Tell a device-dependent measurement from a reproducible one, and never publish the first as though it were the second

Course content

10 sections • 45 lectures • 6h 25m total length
  • Welcome, and how to use this course3:56

    How the course is structured, what you need installed, how the hands-on lectures work, and how to get the most out of it.

Requirements

  • Comfortable writing Python - functions, files, and NumPy arrays
  • You have trained or used a model before; this course is about getting one to the user, not about fitting it
  • Able to read JavaScript well enough to follow a page that loads a model. You will not be asked to write much of it
  • Node 18 or later for the browser labs, and Python 3.10 or later. The labs are offline after setup and none needs a GPU
  • An Android device or emulator is useful for one section, and the rest of the course does not depend on having one

Description

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.

Who this course is for:

  • Engineers with a working model who now have to ship it somewhere that is not a server
  • Anyone who has been asked to make a model smaller and does not yet know what each method will cost in accuracy
  • Web and mobile developers adding inference to a product, who want the trade-offs rather than a framework tour
  • Practitioners weighing client-side inference against an API call, who want the cost, latency and privacy argument laid out as a trade rather than a slogan
  • Anyone who has read a benchmark quoting milliseconds on hardware they do not own and wondered what it was worth