the next step involves compiling we use categorical_crossentropy as our loss function since we are dealing with multiple classes besides thiswe use the adadelta optimizer and then train the classifier on the training data the following snippet showcases the same in [ ]model compile(loss=keras losses categorical_crossentropyoptimizer=keras optimizers adadelta()metrics=['accuracy']model fit(x_trainy_trainbatch_size=batch_sizeepochs=epochsverbose= epoch / / [============================== loss acc epoch / / [============================== loss acc epoch / / [============================== loss acc epoch / / [============================== loss acc epoch / / [============================== loss acc from the preceding outputit is clear that we trained the model for epochs this takes anywhere between - secs on cputhe performance improves manifold when done using gpu we can see the accuracy is around based on the last epoch we will now evaluate the testing performancethis is checked using the evaluate function of the model object the results are as follows test loss test accuracy thuswe can see that our very simple cnn based deep learning model achieved an accuracy of %given the fact that we have built very simple model and that we haven' done much preprocessing or model tuning you are encouraged to try different cnn architectures and experiment with hyperparameter tuning to see how the results can be improved the initial few conv layers of the model kind of work toward feature extraction while the last couple of layers (fully connectedhelp in classifying the data thusit would be interesting to see how the image data is manipulated by the conv-net we just created luckilykeras provides hooks to extract information at intermediate steps in the model they depict how various regions of the image activate the conv layers and how the corresponding feature representations and patterns are extracted