Workflow of the overall project

In this project, we will see how to read images from .jpg format into a matrix representation in Scala. Then, we will further process and prepare those images feedable by the CNNs. We will see several image manipulations, such as squaring all the images and resizing every image to the same dimensions, before we apply a grayscale filter to the image:

Figure 7: A conceptualize view of a CNN for image classification

Then we train nine CNNs on training data for each class. Once the training is completed, we save the trained model, CNN configurations and parameters, so that they can be restored later on, and then we apply a simple aggregate function to assign classes to each restaurant, where each one has multiple images associated with it, each with its own vector of probabilities for each of the nine classes. Then we score test data and finally, evaluate the model using test images.

Now let's see the structure of each CNN. Each network will have two convolutional layers, two subsampling layers, one dense layer, and the output layer as the fully connected layer. The first layer is a convolutional layer followed by a subsampling layer, which is again followed by another convolutional layer, then a subsampling layer, then a dense layer, which is followed by an output layer. We will see each layer's structure later on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset