Basic CNN model

We will start by building a basic CNN model with three convolutional layers, coupled with max pooling for auto-extraction of features from our images and also downsampling the output convolution feature maps. To refresh your memory on how convolution and pooling layers work, check out the CNN section in Chapter 3, Understanding Deep Learning Architectures.

After extracting these feature maps, we will use one dense layer along with an output layer with a sigmoid function for classification. Since we are doing binary classification, a binary_crossentropy loss function will suffice. We will use the popular RMSprop optimizer, which helps us in optimizing the weights of the units in our network using backpropagation so that we ...

Get Hands-On Transfer Learning with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.