## Due: March 25th, 2011

In this assignment, we will use Support Vector Machine (SVM) to do some classification of photographs. The software package we will use is LibSVM. On their webpage, download the version for Matlab for this assignment.

### Part 1. Beach or Grassland (5%)

In this part, you need to use SVM to classify the photographs into "beach" or "grassland". Here are 120 photographs of "beach", and here are 120 photograhs of "grassland". Please random select half of the data for training, and the rest of the data for testing.

The feature vector you will use is called "Grid-based Color Moment". Here is how to compute this feature vector for a given image:

• Convert the image from RGB fro HSV color space (Hint: use the function rgb2hsv in Matlab for this operation)
• Uniformly divide the image into 3x3 blocks
• For each of these nine blocks
• Compute its mean color (H/S/V)

where N is the number of pixels within each block, x_i is the pixel intensity in H/S/V channels.

• Compute its variance (H/S/V)

• Compute its skewness (H/S/V)

• Each block will have 3+3+3=9 features, and thus the entire image will have 9x9=81 features. Before we use SVM to train the classifier, we first need to normalize the 81 features to be within the same range, in order to achieve good numerical behavior. To do the normalization, for each of the 81 features:
• Compute the mean and standard deviation from the training dataset

,

where M is the number of images in the training dataset, and f_i is the feature of the i-th training sample.

• Perform the "whitening" transform for all the data (including both the training data and the testing data), and get the normalized feature value:

• Now, use LibSVM to train your classifier based on the normalized feature vectors of the training dataset.
• Once the training is done, apply the trained classifier on the testing dataset. Make sure to report both your training error and testing error on your webpage.

### Part 2. Try Your Favoriate Photograph Classification Task (5%)

This is the part to be creative. Think of some interesting classification tasks for photographs, and also think of some feature vector that you expect to be useful for solving your classification task. You also need to find the images to perform the classification.

Here are some possible classification tasks:

• Indoor / Outdoor photographs
• Photographs / Paintings
• High quality / Low quality (i.e. blurred, noisy) images
• ......

Here are some possible features you might want to look into:

• Higher order color moment, such as kurtosis.
• Color Histogram (i.e., a 3D histogram, either in RGB space or HSV space. Typically discretize into 8x8x8=512 bins.)
• Edge Histogram (i.e., a 2D histogram. One dimension is the strength of the edge, and the other dimension is the orientation of the edge).
• Structural Similarity Index Measure (SSIM)
• ......

## How to Submit Your Assignment?

You should create a webpage for showing your results and explaining what you did. Do not modify the webpage after the due date. Send an email to Oliver Cossairt <olivercossairt@gmail.com> with the URL to your webpage before the due date.