Optimal Parameters to Use for Classification of Paintings

haremboingAI and Robotics

Oct 20, 2013 (3 years and 11 months ago)

90 views

Optimal Parameters to Use for Classification

of Paintings

Jason Erickson

EECS Department

Northwestern University

j
-
erickson@northwestern.edu

Jo
s
e
ph

Teno

EECS Department

Northwestern University

joe.teno@gmail.com

Chris Zamierowski

EECS Department

Northwestern University

chriszamierowski@gmail.com



ABSTRACT

Currently,
image processing

techniques can be employed to
effectively classify paintings by genre
1
. However, these methods
require a human contribution, which introduces possible error.
Our goal is to eliminate the need for human contribution by
determining which input parameters are most effective for
correct cl
assification.

We do this by creating a set of composite
feature sets, which employ histogram analysis and edge
detection on a set of 185 images using varying input parameters.
Each composite feature set has a corresponding neural network
that is used to tr
y to classify a set of testing images. A genetic
algorithm uses the per
formance of each neural network

(
the
percent

of correctly classified images)

to evolve the parameters
that are most effective at correctly classifying the paintings.

In
this paper, we w
ill present a more detailed explanation of our
approach, as well as evaluate t
he performance of the final neural
network

based on the evolved parameters.

General Terms

Algorithms, experimentation, human factors, measurement,
performance, theory.

Keywords

Artistic genres, genre classification,
paintings,
genetic
algorithms, neural networks, image processing,
histogram
analysis, edge detection,
machine learning.

1. INTRODUCTION

Current Machine Vision techniques (histogram analysis and
edge detection) allow
for accurate artistic genre classification to
be performed on a collection of images
1
. However, these results
currently rely on human contribution, namely which parameters
are to be used as input to the techniques mentioned above. This
introduces the possi
bility of suboptimal results due to the
incorrect choice of parameters.

Our goal is to eliminate this
possible source of error by determining which parameters will
result in the most accurate classification of the images.

We will
further discuss our approa
ch as well as the results of our
experimentation in the following sections.

1.
1 Data

We have assembled a set of 185 images of paintings from the
following seven different artistic genres: Abstract
Expressionism, Impressionism, Pointillism, Pop Art, Surreal
ism,
Cubism, and Realism. These images were gathered from
Artcyclopedia
2
.

We use all 185 images as training images, and
randomly select 35 images, 5 from each genre, as testing
images. Although the testing images are randomly selected, the
same images are
consistently used across all of the neural
networks to ensure comparable results.


2. APPROACH

Our approach can be divided into two main
processes, which are
detailed below.

1.

Feature

set generation
.

a.

Histogram analysis and edge detection are
performed on al
l 185 images in the data set
using varying parameters (bin size, color
space, thresholds and smoothing level).


b.

An initial set of composite feature sets is
assembled, each containing a specific
combination of parameters, and the results
of the histogram an
alysis and edge detection
on the images using those parameters

2.

Evolving the most effective parameter
s

a.

A neural network is built for each composite
feature set and its performance (% correctly
classified images) is calculated. We used
NeuronDotNet
3
.

b.

A genet
ic

algorithm

evolves the best
composite feature set based on its
corresponding neural network performance.

c.

Once the genetic algorithm returns the best
performing set of parameters, a final neural
network is trained using these evolved
parameters, a
nd the p
erformance is
measured.

This process is illustrated in Figure
1

and is explained further
below
.

2.1 Feature Set Generation

We used two image processing techniques to create our feature
sets: histogram analysis and edge detection. The histogram
analysis was

implemented in the RGB and HSV color spaces,
with a variable input parameter of the number of bins used.
The
bin parameter had 10 possible values: 5, 30, 55, 80, 105, 130,
155, 180, 205, 230, and 255. These values were chosen because
they provide a full r
ange of possibilities over the color space.
The output is an array of histograms, each corresponding to one
image in the data set of training images.
Edge detection was
implemented using a Canny Edge Detector, with variable input
parameters
of the smoothin
g level (Σ), the low threshold and
high threshold. The smoothing level can vary
from .1 to 8.1, by
increments of .4. This range was determined based on
background research done on Canny Edge Detection
4
,
5
. The high
thresholds can vary from 1% to 71%, by 8%.

The low threshold
can vary, by definition, from 0% to the high threshold, also by
8%. These values were determined based on our research on the
result the threshold had on effective edge detection.
The edge
density is
then
calculated by determining the pe
rcentage of
pixels that appear on an edge in each image.

Therefore, the RGB
feature set is a collection of arrays corresponding to the
histogram results of each possible bin size, applied to each
training image. The HSV feature set is analogous. The edge
density feature set is an array of arrays, corresponding to each
possible combination of input parameters and the output edge
density percentage for each image.

A composite feature set is a
unique combination of

members from each feature set, yielding
abou
t 92,000 composite feature sets.
All of the image processing
analysis was done using MATLAB
and the

Image Processing
Toolbox.

2.2

E
volving The Most Effective Parameters

The

input to each neural network is

one
c
omposite
f
eature
s
et.
The structure of this ob
ject is an array of values per image in the
form of Array[rgb bin values(i..n), hsv bin values(i..n), edge
value]. This is then passed through a hidden layer of half the
size of the input layer. The output layer is of size seven because
there are seven pos
sible genres in the image database used. In
each of the seven outputs, the Neural Network outputs a value
from 0 to 1
. This output is used to determine the fitness of each
neural network. Based on the fitness, the neural network’s
composite feature set is
evolved by the genetic algorithm.
The
genetic algorithm used

one
-
point crossover, clo
ning with
random mutations and e
litism

to determine the next generation
of feature sets.

3. R
ESULTS

Overall, the project was a success. By evolving the parameters
for the

input to the neural networks

via genetic algorithm
, we
were able to decrease the average misclassifications of paintings
from
47.5%

to
26.4%,

with a reasonable algorithm runtime of
approximately 10 minutes per generation.

3.1 E
volutionary Improvement

The

use of a genetic algorithm produced favorable results and
increased the correct classifications of a neural network. To
evolve our

composite
feature sets, we initialized a random
population of

composite

feature sets and built neural networks
for each. Aft
er determining each network’s fitness, we used
sexual, c
loning with mutation and elitist

reproduction techniques
to produce the next generation of

composite

feature sets.
Through only 27 generations, we were able to reduce our
misclassifications by approxi
mately 44%.

3.
2

C
lassification

We succeeded in classifying the paintings by genre. As
illustrated in figure 2, we were able to surpass random guessing
in each genre and experience high quality results for most
genres. The toughest genre to correctly class
ify was pointillism
(25% correct classification). We attribute this weakness to the
fact
that the Histogram values for pointillism are extremely
similar to those for impressionism.
Because we were using
lower resolution images, the edge detection was not a
ble to
detect the individual edges of the dots. Overall, we exceeded
expectations in classifying paintings correctly with an average of
75% classification for an optimally parameterized neural
network.


Figure

1.
Missed classifications by generation with

a stopping
threshold of 10


Figure
2.

Results of an optimally parameterized neural network

4. F
uture Research


Further testing can be done using our existing code with
different parameters. This includes changing the number of
epochs a
nd neural networks
to train each
iteration, to see which
combinations of these work best with the neural network/
genetic algorithm approach we have implemented. This can also
be extended to training and testing datasets larger than our 185
image database, and those with mor
e genres than the 7 we
chose. Different image analysis methods can also be
implemented such as Gabor Filters for texture analysis.

5
.

REFERENCES

[1]

Zujovic, J., Gandy, L., Friedman, S. 2007. Using Neural
Networks to Classify Paintings by Genre. Northwestern
U
niversity,
http://www.cs.northwestern.edu/~sef318/paintings/

[2]

Artcyclopedia.
http://www.artcyclopedia.com/

[3]

NeuronDotNet
.
http://neurondotnet.freehostia.com/

[4]

Khan, Sohaib.
Canny's Edge Detector: Implementation.

http://suraj.lums.edu.pk/~cs436a02/CannyImplementation.ht
m

[5]

Canny.
http://idlastro.gsfc.nasa.gov/idl_html_help/CANNY.html