TensorFlow Object
Detection
Defining the problem
Library
TF Object Detection offers an API to perform quick
experiments regarding Computer Vision problems
https://github.com/tensorflow/models/tree/master/research/object_detection
Model Zoo
For each task, a pre-trained model in a given dataset is offered
Choose one or other considering the accuracy / speed tradeoff
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc
/detection_model_zoo.md
SSD Mobilenet
SSD: Single Shot MutiBox Detector
MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
MobileNetV2: Inverted Residuals and Linear Bottlenecks
Object Detection
Different
Loss
Function
may be
applied
Convolutional operation
Convolutional operation
Convolutional operation
Convolutional operation
MobileNet v2
1x1 Convolution
Operation applied to
every input channel
used to change the
number of channels in
the output
ResNets
As a DNN becomes deeper, the risk of having vanishing / exploding gradients
increases. Residual Nets aims to address this problem
[He et al., 2015, Deep Residual Learning for Image Recognition]
MobileNet v2
MobileNet v2
MobileNet v2
MobileNet v2 as a Feature Extractor
Single Shot Detector (SSD)
● Neural Net built in top of MobileNet v2 (or others)
● Uses the features extracted to perform object detection
SSD in top of VGG
● Generation of Priors: 19x19, 10x10, 5x5,
3x3, 2x2 and 1x1
Intersection over Union (IoU)
Find which priors (anchors) match which ground truth boxes
Non-Maxima Suppression
● Choose the box with highest prediction score
● Compare it with the others with IoU and delete the most overlapping ones
● Repeat
Alternative models
● Region-based Convolutional Network (R-CNN)
● Fast Region-based Convolutional Network (Fast R-CNN)
● Faster Region-based Convolutional Network (Faster R-CNN)
● Region-based Fully Convolutional Network (R-FCN)
● YOLOv3
● RetinaNet
Article: Review of Deep Learning Algorithms for Object Detection
Project
Define which classes of interest to detect
Use of a video processing library: OpenCV
Modify the detection code to adjust it to your project’s needs
Made an executable version with PyInstaller
https://github.com/xavialex/object-detection
Acknowledgments / References
● https://machinethink.net/blog/mobilenet-v2/
● https://ai.googleblog.com/2018/04/mobilenetv2-next-generation-of-on.html
● https://medium.com/@smallfishbigsea/mobilenet-based-single-short-multi-box
-detector-in-pytorch-onnx-and-caffe2-2509bd038427

Intro to TF Object Detection