Support Vector Machine

What is SVM? 

Kernels

In scikit-learn SVC, there are 4 types of kernels as shown below. The non-linear kernels do dot product using the kernel functions. 

Different Kernels - (scikit-learn)

Generating Features

0 - Original Image

Landscape from the Ore Mountains, 1905, Stanislaw Wyspianski

Image in Artbench-10 (256*256)

1 - Extract Dominant Colors

2 - RGB Histogram

3 - Grayscale Histogram

4 - HSV Histogram

HSV stands for Hue, Saturation, Value, which is another representation of an image. We get 3 additional histograms from HSV images, by resizing to 16*16. 

5 - Sharpness Histogram

6 - Edge Length Histogram

7 - Histogram of Oriented Gradients

Using hog function from scikit-learn. HOG counts occurance of gradients orientation in the localized portion of an image. It contains both angle and magnitude information. 

8 - Modules from SqueezeNet

As you may or may not have seen. NST style transformation done by our project uses SqueezeNet. Some modules in SqueezeNet contain important information of images. So, here we computed 4 gram matrices for each image and treat them as features. Since gram matrices are symmetrical, so we only need half of it. 

Best Combination

After many trials (almost 15 versions), the best combination of classification so far is to have total feature list length of ~1700, with the following features: 

Results

All the results below use SVC with rbf kernel and C=1. 

Classifying 10 Categories

Classifying 7 Categories

As we can see above, "Expressionism", "Post-Impressionism", and "Realism" are difficult for current SVM to classify. If we remove those hard ones, we have:

Classifying 2 Categories 

If we classify only 2 categories at a time, we have pretty high accuracies:

Try Different Combinations of Parameters

As shown below, the best combination among those tests is:

Page written by: Jichi Wang