๐ŸŽ“ IISc CP330 ยท Edge AI Course Project

Real-Time Edge AI
Semantic Mapping

Assistive navigation for the visually impaired โ€” YOLOv8n at 24.7 FPS on Raspberry Pi 5 + Hailo-8 NPU. 5-stage model compression, IMU sensor fusion, live 2D polar semantic map. Fully offline. No cloud. No GPU.

24.7
FPS on RPi5
+9.4%
mAP50 Gain
4.5 MB
HEF Model Size
13 TOPS
Hailo-8 NPU
Hardware

Edge Hardware Stack

Four components working together โ€” fully portable on a USB-C power bank.

๐Ÿ–ฅ๏ธ
Raspberry Pi 5
8 GB RAM ยท Pre/post-processing, display, sensor fusion
โšก
Hailo-8 AI HAT
13 TOPS ยท M.2 PCIe ยท YOLOv8n HEF inference
๐Ÿ“ก
Arduino Nicla Vision
LSM6DSOX IMU ยท Gyroscope yaw at 50 Hz over USB serial
๐Ÿ“ท
TNBA1392 Camera
CSI ribbon ยท RGB 640ร—480 ยท Direct Pi camera interface
Optimization Pipeline

5-Stage Model Compression

From a 6 MB FP32 model to a 4.5 MB Hailo HEF โ€” with accuracy actually improving at the end.

๐Ÿ“ฆ FP32 BaselineYOLOv8n fine-tune
โ†’
๐Ÿ”ข PTQ INT8No retraining
โ†’
๐Ÿงช QAT INT8Simulated quant.
โ†’
โœ‚๏ธ L1 Pruning20% filters removed
โ†’
๐Ÿš€ Hailo HEF4.5 MB ยท RPi5

๐Ÿ’ก Why pruning improves accuracy

Removing the 20% of filters with the lowest L1-norm eliminates the filters that contribute the most quantization noise โ€” giving the INT8 quantizer cleaner weight distributions to round. mAP50 jumped from 0.6093 (PTQ) to 0.6793 (Pruned) โ€” an 11.5% improvement without any new training data.

Benchmarks

Optimization Results

All stages measured on the same 20-class COCO128 validation set.

StagemAP50FPS (T4)Size
Baseline FP32
0.6269
120.56.23 MB
PTQ INT8
0.6093
214.45.57 MB
QAT INT8
0.5944
186.65.65 MB
L1 Pruned INT8
0.6793
218.3 5.65 MB โœ“ Deployed
Hailo HEF on RPi5 โ€” 24.7 4.50 MB โœ“ Edge

System Architecture

BackboneYOLOv8n CSPDarknet
Classes20 indoor-relevant COCO
InferenceHailo HEF โ†’ 6 raw tensors
DFL decodeRPi5 CPU (post-process)
NMSconf > 0.40, IoU < 0.45
Clusters8/8 Hailo clusters used

2D Semantic Map

IMU update rate50 Hz gyroscope
Heading formulaIMU yaw + camera FOV offset
Distance estimateReference height heuristic
SmoothingEMA ฮป = 0.7
Object memory10 second persistence
Map size520ร—520 px OpenCV canvas
Runtime

How It Works on Device

Six steps from camera frame to live polar map โ€” all running on the Raspberry Pi 5.

01
Camera Capture
Picamera2 grabs 640ร—480 RGB frame from TNBA1392 via CSI ribbon at every cycle.
02
Hailo Inference
HEF runs on Hailo-8 NPU via M.2 PCIe. Returns 6 raw tensors (3 box + 3 class) for DFL decode.
03
DFL Decode + NMS
RPi5 CPU decodes Distribution Focal Loss outputs across 3 strides. Class-wise NMS filters duplicates.
04
IMU Yaw Stream
Nicla Vision streams calibrated gyro yaw at 50 Hz over USB serial. Background thread reads continuously.
05
Sensor Fusion
Each detection gets: heading = IMU yaw + camera FOV offset. Distance from bounding-box height heuristic. EMA-smoothed.
06
Dual Display
Window 1: detection feed with labeled boxes + FPS. Window 2: top-down 2D polar map with 1 m range rings.
YOLOv8PyTorchHailo DFC HailoRTPicamera2OpenCV MicroPythonpyserial NumPypyttsx3
Team

CP330 Project Team

IISc Bengaluru ยท Department of Computational and Data Sciences
Instructor: Dr. Pandarasamy Arjunan

Karney Jayanath
SR No. 26831
Model training & optimization โ€” YOLOv8n fine-tuning, PTQ, QAT, L1 pruning, KD ablation, Colab pipeline, benchmarking
Shreevathsa K S
SR No. 25905
RPi5 inference pipeline โ€” Hailo HEF deployment, HailoRT integration, DFL decoder, NMS, Picamera2 capture, bounding-box rendering
Rajneesh Babu โœฆ
SR No. 26058
2D semantic mapping โ€” Nicla Vision IMU firmware (MicroPython), gyro calibration, yaw streaming, polar map, EMA smoothing, distance estimation

Full Code, Report & Models

Training notebook, HEF model, RPi5 inference script, Nicla Vision firmware, and IEEE-format report โ€” all in the repo.

View on GitHub โ† Back to Portfolio