Homework 0 - due Sept 10

In this homework we will be implementing a very simple image classification scheme, based on direct pixel-wise image similarity. The purpose of this HW is to get you started on using matlab and manipulating images.

First download this dataset. This consists of images for 5 categories from the Caltech 101 dataset of images. To open this file in linux use the command: tar zxvf HW0_data.tar.gz

In Matlab:

  1. Convert all of the images to grayscale.
  2. Resize all images to a common thumbnail size (32x32).
  3. Set aside the first 15 images per category to be your training set, the rest of the images will make up your test set.
  4. For each test image, compute its distance to all of the training images using SSD (sum of squared distances), also called Euclidean distance.
  5. Classify the test image with the category label of the nearest training example.
  6. Report your classification performance for each category and average performance across all categories. Here you should first compute the accuracy for each category individually, and then compute the average performance over all 5 object categories by taking the mean of the per category accuracies.

What to Turn in

Email to cse591@gmail.com: your code + a web page describing the results of your experiments including classification accuracy for each category, average classification accuracy across all categories, and a confusion matrix showing the percentage of times one category was confused with another (i.e. for each category x and category y, how many times an image with actual label x was labeled as category y by the algorithm). You should visualize your confusion matrix using the imagesc command and then print this figure out as a jpeg using the command print('-djpeg','confusion.jpg') for display in your web page.


Useful matlab functions for this HW: imread, imwrite, imagesc, rgb2gray, imresize, sum, print, dir, cell. The most useful function in matlab is "help" which can be used by itself to list all available toolboxes, with a toolbox name to view all functions associated with that toolbox (e.g. "help images" lists all image processing related functions), or with a function name to view the help functionality for a specific function (e.g. "help imagesc" tells you how the function imagesc works).