Friday, May 19, 2017

AI 從頭學(二七):ZFNet

AI 從頭學(二七):ZFNet

2017/05/19

前言:

學習 DL 的路上充滿幸運:

第一個是建議實做 LeNet。 然後才有 LeNet實作團。

第二個是 Jason 辦了讀書會一起研讀 Goodfellow 以及 Sutton 的教科書,雖然時間受限沒辦法參加讀書會,但是瀏覽過這兩本書後,對 DRL 的架構清楚很多。

第三個是 Winston 推薦了兩篇論文,還讓他的學生幫忙指導以及討論。現在 DRL實作團也誕生了!

答謝的最好方式是散播幸運...

-----

Summary:

AlexNet [1] 的 feature maps 怎麼 show 出來,[2] 有詳細的說明。[3] 也展示了最後一層的 feature maps。值得一提的是 [3] 的架構被 GoogLeNet [4] 所吸收。

本篇只簡單描述研讀 kernel visualizing 的經驗。

-----


Fig. 1.1. An illustration of the architecture of AlexNet [1].

圖1.1 是 AlexNet 的架構,大體上可以想成是巨型的 LeNet。之所以分成兩路,其中一個原因是硬體的限制,要拆開分別在兩塊 GPU 上面跑。



Fig. 1.2. 96 convolutional kernels learned by the first convolutional layer. The top 48 kernels were learned on GPU 1 while the bottom 48 kernels were learned on GPU 2 [1].

圖1.2 是 conv layer 1 的 feature maps,上面可以看到是一些 edge filters。下面則跟色彩有關。這兩者構成一張圖。

關於這張圖,我的好奇心是:線條跟彩度是如何被分開在兩塊 GPU,隨機的嗎?



Fig. 2.1a. Architecture of revised AlexNet model [2].

圖2.1a 是 AlexNet 修改過的架構。主要是靠窮舉法去把適合的參數找出來。


Fig. 2.1b. A deconvnet layer (left) attached to a convnet layer (right) [2].

圖2.1b 展示了 feature maps 如何利用 deconvolution 「還原」成可以「看」的圖。除了最底層的 edge filter 比較直觀之外,高層的 feature maps 大部分是看不出東西的。說「大部分」,是因為有些最高層的 feature maps 可以看出物體的形狀,參考 [3]。



Fig. 2.2a. Visualization of features in a fully trained model [2].

圖2.2a 是 Layer 1 跟 Layer 2 的視覺化 features。經還原後可以看出 Layer 2 已經有比直線更複雜一點的結構。



Fig. 2.2b. (a): 1st layer features [1]. (b): 1st layer features [2]. (c): 2nd layer features [1]. (d): 2nd layer features [2].

圖2.2b 比較 AlexNet 跟改良版有何不同。改良版的圖「漂亮」一點。所謂漂亮,這裡指的是彩度跟解析都提高了!意味著訊息被保留較多。



Fig. 2.2c. Visualization of features in a fully trained model [2].

圖2.2c 是最高層的 feature maps 「被還原」,可以看到跟原圖很接近的形狀。



Fig. 2.2d. Three test examples [2].

圖2.2d,(a)是輸入的圖片。(b)是熱圖:高強度的數值以紅色表示,低強度的數值則是以藍色來表示。(c)是利用 deconvolution 把 feature maps 還原成類似原圖。(d)是這個圖是「對」的圖的機率高不高。(e)是這個圖最可能是哪一種。機率圖可參考 [6]。



Fig. 3.1a. Comparison of linear convolution layer and mlpconv layer [3].

圖3.1a,左邊是傳統的 convolutional layers,右邊可以看到插進去兩層的全連接層。



Fig. 3.1b. The overall structure of Network In Network [3].

圖3.1b,NiN的架構。



Fig. 3.2a. Visualization of the feature maps from the last mlpconv layer [3].

圖3.2a是接近輸出層的 feature maps。



Fig. 3.2b. Visualization of the automobile feature map from the last mlpconv layer [3].



Fig. 3.2c. Visualization of the automobile feature map from the last mlpconv layer [3].

汽車是最明顯的!

-----

結論:

要看中間的 feature maps,可以利用 deconvolution [2]。

-----

References

[1] 2012_Imagenet classification with deep convolutional neural networks

[2] 2014_Visualizing and understanding convolutional networks

[3] 2013_Network in network

[4] 2015_Going deeper with convolutions

[5] Heat map - Wikipedia
https://en.wikipedia.org/wiki/Heat_map 

[6] Handwritten Digit Recognition Using A Naive Bayes Classifier Trained With MNIST _ Me, Myself and AI
https://gettingintoai.wordpress.com/2014/09/01/firstmlexperience/

No comments: