Deep Learning for Object detection & localization
R-CNN, Fast R-CNN, Faster R-CNN, YOLO, GAP, CAM, MSROI
Aaditya Prakash�Sep 25, 2018
Image classification
Image classification
Localization and Detection
Source: cs231n
Classification vs Localization vs Detection vs Segmentation
Source: cs231n
Detection - Fast and Accurate
MobilEye (video)
Nikon S60
Source: Ross Girshick
Detection - Fast and Accurate
MobilEye (video)
Nikon S60
Source: Ross Girshick
Demo
Source: YOLO
Before deep learning
Source: Pedro Felzenszwalb
Before deep learning
Source: Uijlings et al
Before deep learning
Source: Wang et al
Naive way to use CNN for localization - Regression
Source: cs231n
Naive way to use CNN for localization - Regression
Source: cs231n
Naive way to use CNN for localization - Regression
Source: cs231n
Naive way to use CNN for localization - Regression
Source: cs231n
Better way - Sliding window
0.5 | |
| |
Source: cs231n
Better way - Sliding window
0.5 | 0.75 |
| |
Source: cs231n
Better way - Sliding window
0.5 | 0.75 |
0.6 | |
Source: cs231n
Better way - Sliding window
0.5 | 0.75 |
0.6 | 0.8 |
Source: cs231n
Better way - Sliding window
0.5 | 0.75 |
0.6 | 0.8 |
Source: cs231n
Imagenet results (Localization)
AlexNet: Localization method not published
Overfeat: Multiscale convolutional regression with box merging
VGG: Same as Overfeat, but fewer scales and locations; simpler method, gains all due to deeper features
ResNet: Different localization method (RPN) and much deeper features
Can we do detection as regression?
Can we do detection as classification?
Can we do detection as regression?
Can we do detection as classification?
Better solution - Region proposals
Region Proposals - Selective Search
Intersection over Union
If IoU > 0.5 ⇒ Success
Region based CNN (R-CNN)
Source: Ross Girshick
Source: Ross Girshick
R-CNN Training
1. [offline] M ⃪ Pre-train a ConvNet for ImageNet classification
2. M’ ⃪ Fine-tune M for object detection (softmax classifier + log loss) [add background class]
3. F ⃪ Cache feature vectors to disk using M’
4. Train post hoc linear SVMs on F (hinge loss) [binary classifier]
5. Train post hoc linear bounding-box regressors on F (squared loss)
Source: E Mercan, R Girshick
R-CNN Results/Analysis
mAP - mean Average Precision� - Average of Average Precision for each class.� - True positive if IoU with ground-truth box > 0.5
Source: E Mercan
R-CNN Results/Analysis
mAP - mean Average Precision� - Average of Average Precision for each class.� - True positive if IoU with ground-truth box > 0.5.� - AP is area under the Precision-Recall curve.
Source: E Mercan
Fast R-CNN
Source: Ross Girshick
Fully connected to fully convolutional
Source: Coursera
Fully connected to fully convolutional
Source: Coursera
Fully connected to fully convolutional
Source: Coursera
Convolutional implementation of sliding window
Source: Coursera
Convolutional implementation of sliding window
Source: Coursera
Fast R-CNN
Source: Ross Girshick, Kaiming He
Fast R-CNN
Source: Ross Girshick, Kaiming He
Fast R-CNN: Region of Interest Pooling
Fast R-CNN: Region of Interest Pooling
Fast R-CNN: Region of Interest Pooling
Fast R-CNN: Region of Interest Pooling
Fast R-CNN: Region of Interest Pooling
Region of interest pooling - visualized
Fast R-CNN: Region of Interest Pooling
Fast R-CNN: Spatial Pyramid Pooling
Fast R-CNN: Spatial Pyramid Pooling
ROI Pooling is a special case of SPP pooling
Faster R-CNN
Region Proposal Network
Faster R-CNN: RPN
Anchor is labelled positive if:� - anchor is the one with highest IoU overlap with ground truth box� - anchor has IoU overlap with a ground-truth box higher than 0.7�Anchor is labelled negative if IoU lower than 0.3 for all ground-truth boxes.�50%/50% ratio of positive to negative samples
Source: A Salvador
Faster R-CNN: Comparison accuracy/speed
| R-CNN | Fast R-CNN | Faster R-CNN |
Test time per image | 50 seconds | 2 seconds | 0.2 seconds |
Speedup (+proposal) | 1x | 25x | 250x |
mAP (VOC 2007) | 66.0 | 66.9 | 66.9 |
Non-max Supression
0.6
0.7
0.5
You Only Look Once (YOLO)
You Only Look Once (YOLO)
Can you do this without spatial ground-truth?
Weakly supervised object localization
Can you do this without spatial ground-truth?
Weakly supervised object localization
Max Pooling vs Global Max Pooling
Max Pooling vs Global Max Pooling
Global Max Pooling - Results
Class activation map
Class activation map
References
Questions?