UAT 456 Artificial Intelligence, Machine Learning and Computer Vision for UAS
Worksheet 2 Features and a classifier for cattle and look-alikes
Objective
Extract colour and HOG features, train a classifier, read the confusion matrix and find the missing feature
Equipment and materials
- Dataset from Worksheet 1
- Computer with Python, numpy, opencv, scikit-learn, scipy and the example code at /downloads/uat-456/
- Paper and calculator for hand calculation
Safety
- Desk work at a computer; no flying
- Use only images you have the right to use, and record their source
Steps
- Cut 32 × 32 or 64 × 64-pixel patches, at least 4 classes with 50 each
- Compute one cell's histogram by hand and with Example 1, and compare
- Extract colour and HOG features and train an SVM with Example 2, splitting the test set by paddock or date
- Read the confusion matrix, find the most confused pair, then propose and test one extra feature
- Report per-class precision, recall, F1 and macro average before and after adding the feature
Record of results
| Class | Number of patches | Size (px) | Source date or paddock | Set (train/test) |
|---|---|---|---|---|
| Orientation bin (degrees) | Sum by hand | Code result | Difference |
|---|---|---|---|
| Class | Precision before | Recall before | F1 before | F1 after |
|---|---|---|---|---|
Questions
Which pair of classes is most confused in your confusion matrix, and why does the feature you added separate them?
How long is the HOG vector of a 48 × 48-pixel window, and what happens to HOG if your objects are much smaller than a cell?
Why does your overall accuracy look good even though some classes have low recall? Answer with your own numbers.
How do your results on a test set split by paddock or date differ from the synthetic results of Example 2, and which figure should be reported to the farm?
Check before you hand in
What to hand in
- Patch set table
- Hand versus code histogram table
- Confusion matrices before and after the added feature
- Conclusion on which feature separates the confused pair