R-CNN, Fast R-CNN, Faster R-CNN

R-CNN, Fast R-CNN, Faster R-CNN

今年四月份的時候撑刺,在一個研究院實習(xí)時學(xué)習(xí)了RCNN, Fast RCNN, Faster RCNN系列Object Detection框架硼被,現(xiàn)在總結(jié)一下无切。

一. R-CNN(Regions with CNN features)

1.1 框架結(jié)構(gòu)

rcnn

論文中提到:

Our object detection system consists of three modules. 
The first generates category-independent region proposals. These proposals define the set of candidate detections available to our detector. 
The second module is a large convolutional neural network that extracts a fixed-length feature vector from each region.
The third module is a set of class specific linear SVMs.
Bounding-box Regression
Based on the error analysis, we implemented a simple method to reduce localization errors. Inspired by the bounding-box regression employed in DPM, we train a linear regression model to predict a new detection window given the pool5features for a selective search region proposal.

我們便知道R-CNN由三個部分組成:

  1. 提取Region Proposals的模塊;
  2. 提取特征向量的卷積神經(jīng)網(wǎng)絡(luò);
  3. 線性SVM分類器, bouding-box回歸(用于物體的定位).

1.2 神經(jīng)網(wǎng)絡(luò)結(jié)構(gòu)

rcnn-net

神經(jīng)網(wǎng)絡(luò)的輸入為依靠selective search方法提取region proposal后經(jīng)過warped region調(diào)整大小, 然后經(jīng)過5層卷積和2層全連接層晾咪,輸出結(jié)果一方面送入SVM分類的圆,另一方面送去Bounding-box回歸.

二. SPP-net(Spatial Pyramid Pooling, 空間金字塔池化層)

2.1 提出背景

spp-1
Existing deep convolutional neural networks (CNNs) require a fixed-size (e.g., 224*224) input image. This requirement is “artificial” and may reduce the recognition accuracy for the images or sub-images of an arbitrary size/scale. In this work, we equip the networks with another pooling strategy, “spatial pyramid pooling”, to eliminate the above requirement.

在說到Fast R-CNN之前, 先提一下SPP-net. 如論文所說, 由于其他網(wǎng)絡(luò)比如R-CNN的region proposal需要先經(jīng)過warped region調(diào)整成固定大小, 適用性不是很好, 因此SPP-net提出了一種不限制輸入大小的網(wǎng)絡(luò).

2.2 實現(xiàn)方式

spp-2

輸入的圖像(無論大小), 先經(jīng)過卷積神經(jīng)網(wǎng)絡(luò), 網(wǎng)絡(luò)結(jié)果經(jīng)過選擇的3個filter(此處選取的是16, 4, 1)做pooling, 三個輸出首尾連接形成固定長度的輸出. 至此解決了輸入圖像大小限制的問題.

三. Fast R-CNN

3.1 框架結(jié)構(gòu)

fast-rcnn-1
A Fast R-CNN network takes as input an entire image and a set of object proposals. 
The network first processes the whole image with several convolutional (conv) and max pooling layers to produce a conv feature map. Then, for each object proposal a region of interest (RoI) pooling layer extracts a fixed-length feature vector from the feature map. Each feature vector is fed into a sequence of fully connected (fc) layers that finally branch into two sibling output layers: one that produces softmax probability estimates over K object classes plus a catch-all “background” class and another layer that outputs four real-valued numbers for each of the K object classes. Each set of 4 values encodes refined bounding-box positions for one of the K classes.

首先selective search提取出的region proposal輸入卷積神經(jīng)網(wǎng)絡(luò), 得到的feature map輸入RoI pooling層, 提取出一段固定長度的特征向量, 一方面輸入softmax層估計物體概率, 另一方面輸入Bounding-box回歸層.

The RoI layer is simply the special-case of the spatial pyramid pooling layer used in SPPnets in which there is only one pyramid level.

如論文中所提及, RoI層實際上就是SPP-net的一種情況.

3.2 網(wǎng)絡(luò)結(jié)構(gòu)(VGG16為例)

fast-rcnn-2

四. Faster R-CNN

4.1 框架結(jié)構(gòu)

faster-rcnn-1
Our object detection system, called Faster R-CNN, is composed of two modules.
The first module is a deep fully convolutional network that proposes regions, and the second module is the Fast R-CNN detector that uses the proposed regions.
The entire system is a single, unified network for object detection (Figure 2).

圖像輸入神經(jīng)網(wǎng)絡(luò)后得到feature map, 在進入RoI pooling之前, 先經(jīng)過一個RPN層(下一點提到), 然后將得到的region proposal和feature map一起輸入RoI pooling層, 后續(xù)與Fast R-CNN一致.

4.2 RPN層(Region Proposal Network)

faster-rcnn-2
A Region Proposal Network (RPN) takes an image (of any size) as input and outputs a set of rectangular object proposals, each with an objectness score.

RPN層替代了原來的selective search方法來提取region proposal, 提出anchor box的概念, 通過sliding window的移動和選取k個不同比例的anchor box, 最后得到2k個是否為target的分數(shù)和4k個物體坐標.(這里的2指的是target/not a target, 4指的是坐標x/y/w/h)

4.3 網(wǎng)絡(luò)結(jié)構(gòu)

faster-rcnn-net

五. 總結(jié)

conclusion
  • Fast R-CNN 通過RoI pooling層將R-CNN后面SVM分類與Bounding-box回歸做入到神經(jīng)網(wǎng)絡(luò)中;
  • Faster R-CNN 通過RPN層將Fast R-CNN前面的region proposal提取層整合入神經(jīng)網(wǎng)絡(luò)中, 實現(xiàn)End-to-End.

References

[1] Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik. (2014). Rich feature hierarchies for accurate object detection and semantic segmentation.

[2] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. (2014). Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition.

[3] Ross Girshick. (2015). Fast R-CNN.

[4] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. (2016). Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks.


?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市囊卜,隨后出現(xiàn)的幾起案子臀防,更是在濱河造成了極大的恐慌眠菇,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,907評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件袱衷,死亡現(xiàn)場離奇詭異捎废,居然都是意外死亡,警方通過查閱死者的電腦和手機致燥,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,987評論 3 395
  • 文/潘曉璐 我一進店門登疗,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人嫌蚤,你說我怎么就攤上這事脱吱⌒妫” “怎么了间校?”我有些...
    開封第一講書人閱讀 164,298評論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長汉嗽。 經(jīng)常有香客問我稳析,道長诚纸,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,586評論 1 293
  • 正文 為了忘掉前任杯缺,我火速辦了婚禮袍榆,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 67,633評論 6 392
  • 文/花漫 我一把揭開白布搭独。 她就那樣靜靜地躺著,像睡著了一般配椭。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上雹姊,一...
    開封第一講書人閱讀 51,488評論 1 302
  • 那天股缸,我揣著相機與錄音,去河邊找鬼吱雏。 笑死敦姻,一個胖子當著我的面吹牛瘾境,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播镰惦,決...
    沈念sama閱讀 40,275評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼迷守,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了陨献?” 一聲冷哼從身側(cè)響起盒犹,我...
    開封第一講書人閱讀 39,176評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎眨业,沒想到半個月后急膀,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,619評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡龄捡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,819評論 3 336
  • 正文 我和宋清朗相戀三年卓嫂,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片聘殖。...
    茶點故事閱讀 39,932評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡晨雳,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出奸腺,到底是詐尸還是另有隱情餐禁,我是刑警寧澤,帶...
    沈念sama閱讀 35,655評論 5 346
  • 正文 年R本政府宣布突照,位于F島的核電站帮非,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏讹蘑。R本人自食惡果不足惜末盔,卻給世界環(huán)境...
    茶點故事閱讀 41,265評論 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望座慰。 院中可真熱鬧陨舱,春花似錦、人聲如沸版仔。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,871評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽蛮粮。三九已至益缎,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間蝉揍,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,994評論 1 269
  • 我被黑心中介騙來泰國打工畦娄, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留又沾,地道東北人弊仪。 一個月前我還...
    沈念sama閱讀 48,095評論 3 370
  • 正文 我出身青樓,卻偏偏與公主長得像杖刷,于是被迫代替她去往敵國和親励饵。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 44,884評論 2 354

推薦閱讀更多精彩內(nèi)容