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

Worksheet 4 Surface maps, counting touching animals and anomaly alerts

Analysis activity 90 minAssesses CLO2

Objective

Segment surfaces and evaluate with IoU and Dice, separate touching objects, and detect anomalies with thresholds set from false alerts

Equipment and materials

  • Orthomosaic of a pasture or university field
  • Masks of touching objects from real or synthetic images
  • Tracks from Worksheet 3 or the simulated data in Example 3
  • Computer with Python, numpy, opencv, scikit-learn, scipy and the example code at /downloads/uat-456/

Safety

  • Desk work at a computer; no flying
  • Blur or crop identifiable people before sharing, and keep data only on department storage
  • Alerts are prompts for a person to check, not animal diagnoses

Steps

  1. Label part of the image by hand as a reference, then segment with k-means as in Example 1, before and after filtering
  2. Compute each surface's area in rai and report per-class IoU and Dice
  3. Separate touching objects with morphology and watershed as in Example 2, and record cases that cannot be separated
  4. Have a foundation model make masks from point clicks and time it against drawing by hand
  5. Detect anomalies with the Mahalanobis distance and Isolation Forest, then compute false alerts per day for the chosen threshold

Record of results

Table 1 Area and per-class IoU and Dice
SurfaceArea before filtering (rai)Area after filtering (rai)IoU after filteringDice after filtering
Table 2 Separating touching objects
Image or groupTrue numberConnected componentsWatershedArea per object (m²)Not separated because
Table 3 Anomaly alerts
Animal or objectPer-feature zMahalanobis distance DIsolation ForestAlert?

Questions

  1. In Table 1, how does filtering before k-means change the result for the small class, and why must IoU be reported per class rather than as an overall average?

  2. With a 99% limit on a herd of 900 checked once a day, how many false alerts a day should you expect, and how should the threshold be set if workers accept at most one a day?

  3. Why is cow 256 not flagged when features are checked one at a time, but flagged by the Mahalanobis distance?

  4. From your labelling times, how much did the foundation model help, and why must annotators still check every mask?

Check before you hand in

What to hand in

  • Surface map with area and IoU and Dice table
  • Separation results and failure cases
  • Labelling time comparison
  • Alert list with the threshold rationale

CLO2 Develop image classification, object detection and tracking, image segmentation and anomaly detection with machine learning and deep-learning 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