Weitere ähnliche Inhalte Ähnlich wie “Understanding DNN-Based Object Detectors,” a Presentation from Au-Zone Technologies (20) Mehr von Edge AI and Vision Alliance (20) Kürzlich hochgeladen (20) “Understanding DNN-Based Object Detectors,” a Presentation from Au-Zone Technologies2. 1. Problem Definition
2. Early Deep-Learning Based Approaches
• R-CNN, Fast-RCNN, Faster-RCNN
3. Recent Advancements
• Yolo, SSD, RetinaNet, CenterNet
4. Performance Metrics
• Reported in papers
5. Performance Comparisons
6. Choosing an Object Detector
Presentation Overview
© 2022 Au-Zone Technologies 2
4. Problem Definition
© 2022 Au-Zone Technologies 4
Ref: https://medium.com/syncedreview/
facebook-pointrend-rendering-image-segmentation-f3936d50e7f1
Image Classification (global- easier) Object Segmentation (detailed- tougher)
Ref: Example of Photographs of Objects From the CIFAR-10 Dataset
5. Problem Definition
© 2022 Au-Zone Technologies 5
Ref: By (MTheiler) - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=75843378
Object Detection (Compromise):
1. Localize the object
• Bounding box location
2. Estimate the size
• Bounding box dimensions
3. Classify the object
• Object label
7. Early Deep-Learning Based Approaches
(R-CNN) 2014
© 2022 Au-Zone Technologies 7
Region Proposal: Generate and extract category independent region proposals, e.g.
candidate bounding boxes. (Selective search)
Feature Extractor: Extract feature from each candidate region, e.g. using a deep CNN
Classifier. Classify features as one of the known class, e.g. linear SVM classifier model.
“Rich feature hierarchies for accurate object detection and semantic segmentation”
Issues:
1. Training is a multi-stage pipeline.
Involves the preparation and
operation of three separate models.
2. Training a deep CNN on so many
region proposals per image is very
slow.
3. Object detection is slow. Making
predictions using a deep CNN on so
many region proposals (~2000) is
very slow.
8. Early Deep-Learning Based Approaches
(Fast R-CNN) 2015
© 2022 Au-Zone Technologies 8
Region Proposal: Generate and extract category independent region proposals, e.g.
candidate bounding boxes. (Selective search)
Classification and Bounding Box Combined: A single model instead of a pipeline to
learn and output regions and classifications directly.
Fast R-CNN, ICCV 2015.
Issue:
The model is significantly faster to train
and to make predictions, yet still
requires a set of candidate regions to
be proposed along with each input
image.
9. Early Deep-Learning Based Approaches
(Faster R-CNN) 2016
© 2022 Au-Zone Technologies 9
Region Proposal Network: Convolutional neural
network for proposing regions and the type of object
to consider in the region.
Fast R-CNN: Convolutional neural network for
extracting features from the proposed regions and
outputting the bounding box and class labels.
“Faster R-CNN: Towards Real-Time Object Detection with Region
Proposal Networks”
10. Early Deep-Learning Based Approaches
(Faster R-CNN)
© 2022 Au-Zone Technologies 10
Region Proposal Network
• A procedure of alternating training is
used where both sub-networks are
trained at the same time. This allows
the parameters in the feature
detector deep CNN to be fine-tuned
for both tasks simultaneously.
• For VGG-16 model, it has a frame
rate of 5 fps on a K-40 GPU (200
msec per image).
“Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks”
12. Recent Advancements
(YOLO-V1) 2016
© 2022 Au-Zone Technologies 12
• A single neural network predicts bounding boxes and class probabilities directly from full
images in one evaluation.
• Base YOLO model processes images on Titan X GPU in real-time at 45 fps, and up to 155 fps for a
speed-optimized version of the model.
• YOLO makes more localization errors but is far less likely to predict false detections where nothing
exists.
“You Only Look Once: Unified, Real-Time Object Detection”
• Doesn’t run network sequentially on regions.
• It divides the input image into an S × S grid. If
the center of an object falls into a grid cell, that
grid cell is responsible for detecting that object.
• Each grid cell predicts B bounding boxes,
confidence for those boxes, and C class
probabilities.
• These predictions are encoded as an S × S × (B ∗
5 + C) tensor.
• On PASCAL VOC, S = 7, B = 2. PASCAL VOC has
20 labelled classes so C = 20. The final prediction
is a 7 × 7 × 30 tensor
13. Recent Advancements
(YOLO-v1: Network Architecture)
© 2022 Au-Zone Technologies 13
• The network has 24 convolutional layers followed by 2 fully connected layers.
• Alternating 1 × 1 convolutional layers reduce the features space from preceding layers.
• The convolutional layers were pretrained on the ImageNet classification task.
“You Only Look Once: Unified, Real-Time Object Detection”
Limitations:
• YOLO imposes strong spatial constraints on
bounding box predictions since each grid cell
only predicts two boxes.
• It can only have one class in a cell. This
model struggles with small objects that
appear in groups, such as flocks of birds.
• This model uses relatively coarse features for
predicting bounding boxes (it has multiple
down-sampling layers).
• Finally, they train on a loss function that
approximates detection performance.
14. V3 – 2018:
• The input image is divided into S x S grids at three
different resolution scales (8x8, 16x16, 32x32) (large,
medium and small)
• Each resolution scale is attended by each model
output (3) and the output is conditioned by the input
dimension H x W ( [H/8, W/8, 3 * (5 + C)], [H/16,
W/16, 3 * (5 + C)], [H/32, W/32, 3 * (5 + C)])
• Objects are learned based on the resolution and
anchors. Each resolution has at least 3 anchors to
define objects ratios at each cell.
V4 – 2020:
• Backbone: CSPDarknet53
• Head: YOLOv3
YOLO v4 utilizes:
• Bag of Freebies (BoF) for backbone: CutMix, Mosaic data
augmentation, DropBlock regularization, Class label
smoothing
• Bag of Specials (BoS) for backbone: Mish activation, Cross-
stage partial connections (CSP), Multi-input weighted
residual connections
• Bag of Freebies (BoF) for detector: CIoU- loss, CmBN,
DropBlock regularization, Mosaic data augmentation etc.
Recent Advancements
(YOLO-v3 and YOLO-v4)
14
© 2022 Au-Zone Technologies
15. Recent Advancements
(YOLOX) 2021
© 2022 Au-Zone Technologies 15
Anchor free, decoupled heads
• Feature channel is reduced to
256 using 1x1 conv.
• Add two parallel branches with
two 3x3 conv layers (classification
and regression)
• IoU branch is added to the
regression branch.
16. Recent Advancements
SSD (Single Shot Detectors) 2016
© 2022 Au-Zone Technologies 16
• In a convolutional fashion, it evaluates a small set of default boxes of different aspect
ratios (anchor boxes) at each location in several feature maps with different scales (e.g. 8
× 8 and 4 × 4 in (b) and (c)).
• For each default box, it predicts both the shape offsets and the confidences for all object
categories.
“SSD: Single Shot MultiBox Detector”
17. Recent Advancements
(SSD – Network Architecture)
© 2022 Au-Zone Technologies 17
“SSD: Single Shot MultiBox Detector”
• SSD model adds several “feature
scaler layers” to the end of a
backbone network, which predict the
offsets to default boxes of different
scales and aspect ratios and their
associated confidences.
• Inference frame rate (speed with
batch size 8 using Titan X and cuDNN
v4 with Intel Xeon E5-2667v3 @ 3.20
GHz) is 46 fps for SSD of 300x300
pixel images with mAP = 74.3%
• Whereas for YOLO (VGG-16) frame
rate is 21 fps of 448x448 pixel
images with mAP = 66.4%
• For SSD, candidate bounding boxes
can be very large (~8732); NMS
post-processing needs to be
optimized.
18. Recent Advancements
(RetinaNet) 2017
© 2022 Au-Zone Technologies 18
• Utilizes Feature Pyramid Network (FPN) backbone on top of feedforward ResNet architecture.
• Introduces Focal Loss to handle class imbalance in object detection dataset.
• RetinaNet with ResNet-101-FPN matches the accuracy of ResNet- 101-FPN Faster R-CNN [20],
• 172 msec on an Nvidia M40 GPU.
• At most 1k top-scoring predictions per FPN level, after thresholding detector confidence at 0.05.
• The top predictions from all levels are merged and non-maximum suppression (NMS) with a threshold of
0.5 is applied to yield the final detections.
“Focal Loss for Dense Object Detection”
19. Recent Advancements
(CenterNet) 2019
© 2022 Au-Zone Technologies 19
• Addresses the need for anchors and
NMS post-processing
• The backbone network generates heatmaps
from the input image using CNNs.
• Object are localized by detecting the local
maxima from the heatmaps.
• Single network predicts the keypoints (local
maxima of heatmaps), offset, and size.
• The network predicts a total of C + 4
outputs at each location.
“Objects as Points”
https://sanjivgautamofficial.medium.com/generative-learning-algorithms-
8a306976b9b1
• Not best for accuracy but provides excellent
accuracy-speed tradeoffs.
• Can easily be extended to 3D object detection,
multi-object tracking and pose estimation etc.
21. Performance Metrics
How well the detector is doing?
© 2022 Au-Zone Technologies 21
Intersection over Union (IoU):
IoU metric in object detection evaluates the degree of overlap between the ground (gt)
truth and predicted (pd) bounding boxes. It is calculated as follows:
Types of Errors:
• True Positive (TP) — Correct detection made by the model.
• False Positive (FP) — Incorrect detection made by the detector.
• False Negative (FN) — A Ground-truth missed (not detected) by the object detector.
• True Negative (TN) — This is background region not detected by the model. This metric
is not used in object detection because such regions are not explicitly annotated.
• Closeness or overlap of the detected bounding box with the ground truth (IoU).
• IoU ranges between 0 and 1, where 0 shows no
overlap and 1 means perfect overlap between gt
and pd.
• IoU is used as a threshold (say, α), and using
this threshold we can decide if a detection is
correct or not.
Ref:
https://towardsdatascience.com/o
n-object-detection-metrics-with-
worked-example-
216f173ed31e#:~:text=Average%
20Precision%20(AP)%20and%20
mean,COCO%20and%20PASCAL%
20VOC%20challenges.
22. Performance Metrics
(IoU)
© 2022 Au-Zone Technologies 22
Ref:
https://towardsdatascience.com/o
n-object-detection-metrics-with-
worked-example-
216f173ed31e#:~:text=Average%
20Precision%20(AP)%20and%20
mean,COCO%20and%20PASCAL%
20VOC%20challenges.
• True Positive (TP) is a detection for which IoU(gt,pd) ≥ α and
• False Positive (FP) is a detection for which IoU(gt,pd) < α.
• False Negative is a ground-truth (gt) missed together with gt for which IoU(gt,pd) < α.
Consider IoU threshold, α = 0.5, then TP, FP and FNs can be identified as shown in the figure above.
Note: If we raise the IoU threshold above 0.86, the first instance will be a FP, and if we lower the IoU
threshold below 0.24, the second instance becomes TP.
23. Performance Metrics
(Precision and Recall)
© 2022 Au-Zone Technologies 23
Ref:
https://towardsdatascience.com/o
n-object-detection-metrics-with-
worked-example-
216f173ed31e#:~:text=Average%
20Precision%20(AP)%20and%20
mean,COCO%20and%20PASCAL%
20VOC%20challenges.
• Precision is the degree of exactness of the model in identifying only relevant
objects. It is the ratio of TPs over all detections made by the model.
• Recall measures the ability of the model to detect all ground truths—TPs
among all ground truths.
• A model is said to be a good model if it has high precision and high recall.
• Raising IoU threshold means that more objects will be missed by the model (more FNs and therefore
low recall and high precision).
• Whereas a low IoU threshold will mean that the model gets more FPs (hence low precision and high
recall).
• For a good model, precision and recall stays high even when confidence score is varied.
24. Performance Metrics
(Precision-Recall Curve)
© 2022 Au-Zone Technologies 24
Ref:
https://debuggercafe.com/evaluati
on-metrics-for-object-detection
• The precision-recall (PR) curve is a plot of precision and recall at varying values of
IoU thresholds.
• P-R curve is not monotonic, therefore smoothing is applied.
25. Performance Metrics
(mean Average Precision : mAP)
© 2022 Au-Zone Technologies 25
Ref: https://towardsdatascience.com/on-object-
detection-metrics-with-worked-example-
216f173ed31e#:~:text=Average%20Precision
%20(AP)%20and%20mean,COCO%20and%20
PASCAL%20VOC%20challenges.
Average Precision (AP):
• AP@α is Area Under the Precision-Recall Curve (AUC-PR) evaluated at α IoU
threshold.
• AP50 and AP75 mean AP calculated at IoU=0.5 and IoU=0.75, respectively.
Mean Average Precision (mAP):
• There are as many AP values as the number of
classes.
• These AP values are averaged to obtain the metric -
mean Average Precision (mAP).
• Pascal VOC benchmark requires computing AP at
11 points - AP@[0,0.1,..., 1.0]
Ref: https://debuggercafe.com/evaluation-
metrics-for-object-detection
26. Performance Metrics
(MS COCO Benchmark)
© 2022 Au-Zone Technologies 26
• MS COCO describes 12 evaluation metrics for submitting the results and
determining the winners for the competition,
• The main evaluation metric is still the mAP, or simply called AP.
Ref:
https://debuggercafe.com/evaluati
on-metrics-for-object-detection
28. Comparisons
(SSD, YOLO and Others)
© 2022 Au-Zone Technologies 28
“SSD: Single Shot MultiBox Detector”
(With batch size 8 on Titan X and cuDNN v4 with Intel Xeon E5-2667v3 @ 3.20GHz.)
29. Comparisons
(RetinaNet with Others)
© 2022 Au-Zone Technologies 29
“Focal Loss with Dense Object Detection”
(RetinaNet with ResNet-101-FPN and a 600x600 pixel image size (on nVidia M40 GPU) runs at 122 msec per image.)
31. • High accuracy → More complex, larger models → lower speed
• High speed → Smaller, less complex models → lower accuracy
• Quantization → specific data types (fp16, int16, uint8) → lower accuracy
• Specific compute unit (GPU, NPU) → Highest speed → More effort
Choosing the Object Detector
(High-Level, General Guidelines)
31
© 2022 Au-Zone Technologies
Model type Accuracy Speed Model Size Portability
Floating-point-32 bit
(natively trained)
Highest Lowest Largest High
Floating-point-16 bit Low Low Small Medium
Quantized (int16, uint8) Lower Fast Smaller Low
(special math libraries)
Compute Unit (Not GPUs)
(quantized models)
Lower Fastest Small Lower
32. • Early DNN-based object detectors (R-CNN, Fast R-CNN, Faster R-CNN)
• Recent object detectors (YOLO, YOLOX, SSD, RetinaNet, CenterNet)
• Introduced metrics used for object detections
• Discussed performance and speed comparison
• General guidelines to choose object detectors (no free lunch!)
Conclusions
32
© 2022 Au-Zone Technologies
33. • Smarter devices. Valuable Insights. Enhanced Security & Privacy. Novel customer
experiences.
• By taking advantage of our field proven Starter Kits, Optimized Vision Pipelines
and Advanced AI Models, our customers can significantly improve runtime
performance while reducing technology risk, need for specialized skills and
program development time.
• Well over a decade of experience helping clients get their embedded AI and
Computer Vision concepts off the drawing board and into production, the
engineering design team can help you quickly and confidently explore, develop,
and deploy practical embedded vision and AI solutions at scale.
Au-Zone Technologies Inc.
33
© 2022 Au-Zone Technologies
34. References
(Early Approaches)
Method Bibliography Link
R-CNN Ross Girshick Jeff Donahue Trevor Darrell
Jitendra Malik, "Rich feature hierarchies for
accurate object detection and semantic
segmentation", Tech report (v5), UC Berkeley,
2014
https://arxiv.org/pdf/1311.2524.pdf
Fast R-CNN Ross Girshick, "Fast R-CNN", Microsoft Research,
2015.
https://arxiv.org/pdf/1504.08083.pdf
Faster R-CNN Shaoqing Ren, Kaiming He, Ross Girshick and
Jian Sun, "Faster R-CNN: Towards Real-Time
Object Detection with Region Proposal
Networks", Advances in Neural Information
Processing Systems, 2015.
https://arxiv.org/pdf/1506.01497.pdf
34
© 2022 Au-Zone Technologies
35. References
(Recent Advancements)
Method Bibliography Link
YOLO-v1 Joseph Redmon, Santosh Divvalay, Ross Girshick,
Ali Farhadiy, "You Only Look Once: Unified, Real-
Time Object Detection", 2015.
https://arxiv.org/pdf/1506.02640.pdf
YOLO-v3 Redmon, Joseph, and Ali Farhadi. "Yolov3: An
incremental improvement.“, 2018.
https://arxiv.org/pdf/1804.02767.pdf
YOLO-v4 Bochkovskiy A, Wang CY, Liao HY. Yolov4: Optimal
speed and accuracy of object detection, 2020.
https://arxiv.org/pdf/2004.10934.pdf
YOLOX Zheng Ge, Songtao Liu, Feng Wang, Zeming Li,
Jian Sun. YOLOX: Exceeding YOLO Series in 2021.
https://arxiv.org/pdf/2107.08430.pdf
SSD Wei Liu, Dragomir Anguelov, Dumitru Erhan,
Christian Szegedy, Scott Reed, Cheng-Yang Fu,
Alexander C. Berg, "SSD: Single Shot MultiBox
Detector“, 2015
https://arxiv.org/pdf/1512.02325.pdf
35
© 2022 Au-Zone Technologies
36. References
(Recent Advancements)
Method Bibliography Link
RetinaNet Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming
He, Piotr Dollár, "Focal Loss for Dense Object
Detection", 2017.
https://arxiv.org/pdf/1708.02002.pdf
CenterNet Kaiwen Duan, Song Bai, Lingxi Xie, Honggang
Qi, Qingming Huang, Qi Tian, "CenterNet:
Keypoint Triplets for Object Detection", 2019.
https://arxiv.org/pdf/1904.08189.pdf
Object Detection Metrics With Worked Example https://towardsdatascience.com/on-
object-detection-metrics-with-worked-
example-
216f173ed31e#:~:text=Average%20Pre
cision%20(AP)%20and%20mean,COCO
%20and%20PASCAL%20VOC%20challe
nges
36
© 2022 Au-Zone Technologies