This is Code of AFGR 2019 paper《Exploring Features and Attributes in Deep Face Recognition Using Visualization Techniques》.
The original 5000 images are put into pic5000pick1.rar and pic5000pick2.rar.
Using this code, you can visualize what a neuron detects in VGGFace http://www.robots.ox.ac.uk/~vgg/software/vgg_face/. We provide an example of neuron 22 in pool5, which captures a kind of face attribute "bold". You could also use the code to interpret your own network.
Note: The t-sne code is reference from https://lvdmaaten.github.io/tsne/ and https://cs.stanford.edu/people/karpathy/cnnembed/
- Install caffe.
- put "deconvrelu_layer.hpp" in path "./caffe/include/caffe/layers/"
- put "deconvrelu_layer.cpp¡± in path "./caffe/src/caffe/layers/"
- override "caffe.proto" in path "./caffe/src/caffe/proto/caffe.proto"
- compile caffe and matcaffe (matlab wrapper for caffe)
make all -j4
make matcaffe
- download the pretrained model from http://www.robots.ox.ac.uk/~vgg/software/vgg_face/
As we provide the related images and in-process data, you could run demo.m to get the result. Note that some code related to your own path would be changed in demo.m.
matlab demo.m