COE 592Lecture 00Full guide
Course overview
The whole lecture on one page, taught concept by concept. Work through the parts in order, mark each concept once you understand it, and open the slide chips when you want the original slides.
- Parts
- 2
- Concepts
- 8
- Slides
- 12
- Reading
- 48 min
Part 01: The instructor and edge AI in practice
Who teaches the course, and what his lab's projects show about running vision and security models on UAVs, farm robots, vehicles and IoT devices.
5 concepts, slides 1-8
Why this part matters
This part is the course's motivation written as a portfolio. Every image on slides 3 to 8 is the same problem you will face in the research project: a model sitting next to a sensor, a budget of weight, power, memory and latency, and a requirement to stay correct when the world is wet, noisy or hostile.
Read these slides as budget problems rather than as a list of the instructor's papers. That reading habit is what the rest of COE 592 builds on, because pruning, quantization, neural architecture search, distillation and TinyML are all answers to one question: how much model can this platform afford, and how do we make a good model fit inside that? The bio matters less for exams than the three words in the lab's name, which turn out to be the syllabus in miniature.
By the end you can
- Expand SERV and map each word to a later course theme.
- Name the sensor modalities on a UAV or vehicle inspection rig and explain why payload limits force small on-board models or data offloading.
- Read a detector's size class (n, s, m, l, x) from Ultralytics tables and compute the parameter, FLOP and mAP trade-off between two sizes.
- Read a detection figure critically: separate confidence from correctness, and a saliency map from a metric.
- State why an IoT intrusion detector must be lightweight and what generalizable means.
- Explain why roadside and rolling-stock inspection are real-time, safety-critical edge inference problems.
The course is COE 592, Machine Learning on Embedded Systems, offered in term T261 and taught by Dr. Abdul Jabbar Siddiqui of the Department of Computer Engineering. Of everything on the title and bio slides, one line carries the most information: he leads the SERV Lab, and SERV stands for Secure, Efficient, Robust Vision. Those three adjectives are the map of the course before the syllabus arrives in Part 02.
Instructor profile, as stated on slide 2
- Name
- Dr. Abdul Jabbar Siddiqui
- Roles
- Assistant Professor, Computer Engineering, KFUPM; Research Scholar, SDAIA-KFUPM JRC for AI; Lead of SERV Lab
- Degrees
- PhD, University of Ottawa (2021); MASc, University of Ottawa (2015); BSc, KFUPM (2012)
- Previously
- National Research Council of Canada; NSERC TRANSIT Network
- Research interests
- Edge AI, Visual Intelligence and Analytics, Adversarial machine learning, AI for Cybersecurity, Intelligent transportation systems, UAV-based Inspection and Monitoring, Internet of Things
Reading SERV as a syllabus
Look at the interests list again and notice that every item is an instance of one question: can a model run near the sensor, inside a budget of memory, compute, energy and latency, and still be trusted? Edge AI and IoT name the setting. UAV inspection and transportation systems name the platforms. Adversarial machine learning and AI for cybersecurity name the threats. MIT 6.5940, whose course description slide 11's takeaways echo almost word for word, opens with the same framing, that deep networks "demand extraordinary levels of computation, hindering its deployment on everyday devices" (Han, MIT 6.5940).
| Letter | Word | Course theme | Where you meet it in this part |
|---|---|---|---|
| S | Secure | Adversarial machine learning and intrusion detection | PNet-IDS on slide 6 |
| E | Efficient | Compression, pruning, quantization, nano detectors | EcoWeedNet on slide 4, PNet-IDS on slide 6 |
| R | Robust | Behaviour under rain, noise, blur and domain shift | YOLO-RAW on slide 5 |
| V | Vision | Cameras, thermal imagers and LiDAR as the input | Every figure from slide 3 to slide 8 |
Efficient is the theme that gets the most lecture time, because it is where the arithmetic lives: how many parameters, how many operations, how many milliseconds. Robust is what happens to that efficient model when rain, noise or a new camera changes the input distribution. Secure is the adversarial case, where the change in the input is chosen on purpose: Goodfellow, Shlens and Szegedy defined adversarial examples as inputs formed by applying "small but intentionally worst-case perturbations", and traced the vulnerability to the models' linear behaviour (Goodfellow et al., 2015). A model that is only efficient can be fooled; a model that is only robust may not fit on the drone.
Recall
What do the letters of SERV stand for, and which course theme does each map to?
Quick check
What does the SERV in SERV Lab stand for?
Slide 3 is a wall of figures with no captions, so start by describing what is visibly there. A small unmanned helicopter sits on gravel with its camera payload circled (panel A). Beside it is a rugged field case holding a ground control station (panel B). A snowy corridor with a railway line running through it has been rebuilt in 3D (panel C). Two road vehicles carry roof rigs with four labelled sensors: Visual Camera, Thermal Camera, GPS receiver and LiDAR. Three top-down strips of the same track corridor follow, two with the rails traced in blue and encroaching vegetation segmented in red, one with the vegetation segmented in purple. A photogrammetric point cloud of the corridor appears once in true colour and once coloured by elevation. Finally a ROS-style dashboard shows six panes: an IR camera looking left and right, RGB cameras looking right, forward and left, and a LiDAR output.
Read together, this appears to be a rail corridor inspection platform: a Multi-sensor platform mounted on a UAV and on vehicles, mapping the track and the vegetation around it. The slide attributes no paper and no result, so treat everything beyond the visible labels as a description of the problem class. The instructor did co-author a review of exactly this field, a literature survey of automated machine vision inspection systems in railways, prepared at the National Research Council of Canada for Transport Canada (Siddiqui, Mammeri and Liu, 2021), which is the closest citable link for the theme.
Four sensors, four different questions
Each sensor on the roof rig answers a question the others cannot. A visual camera sees colour and texture, which is what separates green vegetation from grey ballast in the orthomosaic strips. A Thermal camera images emitted infrared instead of reflected light, so it sees temperature: a hot bearing or a person on the track at night shows up with no visible illumination at all. LiDAR is, in NOAA's definition, a remote sensing method that uses light in the form of a pulsed laser to measure ranges, and those ranges become the 3D Point cloud in which clearance and elevation can be measured. GPS contributes no picture of the scene, only where and when each frame was taken, which is what lets overlapping aerial photos be stitched into a georeferenced strip and the segmentation overlays registered onto it.
| Sensor | Measures | Good at | Weak at | Data rate pressure |
|---|---|---|---|---|
| Visual (RGB) camera | Reflected visible light | Colour and texture: vegetation against rail, paint, signs | Darkness, rain, glare | Highest: full-colour frames at video rate |
| Thermal (IR) camera | Emitted infrared, so temperature | Hot bearings, people and animals at night | No colour, lower resolution | Moderate: fewer pixels per frame |
| LiDAR | Laser pulse time of flight, so range | Geometry, clearance, elevation, 3D point clouds | Sparse at long range, cost, weight | High: millions of points per second |
| GPS receiver | Position and time | Georeferencing every frame and point | Nothing about the scene itself | Negligible |
Why the payload cannot carry much
The reason this slide belongs in an embedded machine learning course is the platform, not the sensors. A UAV lifts a fixed mass, and every gram of camera, LiDAR or computer is a gram less battery. Its flight time is set by that battery, and the compute it can run is set by what the battery can feed without shortening the flight. A car rig has more of all three, but still nothing like a data center. So there are exactly two ways to turn the sensor streams into an inspection result: shrink the model until it runs on board, which is the E of SERV, or ship the raw data somewhere that can process it.
Shipping the raw data does not scale. Satyanarayanan's edge computing argument gives the numbers: if 12,000 users each stream 1080p video, the ingress link into the cloud needs about 100 Gbit/s, and a million users would need 8.5 Tbit/s. The cumulative demand is "considerably lower if the raw data is analyzed on cloudlets" near the sensors and only the extracted information travels onward (Satyanarayanan, 2017). Five cameras on one vehicle are a very small version of the same problem.
Worked example
How much video does a five-camera rig produce?
Assume a bit rate per camera
Take five 1080p cameras at an assumed 8 Mbit/s each after compression. This is an illustrative figure, not one from the slide.Total stream
5 × 8 = 40 Mbit/s leaving the rig continuously.One hour of driving
40 × 3600 = 144,000 Mbit, which is 18 GB per hour.Upload over a rural link
At a 5 Mbit/s cellular uplink, 144,000 / 5 = 28,800 s, that is 8 hours to upload one hour of driving.Result
The rig cannot upload what it records. It must detect on board and upload detections, which is why the model on the chip has to fit the platform's budget.
Recall
Name the four sensors labelled on the slide 3 vehicle rigs and one thing each measures.
A farm robot drives between rows of cotton seedlings and must find the weeds without stopping. That is an Object detection task, and the model that does it rides on the robot: no cloud, no rack, just whatever compute the vehicle's battery can feed. Slide 4 shows the instructor's answer, EcoWeedNet, described on the slide as lightweight, computationally and energy efficient, and aimed at sustainable, low-carbon, consumer-electronics-based Precision agriculture.
Drives the field and carries the camera.
Frames taken in the field, in sun and shadow.
A small network that runs within the robot's budget.
Boxes the robot can act on.
Efficient: what a nano detector is
The comparison on slide 4 is against YOLO11n and YOLO12n. In the YOLO family the suffix is a size class: n (nano) is the smallest, then s, m, l and x. The classes share one architecture and differ in width and depth, so the table below is the cleanest picture of what "lightweight" costs and buys. The figures are Ultralytics' own, on COCO validation at 640 px.
| Model | Parameters | FLOPs | mAP50-95 | CPU ONNX latency | T4 TensorRT latency |
|---|---|---|---|---|---|
| YOLO11n | 2.6M | 6.5B | 39.5 | 56.1 ms | 1.5 ms |
| YOLO12n | 2.6M | 7.5B | 40.6 | not listed | 1.64 ms |
| YOLO11m | 20.1M | 68.1B | 51.5 | 183.2 ms | 4.7 ms |
| YOLO11x | 56.9M | 195.3B | 54.7 | 462.8 ms | 11.3 ms |
Worked example
Nano versus medium
Parameters
20.1 / 2.6 ≈ 7.7x fewer parameters in YOLO11n than YOLO11m.Compute
68.1 / 6.5 ≈ 10.5x fewer floating point operations per image.Latency
CPU latency 183.2 / 56.1 ≈ 3.3x lower. The ratio is smaller than the FLOP ratio because small models leave part of the hardware idle.Price
51.5 − 39.5 = 12.0 mAP50-95 points lower.Result
A nano model trades a tenth of the compute for twelve points of accuracy. On a robot that must run at frame rate on a battery, that is usually the right trade, and it is the trade EcoWeedNet is designed to improve on.
The EcoWeedNet paper reports 95.2% mAP@0.5 on the CottonWeedDet12 dataset with about 4.21% of YOLOv4's parameters and 6.59% of its GFLOPs, using two parameter-free attention modules (Khater et al., 2025). Whether a Lightweight model is good enough is always this pair of numbers: an accuracy metric next to a cost metric, never one alone.
What a GradCAM++ heatmap does and does not prove
The slide's Figure 5 lays GradCAM++ heatmaps from YOLO11n, YOLO12n and EcoWeedNet side by side on seedling images, and its caption says EcoWeedNet showed better emphasis and focus on weed-relevant regions. GradCAM++ computes a weighted combination of the positive partial derivatives of the last convolutional layer's feature maps with respect to a class score (Chattopadhyay et al., 2018). In plain terms it answers "which pixels pushed this score up". It does not answer "is this score right". A model can attend to the weed and still misclassify it, or attend to the soil and get lucky. The caption's claim is a qualitative observation about attention; the 95.2% is the quantitative claim about correctness, and they are different kinds of evidence.
Robust: the same detector in the rain
Slide 5 moves from a farm to a rainy sky. The task is to tell a UAV from a bird in weather that smears both into grey blobs. The baseline is YOLOv5-m, the medium class of an earlier family (21.2M parameters, 49.0B FLOPs in the Ultralytics YOLOv5 table). The instructor's model is YOLO-RAW, published in IEEE Transactions on Intelligent Transportation Systems and evaluated on three adverse test sets, rainy, additive Gaussian noise and motion blurred (Munir et al., 2025). The slide never expands RAW, and neither does the paper's title or abstract, so this course does not expand it either.
| Scene | Object | YOLOv5-m | YOLO-RAW |
|---|---|---|---|
| Rain sky | Gull 1 (top left) | no box | Bird 0.50 |
| Rain sky | Gull 2 (centre) | UAV 0.29 (false positive) | Bird 0.63 |
| Rain sky | Gull 3 | no box | Bird 0.54 |
| Rain sky | Gull 4 | no box | Bird 0.73 |
| Rain sky | Gull 5 (bottom) | Bird 0.35 | Bird 0.37 (approximate) |
| Rain field | Real drone | UAV 0.90 | UAV 0.93 |
Read the second row first. YOLOv5-m looks at the centre gull and reports UAV 0.29: a False positive, and one that a drone-detection system would act on. Its only correct box is Bird 0.35. YOLO-RAW boxes all five birds with confidence scores from about 0.37 to 0.73 and reports no drone in the sky. In the bottom row, where a real drone flies over a field, both models find it, 0.90 against 0.93. The gain is not on the easy target; it is on the ambiguous ones.
A detector reports every box above a confidence threshold. Ultralytics' default is 0.25, and its documentation says raising it "can help reduce false positives" (Ultralytics predict mode). So a natural question is whether the baseline's mistake could be fixed by tuning the threshold instead of changing the model. Drag the slider and watch what each setting costs.
| Model | Shown | TP | FP | FN | Precision | Recall |
|---|---|---|---|---|---|---|
| YOLOv5-m | 2 | 1 | 1 | 4 | 0.50 | 0.20 |
| YOLO-RAW | 5 | 5 | 0 | 0 | 1.00 | 1.00 |
At the default 0.25 YOLOv5-m reports a false UAV at 0.29 and one bird; YOLO-RAW reports all five birds and no false positives.
Boxes and confidences are the ones printed on slide 5; the fifth YOLO-RAW label is partly occluded and marked ~. Teal boxes match the true class, light boxes do not. Ground truth is 5 birds.
At 0.30 the false UAV disappears and YOLOv5-m loses nothing else, but it still sees one bird in five. At 0.60 YOLOv5-m already reports nothing and YOLO-RAW has lost three of its five correct birds. The threshold only slices whatever confidence mass the model produced. YOLO-RAW is better because it moved that mass onto the right classes in the first place, not because it was thresholded differently.
Recall
In the slide 5 rain scene, which model produced a false positive, what was it, and at what confidence?
Recall
What does a GradCAM++ heatmap show and what does it not show?
Recall
Roughly how many times fewer parameters and FLOPs does YOLO11n have than YOLO11m, and at what mAP cost?
Quick check
Why would a farm robot's designer pick a nano YOLO variant over a medium one?
Quick check
In the slide 5 rain scene, which model labelled a gull as a UAV?
Quick check
What does a GradCAM++ heatmap over a seedling image show?
A home or factory gateway forwards packets from hundreds of Internet of Things devices, and it has a fraction of a phone's compute. Somewhere in that box a decision has to be made, per packet or per flow, about whether the traffic is an attack. That is an Intrusion detection system, and slide 6 is the first page of the instructor's PNet-IDS paper, a lightweight and generalizable Convolutional neural network for intrusion detection in the Internet of Things.
The paper as printed on slide 6
- Title
- PNet-IDS: A Lightweight and Generalizable Convolutional Neural Network for Intrusion Detection in Internet of Things
- Authors
- Auwal Sani Iliyasu, Abdul Jabbar Siddiqui (Member, IEEE), Houbing Song (Fellow, IEEE), Fahad Jibrin Abdu
- Venue
- IEEE Access, open access research article
- Timeline
- Received 6 May 2025, accepted 22 May 2025, published 2 June 2025, current version 19 June 2025
- DOI
- 10.1109/ACCESS.2025.3575705
- Funding
- KFUPM Deanship of Research and the IRC for Intelligent Secure Systems, grant INSS2309
Why an intrusion detector must be lightweight
The abstract states the problem in one sentence: deep learning detectors perform well, but their "high computational and storage requirements make these impractical for most IoT devices" (Iliyasu et al., 2025). NIST's guide to intrusion detection and prevention lists four classes of system, and the relevant one here is network-based: a sensor that watches traffic on a segment and analyses it for suspicious activity (NIST SP 800-94). On an IoT gateway that sensor is the gateway itself, so the model competes for the same small CPU that forwards the packets, and it has to keep up with the link, which network engineers call running at line rate.
Worked example
Line-rate arithmetic on a gateway (illustrative numbers)
Packets per second
A 100 Mbit/s link carrying 500-byte packets delivers packets per second. A flow-level IDS aggregates packets before scoring, so this per-packet figure is the upper bound on inspection cost.Time budget per packet
1 / 25,000 = 40 µs. Any per-packet decision slower than that falls behind the link.A heavy model
If one decision needs 10 MFLOPs and the gateway CPU sustains 1 GFLOP/s, one decision takes 10 ms, about 250x too slow.A light model
At 0.02 MFLOPs per decision the same CPU answers in 20 µs, inside the budget.Result
The deadline is set by the link, not by the designer. Reducing FLOPs is what moves a detector from impractical to deployable, which is why the paper counts FLOPs, parameters and model size as first-class results.
That is the Efficient leg. The Robust leg is the word generalizable in the title. An IDS trained on one dataset meets, in deployment, traffic and attacks it never saw, a distribution shift. PNet-IDS addresses this with a knowledge distillation framework, in which a small student network is trained to reproduce a larger teacher, and reports that robustness against distribution shifts in network traffic is enhanced as a result. The benchmarks are BoT-IoT and CIC-IDS2017, and the claimed wins are reduced parameter count, reduced FLOPs and reduced model size while maintaining high accuracy and precision (Iliyasu et al., 2025).
Recall
Give two reasons an IoT intrusion detector must be lightweight, and say what generalizable means in PNet-IDS.
Quick check
Why must an IoT intrusion detector such as PNet-IDS be lightweight?
The last two slides are photographs with no captions, and both show a decision that has to be made before the world moves on. Slide 7 pairs a low-speed autonomous shuttle with a pedestrian crossing in front of it and a schematic of a T-intersection where a red arrow, a vehicle turning left, crosses a blue arrow, a pedestrian in the crosswalk. Slide 8 shows grayscale undercarriage images of rail cars: one component circled as defective or missing, and a crack pulled out in a zoom box.
The left-turn pedestrian conflict
The schematic is the left-turn pedestrian conflict, a named pattern in Intelligent transportation systems safety analysis. A left-turning driver scans for oncoming vehicles, accepts a gap, and turns into a crosswalk where a pedestrian is already crossing. FHWA research on left-turn phasing found that protected phasing reduced vehicle-to-vehicle injury crashes but did not significantly reduce vehicle-to-pedestrian crashes, and that under permissive phasing the turning driver must pick a gap in oncoming traffic and yield to the crosswalk at the same time, which prior studies flag as a strong conflict potential (FHWA, HRT-18-044). For an autonomous shuttle the problem is the same one the human driver has, and the detector that watches the crosswalk must answer before the vehicle enters it.
Looking under the train
Slide 8 belongs to Automated visual inspection of rolling stock: cameras placed by the track or under it photograph each wagon as it passes, and a model flags anything that does not look like an intact component. The instructor reviewed exactly this field for Transport Canada while at NRC (Siddiqui, Mammeri and Liu, 2021). The slide itself carries no citation, so the images are described here as an example of the problem class, not attributed to a particular system.
Physics sets the deadline
What unites the shuttle and the wagon is that the time available for Inference is not a design preference. It is set by how fast the scene changes. Satyanarayanan's remark that "the speed of light is an obvious physical limit on latency" (Satyanarayanan, 2017) is the reason a cloud round trip cannot be the answer here: the distance the vehicle covers during the latency of the reply is the safety margin lost.
Worked example
Metres lost per millisecond of latency
The shuttle
At 10 m/s a vehicle covers 1 m every 100 ms. A 200 ms cloud round trip is 2 m of travel before the detector's answer arrives.The wagon
A wagon passing a wayside camera at 15 m/s moves 1.5 m every 100 ms. At 30 frames per second the model has about 33 ms per frame before the next one arrives and the wagon has moved another 0.5 m.Result
In both cases the budget is tens of milliseconds, and the network alone can spend that. The model runs on an Embedded system next to the camera, which means it must be small enough to fit there.
| Scenario | Sensor | Decision | Deadline driver | Cost of a miss |
|---|---|---|---|---|
| Shuttle at a T-intersection | Forward camera on the vehicle | Yield, brake or proceed on a left turn | Vehicle and pedestrian speed | A pedestrian is struck |
| Rolling-stock undercarriage | Wayside or under-track camera | Flag a cracked or missing component | Train speed past the camera | A defect leaves the yard undetected |
Recall
Why is a cloud round trip unacceptable for the shuttle and the wagon inspection, in one sentence each?
Recap
If you remember nothing else
- SERV: Secure (adversarial ML, IDS), Efficient (compression, nano models), Robust (rain, noise, blur, shift), Vision.
- Inspection rigs carry RGB, thermal, LiDAR and GPS; a UAV's weight, battery and compute cap what the on-board model can be.
- Analyze near the sensor, ship the extracted information: 12,000 1080p streams already need 100 Gbit/s into a cloud.
- A nano YOLO is the smallest scale: YOLO11n has 2.6M parameters and 6.5B FLOPs against 20.1M and 68.1B for YOLO11m, for 12 mAP points.
- EcoWeedNet: 95.2% mAP@0.5 on CottonWeedDet12 with about 4.21% of YOLOv4's parameters and 6.59% of its GFLOPs.
- GradCAM++ shows where the class score's evidence sits; it does not certify correctness.
- YOLOv5-m produced a false UAV at 0.29 in rain; YOLO-RAW boxed the birds at 0.37 to 0.73. A threshold slices confidence mass; a better model moves it. RAW is not expanded.
- PNet-IDS cuts FLOPs, parameters and size so an IoT gateway can detect intrusions in real time, and uses knowledge distillation to hold up under traffic distribution shift.
- Shuttle intersections and undercarriage inspection are deadline-bound: distance travelled per millisecond of latency decides where inference runs.
Sources
- Abdul Jabbar Siddiqui, faculty profileDocsKFUPM Department of Computer EngineeringPositions and degree year ranges.(opens in a new tab)
- Automated machine vision inspection systems in railways: literature reviewDocsNational Research Council Canada for Transport Canada, 2021 (Siddiqui, Mammeri, Liu)Report AST-2021-0055. Cited for the rail inspection theme, not for the slide 3 or slide 8 images.(opens in a new tab)
- EcoWeedNet: A Lightweight and Automated Weed Detection Method for Sustainable Next-Generation Agricultural Consumer ElectronicsPaperarXiv, 2025 (Khater, Siddiqui, Hossain, El-Maleh)95.2% mAP@0.5 on CottonWeedDet12 with about 4.21% of YOLOv4's parameters and 6.59% of its GFLOPs.(opens in a new tab)
- YOLO-RAW: Advancing UAV Detection With Robustness to Adverse Weather ConditionsPaperIEEE Transactions on Intelligent Transportation Systems, vol. 26, no. 6, 2025 (Munir, Siddiqui, Hossain, El-Maleh)Rainy, AWGN and motion blurred test sets. RAW is not expanded in the title or abstract.(opens in a new tab)
- PNet-IDS: A Lightweight and Generalizable Convolutional Neural Network for Intrusion Detection in Internet of ThingsPaperIEEE Access, 2025 (Iliyasu, Siddiqui, Song, Abdu)FLOPs, parameters and size reduced while accuracy is maintained; knowledge distillation for distribution shift; BoT-IoT and CIC-IDS2017.(opens in a new tab)
- Grad-CAM++: Improved Visual Explanations for Deep Convolutional NetworksPaperWACV 2018 (Chattopadhyay, Sarkar, Howlader, Balasubramanian)Weighted combination of positive partial derivatives of last-layer feature maps with respect to a class score.(opens in a new tab)
- Explaining and Harnessing Adversarial ExamplesPaperICLR 2015 (Goodfellow, Shlens, Szegedy)Adversarial examples as small, intentionally worst-case perturbations.(opens in a new tab)
- MCUNet: Tiny Deep Learning on IoT DevicesPaperNeurIPS 2020 (Lin, Chen, Lin, Cohn, Gan, Han)Microcontroller memory two to three orders of magnitude below a mobile phone.(opens in a new tab)
- The Emergence of Edge ComputingPaperIEEE Computer, 2017 (M. Satyanarayanan)Ingress bandwidth for 12,000 and one million 1080p streams; the speed of light as a latency limit.(opens in a new tab)
- YOLO11 model documentationDocsUltralyticsParameters, FLOPs, mAP50-95 and latency for the n, m and x classes on COCO at 640.(opens in a new tab)
- YOLO12 model documentationDocsUltralyticsYOLO12n row: 2.6M parameters, 7.5B FLOPs, 40.6 mAP50-95.(opens in a new tab)
- YOLOv5 repository and model tableDocsUltralyticsYOLOv5m: 21.2M parameters, 49.0B FLOPs.(opens in a new tab)
- Predict mode: inference argumentsDocsUltralyticsDefault confidence threshold 0.25; raising it can reduce false positives.(opens in a new tab)
- 6.5940 TinyML and Efficient Deep Learning Computing, Fall 2024DocsMIT HAN Lab (Song Han)Course framing; slide 11's takeaways closely mirror this description.(opens in a new tab)
- SP 800-94: Guide to Intrusion Detection and Prevention Systems (IDPS)DocsNIST, 2007Four classes of IDPS; network-based systems.(opens in a new tab)
- What is lidar?DocsNOAA National Ocean ServiceDefinition of LiDAR as pulsed-laser ranging.(opens in a new tab)
- Safety Evaluation of Protected Left-Turn Phasing and Leading Pedestrian Intervals on Pedestrian SafetyDocsFederal Highway Administration, report HRT-18-044Left-turn phasing reduced vehicle-to-vehicle injury crashes but not vehicle-to-pedestrian crashes.(opens in a new tab)
Part 02: Course takeaways and getting started
What the course promises you will be able to do, the five pillars of efficient deep learning on constrained devices, and what to do in week one.
3 concepts, slides 9-12
Why this part matters
This part is the course contract. Every later lecture, from efficiency metrics through pruning, quantization, architecture search and deployment, is one turn of a five-step loop that slide 11 draws as a neural network funnelling down into a small development board.
Your exams and your research project will ask you to do two things with that loop: place a technique in it (is knowledge distillation an accelerate step or a compare step?), and compute whether a given model fits a given device. Both start here. The part also covers what the instructor asks of you in week one, and what the deck deliberately leaves to Blackboard.
By the end you can
- State the five course takeaways and reorder them as a measure, optimize, compare, explore, deploy loop.
- Compute a model's weight size from parameter count and bit width, and judge whether it fits a device tier.
- Explain why accuracy alone cannot select a model for a constrained device.
- Distinguish on-device inference from on-device training by their memory needs.
- Set up a week-one plan: survey, prerequisites check, device tier, candidate model, metrics log.
On the first evening each student says three things out loud: their name, their educational background (previous studies), and their work background (current or previous work, industry or occupation). Then everyone opens the Pre-course survey at https://forms.cloud.microsoft/r/5ssu8gkcS9, also printed as a QR code on slide 10, and answers questions about background, skills and expectations.
It is tempting to file both under administration, but they serve the same purpose as takeaway 1 later in this part: you cannot tune what you have not measured. A graduate course on efficient deep learning draws people from computer engineering, electrical engineering, computer science and industry. Some have trained convolutional networks for years and never flashed a microcontroller; others write firmware for embedded systems daily and have never opened PyTorch. The instructor uses the room's answers to set depth and pacing, so an honest answer about a gap is worth more to you than an impressive one.
What is worth refreshing before week two
The deck does not list prerequisites, so treat the following as a hedged suggestion drawn from what the course will ask you to do rather than as a slide claim. The topics ahead (compression, pruning, quantization, deployment to boards) match the syllabus of MIT's 6.5940 TinyML and Efficient Deep Learning Computing, which lists an introductory machine learning subject and a computation structures subject as its prerequisites. Translated to tools, four skills will carry most of the weight.
Skills that will probably matter, and why
- Python
- Every framework, script and notebook in efficient deep learning assumes it. The PyTorch beginner tutorial itself assumes basic familiarity with Python.
- PyTorch
- The compression and quantization literature (Deep Compression, MCUNet, TinyTL) ships PyTorch code; you will read and modify such code, not write frameworks.
- Basic CNNs
- Convolutions, pooling and fully connected layers are what get pruned and quantized. The free Deep Learning book by Goodfellow, Bengio and Courville covers them.
- C for microcontrollers
- LiteRT for Microcontrollers is written in C++ 17 for 32-bit platforms with no operating system, so deploying to a board means touching C or C++ code.
None of these needs to be deep on day one. If you can train a small classifier in PyTorch, explain what a convolution computes, and compile and flash a blinking-LED program in C, you can follow the first weeks and fill in the rest as the loop demands it.
Recall
What three things does the icebreaker ask each student to share?
Take a small image classifier with 3 million parameters, trained in PyTorch and saved in 32-bit floating point. Its weights alone occupy 12 MB. A Raspberry Pi Pico has 2 MB of flash and 264 KB of SRAM. The model does not fit, and no amount of accuracy changes that. Everything this course teaches is what you do next.
Slide 11 states the promise as five takeaways. You will know the key Efficiency metrics for deep learning computing. You will understand how to speed up Inference and Training of neural networks on resource-constrained platforms. You will analyse the tradeoffs between different optimization techniques. You will be aware of recent research trends and industry practice. And you will get hands-on experience compressing and implementing deep learning models on resource-constrained devices. The infographic relabels the same five as Measure efficiency, Accelerate, Analyse trade-offs, Track the frontier, and Build and deploy, with a five-word footer: Measure, Optimize, Compare, Explore, Deploy.
Read the five as a loop, not a list
The order on the slide is not arbitrary. It is the order in which you actually work. You measure a baseline: size, memory, compute, latency, energy. You apply one optimization, say pruning. You compare the new numbers against the baseline and note what the step cost in accuracy. You look to the research literature and to industry for the next technique. You deploy on the real board to check that the paper numbers survive contact with hardware, because measured latency and energy routinely differ from analytical estimates. Then you measure again, and the loop turns.
| Pillar | Verb | Question you ask | Deep Compression example |
|---|---|---|---|
| 1 Measure efficiency | Measure | How big, how slow, how hungry is the baseline? | AlexNet: 240 MB, 61 M parameters, 32-bit weights |
| 2 Accelerate | Optimize | Which technique shrinks the cost that hurts most? | Prune 9x fewer connections, quantize to 5 bits, Huffman code |
| 3 Analyse trade-offs | Compare | What did each step cost in accuracy or effort? | 35x smaller with no accuracy loss, after retraining |
| 4 Track the frontier | Explore | What has research or industry done since? | MCUNet, TinyTL and on-device training under 256 KB |
| 5 Build and deploy | Deploy | Does it really run on the target hardware? | 3x to 4x layerwise speedup and 3x to 7x energy efficiency measured on hardware |
Deep Compression is the canonical worked loop. Han, Mao and Dally started from AlexNet at 240 MB and VGG-16 at 552 MB (measure), pruned redundant connections, quantized the survivors from 32 to as few as 5 bits and Huffman coded the result (optimize), reported 35x and 49x reductions with no loss of accuracy (compare), and measured 3x to 4x layerwise speedup and 3x to 7x better energy efficiency on real hardware (deploy). The companion paper on learning both weights and connections had already shown pruning alone cutting AlexNet from 61 M to 6.7 M parameters. Everything after 2016 (MCUNet, TinyTL, on-device training under 256 KB) is the explore step feeding the next turn.
A preview of the efficiency metrics
Slide 11 names the metrics without listing them; the list below previews later lectures and is not slide content. The ordering follows the MIT 6.5940 sequence, which opens with the basics of efficient deep learning before pruning, quantization, neural architecture search, distillation and on-device training. Learn the names now so the loop has something concrete to measure.
| Metric | What it counts | Typical unit |
|---|---|---|
| Parameter count | How many learnable weights and biases the model has | millions (M) |
| Model size | Bytes needed to store the weights: parameters times bits per weight over 8 | MB or KB |
| Peak memory | The most memory needed at any moment: weights plus the largest activation tensors | MB or KB |
| Compute | Multiply-accumulate operations (MACs) or floating-point operations (FLOPs) per inference | MMACs or GFLOPs |
| Latency | Time from one input to its output | ms |
| Throughput | Inferences completed per second | inferences/s |
| Energy | Joules per inference, or average power while running | mJ or mW |
The first two are the easiest to compute by hand, and the calculation is one you will repeat all term. A weight stored in b bits takes b / 8 bytes, so the size of the weights is the parameter count times bits per weight divided by eight.
Worked example
A 3 million parameter model at four bit widths
Start from float32
3,000,000 × 32 / 8 = 12,000,000 bytes, about 12 MB. This is what PyTorch saves by default.Halve the bits, halve the bytes
At 16 bits the same weights take 6 MB; at 8 bits, 3 MB; at 4 bits, 1.5 MB. Nothing else changed: the parameter count is identical.Test against two boards
The Raspberry Pi Pico has 2 MB of flash, so only the 4-bit version fits. The Arduino Nano 33 BLE Sense Rev2 has 1 MB, so none of the four fit, and quantization alone is not enough.Result
Bit width divides size, but the target device decides whether the result is small enough. Below 1 MB this model also needs pruning or a different architecture.
| Bits per weight | Calculation | Size | Fits Pico flash (2 MB)? | Fits Nano 33 BLE Sense flash (1 MB)? |
|---|---|---|---|---|
| 32-bit | 3,000,000 × 32 / 8 | 12,000,000 B (12 MB) | No | No |
| 16-bit | 3,000,000 × 16 / 8 | 6,000,000 B (6 MB) | No | No |
| 8-bit | 3,000,000 × 8 / 8 | 3,000,000 B (3 MB) | No | No |
| 4-bit | 3,000,000 × 4 / 8 | 1,500,000 B (1.5 MB) | Yes | No |
Try it yourself. The calculator applies the formula for any parameter count and bit width and checks the result against generic device tiers. The device figures are datasheet capacities for one example board per tier (Arduino, Raspberry Pi and NVIDIA product pages), not what is free once the runtime and your code are loaded.
Microcontroller, example board: Arduino Nano 33 BLE Sense Rev2 (nRF52840)
Activations, the runtime and your application code also need memory. These figures are datasheet capacities, not what is free. Model sizes use MB as 10^6 bytes; the microcontroller banks use the datasheet binary figures (1 MiB flash, 256 KiB SRAM), which are slightly larger.
Three misconceptions the loop corrects
Quick check
You compare pruning and quantization on the same network and report size, latency and accuracy for each. Which takeaway is this?
Quick check
A network has 12 million parameters stored as 8-bit integers. What is its weight size?
Quick check
Why can accuracy alone not choose a model for a microcontroller?
Quick check
Which memory cost appears in on-device training but not in on-device inference?
Recall
Name the five course takeaways in the order of the loop, then say what comes after the fifth.
Recall
A 3 M parameter model with 8-bit weights: how many bytes, and does it fit 1 MB of flash?
Recall
Why is on-device training harder than on-device inference?
Slide 12 contains three words: "View on Blackboard". That is the whole syllabus section of the deck. It does not give grading weights, exam dates, project deliverables, a textbook, an office location or office hours. Anything you read elsewhere claiming to know those for this course is not coming from these slides.
What is known so far (meeting details from the course registry, not this deck)
- Meetings
- Monday and Wednesday, 20:10 to 21:25
- Room
- Building 59, Room 2004
- Syllabus, grading, deliverables
- On Blackboard, not in this deck
- Textbook, office, office hours
- Not stated in this deck; check Blackboard
Plan the project before the syllabus tells you to
Takeaway 5 promises hands-on experience compressing and implementing models on constrained devices, and the MIT counterpart of this course ends in an open-ended design project. Read that as a strong hint that a hardware Deployment is coming, whatever Blackboard eventually calls it. The students who struggle with such projects are rarely short of techniques; they are short of a baseline to compare against and a board that arrives on time. Both are fixed in week one.
- Pick a device tier first. The memory budget of the tier decides which models are even candidates, so the device is an input to model selection, not an output of it.
- Pick a candidate model that already fits, or is within one or two optimizations of fitting, and record its parameter count and float32 size with the formula from the previous concept.
- Start a metrics log before the first optimization. A baseline recorded after you have started changing things is not a baseline.
| Tier | Example board | Memory | What it is typically asked to run |
|---|---|---|---|
| Microcontroller | Arduino Nano 33 BLE Sense Rev2 (nRF52840) | 1 MB flash, 256 KB SRAM | Keyword spotting, gesture and anomaly detection, tiny image classifiers |
| Microcontroller | Raspberry Pi Pico and Pico 2 | 2 MB flash and 264 KB SRAM; Pico 2 has 4 MB and 520 KB | Same class, a little more headroom |
| Single-board computer | Raspberry Pi 4 Model B | 1 to 8 GB LPDDR4 RAM | Quantized MobileNet-class vision, small detectors, a Linux runtime |
| GPU module | Jetson Orin Nano Super Developer Kit | 8 GB LPDDR5 at 102 GB/s, 67 INT8 TOPS | Real-time detection, small transformers, on-device fine-tuning |
The last column is a guide, not a datasheet claim. MCUNet reached over 70% ImageNet top-1 accuracy on a commercial microcontroller, so the microcontroller tier is more capable than its numbers suggest, but only after the whole loop has been applied to a purpose-built architecture. A model chosen for a GPU module and then squeezed onto a microcontroller is the hardest path in the course.
| When | What to record |
|---|---|
| Week 1 | Target device tier and its flash, SRAM or RAM budget from the datasheet |
| Week 1 | Candidate model, its parameter count and float32 weight size |
| Week 1 | Baseline accuracy on a held-out set you will not change later |
| First run on hardware | Latency per inference and peak memory as the runtime reports them |
| Every optimization | The same four numbers again, next to the baseline, plus what it cost |
Keep the log as a plain table with one row per experiment and the same columns every time: accuracy, parameter count, size, peak memory, latency, energy if you can measure it, and a one-line note of what changed. This is the compare step made permanent, and it is the table an examiner or a reviewer will want to see.
Quick check
Where is the COE 592 grading scheme published, according to the deck?
Recall
Why does the deck not tell you the grading scheme, and what should you do about it?
Recall
What three numbers should be in your metrics log before you run the first optimization?
Recap
If you remember nothing else
- Introduce yourself with name, education and work background, and fill in the pre-course survey so the course can be calibrated to the room.
- Five takeaways: measure efficiency, accelerate, analyse trade-offs, track the frontier, build and deploy. Read them as a loop, not a list.
- Weight size in bytes equals parameters times bits per weight divided by 8: 3 M parameters is 12 MB at 32-bit and 1.5 MB at 4-bit.
- Size, peak memory, compute, latency, throughput and energy are separate metrics and can disagree.
- Compression trades accuracy and effort; Deep Compression's 35x came with retraining, not for free.
- Training on device must hold activations and gradients, far more than inference, and LiteRT for Microcontrollers does not support it.
- The syllabus, grading and deliverables are on Blackboard, not in this deck. Class: Mon and Wed 20:10 to 21:25, Building 59, Room 2004.
- Pick a device tier and a candidate model in week one, and start a metrics log before the first optimization.
Sources
- 6.5940 TinyML and Efficient Deep Learning ComputingDocsMIT Subject ListingCatalogue description, prerequisites and the open-ended design project(opens in a new tab)
- MIT 6.5940 TinyML and Efficient Deep Learning Computing, Fall 2024DocsMIT HAN Lab (Song Han)Lecture sequence; efficientml.ai redirects to the current offering at hanlab.mit.edu/course, which links past offerings(opens in a new tab)
- Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman CodingPaperHan, Mao and Dally, ICLR 201635x and 49x size reduction, 3x to 4x speedup, 3x to 7x energy efficiency(opens in a new tab)
- Learning both Weights and Connections for Efficient Neural NetworksPaperHan, Pool, Tran and Dally, NIPS 2015AlexNet 61 M to 6.7 M parameters by pruning(opens in a new tab)
- MCUNet: Tiny Deep Learning on IoT DevicesPaperLin et al., NeurIPS 2020Microcontroller memory two to three orders of magnitude below phones; over 70% ImageNet top-1 on an MCU(opens in a new tab)
- TinyTL: Reduce Memory, Not Parameters for Efficient On-Device LearningPaperCai et al., NeurIPS 2020Activations, not parameters, are the training memory bottleneck(opens in a new tab)
- On-Device Training Under 256KB MemoryPaperLin et al., NeurIPS 2022Training under 256 KB SRAM and 1 MB flash(opens in a new tab)
- LiteRT for MicrocontrollersDocsGoogle for DevelopersC++ 17, 32-bit platforms, 16 KB core runtime, no on-device training(opens in a new tab)
- Learn the BasicsDocsPyTorchAssumes basic familiarity with Python and deep learning concepts(opens in a new tab)
- Deep LearningBookGoodfellow, Bengio and Courville, MIT Press 2016Free online; convolutional networks refresher(opens in a new tab)
- TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power MicrocontrollersBookWarden and Situnayake, O'Reilly 2019Practical microcontroller deployment(opens in a new tab)
- Arduino Nano 33 BLE Sense Rev2DocsArduinonRF52840, 1 MB flash, 256 KB SRAM(opens in a new tab)
- Raspberry Pi Pico seriesDocsRaspberry PiPico: 2 MB flash, 264 KB SRAM; Pico 2: 4 MB flash, 520 KB SRAM(opens in a new tab)
- Raspberry Pi 4 Model B specificationsDocsRaspberry Pi1 to 8 GB LPDDR4(opens in a new tab)
- Jetson Orin Nano Super Developer KitDocsNVIDIA8 GB LPDDR5, 102 GB/s, 67 INT8 TOPS(opens in a new tab)