The document discusses deep convolutional neural networks and their applications. It provides examples of using pre-trained neural networks for image classification tasks and fine-tuning them for custom image datasets. The key steps outlined are: 1) preparing a custom image dataset with labels, 2) obtaining a pre-trained neural network model, 3) modifying the last fully-connected layers for the custom classes, and 4) retraining the model on the custom dataset. Tips are provided for setting batch sizes, training iterations, and configuring the solver prototxt for efficient fine-tuning.
27. www.seznam.cz
Task
●
We want to analyze our own images
●
We want to classify them to our own
classes
●
Example:
– Guess product category from image
– Guess room type for house photos
– Flower recognition, dog breed recognition
– ...
33. www.seznam.cz
Finetune Dataset
● artistic style tutorial
● 20 categories
● Tutorial is very brief
● Does not explain
what changes to do
and why to do it
● Does not address
many pitfalls
36. www.seznam.cz
Finetune workflow
conv 1 conv 2 conv 3 conv 4 conv 5
fc 6 fc 7 fc 8
Car
Beer
Dog
1000
●
bvlc_reference_caffenet model
●
1000 general categories
43. www.seznam.cz
Tips: CPU vs GPU
●
Nvidia GPU
●
Vit will talk about it more
●
300k images:
Intel CPU @ 1.70GHz ~3 days (!!)
GeForce GTX TITAN Black ~3 min
1000-1500x speedup
44. www.seznam.cz
Tips: Training Process
●
Training is running in iterations
●
Each iteration is one batch (50 images)
●
Weights are updated after each iteration
●
After specified number of iterations:
– Test set is evaluated
– Snapshot is taken
47. www.seznam.cz
Tips: Training Process
●
Number of iterations for test phase
should be set to evaluate whole test set
– 16000 images / 50 batch size = 320 iterations
●
It could be good idea to test after whole
training set was evaluated
– 64000 images / 50 batch size = 1280 iterations
●
Snapshots – 200-300 MB
●
Can be resumed from snapshot
49. www.seznam.cz
Big Summary
●
Image → category / class
●
FC/Convolution layers
●
Backpropagation of errors
●
Caffe for Finetuning of general models
●
Use GPU, shuffle images, setup training
process
54. www.seznam.cz
Prepare Dataset
●
Update train_val.prototxt data layers
layer {
name: "data"
type: "ImageData"
...
include {
phase: TRAIN
}
...
image_data_param {
source: "data/flickr_style/train.txt"
batch_size: 50
...
}
}
Path to the train.txt
Do the same for the TEST
How much images to process
in one iteration
55. www.seznam.cz
Configure Network
FC 8
ReLU 7
FC 7
FC 6
ReLU 6
Max pool 5
ReLU 5
Conv 5
ReLU 4
Conv 4
ReLU 3
Conv 1
ReLU 1
Max pool 1
LRN 1
Conv 2
ReLU 2
Max pool 2
LRN 2
conv 1 conv 2 conv 3 conv 4 conv 5 fc 6 fc 7 fc 8
Conv 3
●
train_val.prototxt