UAT 456 Artificial Intelligence, Machine Learning and Computer Vision for UAS
Worksheet 4 Surface maps, counting touching animals and anomaly alerts
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
- Label part of the image by hand as a reference, then segment with k-means as in Example 1, before and after filtering
- Compute each surface's area in rai and report per-class IoU and Dice
- Separate touching objects with morphology and watershed as in Example 2, and record cases that cannot be separated
- Have a foundation model make masks from point clicks and time it against drawing by hand
- Detect anomalies with the Mahalanobis distance and Isolation Forest, then compute false alerts per day for the chosen threshold
Record of results
| Surface | Area before filtering (rai) | Area after filtering (rai) | IoU after filtering | Dice after filtering |
|---|---|---|---|---|
| Image or group | True number | Connected components | Watershed | Area per object (m²) | Not separated because |
|---|---|---|---|---|---|
| Animal or object | Per-feature z | Mahalanobis distance D | Isolation Forest | Alert? |
|---|---|---|---|---|
Questions
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?
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?
Why is cow 256 not flagged when features are checked one at a time, but flagged by the Mahalanobis distance?
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