Contents

Hi,
As mentioned in Blog posts 1.2, simply using the cropped image and limit their size to 128*128 doesn’t help a lot, and we can observe from experiment 1.2 that only use cropped original images to do learning will result in overfitting, and as we can observe from the learning curve in experiment 1.2, after about 700 epochs, overfitting already occurred, the valid_error will stagnate at around 27%, and the training error will continues to decrease to about 5%, but that isn’t of any use…

So in order to overcome the overfitting phenomenon, there are a lot of methods to regularize, in this experiment 1.3, I uses the Random2DRotation Method to rotate each training image by a random degree, and keep their label untouched, so the model will learn different dogs or cats’images with different random rotated angles, and as we can see from the learning curve of experiment 1.3, this does help to reduce the overfitting. Globally, the training error and validation error curves are sticked together, and the validation error after 100 epochs is 19.4%.

In this experiment, I’m using the same 3-convolution layered CNN architecture as in 1, 1.01, 1.1, 1.2
The configurations are as follows:

num_epochs= 100 
image_shape = (128,128)
filter_sizes = [(5,5),(5,5),(5,5)]
feature_maps = [20,50,80]
pooling_sizes = [(2,2),(2,2),(2,2)]
mlp_hiddens = [1000]
output_size = 2
weights_init=Uniform(width=0.2)
step_rule=Adam()
max_image_dim_limit_method= MaximumImageDimension
dataset_processing = rescale to 128*128

cats and dogs 1 result

Next step I will try more complicated architectures (e.g. more layers) and with more feature maps at last conv layer to see if it can provide more information to the last MLP-softmax classification layer. And it might also be worthwhile to try other data augmentation schemes to regularize.

Contents