In this recipe, we will use keras-vis (https://raghakot.github.io/keras-vis/), an external Keras package for visually inspecting what a pre-built VGG16 network has learned in different filters. The idea is to pick a specific ImageNet category and understand 'how' the VGG16 network has learned to represent it.
Inspecting what filters a VGG pre-built network has learned
Getting ready
The first step is to select a specific category used for training the VGG16 on ImageNet. Let's say that we take the category 20, which corresponds to the American Dipper bird shown in the following picture:
An example of American Dipper as seen on https://commons.wikimedia.org/wiki/File:American_Dipper.jpg
ImageNet mapping can be...