卷積神經網絡中用1*1 卷積有什么作用或者好處呢垫言?

1X1卷積核最開始是在顏水成論文 [1312.4400] Network In Network 中提出的,后來被[GoogLeNet 1409.4842] Going Deeper with Convolutions的Inception結構繼續(xù)應用了。能夠使用更小channel的前提就是sparse比較多 不然1*1效果也不會很明顯

Network in Network and 1×1 convolutions

Lin et al., 2013. Network in network

1x1 卷積可以壓縮信道數(shù)肮街。池化可以壓縮寬和高先慷。
1x1卷積給神經網絡增加非線性横漏,從而減少或保持信道數(shù)不變,也可以增加信道數(shù)

11c.png

11c1.png

1.實現(xiàn)跨通道的交互和信息整合

1×1的卷積層(可能)引起人們的重視是在NIN的結構中熟掂,論文中林敏師兄的想法是利用MLP代替?zhèn)鹘y(tǒng)的線性卷積核缎浇,從而提高網絡的表達能力。文中同時利用了跨通道pooling的角度解釋赴肚,認為文中提出的MLP其實等價于在傳統(tǒng)卷積核后面接cccp層素跺,從而實現(xiàn)多個feature map的線性組合,實現(xiàn)跨通道的信息整合誉券。而cccp層是等價于1×1卷積的指厌,因此細看NIN的caffe實現(xiàn),就是在每個傳統(tǒng)卷積層后面接了兩個cccp層(其實就是接了兩個1×1的卷積層)

1.png

2.進行卷積核通道數(shù)的降維和升維

由于3X3卷積或者5X5卷積在幾百個filter的卷積層上做卷積操作時相當耗時踊跟,所以1X1卷積在3X3卷積或者5X5卷積計算之前先降低維度踩验。那么,1X1卷積的主要作用有以下幾點:
1商玫、降維( dimension reductionality )箕憾。比如,一張500 X500且厚度depth為100 的圖片在20個filter上做1X1的卷積拳昌,那么結果的大小為500X500X20袭异。
2、加入非線性炬藤。卷積層之后經過激勵層御铃,1X1的卷積在前一層的學習表示上添加了非線性激勵( non-linear activation )碴里,提升網絡的表達能力;

What is Depth of a convolutional neural network?


如果卷積的輸出輸入都是一個平面上真,那么1X1卷積核并沒有什么意義咬腋,它是完全不考慮像素與周邊其他像素關系。但卷積的輸出輸入是長方體睡互,所以1X1卷積實際上對每個像素點帝火,在不同的channels上進行線性組合(信息整合),且保留原有平面結構湃缎,調控depth,從而完成升維或降維的功能犀填。
下圖所示,如果選擇2個filters的1X1卷積層嗓违,那么數(shù)據就從原來的depth3降到了2九巡。若用4個filters,則起到了升維的作用。

1.png

MSRA的ResNet同樣也利用了1×1卷積蹂季,并且是在3×3卷積層的前后都使用了冕广,不僅進行了降維,還進行了升維偿洁,使得卷積層的輸入和輸出的通道數(shù)都減小撒汉,參數(shù)數(shù)量進一步減少,如下圖的結構涕滋。

1.png

Simple Answer

Most simplistic explanation would be that 1x1 convolution leads to dimension reductionality. For example, an image of 200 x 200 with 50 features on convolution with 20 filters of 1x1 would result in size of 200 x 200 x 20. But then again, is this is the best way to do dimensionality reduction in the convoluational neural network? What about the efficacy vs efficiency?


One by One [ 1 x 1 ] Convolution - counter-intuitively useful

Complex Answer

Feature transformation

Although 1x1 convolution is a ‘feature pooling’ technique, there is more to it than just sum pooling of features across various channels/feature-maps of a given layer. 1x1 convolution acts like coordinate-dependent transformation in the filter space[https://plus.google.com/118431607943208545663/posts/2y7nmBuh2ar]. It is important to note here that this transformation is strictly linear, but in most of application of 1x1 convolution, it is succeeded by a non-linear activation layer like ReLU. This transformation is learned through the (stochastic) gradient descent. But an important distinction is that it suffers with less over-fitting due to smaller kernel size (1x1).

3.可以在保持feature map 尺寸不變(即不損失分辨率)的前提下大幅增加非線性特性睬辐,把網絡做得很deep

Deeper Network

One by One convolution was first introduced in this paper titled Network in Network. In this paper, the author’s goal was to generate a deeper network without simply stacking more layers. It replaces few filters with a smaller perceptron layer with mixture of 1x1 and 3x3 convolutions. In a way, it can be seen as “going wide” instead of “deep”, but it should be noted that in machine learning terminology, ‘going wide’ is often meant as adding more data to the training. Combination of 1x1 (x F) convolution is mathematically equivalent to a multi-layer perceptron[https://www.reddit.com/r/MachineLearning/comments/3oln72/1x1_convolutions_why_use_them/cvyxood/]

Inception Module

In GoogLeNet architecture, 1x1 convolution is used for two purposes

To make network deep by adding an “inception module” like Network in Network paper, as described above.
To reduce the dimensions inside this “inception module”.
To add more non-linearity by having ReLU immediately after every 1x1 convolution.

Here is the scresnshot from the paper, which elucidates above points :

inception_1x1.png

It can be seen from the image on the right, that 1x1 convolutions (in yellow), are specially used before 3x3 and 5x5 convolution to reduce the dimensions. It should be noted that a two step convolution operation can always to combined into one, but in this case and in most other deep learning networks, convolutions are followed by non-linear activation and hence convolutions are no longer linear operators and cannot be combined.

In designing such a network, it is important to note that initial convolution kernel should be of size larger than 1x1 to have a receptive field capable of capturing locally spatial information. According to the NIN paper, 1x1 convolution is equivalent to cross-channel parametric pooling layer. From the paper - “This cascaded cross channel parameteric pooling structure allows complex and learnable interactions of cross channel information”.

Cross channel information learning (cascaded 1x1 convolution) is biologically inspired because human visual cortex have receptive fields (kernels) tuned to different orientation. For e.g

RotBundleFiltersListPlot3D.gif

Different orientation tuned receptive field profiles in the human visual cortex Source

More Uses

1x1 Convolution can be combined with Max pooling

numerical_max_pooling.gif

1x1 Convolution with higher strides leads to even more redution in data by decreasing resolution, while losing very little non-spatially correlated information.

no_padding_strides.gif

Replace fully connected layers with 1x1 convolutions as Yann LeCun believes they are the same

-In Convolutional Nets, there is no such thing as “fully-connected layers”. There are only convolution layers with 1x1 convolution kernels and a full connection table.– Yann LeCun

Convolution gif images generated using this wonderful code, more images on 1x1 convolutions and 3x3 convolutions can be found here

參考文獻

https://www.zhihu.com/question/56024942

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市宾肺,隨后出現(xiàn)的幾起案子溯饵,更是在濱河造成了極大的恐慌,老刑警劉巖锨用,帶你破解...
    沈念sama閱讀 218,858評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件丰刊,死亡現(xiàn)場離奇詭異,居然都是意外死亡增拥,警方通過查閱死者的電腦和手機啄巧,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,372評論 3 395
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來掌栅,“玉大人秩仆,你說我怎么就攤上這事≡幔” “怎么了逗概?”我有些...
    開封第一講書人閱讀 165,282評論 0 356
  • 文/不壞的土叔 我叫張陵,是天一觀的道長忘衍。 經常有香客問我逾苫,道長,這世上最難降的妖魔是什么枚钓? 我笑而不...
    開封第一講書人閱讀 58,842評論 1 295
  • 正文 為了忘掉前任铅搓,我火速辦了婚禮,結果婚禮上搀捷,老公的妹妹穿的比我還像新娘星掰。我一直安慰自己,他們只是感情好嫩舟,可當我...
    茶點故事閱讀 67,857評論 6 392
  • 文/花漫 我一把揭開白布氢烘。 她就那樣靜靜地躺著,像睡著了一般家厌。 火紅的嫁衣襯著肌膚如雪播玖。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,679評論 1 305
  • 那天饭于,我揣著相機與錄音蜀踏,去河邊找鬼。 笑死掰吕,一個胖子當著我的面吹牛果覆,可吹牛的內容都是我干的。 我是一名探鬼主播殖熟,決...
    沈念sama閱讀 40,406評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼局待,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了菱属?” 一聲冷哼從身側響起燎猛,我...
    開封第一講書人閱讀 39,311評論 0 276
  • 序言:老撾萬榮一對情侶失蹤该酗,失蹤者是張志新(化名)和其女友劉穎毫缆,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體堰酿,經...
    沈念sama閱讀 45,767評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡膜毁,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,945評論 3 336
  • 正文 我和宋清朗相戀三年昭卓,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片瘟滨。...
    茶點故事閱讀 40,090評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡候醒,死狀恐怖,靈堂內的尸體忽然破棺而出杂瘸,到底是詐尸還是另有隱情倒淫,我是刑警寧澤,帶...
    沈念sama閱讀 35,785評論 5 346
  • 正文 年R本政府宣布败玉,位于F島的核電站敌土,受9級特大地震影響镜硕,放射性物質發(fā)生泄漏。R本人自食惡果不足惜返干,卻給世界環(huán)境...
    茶點故事閱讀 41,420評論 3 331
  • 文/蒙蒙 一兴枯、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧矩欠,春花似錦财剖、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,988評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至乳蓄,卻和暖如春咪橙,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背栓袖。 一陣腳步聲響...
    開封第一講書人閱讀 33,101評論 1 271
  • 我被黑心中介騙來泰國打工匣摘, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人裹刮。 一個月前我還...
    沈念sama閱讀 48,298評論 3 372
  • 正文 我出身青樓音榜,卻偏偏與公主長得像,于是被迫代替她去往敵國和親捧弃。 傳聞我的和親對象是個殘疾皇子赠叼,可洞房花燭夜當晚...
    茶點故事閱讀 45,033評論 2 355

推薦閱讀更多精彩內容

  • 01 假如你已經長大 你就要獨自度過天黑踏過路滑 你要告別媽媽 你要四海為家 假如你已經長大 你還要要獨自體驗世間...
    熙官寶閱讀 242評論 0 3
  • 夢里三千場嘴办,才拼湊的初具模樣。印象雙髻山兌現(xiàn)的日出买鸽,云海涧郊,奇石,午時花…… ??日出〉 五點一刻 準時 迎著打顫的山...
    竹若閱讀 573評論 1 1
  • 山里灰蒙蒙的眼五,往遠處望去妆艘,層巒疊嶂,仿佛在仙境看幼,山里的老仙正在冥想坐禪批旺。 去之前以為是在邯鄲,這個遙遠的古老趙都诵姜,...
    小花Ivan閱讀 452評論 0 0
  • 延宕在說之稀泥里 實在 就像一條魚一樣 被憋死了
    李野航閱讀 187評論 0 1