UAT 306 Artificial Intelligence for UAS
Worksheet 5 Benchmarking and shrinking the model
Objective
Measure inference time correctly on a PC and an onboard computer, quantise the model to INT8 and write a deployment plan
Equipment and materials
- Model from worksheet 4
- At least one accessible computer, such as a personal PC or a cloud notebook
- The lab's onboard computer (demonstrated by the lecturer in class, or open for use outside class time if available) with a camera and power supply
- ONNX and a quantisation tool
Safety
- Bench or desk work only; no flying
- If you use the onboard computer yourself, use the correct supply voltage and beware of hot heat sinks during long runs
Steps
- In class: time inference on a PC at least 200 times after warm-up and watch the lecturer run the same measurement on the onboard computer
- Self-study: report p50, p95 and maximum for at least two machines with Example 1, stating hardware, runtime and image size
- In class: export to ONNX, quantise to INT8 and compare size and time
- Self-study: compare the AP of FP32 and INT8
- Self-study: measure end-to-end time from frame to result and compare with model time
- Self-study: write a deployment plan with acceptance criteria
- In class (week 15): present the whole AI system
Record of results
| Machine and runtime | Image size (px) | Runs measured | p50 (ms) | p95 (ms) | Max (ms) |
|---|---|---|---|---|---|
| Model version | File size (MB) | p95 (ms) | AP@0.5 on validation | Change from FP32 |
|---|---|---|---|---|
Questions
From the p95 after warm-up of each machine in Table 1, how many frames per second can the system sustain for 95% of frames, and is that enough for your inspection job?
How much longer is the measured end-to-end time than the model time, which part takes longest, and how far does a drone flying at 10 m/s move in that time?
How much does INT8 AP fall from FP32, is that acceptable under your criterion, and how can an outlier among the weights make INT8 error larger?
If onboard processing cannot keep up with incoming frames, what does your plan make the system do, and why that choice?
Check before you hand in
What to hand in
- Inference-time table for at least two machines, including the onboard-computer result demonstrated by the lecturer
- End-to-end timing
- FP32 versus INT8 table
- Drone deployment plan