This part of the assignment will deal with feature extraction, more specifically you will be
examining texture and shape features. Download an unzip ‘onions.zip’ dataset from
Blackboard. You should obtain 60 images representing 20 different samples, corresponding to
the colour image (‘xx_rgb.png’), the near infra-red image (‘xx_depth.png’) and the
segmentation mask (‘xx_truth.png’). (For example, for sample 5, the corresponding file names
will be ‘05_rgb.png’, ‘05_depth.png’, ‘05_truth.png’) The segmentation masks contain two
different class labels (‘onions’ and ‘weeds’) and the background class. You will need to extract
the image patches corresponding to objects of the two classes (using e.g. connected
component labelling). Using these images, solve the following tasks:
a) (shape features) For each of the patches from both classes, calculate four different shape
features discussed in the lectures (solidity, non-compactness, circularity, eccentricity). Which
of these features would be the most useful in distinguishing onions from weeds in this image?
Plot the distribution of all the four features to justify your choice.
b) (texture features) Calculate the normalised grey-level co-occurrence matrix in four
orientations (0°, 45°, 90°, 135°) for the 8bit image depth (also see the original paper by Haralick
et al. that has been made available) for the patches from both classes, separately for each of
the colour channels (red, green, blue, near infra-red). For each orientation, calculate the first
three features proposed by Haralick et al. (Angular Second Moment, Contrast, Correlation), and
produce per-patch features by calculating the feature average and range across the 4
orientations. Select one feature from each of the colour channels and plot the distribution.
c) (object classification using features) Set aside the images corresponding to sample 19 and 20
as a test set. Train a simple classification model (e.g. SVM) from object patches corresponding
to images 1 – 18: 1) using shape features only 2) texture features only, and the 3) combination
of shape and texture features. Do shape or texture features provide more discriminative
information about plant species? Does combining the two types of features improve the
classification of plant patches? Which of the calculated features contribute the most to the
classification model? Perform feature importance analysis, select 10 most important features,
and retrain the classification model using the 10 selected features. Display the object
classification output for the test samples (images 19 and 20) using the full model (combination
of all shape and texture features) and using the reduced model (10 most important features),
and report the precision and recall scores per class for each of the images.
Analyse and discuss your findings in the report.