An implementation of Channel Pruning on face recognition model Sphereface by Caffe, Caffe's Python interface, realize Convolutional neural network compression and acceleration.
Caffe 1.0.0
Python 2.7.6
Matplotlib 1.3.1
Numpy 1.13.1
Trained by CASIA-Webface dataset
10-folds cross validation by LFW dataset
We adopt a greedy algorithm based channel selection methods to choose the weak channels in every layer of convolutional neural network and prune them.
Channel selection follows the key criterion of convolutional neural network
· The output of i layer is the input of i+1 layer.
· The input channels of i+1-th layer have one-to-one correspondence with the filters in i-th layer.
· If a set of filters in i layer are removed without affecting the output of i+1 layer, that means that this set of filters could be safely removed.
1 epoch fine-tuning after pruning every layer. Becuase CASIA Webface contains 452,723 face images, so 1 epoch means 1768 times iteration by setting batch size to 256. Basic leaning rate is set to 1 × 10−3.
After all layers are pruned, do 8 to 9 epochs fine-tuning, basic learning rate is 1 × 10−3.
SphereFace: Deep Hypersphere Embedding for Face Recognition
ThiNet: A Filter Level Pruning Method for Deep Neural Network Compression