SlideShare una empresa de Scribd logo
1 de 75
Descargar para leer sin conexión
Object Detectors 세상을 여행하는
히치하이커를 위한 안내서
1편(~2016.6)
Object Detectors 세상을 여행하는
히치하이커를 위한 안내서
1편(~2016.6)
Curtis Kim (김일두) @ Kakao
1
Object Detectors
Object Detector를 정리하면서 ‘현재’ 아래와 같은 분류로 모델 및 내용을 정리함
- R-CNN 이전의 모델
- R-CNN 류의 모델 : R-CNN의 모듈들을 개선했거나 유사 구조의 Detection Pipeline을 사용
- Single Shot Detector : 1번의 NN* Forwarding으로 여러 클래스의 여러 물체를 동시 검출
- 기타 Proposal Method / Training 관련 내용들
2* NN : Neural Network
Object Detectors
1. Before RCNN
a. DPM(Object Detection with Discriminatively TrainedPart Based Models) 등
b. ‘Selective Search for Object Recognition’
c. 2013 : DNN for Object Detection / Localization
i. ‘Overfeat’ by Yann Lecun
ii. ‘Deep Neural Networks for Object Detection’ by Google
2. From R-CNN (2013~)
a. Hypothesize bnds(Proposals) → Resampling pixels / features for each boxes → Classifier / Bnd Regressor
b. R-CNN의 성능과 속도의 개선
i. Improving Classifier (Fast R-CNN)
ii. Improving Proposals (Faster R-CNN)
3. Single Shot Detectors ★
a. Single NN Forward로 1개 혹은 여러 개의 Bounding Box의 좌표와 Class 정보를 얻자
b. Single-Shot Detector의 성능과 속도의 개선
i. Formulation(Modeling)
ii. Improving Feature Maps(+Global Contexts)
4. Etcs
3
Before R-CNN
‘Multiple-Class / Multiple-Bounding Box 환경에서 Neural Network로 Detection을 어떻게 할까?’
4
AlexNet
Before R-CNN
Not DNN
Object Detection with Discriminatively TrainedPart Based Models : DPM, 대표적인 Detection Model
Selective Search for Object Recognition : Object Proposal 방식으로 이후 R-CNN 등에서 사용
2013년의 DNN for Object Detection
‘Multiple-Class / Multiple-Bounding Boxes 환경에서 Neural Network로 Detection을 어떻게 할까?’
- 풀리지 않은 질문, Neural Net으로 위 문제를 단순하고 명쾌하게 풀어내지는 못함
Deep Neural Networks for Object Detection
- Single Forward로 여러 Bounding Box까지는 얻었지만, 각 Box의 Class는 또 다른 네트워크를 수행하여 얻었음
OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks
- Sliding Window 방식으로 각 Class별로 학습된 Regressor를 반복수행함
5
Deep Neural Networks for Object Detection
Classification 위주의 DNN에 처음으로 Object Detection을 위한 Formulation
Binary Mask Regression → Bounding Boxes → Classification for each boxes
6
Deep Neural Network for Object Detection - Concept
‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’
- Box가 여러개 일 수 있으니 좌표를 직접 Regression하지 말고, Binary Mask를 Regression하는 방향으로 아이디어!
- Bounding Box Binary Mask
- 1 for Objectness
- {0, 1}로 채워진 (d x d) Output을 통해 Object Bounding Box를 추정
7
Image Deep NN Binary Mask
000111111111000
001111111111000
001111111111100
000011111111100
001111111111110
000011111111100
Deep Neural Network for Object Detection - Concept
Bounding Box를 직접 Regression하지 않았으니, Binary Mask를 Bounding Box로 변경해야 함
- 여러 개의 Prior(미리 지정된 크기/비율의 사각형)을 Sliding하면서 Score가 높은 Box를 선택함
8
Binary Mask
000111111111000
001111111111000
001111111111100
000011111111100
001111111111110
000011111111100
Bounding Box
Deep Neural Network for Object Detection
‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’
- Single Forward NN 을 통해 Multiple Object의 Class / Coordinates를 알 수 있을까?
- Binary Mask Regression으로 문제를 변환함
- Alexnet의 Softmax Classifier 대신에 Binary Mask를 L2 Regression 함
- 여러 위치={full, left, right, top, bottom}으로부터 Binary Mask를 얻음
- Binary Mask → Bounding Boxes
- 90개의 Prior(=여러 모양의 박스)를 이용해 Sliding하면서 Score가 높은 Bouding Box(>0.5)를 취함
- Score : ‘to measure what portion of the bounding box is covered by the mask’
- Binary Mask의 Resolution이 낮아 정확도 떨어짐
- Class를 모르는 각 Bounding Box에 Classifier를 이용해 Class 정보 추출 + NMS
- 성능의 개선을 위해 Multi-scale Box Inference
- 이미지의 여러 부분으로부터 결과를 취합 = {bottom, top, left, right, full}
- 낮은 Scale에서 Objectness가 있다고 판단된 부분에 Scale=1.2를 취한 결과를 취합
- Performance가 극적으로 상승
9
Deep Neural Network for Object Detection
요약
- Binary Mask
- 뉴럴넷에 Forward된 결과는 Binary Mask임
- Scale=1의 여러 위치={full, left, right, top, bottom}으로부터 Binary Mask를 얻음
- Scale을 높여가며 여러 결과를 얻어 취합함
- Binary Mask를 Bounding Box로 변환함
- Bounding Box Region에 Classifier 적용해 Class 정보 추가함
- 즉, Binary Mask를 얻기 위해서도 여러 번의 Neural Network 를 사용하고, 결과로 나온 Bounding Box 각각에 대해서
Classifier를 수행함
10
OverFeat: Integrated Recognition, Localization and
Detection using Convolutional Networks
ILSVRC2013 Localization Task Winner
Class 별로 Box(x, y, w, h)를 출력하는 Network를 따로 학습
Sliding Window Fashion
11
‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’
- 특정 Class의 1개의 Box만을 출력하는 Neural Network를 Sliding하여 결과 취합하자
- Class마다 Neural Network를 따로 학습하자
- 즉, Class 개수만큼의 Neural Network가 (D x D) 이미지를 여러 Scale로 Sliding하며 얻은 모든 결과로 Detection
(x, y, w, h)
OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks
12
Image Deep NN for Specific Class 1개의 좌표
OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks
‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’
- Multi-scale Sliding Window
- 각 클래스별 Regressor를 이용
- 여러 Regressor가 Multi-scale로 Sliding 함
- Regressor는 미리 학습된 Classification의 Output Layer만 변경
- Conv Layer가 OverFeat이라고 불리는 Multi-scale Feature Extractor
- Conv Layer는 Classification Task를 위해 학습되어 있는 상태
- Conv Layer는 Classifier / Localizer가 서로 공유(no backpropagation)
- Output Layer를 4개의 좌표(Bouding Box)의 L2 Loss로 수정
- NN의 Output이 1개의 Bounding Box만 Prediction함
- Class별로 따로 NN을 학습시켰음 : 1000개
- 이러한 이유로 Conv Layer는 BackProp 하지 않고 공유함
- Training Strategy
- GT Bouding Box가 50% 이상 남아있는 경우만 Positive로 사용
- Random하게 Negative Sample을 선별해서 사용
- 여러 번의 NN Forward결과를 취합하는 Heuristic한 알고리즘 제시
13
OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks
Sliding Window로 여러 Regressor를 수행
Resolution을 높인 Window 선정함
Sliding Window로 여러 Regressor를 수행(다른 Scale)
Merged Result
14
Summary : Before RCNN
‘Multiple-Class / Multiple-Bounding Boxes 환경에서 Neural Network로 Detection을 어떻게 할까?’
- NN으로 Bounding Box를 한번에 찾도록 Formulation하기는 어렵지만 시도가 없었던 것은 아님
- 주로 Localization에서 1 or Few Boxes만 Regression하는 것이 많음
- 예를 들면 얼굴 1개만 찾으면 되는 문제라던가.
- Object Detection에는 몇 가지 방법들이 제시되었음
- Solution #1. OverFeat. 하나의 Bounding Box를 찾는 여러 모델을 Sliding Window로 반복 처리
- Solution #2. Google’s Model. Class-Agnostic Multiple Bounding Box를 먼저 찾고 Classification은 각각
후처리
15
From RCNN
DPM 등 기존 Detection Pipeline을 충실히 따르는 R-CNN류 Detection Model.
16
R-CNN류는 아래와 같이 기존에 존재하던 Detection Pipeline을 갖춤
(1) Hypothesize Bounding Boxes (Proposals)
- Image로부터 Object가 존재할 적절한 위치에 Bounding Box Proposal
- RCNN류는 적게는 수 백개에서 수 만개의 Proposal을 반복 처리
(2) Resampling pixels / features for each boxes
- 모든 Proposal 위치에서 이미지 / Feature Level에서 Crop
(3) Classifier / Bounding Box Regressor
- 2의 정보를 Classifier와 Bounding Box Regressor로 처리
RCNN Overview
17
따라서 RCNN류의 성능 개선은
- (1) Bounding Box Proposal의 수를
줄이면서 정확하게
- (2/3) Feature 등을 개선하거나
Post-Processing을 정확하게
함으로써 개선할 수 있음
Bounding Box
Regressor
좌표 : (x, y, w, h)
1 2 3
(1) Hypothesize bnds(Proposals) → (2) Resampling pixels / features for each boxes → (3) Classifier / Bnd Regressor
Rich feature hierarchies for accurate object detection and semantic segmentation
- Selective Search, SVM을 각 1, 3의 과정에 쓰고 2의 과정에서 이미지를 Crop하여 DNN으로 Feature를 추출
Improving 2 or 3
Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition
- 2, 3 과정의 개선 : 이미지를 반복 Crop해서 DNN Feature를 얻는 과정 개선, SPP Layer의 소개
Object detection via a multi-region & semantic segmentation-aware CNN model
- 2 과정의 개선 : Feature와 Context 정보를 보강
Inside-outside net: Detecting objects in context with skip pooling and recurrent neural networks
- 2 과정의 개선 : Feature Level 다양화, RNN으로 Context Feature Extract하여 Concat
Fast R-CNN
- RCNN에서 3에 사용된 SVM을 Neural Network로 개선해서 성능과 속도를 높임 (2, 3 과정이 1개의 Neural Network)
RCNN Overview
18
(1) Hypothesize bnds(Proposals) → (2) Resampling pixels / features for each boxes → (3) Classifier / Bnd Regressor
Improving 1 (Proposals)
R-CNN minus R
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
- Fast RCNN의 1 부분(Selective Search)을 RPN이라는 Neural Network로 교체하되 2,3 과정의 NN과 Weight Share함
- Michael’s Seminar : https://kakao.agit.in/g/300004430/wall/303926704
* Multibox, Edgebox, MSC-Multibox 등 DNN 기반의 방식으로 Proposal 개선하기도 함
Etcs
G-CNN: an Iterative Grid Based Object Detector
Deep Residual Learning for Image Recognition
- Faster R-CNN +++ 의 소개
R-FCN: Object Detection via Region-based Fully Convolutional Networks
RCNN Overview
19
Rich feature hierarchies for accurate object detection
and Semantic segmentation
ILSVRC2013 Detection Task Winner
R-CNN = Region Proposals + CNN
Deep Feature를 사용해서 기존 Object Detection Pipeline을 충실히 따름
20
배경 : ImageNet Classification Task의 빠른 개선 결과들을 Object Detection에서 Beneficial하게 만들 수 없을까?
- 기존에는 SIFT / HOG 같은 Blockwise orientation histogram을 Feature로 사용
- 훌륭한 Classification Model의 Deep Feature를 사용해보자
기존에 많이 사용되던 Detection Pipeline에서 출발함
- Localization을 Regression 문제로 보는 Frame이 대세가 아니었음
- Multiple Box Regression인 <Deep Neural Network for Object Detection>의 mAP가 R-CNN의 절반 수준
- Localization 문제에 대한 다양한 Formulation 방법이 제시되기 이전임
Rich feature hierarchies for accurate object detection and Semantic segmentation
21
Object Proposal
- 이미지 내의 Edge, Color, Texture 등 정보를 통해서 Object가 존재한다고 추정할 만한 곳에 Proposal을 제시함
- 일종의 가설 ‘이것이 물체인가'를 제시하는 것(Objectness Hypothesis)
- Selective Search, CPMC, Multibox 등
- 각 Proposal이 물체인지 검증하고, 물체의 위치를 정확하게 보정해내면 Object Detection이 됨
Rich feature hierarchies for accurate object detection and Semantic segmentation
22
Selective Search의 다양한 Scale로부터
Object Proposal(파란박스)이 나오는 예시
Object Detection Pipeline
(1) Hypothesize Bounding Boxes (Proposals)
- Image로부터 Object가 존재할 적절한 위치에 Bounding Box Proposal
- RCNN류는 적게는 수 백개에서 수 만개의 Proposal을 반복 처리 (R-CNN : 2000개)
(2) Resampling pixels / features for each boxes → Deep Feature로의 전환
- 모든 Proposal 위치에서 이미지 / Feature Level에서 Crop
(3) Classifier / Bounding Box Regressor
- 2의 정보를 Classifier와 Bounding Box Regressor로 처리
Rich feature hierarchies for accurate object detection and Semantic segmentation
23
Bounding Box
Regressor
좌표 : (x, y, w, h)
★기존 Feature Extractor의 자리에 Deep Feature로 교체됨★
Region Proposals
- Selective Search Fast Mode로 2k의 Proposal 생성
- Proposal 영역을 227x227로 Warping (Crop & Resize)
R-CNN - Details #1
24
Bounding Box
Regressor
좌표 : (x, y, w, h)
Feature Extraction
- 각 Proposal Region을 Wraping하고, 이후 단계를 반복 수행함
- AlexNet 등 기존 아키텍쳐 사용
- ILSVRC 2012 Classification Task에 대해 Pre-train
- VOC Detection Task에서 GT Warping해서 Fine-tuning (Object Classes + BG Class) → mAP 2~3% ↑↑↑
- (32 Positive + 96 Negative Random Sampling)
- Warped 227x227 RGB Image → 4096d Feature
R-CNN - Details #2
25
Bounding Box
Regressor
좌표 : (x, y, w, h)
Class-Specific Linear SVM
- 카테고리별 Yes / No Classifier (eg. 자동차인가?)
- 학습시 GT Overlap IoU 0.3 기준으로 Positive/Negative 결정함
- 의문 : CNN Feature뒤에 Softmax Classifier 달면 안되는거임? → 성능이 안나온다고 함!
Bounding Box Regression (Optional)
- Linear Regression : (Pool5 Feature + Proposal Coordinates) → Bounding Box
- mAP 3~4% ↑↑↑
- GT 근처의 Proposal만 선별(IoU 0.6)
- 반복수행을 통한 성능개선 없음
R-CNN - Details #3
26
Bounding Box
Regressor
좌표 : (x, y, w, h)
R-CNN - VOC Result
* VOC로의 Fine-tuning과
Bounding Box Regression 중요함
* Feature 변경(Network변경)으로
큰 성능 향상 가능함
27
Fast R-CNN
28
R-CNN Pipeline의 뒷 부분을 개선함
- 이미지 Warping 후 Classification / Regression 하는 부분
- 성능과 속도 개선
Bounding Box
Regressor
좌표 : (x, y, w, h)
★개선된
부분★
Fast R-CNN
29
Bounding Box
Regressor
좌표 : (x, y, w, h)
★개선 포인트2★
↑↑↑ 요 부분을 개선한다면
- 프로포절 수를 줄인다면 처리할
양이 줄어드니까 빨라질 수 있음
- 프로포절의 정확도를 높이면
모델의 전체적인 성능이 올라갈 수
있음
↑↑↑ 요 부분을 개선한다면
- 주어진 프로포절의 질이 일정 수준 이상이라면 성능 향상이 높을 수
있는 부분
- 이미지에서 Proposal 부분들을 반복적으로 Warping하여 CNN을
사용해 피쳐를 뽑는 과정이 매우 비효율적, 속도가 느림
- SVM + Regressor 방식 역시 성능 개선의 포인트가 될 수 있음
Pipeline의 뒷 부분이 개선 포인트로 먼저 선정된 이유?
* MSC-Multibox : 0.5 Overlap 기준 프로포절은 95%의 정확도를 갖음
* R-CNN minus R : 이미지 내용과 관계 없이 Proposal을 뿌리고 R-CNN 돌려도 성능 하락이 크지 않았음
★개선 포인트1★
Fast R-CNN
30
Bounding Box
Regressor
좌표 : (x, y, w, h)
★이 부분에 대한 개선을
제시★
Other Works
Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition
- 이미지를 반복 Crop해서 DNN Feature를 얻는 과정 개선, SPP Layer의 소개, 성능과 속도의 개선
Object detection via a multi-region & semantic segmentation-aware CNN model
- Feature와 Context 정보를 보강해서 성능을 끌어올림
Inside-outside net: Detecting objects in context with skip pooling and recurrent neural networks
- Feature Level 다양화, RNN으로 Context Feature Extract하여 Concat, 성능을 끌어올림
Fast R-CNN
31
Bounding Box
Regressor
좌표 : (x, y, w, h)
★Fast R-CNN이 변화를 준 곳★
1 2
1 : 이미지 레벨에서
Warping하던 것을
Feature 레벨에서
Warping
2 : SVM + Regressor를
Conv Layer 후반에
Softmax + Regressor로
추가
★
★
★
Feature Extraction
- Image 전체를 CNN을 통해 처리 : Conv feature map 생성
- Proposal 에서 생성된 영역을 feature map에 투영
- RoI Pooling Layer : 투영된 feature map의 영역을 ‘fixed length feature’로 변환하는 layer
기존과 비교할 때
- CNN을 반복처리 → 1번만 처리 : 가장 시간을 많이 사용하는 부분 중 하나를 개선함
- RoI Pooling Layer 도입으로 후반 Pipeline이 1개 Network로 변환
- 학습 과정이 Single-Stage로, 모든 네트워크 레이어 학습 가능
- R-CNN에서는 Conv Layer는 Classifier로 학습한 상태로 고정시키고, SVM + Regressor를 학습함
Fast R-CNN : Details #1
32
★
★
★
RoI Pooling Layer
- 이미지 사이즈 : H x W
- 이미지 내의 RoI 사이즈 : h x w
- Conv Feature Map에 위 비율대로 그대로 투영함
- Max-Pooling
Deep ConvNet
- AlexNet, VGG16 등에서 마지막 Pooling Layer 이후를 모두 제거하고 Pretrained Conv Layer를 그대로 가져옴
Fast R-CNN : Details #2
33
★
★
★
Multi-task loss : Softmax
- K+1 Category : K개의 클래스와 BG클래스
- SoftMax : Discrete class probability
Multi-task loss : bbox Regressor
- 각 클래스 별로 Box Regression을 따로 함
Fast R-CNN : Details #3
34
★
★
★
- Objective Function
- RoI영역에 대한 Loss Function 정의
- Class Loss + Localization Loss
- Class Loss는 Log Loss
-
- Localization Loss는 위치에 대한 Smooth L1 Loss
-
- L2가 Gradient가 매우 커질 수 있는 것에
비해서
덜 민감함
- BG Class(u=0)은 제거
Fast R-CNN : Details #4
35
Training Strategy
- N개의 Image를 샘플링하고 R개의 RoI를 일정하게, 이미지당 R/N개씩 가져옴
- Positive RoI를 25%로 유지(IoU Overlap > 0.5)
- Backgound RoI(Negative RoI)를 IoU Overlap [0.1, 0.5) 에서 랜덤 샘플링함
- Lower Bound 0.1 의 역할 : 휴리스틱한 Hard Example Mining
- Object랑 조금이라도 겹쳐 있는 것이 어려움
- 아래는 Horse에 대한 Positive / Hard Negative(BG RoI) 등 비교
Fast R-CNN : Details #5
36
Positive RoI
(IoU Overlap = 1.0)
Hard Negative
(IoU Overlap = 0.3)
Not Used
(IoU Overlap = 0.0)
Fast R-CNN : VOC Result
37
Fast R-CNN : Etcs
38
↑ Proposal에 대한 시간 빠져 있음(1초 내외)
Faster R-CNN: Toward Real-Time Object Detection
with Region Proposal Networks
39
R-CNN Pipeline의 앞 부분을 개선함
- Object Proposal 하는 부분
- 뒷 부분은 Fast R-CNN을 그대로 사용
- 속도와 성능 개선함
- Michael’s Seminar : https://kakao.agit.in/g/300004430/wall/303926704
Bounding Box
Regressor
좌표 : (x, y, w, h)
★Fast R-CNN★★개선된 부분★
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
40
Bounding Box
Regressor
좌표 : (x, y, w, h)
★개선 포인트2★ : Fast R-CNN
↑↑↑ 요 부분을 개선한다면
- 프로포절 수를 줄인다면 처리할
양이 줄어드니까 빨라질 수 있음
- 프로포절의 정확도를 높이면
모델의 전체적인 성능이 올라갈 수
있음
- Selective Search 등의 속도가
Bottleneck
↑↑↑ 요 부분을 개선한다면
- 주어진 프로포절의 질이 일정 수준 이상이라면 성능 향상이 높을 수
있는 부분
- 이미지에서 Proposal 부분들을 반복적으로 Warping하여 CNN을
사용해 피쳐를 뽑는 과정이 매우 비효율적, 속도가 느림
- SVM + Regressor 방식 역시 성능 개선의 포인트가 될 수 있음
★개선 포인트1★
Region Proposal Network(RPN)를 대체하여
속도 및 성능 향상하자
Other Works
R-CNN minus R
- Region Proposal 자체를 안하고 Image-Agnostic한 Proposal로 대체해도 성능 하락이 크게 없음
Multibox(0.2s), Edgebox(0.2s), MSC-Multibox(0.1s~) 등 DNN 기반의 방식으로 Proposal 개선하기도 함
* R-CNN minus R처럼 ‘Cost-Free’하면서도 효과적인 Proposal 방법이 없을까?
→→→ Feature를 뽑기 위해 사용하던 CNN을 공유해서 Region Proposal을 하면 계산 비용이 매우 적음!
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
41
Bounding Box
Regressor
좌표 : (x, y, w, h)
★이곳을 개선하자★
Fast R-CNN
- 이미지 전체 레벨에서 Conv Feature를 CNN으로 생성
Faster R-CNN
- Conv Feature를 RPN에도 사용하고,
Classifier + Regressor에도 사용하자.
- 1장 처리 속도가 200ms 수준까지도 가능해짐
RPN : Region Proposal Network
- Image를 받아서 Object Location 목록과 Score 목록을 출력
- Location마다 최대 k개의 Proposal
- FCN : Fully Convolutional Network
- “p.3: To generate region proposals, we slide a small network over the convolutional feature map output by the last
shared convolutional layer.” : 3x3 Convolutional하게 처리!
- Box Regression과 Box Classification 2갈래로 출력함
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
42
RPN : Region Proposal Network : Fully Convolution?
- Sliding Window
- 3x3 Convolutional하게 처리!
- Box Regression과 Box Classification 2갈래로 출력함
- 1x1 Convolution 이용함
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
43
3x3 Convolution
1x1 Convolution
Fully Convolutional
RPN : Region Proposal Network : Anchor?
- ‘An anchor is centered at the sliding window in question’
- 3개의 Scale과 3개의 Aspect Ratio = 9개 (=k)
- Convolution Feature Map(WxH) = W x H x 9 개의 Anchor
- ‘The k proposals are parameterized relative to k reference boxes‘
- k개의 Box/Class는 사전에 정의된 Anchor와 1:1 Mapping
- Translation-Invariant Anchors
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
44
즉, 실제로 Anchor Box로 Sliding하는 것이 아님.
Network가 출력할 k개의 박스 중 어느 곳에서 값을
출력할지 Mapping하는 용도임.
(Anchor 없이 학습하면 k개에 Assign되는 박스가
뒤죽박죽이어서학습이 어려울 수 있는 등의
문제가 있음)
RPN : Region Proposal Network : Loss?
- Anchor가 Activate되는 조건
- Anchor중에서 GT와 가장 높은 IoU인 경우
- IoU Overlap > 0.7 인 경우
- 즉, 1개의 GT가 여러개의 Anchor에 Assignable함
- IoU Overlap < 0.3 인 경우 BG Class
- IoU ⊂ [0.3~0.7] 인 경우 Loss 계산 X
- Objective Function
에 의해 부분이 활성화/비활성화됨.
: smooth L1
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
45
RPN : Region Proposal Network : Mini-batch?
- 1장의 이미지에 여러개의 Positive / Negative 존재
- Negative가 훨씬 많겠지
- 랜덤하게 256개의 Anchor를 선별함
- Positive : Negative = 1: 1
- 만약 Positive 개수가 128개에 모자르면, 나머지를 Negative로 채움
RPN : Region Proposal Network : Alternating Training?
- RPN과 Fast R-CNN이 서로 Convolutional Layer를 공유
- 둘 다 Convolutional Layer를 업데이트하려고 할텐데… → 학습 방법 필요
- Alternating Training
- 1. RPN을 먼저 학습함
- 2. Fast R-CNN 학습함
- 3. 2에서 학습된 Network를 RPN학습하는 초기 Network로 사용.
이 때 공유되는 Convolutional Layer는 Update하지 않음
- 4. Fast R-CNN 학습함
이 때 공유되는 Convolutional Layer는 Update하지 않음
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
46
Result - RPN자체는 SS에 비해서 Recall 높지만 Bounding Box 정확도가 떨어짐
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
47
Result - 5fps 수준의 Detector (Fast R-CNN대비 10배 향상)
Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks
48
Faster R-CNN 그리고...
Faster R-CNN 등장 이후 몇가지 논문 제시됨
G-CNN: an Iterative Grid Based Object Detector
Deep Residual Learning for Image Recognition
- ResNet 논문
- Faster RCNN+++ 의 소개*
- ResNet 101사용
- Competition용으로 Box refinement, Global context, Multi-scale 등 추가하고 VOC 2007에서 85.6%*
R-FCN: Object Detection via Region-based Fully Convolutional Networks ★★★
- Faster R-CNN을 Fully Convolutional 하게 변경*
- Faster R-CNN+++ 과 성능 유사(VOC 2007 mAP 83.6%, 170ms)
49
최신 논문(SSD, MSC-MultiBox, …)등에서는 비슷한 형태의 FCN을 사용하고 있음
R-FCN: Object Detection via Region-based Fully Convolutional Networks
50
To be continued.
Object Proposals by DNN
R-CNN이 발전하는 동안 딥러닝을 활용한 새로운 Object Proposal 방법들도 제시됨
Papers
Multibox - Scalable Object Detection using Deep Neural Networks
Edge Boxes: Locating Object Proposals from Edges
MSC-Multibox - Scalable, High-Quality Object Detection
DeepBox: Learning Objectness With Convolutional Networks
...
51
“Multibox”
Scalable Object Detection using Deep Neural Networks
52
OverFeat이 ILSVRC2012에서 Localization Task에서 1st
→ 1개의 Bounding Box Regression하는 Neural Network
→ Naive하게 Sliding해서 여러 Object의 위치를 찾음
여러 Object의 위치를 Single Network Forwarding으로 찾게한 것이 큰 의의
여러 Object를 한번에 Localization할 수 있는 Formulation?
- OverFeat : 4점(x, y, w, h)를 Regression
- 변수를 그냥 막 늘려서 여러 점을 Regression할 순 없을까? → N개의 박스?
- Training하는 과정에서 여러 GT와 여러 Bounding Box가 어떻게 Matching되어야할까?
- 학습을 위해서는 1번 박스가 2번 박스에 비해서 좌상단에 있어야 된다거나 하는 조건이 붙어야할 것
- N개의 박스의 자유도가 높으면 학습이 아예 되지 않을 수도 있음
MultiBox: Scalable Object Detection using Deep Neural Networks
53
MultiBox : Objective Function
- N개의 Bounding Box 과 각각의 Confidence Score 를 출력함
MultiBox: Scalable Object Detection using Deep Neural Networks
54
Bounding Box : L2 Loss
Confidence Loss
MultiBox : Prior와 Matching의 제안 ★ ★ ★
- Prior
- GT Location 데이터로 K개의 Clustering 만듦
- Clustering의 중심(Centroid)가 K개 Prior가 됨
- ‘free-floating’하는 여러 개의 박스들이 아님
- 논문에서는 K=100 또는 K=200 사용함
- Prior 개수 = 네트워크가 출력하는 Bounding Box 개수
- Matching
- “instead of matching the N ground truth locations with the K predictions,
we find the best match between the K priors and the ground truth.”
- 즉, K개의 Prior가 Activate/Deactivate되면서 뉴럴넷의 해당 노드에서 적절한 Output을 주는 것
- “We have found that without prior matching, the convergence speed and quality of our models were
significantly lower.”
Result
- 기존 다른 방법과 성능이 유사하면서도 한번에 여러개의 Bounding Box를 출력하게 함
- 훨씬 적은 계산 비용!
MultiBox: Scalable Object Detection using Deep Neural Networks
55
“In the future, we hope to be able to fold the localization and recognition paths into a single
network, such that we would be able to extract both location and class label information in a single
feed-forward pass through the network. Even in its current state, the two-pass procedure (localiza-
tion network followed by categorization network) entails 5- 10 network evaluations. Importantly,
this number does not scale linearly with the number of classes to be recognized, which still makes
the proposed approach very competitive with DPM-like approaches.”
MultiBox: Scalable Object Detection using Deep Neural Networks
56
“MSC-Multibox”
Scalable, High-Quality Object Detection
57
Multibox가 Multiple Bounding Box Regression하는 좋은 방법을 제시.
MSC-MultiBox는 ‘Convolutional Prior’라는 개념을 도입하여 성능 향상★
- 기존과 Prior 개념 조금 다름
- Convolutional Layer에 Multi-Scale Feature Map 만듦
Single Shot Detectors Overview
‘Multiple-Class / Multiple-Bounding Boxes 환경에서 Neural Network로 Detection을 어떻게 할까?’
+
* Single Forwarding만으로.
58
Detection Pipeline이 Single NN Forward인 모델들
대체로 속도 빠르고, Single Module이므로 학습과 유지보수가 쉬움
Overfeat 등 초기 모델들의 문제
- 한번의 NN Forward로 여러 개의 Bounding Box를 찾아내기 어려웠음
- Box가 몇 개 있을지 알 수 없음
- 여러 변수를 무작정 도입해야할까?
- Overfeat : 1개의 NN이 1개의 Class에 대해 1개의 Bounding Box만을 찾아냄
- Google’s Model : Binary Map으로 여러 Bounding Box는 찾았지만 Class 정보는 별도의 Network를 반복해서 수행
Object Proposal 등에서 (Class-Agnostic 하지만) 많은 Bounding Box를 찾아내는 Formulation과 Training Strategy를
소개함
- 기존 모델링의 한계를 넘어 Single Shot Detector들의 등장할 수 있는 배경이 됨
Single Shot Detectors Overview
59
Person 0.87 Dog 0.93
You Only Look Once: Unified, Real-Time Object Detection
- Overfeat, Multibox 등의 Formulation을 발전시키고, Network Architecture의 개선으로 성능 개선
- CVPR2016 : You Only Look Once: Unified, Real-Time Object Detection
- Curtis’s Seminar : https://kakao.agit.in/g/300004430/wall/302933427
SSD: Single Shot MultiBox Detector
- Faster RCNN 등과 성능이 비등하면서도 YOLO만큼 빠름
- MSC-Multibox 등의 아이디어를 발전시켜 여러 크기의 Feature-Map으로부터 Prediction하는 것이 핵심
Single Shot Detectors Overview
60
Person 0.87 Dog 0.93
You Only Look Once:
Unified, Real-Time Object Detection
61
MultiBox가 K개의 Prior에 Matching하는 형태로 모델링
- 하나의 네트워크로 Multiple Bounding Box Regression하는 최초의 Reasonable한 모델
- 지정된 Prior에만 매칭되므로 자유도가 한정적임
YOLO는 Grid에 Matching하는 형태로 모델링
- 지정된 Prior가 없다는 점이 MultiBox에 비해 자유도가 높아진 부분 (Prior ~= Grid)
- 각 Grid는 1개의 Bounding Box를 Output으로 출력
- 결국 Grid는 49개의 균등하게 자리잡은 Prior와 동일한 개념
- 각 클래스별 Score를 통해 박스의 클래스를 알 수 있음
You Only Look Once: Unified, Real-Time Object Detection
7 x 7 Grid Matching
- 최대 7x7=49개의 Bounding Box 출력 가능
- Object의 중심부에 Matching된 Grid Cell에서 Bounding Box(x,y,w,h) 출력함
- 각 Grid Cell 별로 Class 개수 만큼의 확률값 출력
- IoU Overlap이 가장 높은 1개의 Grid에 Matching함
62
You Only Look Once: Unified, Real-Time Object Detection
63
해당 Grid의 Bounding Box에
대한
각 Class별 확률
해당 Grid의 Bounding Box 좌표
You Only Look Once: Unified, Real-Time Object Detection
Objective Function
64
You Only Look Once: Unified, Real-Time Object Detection
Result - VOC Result
* Localization Error가 Classification Error보다 높음
* ‘Strong Spatial Constraints’ 때문 : 1그리드는 1개(혹은 2개)의 Object만을 갖음
65
YOLO는 자연스럽게
Global Context를
사용하기 때문에,
Background 등에 대한
False Positive 적어서, 기존
R-CNN과 함께 사용했을 때
mAP를 크게 상승시킬 수
있음
You Only Look Once: Unified, Real-Time Object Detection
Result - Prediction Speed(VOC 2007)
* Network는 Pooling 대신 Stride를 활용해서 설계됨. 논문 참조.
* CVPR 2016의 논문에서는 약간의 Modeling 수정이 있음
* Hard Data Mining 관련된 내용이 논문에 언급없음
* 1개의 Grid가 아니라 IoU Threshold 이상의 모든 Grid에 매칭했다면 성능이 어떻게 달라질까?
66
SSD: Single Shot MultiBox Detector
67
YOLO 는 MultiBox와 많은 부분이 유사
SSD는 MSC-MultiBox 등과 많은 부분이 유사
Default Box : Prior와 개념 동일
Multiple Convolutional Feature Map으로부터 Prediction함
최초로 기존 Detection Pipeline을 사용하지 않으면서 기존 State-of-art와 비등한 수준의 모델
SSD: Single Shot MultiBox Detector
“Our improvements include using a small convolutional filter to predict object categories and offsets in
bounding box locations, using separate predictors (filters) for different aspect ratio detections, and applying these
filters to multiple feature maps from the later stages of a network in order to perform detection at multiple
scales.”
Small Convolutional Filter(Predictors) for Detector★★
- 3x3 small kernal (MSC-MultiBox와 동일)
- 카테고리에 대한 Score와 Bounding Box 모두를 출력하도록 함
Multi-scale feature maps for Detection★★★
- Add Multiple Convolutional Feature Layers for ‘Multiple Scale of Object’
68
SSD: Single Shot MultiBox Detector
Default Boxes and Aspect Ratios
- k개의 default box 가정(=Prior in MSC-MultiBox)
- MSC-MultiBox와 유사하게 각 Feature map cell마다 Convolutional Filter를 사용해서 Class-Score와 Box Location
출력
- 클래스 개수가 c개, 4개의 좌표(x, y, w, h)이므로 (c+4)k개의 출력
Matching Strategy
- 1. Best jaccard overlap 인 1개의 default box에 assign
- 2. Jaccard overlap > 0.5 인 모든 default box에 assign
(MSC-Multibox와 유사)
69
SSD: Single Shot MultiBox Detector
Training
- Objective Function (Softmax + smooth L1 Loss)
- Hard negative Mining
- Confidence Score로 정렬해서 Positive와 Negative가 최대 1:3이 되도록 샘플링함
(어려운 Hard Negative를 Batch에 넣겠다는 의도)
- MSC-MultiBox처럼 Positive 수가 모자르면 Negative를 더 넣음
* MSC-MultiBox으로부터 아주 다양한 면에서 이어져온 것으로 보임
70
SSD: Single Shot MultiBox Detector
Comparison with YOLO
71
SSD: Single Shot MultiBox Detector
VOC Result
72
* VOC 2007
Hard Negative Mining
Training Region-based Object Detectors with Online Hard Example Mining
- 논문들에서 OHEM이라고 자주 언급
- Heuristic하게 논문마다 다르게 적용하던 Hard Negative Mining기법을 정리했고, 성능 향상 2~3% 이상 있음
Etcs
73
2~3%
히치하이커를 위한 안내서
74
히치하이커 중에 학습도 용이하고 성능도 좋으면서 100ms 이내 응답을 주는 빠른 모델이 필요하면
- SSD Default Model을 쓰세요. VOC 2007 mAP 75%, 50ms 수준
히치하이커 중에 진짜 빨라야되는 경우에는
- SSD Small Model을 쓰세요. VOC 2007 mAP 72%, 20ms 수준
히치하이커 중에 진짜 개빨라야되는 경우에는
- Fast Yolo Model을 쓰세요. VOC 2007 mAP 52.7%, 7ms 수준
히치하이커 중에 성능이 깡패여야되는 경우에는
- R-FCN을 쓰세요. VOC 2007 mAP 79.4%, 120ms 수준
- https://github.com/daijifeng001/r-fcn
히치하이커 중에 느려도 된다 난 미친듯이 성능이 좋아야한다 하는 경우에는
- Faster R-CNN+++의 방법들과 R-FCN을 조합해보기를 권장.
그래도 모르겠다하는 히치하이커는 Curtis Kim에게 illy의 코코넛 한 잔과 함께 찾아오세요
Object Detectors 세상을 여행하는
히치하이커를 위한 안내서
1편(~2016.6)
Object Detectors 세상을 여행하는
히치하이커를 위한 안내서
1편(~2016.6)
Curtis Kim (김일두) @ Kakao
75

Más contenido relacionado

La actualidad más candente

Image segmentation
Image segmentationImage segmentation
Image segmentationRania H
 
Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)Hwa Pyung Kim
 
PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...
PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...
PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...Jinwon Lee
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harrisWael Badawy
 
You only look once (YOLO) : unified real time object detection
You only look once (YOLO) : unified real time object detectionYou only look once (YOLO) : unified real time object detection
You only look once (YOLO) : unified real time object detectionEntrepreneur / Startup
 
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentationtaeseon ryu
 
[Pr12] dann jaejun yoo
[Pr12] dann   jaejun yoo[Pr12] dann   jaejun yoo
[Pr12] dann jaejun yooJaeJun Yoo
 
Anatomy of YOLO - v1
Anatomy of YOLO - v1Anatomy of YOLO - v1
Anatomy of YOLO - v1Jihoon Song
 
[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper review
[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper review[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper review
[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper reviewtaeseon ryu
 
Super resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun YooSuper resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun YooJaeJun Yoo
 
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015Jia-Bin Huang
 
Classification of Breast Masses Using Convolutional Neural Network as Feature...
Classification of Breast Masses Using Convolutional Neural Network as Feature...Classification of Breast Masses Using Convolutional Neural Network as Feature...
Classification of Breast Masses Using Convolutional Neural Network as Feature...Pinaki Ranjan Sarkar
 
You only look once: Unified, real-time object detection (UPC Reading Group)
You only look once: Unified, real-time object detection (UPC Reading Group)You only look once: Unified, real-time object detection (UPC Reading Group)
You only look once: Unified, real-time object detection (UPC Reading Group)Universitat Politècnica de Catalunya
 
Object detection with deep learning
Object detection with deep learningObject detection with deep learning
Object detection with deep learningSushant Shrivastava
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Gaurav Mittal
 

La actualidad más candente (20)

Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)Tutorial on Object Detection (Faster R-CNN)
Tutorial on Object Detection (Faster R-CNN)
 
GoogLeNet Insights
GoogLeNet InsightsGoogLeNet Insights
GoogLeNet Insights
 
Lecture-11.pdf
Lecture-11.pdfLecture-11.pdf
Lecture-11.pdf
 
PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...
PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...
PR-120: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture De...
 
Yolo releases gianmaria
Yolo releases gianmariaYolo releases gianmaria
Yolo releases gianmaria
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harris
 
You only look once (YOLO) : unified real time object detection
You only look once (YOLO) : unified real time object detectionYou only look once (YOLO) : unified real time object detection
You only look once (YOLO) : unified real time object detection
 
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
 
[Pr12] dann jaejun yoo
[Pr12] dann   jaejun yoo[Pr12] dann   jaejun yoo
[Pr12] dann jaejun yoo
 
Anatomy of YOLO - v1
Anatomy of YOLO - v1Anatomy of YOLO - v1
Anatomy of YOLO - v1
 
[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper review
[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper review[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper review
[딥논읽] Meta-Transfer Learning for Zero-Shot Super-Resolution paper review
 
Super resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun YooSuper resolution in deep learning era - Jaejun Yoo
Super resolution in deep learning era - Jaejun Yoo
 
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
 
Classification of Breast Masses Using Convolutional Neural Network as Feature...
Classification of Breast Masses Using Convolutional Neural Network as Feature...Classification of Breast Masses Using Convolutional Neural Network as Feature...
Classification of Breast Masses Using Convolutional Neural Network as Feature...
 
Content-based Image Retrieval - Eva Mohedano - UPC Barcelona 2018
Content-based Image Retrieval - Eva Mohedano - UPC Barcelona 2018Content-based Image Retrieval - Eva Mohedano - UPC Barcelona 2018
Content-based Image Retrieval - Eva Mohedano - UPC Barcelona 2018
 
You only look once: Unified, real-time object detection (UPC Reading Group)
You only look once: Unified, real-time object detection (UPC Reading Group)You only look once: Unified, real-time object detection (UPC Reading Group)
You only look once: Unified, real-time object detection (UPC Reading Group)
 
Object detection with deep learning
Object detection with deep learningObject detection with deep learning
Object detection with deep learning
 
Deep Neural Networks (DNN)
Deep Neural Networks (DNN)Deep Neural Networks (DNN)
Deep Neural Networks (DNN)
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
 

Destacado

Q Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object LocalizationQ Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object Localization홍배 김
 
Understanding RCNN Family
Understanding RCNN FamilyUnderstanding RCNN Family
Understanding RCNN Family민기 정
 
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance SegmentationSingle Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance Segmentation홍배 김
 
인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝Jinwon Lee
 

Destacado (6)

Q Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object LocalizationQ Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object Localization
 
Understanding RCNN Family
Understanding RCNN FamilyUnderstanding RCNN Family
Understanding RCNN Family
 
Recurrent Instance Segmentation (UPC Reading Group)
Recurrent Instance Segmentation (UPC Reading Group)Recurrent Instance Segmentation (UPC Reading Group)
Recurrent Instance Segmentation (UPC Reading Group)
 
SSD: Single Shot MultiBox Detector (UPC Reading Group)
SSD: Single Shot MultiBox Detector (UPC Reading Group)SSD: Single Shot MultiBox Detector (UPC Reading Group)
SSD: Single Shot MultiBox Detector (UPC Reading Group)
 
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance SegmentationSingle Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
 
인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝인공지능, 기계학습 그리고 딥러닝
인공지능, 기계학습 그리고 딥러닝
 

Similar a Deep Object Detectors #1 (~2016.6)

Summary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detectionSummary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detection창기 문
 
Summary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detectionSummary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detection창기 문
 
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal NetworksFaster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal NetworksOh Yoojin
 
ICIP 2018 REVIEW
ICIP 2018 REVIEWICIP 2018 REVIEW
ICIP 2018 REVIEWSungMan Cho
 
Deep learning의 이해
Deep learning의 이해Deep learning의 이해
Deep learning의 이해KwangPil Hong
 
Faster R-CNN
Faster R-CNNFaster R-CNN
Faster R-CNNrlawjdgns
 
Deep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesKang Pilsung
 
[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...
[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...
[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...Gyubin Son
 
[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_sparkNAVER D2
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장Sunggon Song
 
FCN to DeepLab.v3+
FCN to DeepLab.v3+FCN to DeepLab.v3+
FCN to DeepLab.v3+Whi Kwon
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderLee Seungeun
 
딥러닝 논문읽기 efficient netv2 논문리뷰
딥러닝 논문읽기 efficient netv2  논문리뷰딥러닝 논문읽기 efficient netv2  논문리뷰
딥러닝 논문읽기 efficient netv2 논문리뷰taeseon ryu
 
OpenCV's Built-in Trackers
OpenCV's Built-in TrackersOpenCV's Built-in Trackers
OpenCV's Built-in TrackersKwonkyuPark
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용Youngjae Kim
 
Rl from scratch part5
Rl from scratch part5Rl from scratch part5
Rl from scratch part5Shinwoo Park
 
Segment Anything
Segment AnythingSegment Anything
Segment Anythingfake can
 
History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AITae Young Lee
 
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...Mad Scientists
 

Similar a Deep Object Detectors #1 (~2016.6) (20)

Summary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detectionSummary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detection
 
Summary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detectionSummary in recent advances in deep learning for object detection
Summary in recent advances in deep learning for object detection
 
Feature Pyramid Network, FPN
Feature Pyramid Network, FPNFeature Pyramid Network, FPN
Feature Pyramid Network, FPN
 
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal NetworksFaster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
 
ICIP 2018 REVIEW
ICIP 2018 REVIEWICIP 2018 REVIEW
ICIP 2018 REVIEW
 
Deep learning의 이해
Deep learning의 이해Deep learning의 이해
Deep learning의 이해
 
Faster R-CNN
Faster R-CNNFaster R-CNN
Faster R-CNN
 
Deep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniquesDeep neural networks cnn rnn_ae_some practical techniques
Deep neural networks cnn rnn_ae_some practical techniques
 
[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...
[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...
[paper review] 손규빈 - Eye in the sky & 3D human pose estimation in video with ...
 
[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark[264] large scale deep-learning_on_spark
[264] large scale deep-learning_on_spark
 
밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장밑바닥부터 시작하는딥러닝 8장
밑바닥부터 시작하는딥러닝 8장
 
FCN to DeepLab.v3+
FCN to DeepLab.v3+FCN to DeepLab.v3+
FCN to DeepLab.v3+
 
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding Autoencoder
 
딥러닝 논문읽기 efficient netv2 논문리뷰
딥러닝 논문읽기 efficient netv2  논문리뷰딥러닝 논문읽기 efficient netv2  논문리뷰
딥러닝 논문읽기 efficient netv2 논문리뷰
 
OpenCV's Built-in Trackers
OpenCV's Built-in TrackersOpenCV's Built-in Trackers
OpenCV's Built-in Trackers
 
Image Deep Learning 실무적용
Image Deep Learning 실무적용Image Deep Learning 실무적용
Image Deep Learning 실무적용
 
Rl from scratch part5
Rl from scratch part5Rl from scratch part5
Rl from scratch part5
 
Segment Anything
Segment AnythingSegment Anything
Segment Anything
 
History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AI
 
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
Face Feature Recognition System with Deep Belief Networks, for Korean/KIISE T...
 

Deep Object Detectors #1 (~2016.6)

  • 1. Object Detectors 세상을 여행하는 히치하이커를 위한 안내서 1편(~2016.6) Object Detectors 세상을 여행하는 히치하이커를 위한 안내서 1편(~2016.6) Curtis Kim (김일두) @ Kakao 1
  • 2. Object Detectors Object Detector를 정리하면서 ‘현재’ 아래와 같은 분류로 모델 및 내용을 정리함 - R-CNN 이전의 모델 - R-CNN 류의 모델 : R-CNN의 모듈들을 개선했거나 유사 구조의 Detection Pipeline을 사용 - Single Shot Detector : 1번의 NN* Forwarding으로 여러 클래스의 여러 물체를 동시 검출 - 기타 Proposal Method / Training 관련 내용들 2* NN : Neural Network
  • 3. Object Detectors 1. Before RCNN a. DPM(Object Detection with Discriminatively TrainedPart Based Models) 등 b. ‘Selective Search for Object Recognition’ c. 2013 : DNN for Object Detection / Localization i. ‘Overfeat’ by Yann Lecun ii. ‘Deep Neural Networks for Object Detection’ by Google 2. From R-CNN (2013~) a. Hypothesize bnds(Proposals) → Resampling pixels / features for each boxes → Classifier / Bnd Regressor b. R-CNN의 성능과 속도의 개선 i. Improving Classifier (Fast R-CNN) ii. Improving Proposals (Faster R-CNN) 3. Single Shot Detectors ★ a. Single NN Forward로 1개 혹은 여러 개의 Bounding Box의 좌표와 Class 정보를 얻자 b. Single-Shot Detector의 성능과 속도의 개선 i. Formulation(Modeling) ii. Improving Feature Maps(+Global Contexts) 4. Etcs 3
  • 4. Before R-CNN ‘Multiple-Class / Multiple-Bounding Box 환경에서 Neural Network로 Detection을 어떻게 할까?’ 4 AlexNet
  • 5. Before R-CNN Not DNN Object Detection with Discriminatively TrainedPart Based Models : DPM, 대표적인 Detection Model Selective Search for Object Recognition : Object Proposal 방식으로 이후 R-CNN 등에서 사용 2013년의 DNN for Object Detection ‘Multiple-Class / Multiple-Bounding Boxes 환경에서 Neural Network로 Detection을 어떻게 할까?’ - 풀리지 않은 질문, Neural Net으로 위 문제를 단순하고 명쾌하게 풀어내지는 못함 Deep Neural Networks for Object Detection - Single Forward로 여러 Bounding Box까지는 얻었지만, 각 Box의 Class는 또 다른 네트워크를 수행하여 얻었음 OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks - Sliding Window 방식으로 각 Class별로 학습된 Regressor를 반복수행함 5
  • 6. Deep Neural Networks for Object Detection Classification 위주의 DNN에 처음으로 Object Detection을 위한 Formulation Binary Mask Regression → Bounding Boxes → Classification for each boxes 6
  • 7. Deep Neural Network for Object Detection - Concept ‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’ - Box가 여러개 일 수 있으니 좌표를 직접 Regression하지 말고, Binary Mask를 Regression하는 방향으로 아이디어! - Bounding Box Binary Mask - 1 for Objectness - {0, 1}로 채워진 (d x d) Output을 통해 Object Bounding Box를 추정 7 Image Deep NN Binary Mask 000111111111000 001111111111000 001111111111100 000011111111100 001111111111110 000011111111100
  • 8. Deep Neural Network for Object Detection - Concept Bounding Box를 직접 Regression하지 않았으니, Binary Mask를 Bounding Box로 변경해야 함 - 여러 개의 Prior(미리 지정된 크기/비율의 사각형)을 Sliding하면서 Score가 높은 Box를 선택함 8 Binary Mask 000111111111000 001111111111000 001111111111100 000011111111100 001111111111110 000011111111100 Bounding Box
  • 9. Deep Neural Network for Object Detection ‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’ - Single Forward NN 을 통해 Multiple Object의 Class / Coordinates를 알 수 있을까? - Binary Mask Regression으로 문제를 변환함 - Alexnet의 Softmax Classifier 대신에 Binary Mask를 L2 Regression 함 - 여러 위치={full, left, right, top, bottom}으로부터 Binary Mask를 얻음 - Binary Mask → Bounding Boxes - 90개의 Prior(=여러 모양의 박스)를 이용해 Sliding하면서 Score가 높은 Bouding Box(>0.5)를 취함 - Score : ‘to measure what portion of the bounding box is covered by the mask’ - Binary Mask의 Resolution이 낮아 정확도 떨어짐 - Class를 모르는 각 Bounding Box에 Classifier를 이용해 Class 정보 추출 + NMS - 성능의 개선을 위해 Multi-scale Box Inference - 이미지의 여러 부분으로부터 결과를 취합 = {bottom, top, left, right, full} - 낮은 Scale에서 Objectness가 있다고 판단된 부분에 Scale=1.2를 취한 결과를 취합 - Performance가 극적으로 상승 9
  • 10. Deep Neural Network for Object Detection 요약 - Binary Mask - 뉴럴넷에 Forward된 결과는 Binary Mask임 - Scale=1의 여러 위치={full, left, right, top, bottom}으로부터 Binary Mask를 얻음 - Scale을 높여가며 여러 결과를 얻어 취합함 - Binary Mask를 Bounding Box로 변환함 - Bounding Box Region에 Classifier 적용해 Class 정보 추가함 - 즉, Binary Mask를 얻기 위해서도 여러 번의 Neural Network 를 사용하고, 결과로 나온 Bounding Box 각각에 대해서 Classifier를 수행함 10
  • 11. OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks ILSVRC2013 Localization Task Winner Class 별로 Box(x, y, w, h)를 출력하는 Network를 따로 학습 Sliding Window Fashion 11
  • 12. ‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’ - 특정 Class의 1개의 Box만을 출력하는 Neural Network를 Sliding하여 결과 취합하자 - Class마다 Neural Network를 따로 학습하자 - 즉, Class 개수만큼의 Neural Network가 (D x D) 이미지를 여러 Scale로 Sliding하며 얻은 모든 결과로 Detection (x, y, w, h) OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks 12 Image Deep NN for Specific Class 1개의 좌표
  • 13. OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks ‘어떻게 Classification이 아닌 Object Detection을 DNN Objective Function으로 Formulate 해야 될까?’ - Multi-scale Sliding Window - 각 클래스별 Regressor를 이용 - 여러 Regressor가 Multi-scale로 Sliding 함 - Regressor는 미리 학습된 Classification의 Output Layer만 변경 - Conv Layer가 OverFeat이라고 불리는 Multi-scale Feature Extractor - Conv Layer는 Classification Task를 위해 학습되어 있는 상태 - Conv Layer는 Classifier / Localizer가 서로 공유(no backpropagation) - Output Layer를 4개의 좌표(Bouding Box)의 L2 Loss로 수정 - NN의 Output이 1개의 Bounding Box만 Prediction함 - Class별로 따로 NN을 학습시켰음 : 1000개 - 이러한 이유로 Conv Layer는 BackProp 하지 않고 공유함 - Training Strategy - GT Bouding Box가 50% 이상 남아있는 경우만 Positive로 사용 - Random하게 Negative Sample을 선별해서 사용 - 여러 번의 NN Forward결과를 취합하는 Heuristic한 알고리즘 제시 13
  • 14. OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks Sliding Window로 여러 Regressor를 수행 Resolution을 높인 Window 선정함 Sliding Window로 여러 Regressor를 수행(다른 Scale) Merged Result 14
  • 15. Summary : Before RCNN ‘Multiple-Class / Multiple-Bounding Boxes 환경에서 Neural Network로 Detection을 어떻게 할까?’ - NN으로 Bounding Box를 한번에 찾도록 Formulation하기는 어렵지만 시도가 없었던 것은 아님 - 주로 Localization에서 1 or Few Boxes만 Regression하는 것이 많음 - 예를 들면 얼굴 1개만 찾으면 되는 문제라던가. - Object Detection에는 몇 가지 방법들이 제시되었음 - Solution #1. OverFeat. 하나의 Bounding Box를 찾는 여러 모델을 Sliding Window로 반복 처리 - Solution #2. Google’s Model. Class-Agnostic Multiple Bounding Box를 먼저 찾고 Classification은 각각 후처리 15
  • 16. From RCNN DPM 등 기존 Detection Pipeline을 충실히 따르는 R-CNN류 Detection Model. 16
  • 17. R-CNN류는 아래와 같이 기존에 존재하던 Detection Pipeline을 갖춤 (1) Hypothesize Bounding Boxes (Proposals) - Image로부터 Object가 존재할 적절한 위치에 Bounding Box Proposal - RCNN류는 적게는 수 백개에서 수 만개의 Proposal을 반복 처리 (2) Resampling pixels / features for each boxes - 모든 Proposal 위치에서 이미지 / Feature Level에서 Crop (3) Classifier / Bounding Box Regressor - 2의 정보를 Classifier와 Bounding Box Regressor로 처리 RCNN Overview 17 따라서 RCNN류의 성능 개선은 - (1) Bounding Box Proposal의 수를 줄이면서 정확하게 - (2/3) Feature 등을 개선하거나 Post-Processing을 정확하게 함으로써 개선할 수 있음 Bounding Box Regressor 좌표 : (x, y, w, h) 1 2 3
  • 18. (1) Hypothesize bnds(Proposals) → (2) Resampling pixels / features for each boxes → (3) Classifier / Bnd Regressor Rich feature hierarchies for accurate object detection and semantic segmentation - Selective Search, SVM을 각 1, 3의 과정에 쓰고 2의 과정에서 이미지를 Crop하여 DNN으로 Feature를 추출 Improving 2 or 3 Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition - 2, 3 과정의 개선 : 이미지를 반복 Crop해서 DNN Feature를 얻는 과정 개선, SPP Layer의 소개 Object detection via a multi-region & semantic segmentation-aware CNN model - 2 과정의 개선 : Feature와 Context 정보를 보강 Inside-outside net: Detecting objects in context with skip pooling and recurrent neural networks - 2 과정의 개선 : Feature Level 다양화, RNN으로 Context Feature Extract하여 Concat Fast R-CNN - RCNN에서 3에 사용된 SVM을 Neural Network로 개선해서 성능과 속도를 높임 (2, 3 과정이 1개의 Neural Network) RCNN Overview 18
  • 19. (1) Hypothesize bnds(Proposals) → (2) Resampling pixels / features for each boxes → (3) Classifier / Bnd Regressor Improving 1 (Proposals) R-CNN minus R Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks - Fast RCNN의 1 부분(Selective Search)을 RPN이라는 Neural Network로 교체하되 2,3 과정의 NN과 Weight Share함 - Michael’s Seminar : https://kakao.agit.in/g/300004430/wall/303926704 * Multibox, Edgebox, MSC-Multibox 등 DNN 기반의 방식으로 Proposal 개선하기도 함 Etcs G-CNN: an Iterative Grid Based Object Detector Deep Residual Learning for Image Recognition - Faster R-CNN +++ 의 소개 R-FCN: Object Detection via Region-based Fully Convolutional Networks RCNN Overview 19
  • 20. Rich feature hierarchies for accurate object detection and Semantic segmentation ILSVRC2013 Detection Task Winner R-CNN = Region Proposals + CNN Deep Feature를 사용해서 기존 Object Detection Pipeline을 충실히 따름 20
  • 21. 배경 : ImageNet Classification Task의 빠른 개선 결과들을 Object Detection에서 Beneficial하게 만들 수 없을까? - 기존에는 SIFT / HOG 같은 Blockwise orientation histogram을 Feature로 사용 - 훌륭한 Classification Model의 Deep Feature를 사용해보자 기존에 많이 사용되던 Detection Pipeline에서 출발함 - Localization을 Regression 문제로 보는 Frame이 대세가 아니었음 - Multiple Box Regression인 <Deep Neural Network for Object Detection>의 mAP가 R-CNN의 절반 수준 - Localization 문제에 대한 다양한 Formulation 방법이 제시되기 이전임 Rich feature hierarchies for accurate object detection and Semantic segmentation 21
  • 22. Object Proposal - 이미지 내의 Edge, Color, Texture 등 정보를 통해서 Object가 존재한다고 추정할 만한 곳에 Proposal을 제시함 - 일종의 가설 ‘이것이 물체인가'를 제시하는 것(Objectness Hypothesis) - Selective Search, CPMC, Multibox 등 - 각 Proposal이 물체인지 검증하고, 물체의 위치를 정확하게 보정해내면 Object Detection이 됨 Rich feature hierarchies for accurate object detection and Semantic segmentation 22 Selective Search의 다양한 Scale로부터 Object Proposal(파란박스)이 나오는 예시
  • 23. Object Detection Pipeline (1) Hypothesize Bounding Boxes (Proposals) - Image로부터 Object가 존재할 적절한 위치에 Bounding Box Proposal - RCNN류는 적게는 수 백개에서 수 만개의 Proposal을 반복 처리 (R-CNN : 2000개) (2) Resampling pixels / features for each boxes → Deep Feature로의 전환 - 모든 Proposal 위치에서 이미지 / Feature Level에서 Crop (3) Classifier / Bounding Box Regressor - 2의 정보를 Classifier와 Bounding Box Regressor로 처리 Rich feature hierarchies for accurate object detection and Semantic segmentation 23 Bounding Box Regressor 좌표 : (x, y, w, h) ★기존 Feature Extractor의 자리에 Deep Feature로 교체됨★
  • 24. Region Proposals - Selective Search Fast Mode로 2k의 Proposal 생성 - Proposal 영역을 227x227로 Warping (Crop & Resize) R-CNN - Details #1 24 Bounding Box Regressor 좌표 : (x, y, w, h)
  • 25. Feature Extraction - 각 Proposal Region을 Wraping하고, 이후 단계를 반복 수행함 - AlexNet 등 기존 아키텍쳐 사용 - ILSVRC 2012 Classification Task에 대해 Pre-train - VOC Detection Task에서 GT Warping해서 Fine-tuning (Object Classes + BG Class) → mAP 2~3% ↑↑↑ - (32 Positive + 96 Negative Random Sampling) - Warped 227x227 RGB Image → 4096d Feature R-CNN - Details #2 25 Bounding Box Regressor 좌표 : (x, y, w, h)
  • 26. Class-Specific Linear SVM - 카테고리별 Yes / No Classifier (eg. 자동차인가?) - 학습시 GT Overlap IoU 0.3 기준으로 Positive/Negative 결정함 - 의문 : CNN Feature뒤에 Softmax Classifier 달면 안되는거임? → 성능이 안나온다고 함! Bounding Box Regression (Optional) - Linear Regression : (Pool5 Feature + Proposal Coordinates) → Bounding Box - mAP 3~4% ↑↑↑ - GT 근처의 Proposal만 선별(IoU 0.6) - 반복수행을 통한 성능개선 없음 R-CNN - Details #3 26 Bounding Box Regressor 좌표 : (x, y, w, h)
  • 27. R-CNN - VOC Result * VOC로의 Fine-tuning과 Bounding Box Regression 중요함 * Feature 변경(Network변경)으로 큰 성능 향상 가능함 27
  • 28. Fast R-CNN 28 R-CNN Pipeline의 뒷 부분을 개선함 - 이미지 Warping 후 Classification / Regression 하는 부분 - 성능과 속도 개선 Bounding Box Regressor 좌표 : (x, y, w, h) ★개선된 부분★
  • 29. Fast R-CNN 29 Bounding Box Regressor 좌표 : (x, y, w, h) ★개선 포인트2★ ↑↑↑ 요 부분을 개선한다면 - 프로포절 수를 줄인다면 처리할 양이 줄어드니까 빨라질 수 있음 - 프로포절의 정확도를 높이면 모델의 전체적인 성능이 올라갈 수 있음 ↑↑↑ 요 부분을 개선한다면 - 주어진 프로포절의 질이 일정 수준 이상이라면 성능 향상이 높을 수 있는 부분 - 이미지에서 Proposal 부분들을 반복적으로 Warping하여 CNN을 사용해 피쳐를 뽑는 과정이 매우 비효율적, 속도가 느림 - SVM + Regressor 방식 역시 성능 개선의 포인트가 될 수 있음 Pipeline의 뒷 부분이 개선 포인트로 먼저 선정된 이유? * MSC-Multibox : 0.5 Overlap 기준 프로포절은 95%의 정확도를 갖음 * R-CNN minus R : 이미지 내용과 관계 없이 Proposal을 뿌리고 R-CNN 돌려도 성능 하락이 크지 않았음 ★개선 포인트1★
  • 30. Fast R-CNN 30 Bounding Box Regressor 좌표 : (x, y, w, h) ★이 부분에 대한 개선을 제시★ Other Works Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition - 이미지를 반복 Crop해서 DNN Feature를 얻는 과정 개선, SPP Layer의 소개, 성능과 속도의 개선 Object detection via a multi-region & semantic segmentation-aware CNN model - Feature와 Context 정보를 보강해서 성능을 끌어올림 Inside-outside net: Detecting objects in context with skip pooling and recurrent neural networks - Feature Level 다양화, RNN으로 Context Feature Extract하여 Concat, 성능을 끌어올림
  • 31. Fast R-CNN 31 Bounding Box Regressor 좌표 : (x, y, w, h) ★Fast R-CNN이 변화를 준 곳★ 1 2 1 : 이미지 레벨에서 Warping하던 것을 Feature 레벨에서 Warping 2 : SVM + Regressor를 Conv Layer 후반에 Softmax + Regressor로 추가 ★ ★ ★
  • 32. Feature Extraction - Image 전체를 CNN을 통해 처리 : Conv feature map 생성 - Proposal 에서 생성된 영역을 feature map에 투영 - RoI Pooling Layer : 투영된 feature map의 영역을 ‘fixed length feature’로 변환하는 layer 기존과 비교할 때 - CNN을 반복처리 → 1번만 처리 : 가장 시간을 많이 사용하는 부분 중 하나를 개선함 - RoI Pooling Layer 도입으로 후반 Pipeline이 1개 Network로 변환 - 학습 과정이 Single-Stage로, 모든 네트워크 레이어 학습 가능 - R-CNN에서는 Conv Layer는 Classifier로 학습한 상태로 고정시키고, SVM + Regressor를 학습함 Fast R-CNN : Details #1 32 ★ ★ ★
  • 33. RoI Pooling Layer - 이미지 사이즈 : H x W - 이미지 내의 RoI 사이즈 : h x w - Conv Feature Map에 위 비율대로 그대로 투영함 - Max-Pooling Deep ConvNet - AlexNet, VGG16 등에서 마지막 Pooling Layer 이후를 모두 제거하고 Pretrained Conv Layer를 그대로 가져옴 Fast R-CNN : Details #2 33 ★ ★ ★
  • 34. Multi-task loss : Softmax - K+1 Category : K개의 클래스와 BG클래스 - SoftMax : Discrete class probability Multi-task loss : bbox Regressor - 각 클래스 별로 Box Regression을 따로 함 Fast R-CNN : Details #3 34 ★ ★ ★
  • 35. - Objective Function - RoI영역에 대한 Loss Function 정의 - Class Loss + Localization Loss - Class Loss는 Log Loss - - Localization Loss는 위치에 대한 Smooth L1 Loss - - L2가 Gradient가 매우 커질 수 있는 것에 비해서 덜 민감함 - BG Class(u=0)은 제거 Fast R-CNN : Details #4 35
  • 36. Training Strategy - N개의 Image를 샘플링하고 R개의 RoI를 일정하게, 이미지당 R/N개씩 가져옴 - Positive RoI를 25%로 유지(IoU Overlap > 0.5) - Backgound RoI(Negative RoI)를 IoU Overlap [0.1, 0.5) 에서 랜덤 샘플링함 - Lower Bound 0.1 의 역할 : 휴리스틱한 Hard Example Mining - Object랑 조금이라도 겹쳐 있는 것이 어려움 - 아래는 Horse에 대한 Positive / Hard Negative(BG RoI) 등 비교 Fast R-CNN : Details #5 36 Positive RoI (IoU Overlap = 1.0) Hard Negative (IoU Overlap = 0.3) Not Used (IoU Overlap = 0.0)
  • 37. Fast R-CNN : VOC Result 37
  • 38. Fast R-CNN : Etcs 38 ↑ Proposal에 대한 시간 빠져 있음(1초 내외)
  • 39. Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 39 R-CNN Pipeline의 앞 부분을 개선함 - Object Proposal 하는 부분 - 뒷 부분은 Fast R-CNN을 그대로 사용 - 속도와 성능 개선함 - Michael’s Seminar : https://kakao.agit.in/g/300004430/wall/303926704 Bounding Box Regressor 좌표 : (x, y, w, h) ★Fast R-CNN★★개선된 부분★
  • 40. Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 40 Bounding Box Regressor 좌표 : (x, y, w, h) ★개선 포인트2★ : Fast R-CNN ↑↑↑ 요 부분을 개선한다면 - 프로포절 수를 줄인다면 처리할 양이 줄어드니까 빨라질 수 있음 - 프로포절의 정확도를 높이면 모델의 전체적인 성능이 올라갈 수 있음 - Selective Search 등의 속도가 Bottleneck ↑↑↑ 요 부분을 개선한다면 - 주어진 프로포절의 질이 일정 수준 이상이라면 성능 향상이 높을 수 있는 부분 - 이미지에서 Proposal 부분들을 반복적으로 Warping하여 CNN을 사용해 피쳐를 뽑는 과정이 매우 비효율적, 속도가 느림 - SVM + Regressor 방식 역시 성능 개선의 포인트가 될 수 있음 ★개선 포인트1★ Region Proposal Network(RPN)를 대체하여 속도 및 성능 향상하자
  • 41. Other Works R-CNN minus R - Region Proposal 자체를 안하고 Image-Agnostic한 Proposal로 대체해도 성능 하락이 크게 없음 Multibox(0.2s), Edgebox(0.2s), MSC-Multibox(0.1s~) 등 DNN 기반의 방식으로 Proposal 개선하기도 함 * R-CNN minus R처럼 ‘Cost-Free’하면서도 효과적인 Proposal 방법이 없을까? →→→ Feature를 뽑기 위해 사용하던 CNN을 공유해서 Region Proposal을 하면 계산 비용이 매우 적음! Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 41 Bounding Box Regressor 좌표 : (x, y, w, h) ★이곳을 개선하자★
  • 42. Fast R-CNN - 이미지 전체 레벨에서 Conv Feature를 CNN으로 생성 Faster R-CNN - Conv Feature를 RPN에도 사용하고, Classifier + Regressor에도 사용하자. - 1장 처리 속도가 200ms 수준까지도 가능해짐 RPN : Region Proposal Network - Image를 받아서 Object Location 목록과 Score 목록을 출력 - Location마다 최대 k개의 Proposal - FCN : Fully Convolutional Network - “p.3: To generate region proposals, we slide a small network over the convolutional feature map output by the last shared convolutional layer.” : 3x3 Convolutional하게 처리! - Box Regression과 Box Classification 2갈래로 출력함 Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 42
  • 43. RPN : Region Proposal Network : Fully Convolution? - Sliding Window - 3x3 Convolutional하게 처리! - Box Regression과 Box Classification 2갈래로 출력함 - 1x1 Convolution 이용함 Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 43 3x3 Convolution 1x1 Convolution Fully Convolutional
  • 44. RPN : Region Proposal Network : Anchor? - ‘An anchor is centered at the sliding window in question’ - 3개의 Scale과 3개의 Aspect Ratio = 9개 (=k) - Convolution Feature Map(WxH) = W x H x 9 개의 Anchor - ‘The k proposals are parameterized relative to k reference boxes‘ - k개의 Box/Class는 사전에 정의된 Anchor와 1:1 Mapping - Translation-Invariant Anchors Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 44 즉, 실제로 Anchor Box로 Sliding하는 것이 아님. Network가 출력할 k개의 박스 중 어느 곳에서 값을 출력할지 Mapping하는 용도임. (Anchor 없이 학습하면 k개에 Assign되는 박스가 뒤죽박죽이어서학습이 어려울 수 있는 등의 문제가 있음)
  • 45. RPN : Region Proposal Network : Loss? - Anchor가 Activate되는 조건 - Anchor중에서 GT와 가장 높은 IoU인 경우 - IoU Overlap > 0.7 인 경우 - 즉, 1개의 GT가 여러개의 Anchor에 Assignable함 - IoU Overlap < 0.3 인 경우 BG Class - IoU ⊂ [0.3~0.7] 인 경우 Loss 계산 X - Objective Function 에 의해 부분이 활성화/비활성화됨. : smooth L1 Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 45
  • 46. RPN : Region Proposal Network : Mini-batch? - 1장의 이미지에 여러개의 Positive / Negative 존재 - Negative가 훨씬 많겠지 - 랜덤하게 256개의 Anchor를 선별함 - Positive : Negative = 1: 1 - 만약 Positive 개수가 128개에 모자르면, 나머지를 Negative로 채움 RPN : Region Proposal Network : Alternating Training? - RPN과 Fast R-CNN이 서로 Convolutional Layer를 공유 - 둘 다 Convolutional Layer를 업데이트하려고 할텐데… → 학습 방법 필요 - Alternating Training - 1. RPN을 먼저 학습함 - 2. Fast R-CNN 학습함 - 3. 2에서 학습된 Network를 RPN학습하는 초기 Network로 사용. 이 때 공유되는 Convolutional Layer는 Update하지 않음 - 4. Fast R-CNN 학습함 이 때 공유되는 Convolutional Layer는 Update하지 않음 Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 46
  • 47. Result - RPN자체는 SS에 비해서 Recall 높지만 Bounding Box 정확도가 떨어짐 Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 47
  • 48. Result - 5fps 수준의 Detector (Fast R-CNN대비 10배 향상) Faster R-CNN: Toward Real-Time Object Detection with Region Proposal Networks 48
  • 49. Faster R-CNN 그리고... Faster R-CNN 등장 이후 몇가지 논문 제시됨 G-CNN: an Iterative Grid Based Object Detector Deep Residual Learning for Image Recognition - ResNet 논문 - Faster RCNN+++ 의 소개* - ResNet 101사용 - Competition용으로 Box refinement, Global context, Multi-scale 등 추가하고 VOC 2007에서 85.6%* R-FCN: Object Detection via Region-based Fully Convolutional Networks ★★★ - Faster R-CNN을 Fully Convolutional 하게 변경* - Faster R-CNN+++ 과 성능 유사(VOC 2007 mAP 83.6%, 170ms) 49
  • 50. 최신 논문(SSD, MSC-MultiBox, …)등에서는 비슷한 형태의 FCN을 사용하고 있음 R-FCN: Object Detection via Region-based Fully Convolutional Networks 50 To be continued.
  • 51. Object Proposals by DNN R-CNN이 발전하는 동안 딥러닝을 활용한 새로운 Object Proposal 방법들도 제시됨 Papers Multibox - Scalable Object Detection using Deep Neural Networks Edge Boxes: Locating Object Proposals from Edges MSC-Multibox - Scalable, High-Quality Object Detection DeepBox: Learning Objectness With Convolutional Networks ... 51
  • 52. “Multibox” Scalable Object Detection using Deep Neural Networks 52 OverFeat이 ILSVRC2012에서 Localization Task에서 1st → 1개의 Bounding Box Regression하는 Neural Network → Naive하게 Sliding해서 여러 Object의 위치를 찾음 여러 Object의 위치를 Single Network Forwarding으로 찾게한 것이 큰 의의
  • 53. 여러 Object를 한번에 Localization할 수 있는 Formulation? - OverFeat : 4점(x, y, w, h)를 Regression - 변수를 그냥 막 늘려서 여러 점을 Regression할 순 없을까? → N개의 박스? - Training하는 과정에서 여러 GT와 여러 Bounding Box가 어떻게 Matching되어야할까? - 학습을 위해서는 1번 박스가 2번 박스에 비해서 좌상단에 있어야 된다거나 하는 조건이 붙어야할 것 - N개의 박스의 자유도가 높으면 학습이 아예 되지 않을 수도 있음 MultiBox: Scalable Object Detection using Deep Neural Networks 53
  • 54. MultiBox : Objective Function - N개의 Bounding Box 과 각각의 Confidence Score 를 출력함 MultiBox: Scalable Object Detection using Deep Neural Networks 54 Bounding Box : L2 Loss Confidence Loss
  • 55. MultiBox : Prior와 Matching의 제안 ★ ★ ★ - Prior - GT Location 데이터로 K개의 Clustering 만듦 - Clustering의 중심(Centroid)가 K개 Prior가 됨 - ‘free-floating’하는 여러 개의 박스들이 아님 - 논문에서는 K=100 또는 K=200 사용함 - Prior 개수 = 네트워크가 출력하는 Bounding Box 개수 - Matching - “instead of matching the N ground truth locations with the K predictions, we find the best match between the K priors and the ground truth.” - 즉, K개의 Prior가 Activate/Deactivate되면서 뉴럴넷의 해당 노드에서 적절한 Output을 주는 것 - “We have found that without prior matching, the convergence speed and quality of our models were significantly lower.” Result - 기존 다른 방법과 성능이 유사하면서도 한번에 여러개의 Bounding Box를 출력하게 함 - 훨씬 적은 계산 비용! MultiBox: Scalable Object Detection using Deep Neural Networks 55
  • 56. “In the future, we hope to be able to fold the localization and recognition paths into a single network, such that we would be able to extract both location and class label information in a single feed-forward pass through the network. Even in its current state, the two-pass procedure (localiza- tion network followed by categorization network) entails 5- 10 network evaluations. Importantly, this number does not scale linearly with the number of classes to be recognized, which still makes the proposed approach very competitive with DPM-like approaches.” MultiBox: Scalable Object Detection using Deep Neural Networks 56
  • 57. “MSC-Multibox” Scalable, High-Quality Object Detection 57 Multibox가 Multiple Bounding Box Regression하는 좋은 방법을 제시. MSC-MultiBox는 ‘Convolutional Prior’라는 개념을 도입하여 성능 향상★ - 기존과 Prior 개념 조금 다름 - Convolutional Layer에 Multi-Scale Feature Map 만듦
  • 58. Single Shot Detectors Overview ‘Multiple-Class / Multiple-Bounding Boxes 환경에서 Neural Network로 Detection을 어떻게 할까?’ + * Single Forwarding만으로. 58
  • 59. Detection Pipeline이 Single NN Forward인 모델들 대체로 속도 빠르고, Single Module이므로 학습과 유지보수가 쉬움 Overfeat 등 초기 모델들의 문제 - 한번의 NN Forward로 여러 개의 Bounding Box를 찾아내기 어려웠음 - Box가 몇 개 있을지 알 수 없음 - 여러 변수를 무작정 도입해야할까? - Overfeat : 1개의 NN이 1개의 Class에 대해 1개의 Bounding Box만을 찾아냄 - Google’s Model : Binary Map으로 여러 Bounding Box는 찾았지만 Class 정보는 별도의 Network를 반복해서 수행 Object Proposal 등에서 (Class-Agnostic 하지만) 많은 Bounding Box를 찾아내는 Formulation과 Training Strategy를 소개함 - 기존 모델링의 한계를 넘어 Single Shot Detector들의 등장할 수 있는 배경이 됨 Single Shot Detectors Overview 59 Person 0.87 Dog 0.93
  • 60. You Only Look Once: Unified, Real-Time Object Detection - Overfeat, Multibox 등의 Formulation을 발전시키고, Network Architecture의 개선으로 성능 개선 - CVPR2016 : You Only Look Once: Unified, Real-Time Object Detection - Curtis’s Seminar : https://kakao.agit.in/g/300004430/wall/302933427 SSD: Single Shot MultiBox Detector - Faster RCNN 등과 성능이 비등하면서도 YOLO만큼 빠름 - MSC-Multibox 등의 아이디어를 발전시켜 여러 크기의 Feature-Map으로부터 Prediction하는 것이 핵심 Single Shot Detectors Overview 60 Person 0.87 Dog 0.93
  • 61. You Only Look Once: Unified, Real-Time Object Detection 61 MultiBox가 K개의 Prior에 Matching하는 형태로 모델링 - 하나의 네트워크로 Multiple Bounding Box Regression하는 최초의 Reasonable한 모델 - 지정된 Prior에만 매칭되므로 자유도가 한정적임 YOLO는 Grid에 Matching하는 형태로 모델링 - 지정된 Prior가 없다는 점이 MultiBox에 비해 자유도가 높아진 부분 (Prior ~= Grid) - 각 Grid는 1개의 Bounding Box를 Output으로 출력 - 결국 Grid는 49개의 균등하게 자리잡은 Prior와 동일한 개념 - 각 클래스별 Score를 통해 박스의 클래스를 알 수 있음
  • 62. You Only Look Once: Unified, Real-Time Object Detection 7 x 7 Grid Matching - 최대 7x7=49개의 Bounding Box 출력 가능 - Object의 중심부에 Matching된 Grid Cell에서 Bounding Box(x,y,w,h) 출력함 - 각 Grid Cell 별로 Class 개수 만큼의 확률값 출력 - IoU Overlap이 가장 높은 1개의 Grid에 Matching함 62
  • 63. You Only Look Once: Unified, Real-Time Object Detection 63 해당 Grid의 Bounding Box에 대한 각 Class별 확률 해당 Grid의 Bounding Box 좌표
  • 64. You Only Look Once: Unified, Real-Time Object Detection Objective Function 64
  • 65. You Only Look Once: Unified, Real-Time Object Detection Result - VOC Result * Localization Error가 Classification Error보다 높음 * ‘Strong Spatial Constraints’ 때문 : 1그리드는 1개(혹은 2개)의 Object만을 갖음 65 YOLO는 자연스럽게 Global Context를 사용하기 때문에, Background 등에 대한 False Positive 적어서, 기존 R-CNN과 함께 사용했을 때 mAP를 크게 상승시킬 수 있음
  • 66. You Only Look Once: Unified, Real-Time Object Detection Result - Prediction Speed(VOC 2007) * Network는 Pooling 대신 Stride를 활용해서 설계됨. 논문 참조. * CVPR 2016의 논문에서는 약간의 Modeling 수정이 있음 * Hard Data Mining 관련된 내용이 논문에 언급없음 * 1개의 Grid가 아니라 IoU Threshold 이상의 모든 Grid에 매칭했다면 성능이 어떻게 달라질까? 66
  • 67. SSD: Single Shot MultiBox Detector 67 YOLO 는 MultiBox와 많은 부분이 유사 SSD는 MSC-MultiBox 등과 많은 부분이 유사 Default Box : Prior와 개념 동일 Multiple Convolutional Feature Map으로부터 Prediction함 최초로 기존 Detection Pipeline을 사용하지 않으면서 기존 State-of-art와 비등한 수준의 모델
  • 68. SSD: Single Shot MultiBox Detector “Our improvements include using a small convolutional filter to predict object categories and offsets in bounding box locations, using separate predictors (filters) for different aspect ratio detections, and applying these filters to multiple feature maps from the later stages of a network in order to perform detection at multiple scales.” Small Convolutional Filter(Predictors) for Detector★★ - 3x3 small kernal (MSC-MultiBox와 동일) - 카테고리에 대한 Score와 Bounding Box 모두를 출력하도록 함 Multi-scale feature maps for Detection★★★ - Add Multiple Convolutional Feature Layers for ‘Multiple Scale of Object’ 68
  • 69. SSD: Single Shot MultiBox Detector Default Boxes and Aspect Ratios - k개의 default box 가정(=Prior in MSC-MultiBox) - MSC-MultiBox와 유사하게 각 Feature map cell마다 Convolutional Filter를 사용해서 Class-Score와 Box Location 출력 - 클래스 개수가 c개, 4개의 좌표(x, y, w, h)이므로 (c+4)k개의 출력 Matching Strategy - 1. Best jaccard overlap 인 1개의 default box에 assign - 2. Jaccard overlap > 0.5 인 모든 default box에 assign (MSC-Multibox와 유사) 69
  • 70. SSD: Single Shot MultiBox Detector Training - Objective Function (Softmax + smooth L1 Loss) - Hard negative Mining - Confidence Score로 정렬해서 Positive와 Negative가 최대 1:3이 되도록 샘플링함 (어려운 Hard Negative를 Batch에 넣겠다는 의도) - MSC-MultiBox처럼 Positive 수가 모자르면 Negative를 더 넣음 * MSC-MultiBox으로부터 아주 다양한 면에서 이어져온 것으로 보임 70
  • 71. SSD: Single Shot MultiBox Detector Comparison with YOLO 71
  • 72. SSD: Single Shot MultiBox Detector VOC Result 72 * VOC 2007
  • 73. Hard Negative Mining Training Region-based Object Detectors with Online Hard Example Mining - 논문들에서 OHEM이라고 자주 언급 - Heuristic하게 논문마다 다르게 적용하던 Hard Negative Mining기법을 정리했고, 성능 향상 2~3% 이상 있음 Etcs 73 2~3%
  • 74. 히치하이커를 위한 안내서 74 히치하이커 중에 학습도 용이하고 성능도 좋으면서 100ms 이내 응답을 주는 빠른 모델이 필요하면 - SSD Default Model을 쓰세요. VOC 2007 mAP 75%, 50ms 수준 히치하이커 중에 진짜 빨라야되는 경우에는 - SSD Small Model을 쓰세요. VOC 2007 mAP 72%, 20ms 수준 히치하이커 중에 진짜 개빨라야되는 경우에는 - Fast Yolo Model을 쓰세요. VOC 2007 mAP 52.7%, 7ms 수준 히치하이커 중에 성능이 깡패여야되는 경우에는 - R-FCN을 쓰세요. VOC 2007 mAP 79.4%, 120ms 수준 - https://github.com/daijifeng001/r-fcn 히치하이커 중에 느려도 된다 난 미친듯이 성능이 좋아야한다 하는 경우에는 - Faster R-CNN+++의 방법들과 R-FCN을 조합해보기를 권장. 그래도 모르겠다하는 히치하이커는 Curtis Kim에게 illy의 코코넛 한 잔과 함께 찾아오세요
  • 75. Object Detectors 세상을 여행하는 히치하이커를 위한 안내서 1편(~2016.6) Object Detectors 세상을 여행하는 히치하이커를 위한 안내서 1편(~2016.6) Curtis Kim (김일두) @ Kakao 75