UAT 306 Artificial Intelligence for UAS

Worksheet 4 Training and evaluating a detector

Analysis activity 4 hAssesses CLO3, CLO1

Objective

Train an object detector by transfer learning, compute AP yourself against the tool and analyse errors

Equipment and materials

  • Computer with a GPU or a cloud notebook
  • A small YOLO model (e.g. Ultralytics)
  • Dataset from worksheet 3
  • Module 4 example code

Safety

  • Desk work only; no flying
  • For cloud training, upload only data that you are permitted to upload

Steps

  1. In class: compute feature-map sizes of the first three layers with Example 2
  2. In class: start training a detector on the module 3 dataset by transfer learning
  3. Self-study: finish training and keep the training log and model weights
  4. In class: export validation predictions and compute AP@0.5 with Example 3
  5. Self-study: compare AP with the tool and explain the difference
  6. In class: vary NMS IoU and confidence threshold; observe precision and recall
  7. Self-study: review wrong predictions one by one and group their causes

Record of results

Table 1 Feature-map size and parameters of the first three layers
LayerInput size (px)k, s, pOutput size (px)Channels in → outParameters
Table 2 AP@0.5 from two sources and the effect of NMS IoU and confidence threshold
NMS IoUConfidence thresholdPrecisionRecallAP@0.5 ownAP@0.5 tool
Table 3 Grouped causes of wrong predictions
Cause groupFalse alarm (FP) or miss (FN)ImagesExample image no.Possible fix

Questions

  1. How far is your own AP@0.5 from the value reported by the tool? Explain where the difference can come from.

  2. As the confidence threshold rises, how do precision and recall in Table 2 change? For screening where misses cost far more than false alarms (Module 1), which setting would you choose?

  3. If NMS IoU is set very high, such as 0.95, what happens to duplicate boxes and how does AP change?

  4. What is the largest cause group in Table 3, and what data or labels would fix it (link to Module 3)?

Check before you hand in

What to hand in

  • Layer-size table
  • Training log and model weights
  • AP from both sources
  • Effect of IoU and threshold
  • Grouped error causes

CLO3 Train, evaluate and deploy models. CLO1 Explain machine learning and deep learning principles. (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