介紹
Inception v2與Inception v3被作者放在了一篇paper裡面,因此我們也作為一篇blog來對其講解。
Google家的Inception系列模型提出的初衷主要為了解決CNN分類模型的兩個問題,其一是如何使得網路深度增加的同時能使得模型的分類性能隨著增加,而非像簡單的VGG網路那樣達到一定深度後就陷入了性能飽和的困境(Resnet針對的也是此一問題);其二則是如何在保證分類網路分類準確率提升或保持不降的同時使得模型的計算開銷與內存開銷充分地降低。在這兩個問題中,他們尤其關注第二個問題,畢竟在移動互聯網大行天下的今天,如何將複雜的CNN模型部署在計算與存儲資源均有限的移動端,並使之有效地運行有著更大的實際價值。
在Inception v1當中,它用於參賽的Googlenet模型只使用了約5百萬個參數,與它相比,Alexnet使用了約6千萬個參數,VGG用的參數更是多達1億八千萬個(當然其中主要是因為後兩者使用了較大的FC層)。
而在Inception v2模型中,作者們又進一步考慮了其它減少計算與可訓練參數的可能,最終這一新模型在使用較少訓練參數的情況下達到了更高的state-of-art分類準確率。
模型設計的通用準則
對於CNN模型設計與訓練這一『鍊金術』學問,Googler們在一番摸索與思考後提出了以下幾個尚未被證偽的『煉金法則』。而Inception v2/v3模型的設計思想即是源自於它們。
慎用bottleneck
如果出於模型分類精度考慮,那麼應盡量避免使用bottleneck模塊(關於此可參考不才之前的那篇inception v1博客),尤其是不應當在模型的早期階段使用。作者們認為CNN模型本質上是一個DAG(有向無環圖),其上信息自底向上流動,而每一個bottleneck的使用都會損失一部分信息,因此當我們出於計算與存儲節省而使用bottleneck時,一定要下手輕些(不要一下子使用1x1 conv縮減過多的feature maps的channels數目,如果一定要用reduction模塊也要在模型較靠後的幾層使用)。
層寬些還是有好處的
撇開計算與內存開銷增加的負面因素不談,每個Conv層的kernels數目增加對於模型處理局部信息,進而更有效地對其表達還是有好處的。畢竟多些參數就可使得每層獲得多些的表達能力,所謂一寸長一寸強。它還可使得模型收斂得更快(當然是指的整體所需的迭代次數減少,而非整體訓練下來所需的全部時間)。
更深的較底層(size亦小)可以使勁壓
這個純是實驗多了試出來的結論。即對於網路後面的feature maps可以使用像bottleneck那樣的模塊對其進行channels數目縮減再進行3x3 conv這樣的較大計算。在其中1x1 conv reduction op的使用不僅不會影響模型精度,反而還能使其收斂速度加快。他們給出的猜測性解釋是,後期較小size的feature maps之上的相鄰units(即channels)之間具有更加的關聯性(即冗餘信息不少),因此可以折騰的厲害些(使輸出的channels變少)而不擔心信息丟失(反而信息被梳理的更清晰、有效)。。(好吧,我承認這一段乍讀像是在胡說,我自己也是雲里霧裡。。什麼時候SCI文章也開始像李義山的詩一樣朦朧了。。)
平衡網路的深度與寬度
Googler們將深度學習網路的設計問題視為了一個在計算/內存資源限定條件存在的情況下,通過有效組合、堆加各種層/模塊,從而使得模型分類精度最高的一種最優化問題。而這自然也是最近火熱的所謂AutoML的核心思想。。
他們認為(也是通過實驗後總結)一個成功的CNN網路設計一定要將深度與寬度同時增加,瘦高或矮胖的CNN網路都不如一個身材勻稱的網路的效果好。
Inception v2中引入的一些變動
將kernel size較大的conv計算進一步分解
inception v1中稀疏表達模塊的思想在inception v2中得到了較好的繼承。既然我們可以用稀疏的inception模塊來有力地表達多維度信息,那麼幹嗎不再進一步將其中大的kernel size的conv層再進一步分解展開呢。。Network in network文章中提到一個表達力強的複雜網路可以由較簡單的小網路來組成,那麼乾脆就將網路的組合維度再增加些好了,說不定就能更有效地逼近人腦神經元的組合複雜度呢。。下圖為inception v1中所使用的inception 模塊。
TAG:模型 | 卷積神經網路(CNN) | 深度學習(DeepLearning) |