Science and engineering
Machine learning for internet of things
IoT systems use machine learning to recognise activities and occupancy from sensors, to detect equipment faults and anomalies, and to run compact models directly on microcontrollers and gateways where bandwidth, memory and power are limited.
How machine learning is used in the Internet of Things
Running models on microcontrollers
Compact models run directly on microcontrollers and gateways, so devices can classify sensor data without sending raw streams to the cloud. This saves bandwidth and power and keeps working offline.
Real exampleTensorFlow Lite Micro (David et al., 2020)Describes a framework for running deep learning inference on embedded devices whose compute, memory and power are severely constrained.
Always-on audio and keyword spotting
Small neural networks listen continuously for a wake word or specific sounds on a battery-powered device, and only wake larger systems when needed.
Real exampleHello Edge: keyword spotting on microcontrollers (Zhang et al., 2017)Explored neural network architectures for keyword spotting that fit the memory and compute limits of microcontrollers while keeping accuracy high.
Detecting machine faults from sound and vibration
Sensors on pumps, fans and motors record normal operation, and anomaly detection models flag sounds or vibrations that drift from it. Faults are rare, so models usually learn normal behaviour first.
Real exampleMIMII dataset (Hitachi, 2019)A public dataset of normal and anomalous sounds from industrial machines, including valves, pumps, fans and slide rails, for developing machine monitoring.
Detecting occupancy in buildings
Environmental sensors for light, temperature, humidity and CO2 can show whether a room is occupied, which drives heating, ventilation and lighting control without cameras.
Real exampleOccupancy detection dataset (UCI Machine Learning Repository)A public dataset and study of detecting office occupancy from light, temperature, humidity and CO2 measurements with statistical learning models.
Can you learn machine learning for IoT?
Yes. Embedded and IoT engineers can add machine learning in stages: Python for data work, signal features and classical models, then small neural networks and the tools that compress them for microcontrollers.
- PythonCollect and analyse sensor logs on a laptop before anything runs on a device.Learn it in Python
- Time-series handlingWindow, resample and label sensor streams with pandas.Learn it in Data Tools
- Classical modelsSmall decision trees and logistic regression often fit on microcontrollers and are easy to debug.Learn it in Machine Learning
- Small neural networksTrain compact convolutional networks and quantise them for TensorFlow Lite Micro or similar runtimes.Learn it in Deep Learning
- Embedded deploymentMeasure memory, latency and power on the target board, and plan how models are updated in the field.
Moving into machine learning for IoT
If you already work in the field
Embedded engineers already know microcontrollers, memory limits and power budgets, which most machine learning engineers do not. Learn Python and basic machine learning, then deploy a keyword spotting or gesture model to a board you already use. Companies building sensors, wearables and industrial monitoring products hire for this mix.
If you come from data science or ML
Machine learning engineers should learn embedded constraints: kilobytes of RAM, fixed-point arithmetic, battery life and firmware updates. A microcontroller development board and the TinyML literature give a practical start.
Roles that do this workEmbedded machine learning engineerIoT data scientistEdge AI engineerFirmware engineer
Tools you will use
| Tool | What you use it for |
|---|---|
| LiteRT (TensorFlow Lite) | Convert and quantise models to run on phones, gateways and microcontrollers. |
| ONNX Runtime | Run exported models efficiently on edge hardware from many languages. |
| Edge Impulse | Collect sensor data, train and deploy small models to embedded devices. |
| River | Train and update models online as sensor streams arrive. |
| scikit-learn | Build windowed-feature classifiers and anomaly detectors on sensor data. |
Public data to practise on
- Occupancy Detection (UCI): Office light, temperature, humidity and CO2 readings labelled with room occupancy.
- Human Activity Recognition Using Smartphones (UCI): Smartphone accelerometer and gyroscope signals labelled with walking, sitting and other activities.
Your first project
Download the UCI Occupancy Detection data, predict room occupancy from light, CO2, temperature and humidity with a small decision tree, and compare it with a CO2 threshold rule using F1, then confirm the ONNX export gives identical predictions.
Common questions
What is TinyML?
TinyML is machine learning on microcontrollers and other very low-power devices. Models are small and quantised so they fit in kilobytes of memory and run on milliwatts of power.
Should IoT models run on the device or in the cloud?
It depends on latency, bandwidth, privacy and power. Simple, frequent decisions often run on the device, while heavier analysis and model training stay in the cloud.
Which hardware is used for edge machine learning?
Options range from Arm Cortex-M microcontrollers for tiny models to single-board computers and accelerators for larger ones. The right choice depends on model size, latency and power budget.
What data is needed for IoT anomaly detection?
Mostly normal operating data, because faults are rare. Models learn normal behaviour and flag deviations, and a smaller set of labelled faults is used to check detection.
Courses for these skills
- Practical Machine Learning in PythonStudy anomaly detection and rare-event classification.51 published lessons · more lessons in production
- Python for AI and Machine LearningUnderstand input validation and reproducible transformations.33 published lessons · all planned lessons open
- Data Tools: NumPy, pandas, Matplotlib and scikit-learnPreserve capture groups and clean traffic-feature tables.23 published lessons · all planned lessons open
- Deep Learning with PyTorchExplore sequence representations after a baseline.Syllabus available · lessons open as produced
New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.