At kaggle we can find a dataset containing a collection of art images of google images, yandex images and from The Virtual Russian Museum. The dataset has about 9000 images with five categories:
- Drawings and Watercolors
- Paintings
- Sculpture
- Graphic Art
- Iconography (old Russian art)
Can we use deep learning and create a convolutional neural networks (CNN) to predict what category a given image is from.
I ended up adding several more layers, including Dropout
layers to help to avoid over-fitting.
model = Sequential([
Conv2D(32, (3, 3), input_shape=input_shape, activation='relu'),
MaxPooling2D(pool_size=(2, 2)),
Dropout(0.2),
Conv2D(32, (3, 3), activation='relu'),
MaxPooling2D(pool_size=(2, 2)),
Dropout(0.2),
Conv2D(64, (3, 3), activation='relu'),
MaxPooling2D(pool_size=(2, 2)),
Dropout(0.2),
Flatten(),
Dense(128, activation='relu'),
Dropout(0.2),
Dense(64, activation='relu'),
Dropout(0.2),
Dense(5, activation='softmax')
])
With the simple sequential model the computational time wasn't too bad but with the given dataset, the time went up from several minutes per epochs to nearly 30 minutes per epochs.
To free up the computer I used Gradient
from paperspace. Which allows me to prototype locally (prove of concept) and compute offline.
License MIT © Stephan Osterburg