This is a implementation of Deconvnet in keras, following Matthew D.Zeiler's paper Visualizing and Understanding Convolutional Networks
Given a pre-trained keras model, this repo can visualize features of specified layer including dense layer.
Below is several examples of feature visualization based on pre-trained VGG16 in keras, 'max' means pick the greates activation in the feature map to be visualized and set other elements to zeros, 'all' mean use all values in the feature map to visualize.
The left is max activation feature, the right is all activation feature
Original Image
block3_conv3_128
block4_conv2_46
The 46th feature in block4_conv2 layer catches 'nose' feature
The 256th feature in block5_conv3 layer catches 'ear' feature
fc1_0
fc2_248
predictions_248
predictions_248 is the predicted class of the image(label: Eskimo_dog)