training convnet from scratch on small dataset fnames ['dog {jpgformat(ifor in range( )for fname in fnamessrc os path join(original_dataset_dirfnamedst os path join(train_dogs_dirfnameshutil copyfile(srcdstcopies the first , dog images to train_dogs_dir fnames ['dog {jpgformat(ifor in range( )for fname in fnamessrc os path join(original_dataset_dirfnamedst os path join(validation_dogs_dirfnameshutil copyfile(srcdstcopies the next dog images to validation_dogs_dir fnames ['dog {jpgformat(ifor in range( )for fname in fnamessrc os path join(original_dataset_dirfnamedst os path join(test_dogs_dirfnameshutil copyfile(srcdstcopies the next dog images to test_dogs_dir as sanity checklet' count how many pictures are in each training split (train/validation/test)print('total training cat images:'len(os listdir(train_cats_dir))total training cat images print('total training dog images:'len(os listdir(train_dogs_dir))total training dog images print('total validation cat images:'len(os listdir(validation_cats_dir))total validation cat images print('total validation dog images:'len(os listdir(validation_dogs_dir))total validation dog images print('total test cat images:'len(os listdir(test_cats_dir))total test cat images print('total test dog images:'len(os listdir(test_dogs_dir))total test dog images so you do indeed have , training images , validation imagesand , test images each split contains the same number of samples from each classthis is balanced binary-classification problemwhich means classification accuracy will be an appropriate measure of success building your network you built small convnet for mnist in the previous exampleso you should be familiar with such convnets you'll reuse the same general structurethe convnet will be stack of alternated conv (with relu activationand maxpooling layers but because you're dealing with bigger images and more complex problemyou'll make your network largeraccordinglyit will have one more conv maxpooling stage this serves both to augment the capacity of the network and to further reduce the size of the feature maps so they aren' overly large when you reach the flatten layer herebecause you start from inputs of size ( somewhat arbitrary choice)you end up with feature maps of size just before the flatten layer licensed to