Model building, training, and analysis
We will use a standard sequential model from the keras
library to build the CNN. The network will consist of three convolutional layers, two maxpooling layers, and four fully connected layers. The input layer and the subsequent hidden layers have 16 neurons, while the maxpooling layers contain a pool size of (2,2). The four fully connected layers consist of two dense layers and one flattened layer and one dropout layer. Dropout 0.25 was used to reduce the overfitting problem. Another noveltyof this algorithm is the use of dataaugmentation to fight the overfitting phenomenon. Data augmentation is carried by rotating, shifting, shearing, and zooming the images to different extents to fit the model.
The relu
function is used as the activation function in both the input and hidden layers, while the softmax
classifier is used in the output layer to classify the test images based on the predicted output.
Getting ready
The network which will be constructed can...