論文筆記:A Gift from Knowledge Distillation

來源

CVPR2017

名詞解釋

遷移學習

遷移學習的效果與知識的表示是很相關的。

Because a DNN uses many layers sequentially to map from the input space to the output space, the flow of solving a problem can be defined as the relationship between features from two layers.

Gramian Matrix格萊姆矩陣

Gramian矩陣是通過計算一組特徵向量的內積進行生成的,包含了兩個向量之間的方向關係,可以用來表示文理特徵。

FSP matrix

The extracted feature maps from two layers are used to generate the flow of solution procedure (FSP) matrix. The student DNN is trained to make its FSP matrix similar to that of the teacher DNN

本文中的FSP矩陣的計算與Gramian矩陣的計算是類似的。我們計算GramianMatrix是跨層計算的。而傳統Gramian Matrix是在一個層內的features之間進行計算的。如下圖所示。

本文中的遷移學習方法示意圖

Distilled Knowledge 如果將DNN的輸入視爲問題,將DNN的輸出作爲回答,那麼我們可以將中間的生成的特徵看作回答問題過程中的中間結果。 老師教學生的過程也是類似的,學生需要着重學習的是某類題目的解答方法,而不是學會解某個題目。因此,一般是對問題的解決過程進行建模。

Model

對問題的解決過程往往被定義爲兩個中間結果的關係進行表示。本文中定義FSP矩陣來表示問題解決過程。

如何計算FSP矩陣

FSP矩陣計算

如何優化FSP矩陣

首先是Teacher Network中生成的FSP矩陣,Gt_i (i = 1, ..n). Student Network 中生成了n個FSP矩陣,Gs_i (i=1,.. n). 然後Teacher和Student Network的FSP矩陣組成對(Gt_i, Gs_i), i = 1,2,...n FSP矩陣計算

方法架構圖

Stage 1: 學習FSP矩陣

Weights of the student and teacher networks: Ws, Wt
1: Ws = arg minWs LFSP(Wt, Ws) # 就是上面優化FSP矩陣中提到的損失函數的優化

Stage 2: 針對原始任務進行訓練

1: Ws = arg min Ws Lori(Ws)  # 例如是分類任務的話, 我們可以使用softmax交叉熵損失作爲任務的損失函數進行學習和優化

實驗

Fast Optimization

DenseNet的組成結構

從結果中可以看出student network比teacher network 收斂速度更快。 大概快了3倍,試驗中Teacher Network和Student Network是相同的結構。 依次類推,1/3原來的迭代次數,我們在Student Network訓練過程中使用相應的學習率。實驗結果如下表: Recignition rates on CIFAR-10

* 表示每個網絡訓練了21000iteration, 原始網絡迭代次數爲63000. 兩個+的符號(++)表示Teacher Network在前面64000次迭代基礎上,又訓練了21000次迭代。 寶劍符號(+-)表示stage 1中,student network學習的是randomly shuffled 的FSP矩陣。Student*+-表示Student network在stage 1訓練了21000次迭代,stage 2訓練了21000次迭代。

As both teacher networks and student networks are of the same architecture, one can also transfer knowledge by directly copying weights. FSP is less restrictive than copying the weights and allows for better diversity and ensemble performance

Network Minimization

最近,很多研究結果都是使用更大更深的神經網絡獲得更好的性能表現。那麼,我們想通過將學習深層網絡的知識應用到提升小網絡中來。就像下圖所示:

DenseNet的組成結構

Because the student DNN and teacher DNN had the same number of channels, the sizes of the FSP matrices were the same. By minimizing the distance between the FSP matrices of the student network and teacher network, we found a good initial weight for the student network. Then,the student network was trained to solve the main task.

來看看使用這個想法,全部不使用數據增強,訓練網絡的結果: DenseNet的組成結構 從中可以看出使用distill knowledge還是有效果的。而且使用本文中的方法效果比FitNet好很多(2.0%+)。

Transfer Learning

是跨任務知識使用。尤其是利用那些使用大數據集合訓練的神經網絡模型應用到小規模的數據集合方面的應用。本文中試驗了ImageNet-> Caltech-UCSD Birds (CUB) 200-2011 dataset的遷移學習,神經網絡是比Teacher DNN 淺1.7倍左右。但是這個實驗做的還是不夠充分,感覺是對前面網絡最小化實驗的另一種說法啊。

評測標準

Recognition rates

由於本文中使用的數據集合是單一主要是單一物體,主要是物體分類的問題。

收斂速度

小結

本文利用使用兩層featuremap 之間的關係表示爲FSP。利用這種學習過程知識表示方法,在DNN加速方面有很的表現。並且這個方法還可以應用到遷移學習中。當前的研究主要是在一些簡單得數據集合上進行實驗的,是不是可以考慮在更復雜的數據集合上進行實驗。

參考文獻

  1. MSRA:Delving Deep into Rectifiers:Surpassing Human-Level Performance on ImageNet Classification MSRA初始化是一個均值爲0方差爲2/n的高斯分佈
  2. A. Romero, N. Ballas, S. E. Kahou, A. Chassang, C. Gatta,and Y. Bengio. Fitnets: Hints for thin deep nets. In In Proceedings of ICLR, 2015.
發佈了44 篇原創文章 · 獲贊 17 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章