Keras has a great functionality, and in this section, we will use it to visualize the model architecture.
The following code will help you create a visualization of your image:
from keras.utils.vis_utils import plot_model
%matplotlib inline
from keras.utils import plot_model
plot_model(model, to_file='model.png',
show_shapes= True,
show_layer_names = True)
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
img = mpimg.imread('model.png')
plt.imshow(img)
plt.show()
The visualized model architecture looks as follows:
Fig 6.24: The model architecture
Now, we will validate the performance using a confusion matrix.