How it works...
In step 1, we used the flow_images_from_directory() function to load the images from a directory. To use this functionality, we must structure our data as we did for the Fruits 360 dataset. This function gives us the flexibility to transform our images while loading them in R. In our implementation, we reshaped each image to a size of 20 × 20 and changed the color mode to RGB channel. Next, we explored the data and looked at the distribution of images in the training and test datasets.
In the next step, we defined our model. In this model, we fit a max-pooling layer followed by two dense layers. The last layer of the network had softmax activation with 23 units since we had 23 output labels. Next, we looked at the summary ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access