Session 1 · Edge AI & TinyML

How much time does the car have?

You’re traveling at 90 km/h. An obstacle suddenly appears 5 metres ahead.

Five metres go by fast.

200 ms

90 km/h = 25 m/s

5 m ÷ 25 m/s = 0.2 s

0 m
0 ms
1 m
40 ms
2 m
80 ms
3 m
120 ms
4 m
160 ms
5 m
200 ms

The car reaches the obstacle’s position in 200 ms at unchanged speed. Braking still takes time and distance after the command.

Where should the decision run?

110 ms

Onboard command ready

30 ms

170 ms before the obstacle point

  1. Capture 10 ms
  2. Process 20 ms

Cloud command ready

250 ms

50 ms after the obstacle point

  1. Capture 10 ms
  2. Upload 110 ms
  3. Process 20 ms
  4. Return 110 ms

Illustrative timings. Both paths use 10 ms to capture data and 20 ms to process it. The cloud path adds an upload and a return trip, each using the delay you set.

Run the model close to the data.

That’s the idea behind Edge AI. When a decision has to happen right away, processing onboard keeps the network round trip out of the loop.

Edge AI · Onboard computer

A robotaxi

Waymo’s onboard computer processes sensor data and plans driving actions in real time. Tesla uses in-vehicle inference hardware for FSD (Supervised).

A white Waymo Jaguar I-PACE with roof sensors pulled up to the curb as riders approach
A Waymo robotaxi in San Francisco Source: Waymo

TinyML · Microcontroller

A vibration sensor

An accelerometer measures the fan’s vibrations. An ESP32 runs a small model to flag unusual patterns. The model has to fit the microcontroller’s memory and power budget.

A vibration sensor mounted on a fan test rig, beside a close-up of the circuit board labeled with the sensor and ESP32 microcontroller
Fan vibration sensor and TinyML board Antonini et al., Fig. 4 · CC BY 4.0
Sources

Waymo Driver · Tesla inference hardware · Tesla FSD (Supervised) · TinyML and deployment settings

On-device inference · Driving

Slow down first. Pass when clear.

Robotaxi · 90 km/h Three cars ahead · 60 km/h each Speeds in km/h · Traffic →
  1. Sense

    On approach at 90 km/h, the robotaxi senses three cars side by side at 60 km/h.

  2. Prepare the data

    Combine the readings into tracks. The gap is shrinking because the robotaxi is 30 km/h faster.

  3. Run the model

    Predict that the cars will stay side by side. The planner chooses to slow down and follow.

  4. Act

    The controller brings the robotaxi down to 60 km/h and holds a gap of about 35 m.

Schematic road layout. At 60 km/h, a 3–4 m gap gives only about 0.2 seconds. Following-distance guidance · How Waymo drives

On-device inference · Vibration

Can the motor mount vibrate less?

Before damping
After damping starts
Illustrative vibration traces on the same scale. Time moves right →
  1. Sense

    An accelerometer measures vibration at a specific motor mount.

  2. Prepare the data

    Group readings into short windows. Calculate vibration strength and which frequencies stand out.

  3. Run the model

    The TinyML model flags a vibration pattern outside the motor’s usual range.

  4. Act

    The controller drives an active damper at the mount. The accelerometer measures again to check the effect.

This example assumes a motor mount equipped with active damping. Active damping research

Next, the Car AI demo ↓

Car AI live demo

The planner checks traffic within 180 pixels and picks a lane and speed. The 4 → 6 → 4 network sets the controls every tick.

4 model inputs

  • Offset from target lane center
  • Current heading
  • Target speed
  • Current speed

6 hidden neurons

4 output neurons

  • Accelerate
  • Steer left
  • Steer right
  • Brake

6 hidden + 4 output = 10 computing neurons. They use 48 weights and 10 biases. The five visible rays are a visual aid in this mode.

What is Edge AI?

Edge AI runs a model on the device collecting the data or on a nearby computer.

On the device

The robot uses its onboard computer to decide how to move.

Robot sensorsOnboard modelMovement

On a nearby computer

A computer on the factory floor can inspect feeds from several cameras.

Line camerasNearby modelDefect alert

Keeping the model close can shorten response times and reduce how much raw data travels to the cloud. Harvard ML Systems

How the categories overlap

Microcontroller

TinyML

TinyML runs machine learning on very small, low-power devices with limited memory, such as microcontrollers.

Think of a battery-powered motor monitor. It can combine sound from a microphone and motion from an accelerometer to flag an unusual pattern.

Sound and motion together make it multimodal. Running the model locally makes it Edge AI. Running it on a low-power microcontroller makes it TinyML as well.

MicrophoneSound
AccelerometerMotion
MicrocontrollerRuns a small model on both signals

Flag an unusual pattern

TinyML in Harvard ML Systems · Multimodal TinyML research

Phone

On-device AI

The model runs directly on the device collecting the data.

A phone’s microphone captures your voice. A speech model on the phone turns that audio into text. When local recognition is supported and enabled, the audio can stay on the device.

Apple’s on-device speech documentation

Microphone audio

Local transcript

“The meeting starts at nine.”

Robot

Embedded AI in robotics

The onboard computer runs the model as part of the robot’s sensing and control loop.

A floor-cleaning robot uses live camera and lidar data to navigate busy aisles. Its onboard system uses the model’s output to decide where to go and sends commands to the wheels.

Camera and lidarOnboard modelWheel commands

NVIDIA and Brain Corp robotics case study

A blue Tennant floor-cleaning robot in a grocery aisle near an employee stocking shelves
Autonomous floor-cleaning robot. Photo from Brain Corp

Factory computer

Industrial Edge AI

Industrial Edge AI runs models close to the machines and processes they monitor.

Several cameras can send images of parts to one computer on the factory floor. Its model flags defects so the line can divert the affected parts.

Inference can also run directly on the machine. The choice depends on what the machine can handle and whether several stations need to share a computer.

NVIDIA manufacturing case studies

Camera 1Top view
Camera 2Side view
Camera 3End view
Factory computerRuns the defect detection model

Flag a part for removal

What has to fit?

FlashFlash is the microcontroller’s permanent storage stores the program and the model. RAM holds sensor readings and the model’s working data while it runs.

FlashFlash is the microcontroller’s permanent storage · Car AI lane-following network

232 bytes

4 inputs → 6 hidden neurons → 4 output neurons. Count 4 × 6 + 6 × 4 = 48 weights and 10 biases. At 4 bytes each, those 58 parameters take 232 bytes.

RAM · Raw vibration buffer

600 bytes

100 samples × 3 axes × 2 bytes per axis. Preprocessing and intermediate model results also need RAM.

1 s

The vibration buffer uses 100 samples per second and 16-bit readings. Both bars use the same 1,200-byte scale. TinyML memory in Harvard ML Systems

The network uses lane-center offset, heading, target speed, and current speed to set the four driving controls.

How long until the warning?

The model takes 8 ms in this example. The first warning also waits for the buffer to fill.

Fill the sensor buffer · 1,000 msProcess and alert · 25 ms
Prepare the data
12 ms
Run the model
8 ms
Issue the alert
5 ms

1,025 ms to the first alert if that window contains the fault.

Illustrative timings. The capture time follows the window on the previous slide. In continuous monitoring, overlapping windows can produce updates more often. Shorter windows also give the model less signal to work with.

What does the round trip add?

Start the clock once the vibration readings are ready. Both paths run the same trained model.

100 ms

Model runs on the device

25 ms

Prepare the data on device
12 ms
Run the model on device
8 ms
Issue the alert
5 ms

9×

as long in the cloud

225 ms ÷ 25 ms

Model runs in the cloud

225 ms

Upload readings
100 ms
Prepare the data in the cloud
12 ms
Run the model in the cloud
8 ms
Return the decision
100 ms
Issue the alert on device
5 ms

200 ms added by the round trip.

Illustrative timings. Both paths use 25 ms to process and alert. The slider sets the network delay in each direction.

What drains the battery?

A battery-powered sensor can sleep between measurements if the application can tolerate gaps in coverage.

Continuous monitoring

10 mA

Average current if the device stays awake for all 10 seconds.

Wake once every 10 seconds

1.09 mA

Average current with 1 second awake at 10 mA and 9 seconds asleep at 0.1 mA.

AwakeAsleep · Each division represents 1 second

For example, a periodic health check can sleep between readings. A short vibration spike can happen in the middle of that sleep window.

Illustrative current values. Measure the whole device, including the sensor, processor, and any radio transmissions. MLPerf Tiny benchmarks

Why make the model smaller?

The hardware sets the memory, compute, and power budget.

Microcontroller

ESP32-S3

Espressif ESP32-S3-DevKitC-1 development board

512 KB

On-chip RAM · 8 MB flash (N8 board)

2 CPU cores · up to 240 MHz

Detect a motor vibration fault

Example classifier with 50,000 int8 weights uses 50 KB for weights.

Laptop

MacBook Pro (M3 Pro)

Apple MacBook Pro with M3 Pro

36 GB

Unified RAM shared by CPU and GPU

12 CPU cores · up to 4.06 GHz
18 GPU cores

Run a local chat model with Ollama

Quantized downloads
Llama 3.1 · 8 billion params · 4.9 GB
Qwen 2.5 · 14 billion params · 9 GB

ML server

NVIDIA DGX H100

NVIDIA DGX H100 rackmount server

640 GB

GPU memory across 8 H100s · 2 TB system RAM

112 CPU cores · up to 3.8 GHz

Serve a large language model

Llama 3.1 with 405 billion parameters runs in FP8 across all eight H100 GPUs.

On the ESP32-S3, every byte counts. The device needs room for the model, sensor readings, and intermediate results.

How do we make the model smaller?

Quantization stores the lane-following network’s 48 weights using fewer bits. A scale tells us what each stored integer represents.

32-bit floating-point weights

192 bytes

48 weights × 4 bytes

8-bit integer weights

48 bytes

48 weights × 1 byte

For this illustrative weight, use a scale of 0.02 and a zero point of 0.

0.373Original weight19Stored integer0.380Approximate value

With ten 32-bit biases, the quantized weights and biases total 88 bytes. Model metadata and planner settings add storage. Compare accuracy and timing on the target hardware after quantizing. LiteRT quantization specification

Quantize the Car AI weights

Car AI’s weights are already integers, so we can store them directly as Int8 with a scale of 1.

  1. 1. Find the range

    The model’s 48 weights are −1, 0, or +1. All three fit in a signed byte.

  2. 2. Use a scale of 1

    Keep each integer as it is. Multiplying by 1 when you read it back gives the exact original weight.

  3. 3. Pack the weights

    Store each weight in one byte. Keep the 10 biases at 32 bits, or four bytes each.

Before · 32-bit weights

232 bytes

48 × 4 bytes for weights + 10 × 4 bytes for biases

After · 8-bit weights

88 bytes

48 × 1 byte for weights + 10 × 4 bytes for biases

144 bytes saved, about 62% of parameter storage. A scale of 1/127 codes these same weights as −127, 0, and +127 and uses the same space. That scale helps when weights have fractions.

Both Int8 scales use one byte

Choose a Car AI weight to see its Float32 bytes and both Int8 encodings.

Choose a model weight

Float3232 bits · 4 bytes

10111111100000000000000000000000

Int8 · scale 18 bits · 1 byte

11111111 3 bytes saved per weight

Int8 · scale 1/1278 bits · 1 byte

10000001 3 bytes saved per weight
Read back with scale 1
−1 × 1 = −1
Read back with scale 1/127
−127 × (1 ÷ 127) = −1

Either Int8 scale saves 144 bytes across 48 weights. The float bytes are shown most significant first. Float and signed-byte formats

Why scale decimal weights?

For weights between −1 and +1, a scale of 1/127 gives the same one-byte storage with finer steps.

0.37

Int8 · Scale 1

0

Round(0.37 × 1) = 0 stored in 1 byte

Read back 0 × 1

Absolute error 0.37

Int8 · Scale 1/127

0.37008

Round(0.37 × 127) = 47 stored in 1 byte

Read back 47 ÷ 127

Absolute error 0.00008

Original weightRecovered weight

127 is the largest positive Int8 code. Mapping −1 and +1 to −127 and +127 gives 255 evenly spaced values in the same range, with a step of about 0.00787. Scale 1 gives three values.

How does the motor monitor learn and relearn?

Supervised learning uses vibration recordings labeled healthy or faulty.

First deployment

  1. Record and labelCollect vibration at different speeds and loads.
  2. Train on a computerLearn which vibration patterns signal a fault.
  3. Deploy on the boardThe model reads new samples and raises alerts locally.

Relearning loop

  1. Review alertsA technician checks the motor and labels the new recording.
  2. Retrain on a computerUse the new labels alongside earlier examples.
  3. Test on the boardCheck for missed faults and false alarms on separate recordings.
  4. RedeployFlash the updated model if it passes the checks.

Keep monitoring and review new alerts

Example. A healthy replacement motor trips the old model. Once a technician confirms it is healthy, that recording can teach the next model what normal looks like.

What actually goes into the model?

The accelerometer gives us a stream of samples. We take a short window and turn it into inputs the model can use.

Take a window

Signal A · slower vibration

Signal B · faster vibration

One second at 100 Hz gives 100 samples of one axis.

Extract features

How strong is the vibration?
Both signals have the same RMS amplitude: 0.71 g.
How fast does it repeat?
Signal A peaks at 8 Hz. Signal B peaks at 22 Hz.
Example model inputs · RMS amplitude and peak frequency

Synthetic examples. RMS summarizes vibration strength within the window.

What would Car AI look like on an ESP32?

Proposed build. The browser simulates traffic and plans the lane and speed. The ESP32 runs the trained network.

Browser

Simulator and planner

Prepare four inputs
Lane offset, current heading, target speed, and current speed.
Apply four output flags
Accelerate, steer left, steer right, or brake.

ESP32-S3

On-device inference

4 inputs → 6 hidden neurons → 4 outputs

Store the model and firmware in flash. Use RAM for inputs and intermediate values.

First test. Give both versions of the network the same four inputs. Compare the output flags before swapping in the board’s decisions.

Microcontroller deployment example

Does the model need to run all the time?

A cheap vibration check runs every window. The model only wakes when the score reaches the threshold.

5 / 10
Dark green means the model runs. Orange caps mark known faults in windows 7, 9, and 11.
Model runs in 2 / 12 windows Known fault windows skipped 1 / 3

Illustrative scores. Lower the threshold to pass the weak fault in window 7 through to the model.

What stays on the device?

The board raises local warnings. A dashboard displays the events it sends.

Motor monitor

Read → classify → warn

Raw readings stay on the board. Local warnings work offline.

2.16 MB of raw samples per hour
100 samples/s × 3 axes × 2 bytes × 3,600 s

Maintenance dashboard

Grafana dashboard

Motor 07 · fault detected
14:32 · inspect the motor

120 bytes per event · example payload

Local warning raised. The dashboard received the event.

Edge AI you use every day

Four devices turn microphone, camera, or motion readings into an action right where the data is collected.

Amazon Echo Dot smart speaker

Amazon Echo

Wake-word detection

The speaker recognizes “Alexa” locally. The request that follows can go to the cloud.

Google Pixel phone showing Now Playing on the lock screen

Google Pixel

Now Playing

The phone matches an audio fingerprint against songs stored on the device and shows the title.

iPhone showing Face ID enrollment

iPhone Face ID

Face matching

The TrueDepth camera reads your face and the phone checks it against the enrolled face to unlock.

Apple Watch displaying a fall detection prompt

Apple Watch

Fall detection

The watch uses wrist-motion data to detect a hard fall and can prompt the wearer to respond.

Edge AI that sees and responds

These devices use onboard camera processing to decide what to flag, avoid, or follow.

Google Nest Cam battery-powered camera

Google Nest Cam

Person and pet alerts

Supported Nest cameras classify objects locally so an alert can tell you whether it saw a person or an animal.

Roomba j7 robot vacuum near an obstacle

iRobot Roomba j7

Obstacle avoidance

The vacuum recognizes hazards such as charging cables and steers around them while cleaning.

DJI Mini 4 Pro drone in flight

DJI Mini 4 Pro

Subject tracking

ActiveTrack follows a selected subject as the drone adjusts its flight and framing.

Small devices with a specific job

A hearing aid runs AI on a dedicated chip. Two TinyML projects use microcontrollers.

Oticon Intent hearing aids

On-device audio

Oticon Intent

Neural noise reduction

A neural network on the hearing aid’s Sirius chip helps reduce background noise.

Arduino Nano Matter gesture recognition project

TinyML project

Arduino Magic Wand

Gesture control

The Nano Matter classifies motion from an accelerometer. A recognized gesture can trigger a smart-home action.

Grove Vision AI Module V2 connected to a camera

TinyML project

Seeed Grove Vision AI V2

Person detection

A small camera module can run a person detector and send the result to a host board.

Dashboard source