As described in Chapter 1, Computer Vision and Neural Networks, you will notice that our model is overfitting—training accuracy is greater than test accuracy. If we train the model for five epochs, we end up with an accuracy of 97% on the test set. This is about 2% better than in the previous chapter, where we achieved 95%. State-of-the-art algorithms attain 99.79% accuracy.
We followed three main steps:
- Loading the data: In this case, the dataset was already available. During future projects, you may need additional steps to gather and clean the data.
- Creating the model: This step was made easy by using Keras—we defined the architecture of the model by adding sequential layers. Then, we selected a loss, an optimizer, and a metric to monitor.
- Training the model: Our model worked pretty well the first time. On more complex datasets, you will usually need to fine-tune parameters during training.
The whole process was extremely simple thanks to Keras...