The second homework from perception is to implement and evaluate a reliable colour recognition method. The goal is to train a classifier to recognize at least six colours: red, green, blue, yellow, white, black.
The dataset of 2900 images was retrieved from the google images site using the automated method described [here] (https://www.pyimagesearch.com/2017/12/04/how-to-create-a-deep-learning-dataset- using-google-images/).
We’ve experimented with 5 classifiers, of which 4 were implemented by us.
A k-Nearest Neighbors method on RGB color histograms; the code can be found in this repo.
Accuracy: 69.00%
The predefined color ranges in HSV color space can be seen in this image:
Code: detect_color.py
Accuracy: 90.17%
Calculating Bhattacharyya distance between hue histograms of an image and the average histogram for each color.
Code: hist_detector.py
Accuracy: 77.00%
A kNN classifier comparing 3D color histograms of HSL images. (k=5)
Code: knn_detector.py
Accuracy: 80.69%
A CNN trained on 128x128 RGB images.
Code: cnn_detector.py
Accuracy: 93.81%
You can find a more detailed report in homework2.pdf.