Edge AI
01
Edge AI
02
Edge AI
03

Embedded Story

Edge AI
04
The Baseline

Planting with a Timer

Simple logic: if (time == 8:00) water_on(); — Rigid, blind, and efficient.
Edge AI
05
The Evolution

Remote Control

Adding Connectivity: Control
Edge AI
06
Local Intelligence

Autonomous Sense & React + Collecting Data

Adding local compute: ESP32-S3 — Smart farmer happens on the device.
Edge AI
07
The Challenge

Embedded Constraints

🔋
Power
Milliwatts (mW) budget. Running on a coin cell for years, not hours.
💾
Memory
Kilobytes (kB) of RAM. No swapping. Flash is your only ocean.
⚡
Speed
Real-time or bust. Sub-millisecond jitter. Clocked in MHz, not GHz.
📏
Size
Fingernail-sized silicon. BOM cost matters down to the penny.
Shipping AI on the edge is the art of fitting a gallon into a thimble.
Edge AI
08

Edge AI

When AI lives inside the thing.

From the milliwatt microcontroller in your earbud to the camera on a factory floor — what it takes to ship intelligence outside the cloud.

Edge AI
09
// RIGHT NOW, WHILE YOU HEAR ME

The earbuds in your pocket run a neural network.

No cloud. No Wi-Fi. No latency. Just a tiny chip, a microphone, and a model small enough to live there.
That is Edge AI — and it's eating the world quietly.
Wireless earbuds with charging case
Edge AI
10
Roadmap

Build your way up.

01
Foundations
What & why of Edge AI
02
Cloud · Fog · Edge
Where compute lives
03
Vocabulary
Cheat-sheet for the rest
04
Use cases
Where it's already shipping
05
The pipeline
Sensor → action
06
Sensors & features
Fusion, FFT, MFCC
07
Modeling & tools
Models, optims, frameworks
08
KWS demo
Edge-Impulse
? Questions welcome at any step — write in the chat whenever an idea sparks.
Edge AI
11
Definition

What is Edge AI?

In one sentence
Running AI inference on the device that produced the data — instead of sending it to a server.
تشغيل استدلال الذكاء الاصطناعي على الجهاز الذي أنتج البيانات — بدلاً من إرسالها إلى خادم.
The model was probably trained in the cloud. (Huge dataset)
It runs locally (Small model).
That asymmetry is the whole point.
Old way · Cloud AI
📱
network ↑↓
☁ AI
New way · Edge AI
📱 + AI
☁ optional
Traffic camera
Edge AI
12
Where compute lives

Cloud · Fog · Edge.

Same data, very different physics.
 
↓ farthest from sensor
☁ Cloud
AWS, GCP, Azure datacenters
↓ in between
🌫 Fog
Gateways, local servers, on-prem
↓ on the device
⚡ Edge
MCUs, phones, sensors
Latency
100–500 ms
10–100 ms
< 10 ms
Bandwidth
Streams everything ↑
Aggregates locally
Sends only decisions
Privacy
Data leaves device
Stays on premise
Never leaves the chip
Cost / scale
$$ per inference
$ once, then free
Free after BOM
Compute budget
Effectively unlimited
CPU/GPU on a box
kB of RAM, mW of power
Reality: most products are hybrid — train in cloud, fuse in fog, decide at edge.
📷 Traffic camera
Stores raw 4K footage · trains next model version · city-wide flow analytics
Local server aggregates 40 cameras · runs plate OCR · flags incidents
Detects red-light violation in <5 ms, on-chip — no network needed
Edge AI
13
Why now

Four forces moving AI off the cloud.

01
⚡
Latency
A car braking for a child can't wait 200 ms for a round-trip.
< 10 ms or it's useless
02
🔒
Privacy
Your microphone, your camera, your heart — should stay local.
data never leaves
03
📶
Bandwidth
A 4K camera @ 30 fps = 12 Gbps raw. Nobody pays for that.
send decisions, not pixels
04
📡
Offline reliability
Tractors, drones, oil rigs, wearables. Network is a luxury.
works when Wi-Fi doesn't
Edge AI
14
The spectrum

"The edge" is not one place.

Phone / SBC
📱 Phone / SBC
Apple Neural Engine, Pixel (Google Tensor), Raspberry Pi 5
~5–50 W
GB of RAM
Gateway
🛜 Gateway
Industrial PCs, smart cameras, edge servers in a closet
~1–20 W
100s of MB
MCU / TinyML
🔲 MCU / TinyML
ESP32-S3, Cortex-M4/M7, nRF52840
~10–500 mW
kB to MB
In-sensor
🧫 In-sensor
Sony IMX500, BMI270 — compute on the silicon itself
µW range
fixed function
Same model class, totally different engineering. The constraints get much tighter as you move right.
Edge AI
15
Cheat-sheet

Vocabulary, fast.

Keep this map in your head for the next 25 minutes.
training vs inference
التدريب مقابل الاستدلال
Training learns the weights (cloud, hours). Inference runs them (device, ms).
model · weights
النموذج · الأوزان
Architecture is the recipe. Weights are the numbers it cooked into.
quantization
التكميم
Replacing 32-bit floats with 8-bit ints. ~4× smaller, ~3× faster, tiny accuracy hit.
distillation
التقطير
Training a small "student" model to mimic a giant "teacher" model.
model vs equation
النموذج مقابل المعادلة
A model learns patterns from data. An equation is hand-crafted logic. Edge AI uses models where rules are too complex to write.
sensor fusion
دمج أجهزة الاستشعار
Combining data from multiple sensors (e.g. Mic + IMU) to get a more accurate picture than any single sensor.
Edge AI
16
Section · Use cases

It's already shipping
everywhere.

Wearables
AR / VR
Automotive
Industry 4.0
Medical
Smart home
Agriculture
Drones
Retail
Robotics
Logistics
Energy grid
Defense
Audio
Next three slides: real examples — what sensor, what model, what constraint dominates.
Edge AI
17
Use cases · Consumer & wearables

Things in your pocket.

Galaxy Buds4 Pro
Smart earbuds
Active noise cancelling
SENSOR mic array · MODEL tiny RNN · CONSTRAINT latency < 5 ms
Real-time translate
SENSOR mic · MODEL on-device ASR + NMT · CONSTRAINT < 300 ms
Voice action words
SENSOR mic · MODEL KWS / wake-word · CONSTRAINT always-on µW
Head gesture (nod / shake)
SENSOR IMU · MODEL gesture classifier · CONSTRAINT < 20 ms
Osmo Pocket 4
Vlogging camera
ActiveTrack 6.0
SENSOR CMOS sensor · MODEL tiny ViT · CONSTRAINT 4K 120fps sync
Face auto-exposure
SENSOR CMOS sensor · MODEL light-metering CNN · CONSTRAINT < 10 ms
Wind noise reduction
SENSOR 3-mic array · MODEL spectral RNN · CONSTRAINT low-latency audio
Gimbal orientation
SENSOR 3-axis IMU · MODEL motion prediction · CONSTRAINT 1000 Hz update
Edge AI
18
Use cases · Industrial & automotive

Things that move metal.

Banana Pro Motor Sensor
Predictive maintenance
Motor vibration (IMU)
SENSOR 6-axis IMU · MODEL anomaly detector · CONSTRAINT real-time FFT
Bearing scream (Mic)
SENSOR MEMS mic · MODEL spectral RNN · CONSTRAINT always-on mW
Load imbalance
SENSOR Current sensor · MODEL anomaly detector · CONSTRAINT high-rate ADC
ADAS System
ADAS systems
Pedestrian detection
SENSOR HDR camera · MODEL YOLOv8-tiny · CONSTRAINT latency < 30 ms
Lane keep assist
SENSOR monocular cam · MODEL segmentation CNN · CONSTRAINT 99.999% reliability
Blind spot monitor
SENSOR radar array · MODEL point-cloud DNN · CONSTRAINT sensor fusion lag
Driver monitoring
SENSOR NIR camera · MODEL gaze tracking · CONSTRAINT privacy (no cloud)
Edge AI
19
The spine of every Edge AI system

Sensor → Action.

Development & Training (Cloud / PC)
01
Collection
Raw datasets
02
Labeling
Ground truth
03
DSP / Features
Python / Python
04
Training
GPU Clusters
05
Optimization
Quantize → C++
Production & Inference (Device)
01
Sensor
Live Stream
02
Conditioning
Hardware filters
03
DSP / Features
C++ / Assembly
04
Inference
Tiny Engine
05
Action
Real-world result
Most "AI" energy spent on Dev Row 04.
Biggest engineering risk is **Feature Parity** between Dev 03 and Prod 03.
Most product value in Prod 05.
Edge AI
20
Edge AI
21
Sensors

One sensor lies. Many sensors confess.

Sensor fusion = combining signals from multiple sensors so the system understands more than any one sensor could alone.
Three flavours
Early fusion — concatenate raw signals, model learns the relationship.

Late fusion — each sensor has its own model, vote at the end.

Mid fusion — fuse features. Usually the best trade-off on MCUs.
📈 IMU 🎙 Mic 🌡 Temp FUSION + MODEL decision
Edge AI
22
Sensors · Mobile Edge AI

The supercomputer in your pocket.

01 · Raw Sensors
🎙 Mic
📈 Accel
🔄 Gyro
🧭 Mag
🌡 Baro
📍 GPS
💡 Lux
📱 Prox
📸 Camera
📡 WiFi
📶 BLE
🌍 GSM
02 · Feature Extraction
Time-domain:
RMS, Zero-crossing, Peak-to-Peak, Mean, Variance, Jerk (Δ Accel), Orientation (Roll/Pitch)
Frequency-domain:
FFT (Spectral power), MFCCs (Speech), PSD (Vibration footprint), Dominant Freq
03 · Sensor Fusion Intel
🚶 Step count & Gait analysis
🧭 True North (Mag + GPS)
🏃 Activity (Running / Driving)
🏠 Indoor / Outdoor detect
📱 On-body / In-pocket
⛰ Altitude (Baro + GPS)
🤝 Social context (Prox + Mic)
Edge AI
23
Edge AI
24
Data Cleaning

Signal Conditioning: Cleaning the Noise

LPF
Low-Pass Filter
Removes high-frequency jitter. Smooths the signal so the model sees the **trend**, not the static.
RDP
Ramer-Douglas-Peucker
Reduces the number of points in a curve while keeping its shape. **Massive memory saver** for MCUs.
Don't feed the raw signal to the model.
Clean data in = Reliable inference out.
Edge AI
25
Feature families · 1 / 2

Time-domain features.

Cheap, intuitive, often enough on their own.
Sliding window over signal
window (e.g. 25 ms)
RMS
Root-mean-square — average energy. "How loud / how strong."
Zero-crossing rate
How often the signal crosses zero. Cheap pitch / texture proxy.
Mean · variance · skew · kurtosis
The shape of the distribution in this window.
Peak · crest factor
Spikes vs. smooth — gold for vibration / impact detection.
Edge AI
26
Feature families · 2 / 2

Frequency-domain features.

When what frequencies matters more than what shape.
FFT
Spectrum of one window
"Which frequencies are present right now."
MFCC
Mel-Frequency Cepstral Coeffs
FFT, warped to how human ears hear. The KWS workhorse.
Spectrogram
FFT through time
"How spectrum evolves." Fed straight to a CNN as an image.
Edge AI
27
Modeling for the edge

The constraint triangle.

Pick two. The third pushes back, hard.
ACCURACY MEMORY ENERGY PICK TWO
Accuracy ↑ + Memory ↑
→ Energy explodes. Battery dies in a day.
Memory ↓ + Energy ↓
→ Accuracy suffers. Quantize, prune, distill — earn it back.
Accuracy ↑ + Energy ↓
→ Memory blows up. Hope you have flash.
Edge ML is the art of moving the trade-off — every optimization buys you a bit more of all three.
Edge AI
28
Modeling · what actually fits on edge

Boring models. Real wins.

Forget transformers. These four cover ~90% of shipping Edge AI.
01 · Decision tree / Random forest
When features are tabular & few
Tiny, blazing fast, interpretable. No multiplications — just comparisons.
USE FOR   activity classification · gesture recognition · sensor-driven rules
02 · Tiny 1D-CNN
When the input is a stream
Convolutions slide along time. Great with FFT/MFCC inputs.
USE FOR   keyword spotting · ECG classification · vibration anomaly
03 · Tiny 2D-CNN (depthwise-separable)
When the input is an image-ish thing
Spectrograms, low-res camera frames. MobileNet-style blocks shrink it 5–10×.
USE FOR   person detection · visual QC · gesture from camera
04 · Anomaly detector (autoencoder / iForest)
When you only have "normal" data
Train on healthy state, flag what's far from it. No labels needed.
USE FOR   predictive maintenance · network intrusion · industrial monitoring
Edge AI
29
Modeling · optimization toolbox

Make a big model fit a small chip.

QUANTIZATION
FP32 → INT8
FP32 weights · 4 bytes each INT8
~4× smaller. ~3× faster on DSP/NPU. Usually < 1% accuracy hit.
PRUNING
Delete dead weights
→ keep what fires
Remove weights below a threshold; retrain. 50–80% sparsity is realistic.
DISTILLATION
Big teacher → small student
TEACHER student
Student mimics teacher's outputs — often beats training student alone.
Edge AI
30
Tooling

Frameworks you'll actually touch.

TensorFlow Lite for Microcontrollers
The TinyML default. C++ runtime, no malloc, no OS. INT8 + FP16.
ONNX Runtime
Train anywhere, run anywhere. Phones, SBCs, browsers, Linux edge.
ExecuTorch
PyTorch's edge story. Mobile + embedded inference from the same graph.
CMSIS-NN
ARM's hand-tuned NN kernels for Cortex-M. The bedrock under TFLM on M-class.
ESP-DSP & ESP-NN (ESP-IDF)
Espressif's DSP & NN kernels — vector FFT/MFCC, INT8 conv. What we'll use in the demo.
Edge Impulse · Roboflow
End-to-end studios: collect → label → train → deploy a C library.
Edge AI
31
Recap

The Intelligence Leap

01 Embedded (power, memory, speed)
02 Edge AI (privacy, bandwidth, offline, latencey)
03 Data (feature extraction, sensor fusion, modeling)
04 Flow (training, quantization, inference)
The seeds are planted.
Now, go build the thing.
?

Open
Questions

Edge AI
32

The seeds are planted.
Now, go build the thing.