Majid Al-RaimiThe instructor and edge AI in practice

COE 592Lecture 00Part 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.

Concepts
5
Slides
1-8
Reading
30 min
Understood
0/5 concepts

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

  1. Expand SERV and map each word to a later course theme.
  2. Name the sensor modalities on a UAV or vehicle inspection rig and explain why payload limits force small on-board models or data offloading.
  3. 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.
  4. Read a detection figure critically: separate confidence from correctness, and a saliency map from a metric.
  5. State why an IoT intrusion detector must be lightweight and what generalizable means.
  6. 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).

LetterWordCourse themeWhere you meet it in this part
SSecureAdversarial machine learning and intrusion detectionPNet-IDS on slide 6
EEfficientCompression, pruning, quantization, nano detectorsEcoWeedNet on slide 4, PNet-IDS on slide 6
RRobustBehaviour under rain, noise, blur and domain shiftYOLO-RAW on slide 5
VVisionCameras, thermal imagers and LiDAR as the inputEvery figure from slide 3 to slide 8
SERV mapped onto the course
A camera on three legs. Secure, Efficient and Robust each hold up one corner; remove any leg and the deployment tips over.

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?

Secure (adversarial machine learning, intrusion detection), Efficient (compression, quantization, nano detectors), Robust (rain, noise, blur, domain shift), Vision (the input modality across all of them).

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.

SensorMeasuresGood atWeak atData rate pressure
Visual (RGB) cameraReflected visible lightColour and texture: vegetation against rail, paint, signsDarkness, rain, glareHighest: full-colour frames at video rate
Thermal (IR) cameraEmitted infrared, so temperatureHot bearings, people and animals at nightNo colour, lower resolutionModerate: fewer pixels per frame
LiDARLaser pulse time of flight, so rangeGeometry, clearance, elevation, 3D point cloudsSparse at long range, cost, weightHigh: millions of points per second
GPS receiverPosition and timeGeoreferencing every frame and pointNothing about the scene itselfNegligible
The four modalities on the slide 3 rigs

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.

Three sensors feed one small chip on the platform. The weight, power and compute bars fill almost to the limit but must not overflow 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?

  1. 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.
  2. Total stream

    5 × 8 = 40 Mbit/s leaving the rig continuously.
  3. One hour of driving

    40 × 3600 = 144,000 Mbit, which is 18 GB per hour.
  4. 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.
  5. 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.

Visual camera (colour and texture from reflected light), thermal camera (emitted infrared, so temperature), LiDAR (pulsed-laser range, giving 3D points), GPS receiver (position and time for georeferencing).

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.

Farm device
consumer electronics, vehicle or robot

Drives the field and carries the camera.

captured images
Smart farm images
cotton seedlings and weeds

Frames taken in the field, in sun and shadow.

images in
EcoWeedNet
lightweight detector

A small network that runs within the robot's budget.

boxes
Weed detections
automated output

Boxes the robot can act on.

The EcoWeedNet pipeline as drawn on slide 4

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.

ModelParametersFLOPsmAP50-95CPU ONNX latencyT4 TensorRT latency
YOLO11n2.6M6.5B39.556.1 ms1.5 ms
YOLO12n2.6M7.5B40.6not listed1.64 ms
YOLO11m20.1M68.1B51.5183.2 ms4.7 ms
YOLO11x56.9M195.3B54.7462.8 ms11.3 ms
YOLO size classes (Ultralytics documentation)

Worked example

Nano versus medium

  1. Parameters

    20.1 / 2.6 ≈ 7.7x fewer parameters in YOLO11n than YOLO11m.
  2. Compute

    68.1 / 6.5 ≈ 10.5x fewer floating point operations per image.
  3. 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.
  4. Price

    51.5 − 39.5 = 12.0 mAP50-95 points lower.
  5. 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.

SceneObjectYOLOv5-mYOLO-RAW
Rain skyGull 1 (top left)no boxBird 0.50
Rain skyGull 2 (centre)UAV 0.29 (false positive)Bird 0.63
Rain skyGull 3no boxBird 0.54
Rain skyGull 4no boxBird 0.73
Rain skyGull 5 (bottom)Bird 0.35Bird 0.37 (approximate)
Rain fieldReal droneUAV 0.90UAV 0.93
Every label printed on slide 5, with the same gull numbered the same way in both panels

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.

SimulatorConfidence threshold on the slide 5 scene
Scene
0.25
YOLOv5-m
UAV 0.29Bird 0.35
YOLO-RAW
Bird 0.50Bird 0.63Bird 0.54Bird 0.73Bird 0.37~
ModelShownTPFPFNPrecisionRecall
YOLOv5-m21140.500.20
YOLO-RAW55001.001.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.

precision=TPTP+FP,recall=TPTP+FN\text{precision} = \frac{TP}{TP + FP}, \qquad \text{recall} = \frac{TP}{TP + FN}
The two numbers a threshold trades against each other

Recall

In the slide 5 rain scene, which model produced a false positive, what was it, and at what confidence?

YOLOv5-m labelled a gull as UAV 0.29. YOLO-RAW labelled the same bird Bird 0.63.

Recall

What does a GradCAM++ heatmap show and what does it not show?

Where in the image the positive gradients of the class score concentrated, that is which regions drove the score. It does not show whether the prediction is correct; that needs mAP, precision or recall on held-out data.

Recall

Roughly how many times fewer parameters and FLOPs does YOLO11n have than YOLO11m, and at what mAP cost?

About 7.7x fewer parameters (2.6M against 20.1M) and 10.5x fewer FLOPs (6.5B against 68.1B), for 12.0 mAP50-95 points (39.5 against 51.5).

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)

  1. Packets per second

    A 100 Mbit/s link carrying 500-byte packets delivers 100×106/(500×8)=25,000100 \times 10^{6} / (500 \times 8) = 25{,}000 packets per second. A flow-level IDS aggregates packets before scoring, so this per-packet figure is the upper bound on inspection cost.
  2. Time budget per packet

    1 / 25,000 = 40 µs. Any per-packet decision slower than that falls behind the link.
  3. 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.
  4. A light model

    At 0.02 MFLOPs per decision the same CPU answers in 20 µs, inside the budget.
  5. 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.

It runs on gateways with little compute and storage, and it must decide at line rate, between packet arrivals. Generalizable means keeping accuracy under distribution shift, on traffic or attacks unlike the training set, which PNet-IDS supports with knowledge distillation.

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.

A wayside camera sweeps a passing wagon, boxes a crack, and pulls it out into a zoom for the inspector.

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

  1. 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.
  2. 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.
  3. 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.
ScenarioSensorDecisionDeadline driverCost of a miss
Shuttle at a T-intersectionForward camera on the vehicleYield, brake or proceed on a left turnVehicle and pedestrian speedA pedestrian is struck
Rolling-stock undercarriageWayside or under-track cameraFlag a cracked or missing componentTrain speed past the cameraA defect leaves the yard undetected
Two safety-critical edge inference problems

Recall

Why is a cloud round trip unacceptable for the shuttle and the wagon inspection, in one sentence each?

The shuttle moves about 2 m during a 200 ms round trip, which is the margin between yielding and striking a pedestrian. The wagon moves out of the camera's view within tens of milliseconds, so the frame must be analysed before the next one arrives.

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