UAT 306 Artificial Intelligence for UAS

Worksheet 5 Benchmarking and shrinking the model

Lab 4 hAssesses CLO3

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

  1. 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
  2. Self-study: report p50, p95 and maximum for at least two machines with Example 1, stating hardware, runtime and image size
  3. In class: export to ONNX, quantise to INT8 and compare size and time
  4. Self-study: compare the AP of FP32 and INT8
  5. Self-study: measure end-to-end time from frame to result and compare with model time
  6. Self-study: write a deployment plan with acceptance criteria
  7. In class (week 15): present the whole AI system

Record of results

Table 1 Model inference time after warm-up
Machine and runtimeImage size (px)Runs measuredp50 (ms)p95 (ms)Max (ms)
Table 2 FP32 versus INT8
Model versionFile size (MB)p95 (ms)AP@0.5 on validationChange from FP32
End-to-end time (capture, resize, inference, send) and the drone deployment plan with acceptance criteria

Questions

  1. 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?

  2. 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?

  3. 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?

  4. 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

CLO3 Train, evaluate and deploy models. (CLOs are a web-team draft; the course owner sets the final ones.)

Instructors: answers and teaching notes for this worksheet are in the teaching pack