Training a CNN model
Training a CNN model involves four phases: compiling the model, loading the training data, loading the test data, and running the model through epochs of loss evaluation and parameter-updating cycles.
In this section, the choice of the theme of the training dataset will be a real-life case study from the food-processing industry.
The goal
The primary goal of this model consists of detecting production efficiency flaws on a food-processing conveyor belt. The use of CIFAR-10 (images) and MNIST (handwritten digit base) proves useful to understand and train some models (see Chapter 10, Applying Biomimicking to Artificial Intelligence). However, at one point, real-life datasets must be used to sell and implement deep learning and artificial intelligence in general.
The following photograph shows a section of the conveyor belt that contains an acceptable level of products, in this case, portions of chocolate cakes:

Portions of chocolate cake example
However, sometimes the production...