UAT 456 Artificial Intelligence, Machine Learning and Computer Vision for UAS

Worksheet 13 A baseline for classification, detection and segmentation

Analysis activity 3 hAssesses CLO7, CLO9

Objective

Build a classical baseline and evaluate it with precision, recall, IoU and the tolerant metric, with the group's decision table

Equipment and materials

  • At least 20 real images of a concrete surface or wall
  • Computer with Python, OpenCV and scikit-learn
  • The module 13 example code

Safety

  • Mainly desk work; no flying
  • Keep images showing faces or number plates out of the dataset

Steps

  1. Cut at least 200 patches of 128 × 128 pixels, label two classes and split by source image
  2. Extract features, train logistic regression and report accuracy against always answering 'normal', with the confusion table
  3. Choose the threshold on the validation set, report the test result and explain the difference
  4. Detect a repeated object with a template; report precision and recall at IoU 0.5 and test light and scale
  5. Label crack masks by hand on five images, run black-hat and report strict Dice and the 2-pixel tolerant metric
  6. Write a 5-method by 5-criterion decision table and find the weight at which the result flips

Record of results

Table 1 Confusion results and the chosen threshold
Probability thresholdRecallPrecisionFalse alarms per panelSet used (validation/test)
Table 2 Template matching
SituationThresholdTPFPFNPrecision / recall
Table 3 Segmentation metrics and decision table
Method or imageIoUDicePrecision, 2 px toleranceRecall, 2 px toleranceWeighted score

Questions

  1. How far is your classifier's accuracy from always answering 'normal', and why must the false-alarm rate be converted into a count per panel?

  2. How did the threshold chosen on validation behave on the test set, and why?

  3. Why does TM_CCOEFF_NORMED tolerate light changes but not scale changes, and what did you base the scale range on?

  4. If the crack Dice equals that of a perfect answer shifted by 1 px, should you conclude the method is weak?

  5. In your decision table, which weight had to change by how much for the result to flip, and what does that say about the choice?

Check before you hand in

What to hand in

  • Confusion table and the chosen threshold
  • Template-matching precision and recall table
  • Table of the two segmentation metrics
  • Decision table with sensitivity analysis

CLO7 Select and compare computer vision techniques (image and video processing, edge and feature detection, image matching, detection, classification, segmentation and tracking) to fit the problem, the data and the limits of an application. CLO9 Evaluate an application against measurable acceptance criteria, improve its performance and design how it handles failures. (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