Di image classification models we don deal wit before na to take one image and produce one categorical result, like di class 'number' for MNIST problem. But, for many cases, we no just wan sabi say di picture get objects - we wan fit know di exact place wey dem dey. Na wetin object detection dey do be dat.
Image from YOLO v2 web site
If we wan find cat for one picture, one simple way to do object detection go be like dis:
- Cut di picture into plenty small tiles.
- Run image classification for each tile.
- Any tile wey get high activation fit mean say di object dey inside.
Image from Exercise Notebook
But dis method no too make sense because e no dey fit locate di object bounding box well. To get di exact location, we go need to run regression to predict di bounding box coordinates - and for dat, we go need special datasets.
Dis blog post explain di basics of detecting shapes well well.
You fit see dis datasets for dis kind task:
- PASCAL VOC - 20 classes
- COCO - Common Objects in Context. 80 classes, bounding boxes and segmentation masks
For image classification, e dey easy to measure how di algorithm dey perform. But for object detection, we need to measure di class correctness and di bounding box location precision. For di bounding box, we dey use Intersection over Union (IoU), wey dey measure how two boxes (or areas) dey overlap.
Figure 2 from dis blog post on IoU
Di idea simple - we go divide di area wey two figures dey overlap by di area of their union. If di two areas dey exactly di same, IoU go be 1. If dem no touch at all, IoU go be 0. Any other case go dey between 0 and 1. We dey usually consider bounding boxes wey get IoU above one certain value.
If we wan measure how well one class of objects
- Look di Precision-Recall curve wey show accuracy based on detection threshold (0 to 1).
- Di threshold go affect how many objects we detect and di precision/recall values.
- Di curve go look like dis:
Image from NeuroWorkshop
Di Average Precision for one class
We go only consider detections wey get IoU above one certain value. For example, for PASCAL VOC dataset,
Image from NeuroWorkshop
Di main metric for Object Detection na Mean Average Precision or mAP. E dey calculate di Average Precision across all object classes, and sometimes across
We get two main types of object detection algorithms:
- Region Proposal Networks (R-CNN, Fast R-CNN, Faster R-CNN). Di idea na to generate Regions of Interests (ROI) and run CNN for dem to find maximum activation. E dey similar to di simple method, but di ROIs dey generated in a smarter way. Di problem be say e dey slow because we dey run CNN classifier many times for di image.
- One-pass (YOLO, SSD, RetinaNet) methods. For dis ones, di network dey predict both classes and ROIs in one pass.
R-CNN dey use Selective Search to generate ROI regions, wey CNN go process to extract features. SVM-classifiers go determine di object class, and linear regression go predict di bounding box coordinates. Official Paper
Image from van de Sande et al. ICCV’11
*Images from dis blog
Dis method dey similar to R-CNN, but e dey define regions after convolution layers don run.
Image from di Official Paper, arXiv, 2015
Dis method dey use neural network to predict ROIs - di Region Proposal Network. Paper, 2016
Image from di official paper
Dis algorithm dey faster pass Faster R-CNN. Di main idea be:
- Extract features wit ResNet-101.
- Process di features wit Position-Sensitive Score Map. Each object from
$C$ classes dey divide into$k\times k$ regions, and we dey train to predict di object parts. - For each part, di network go vote for di object class, and di class wit di highest vote go dey selected.
Image from official paper
YOLO na realtime one-pass algorithm. Di main idea be:
- Divide di image into
$S\times S$ regions. - For each region, CNN go predict
$n$ possible objects, bounding box coordinates, and confidence=probability * IoU.
Image from official paper
- RetinaNet: official paper
- SSD (Single Shot Detector): official paper
Continue your learning for dis notebook:
For dis lesson, you don see di different ways wey object detection fit work!
Read dis articles and notebooks about YOLO and try dem:
- Good blog post wey explain YOLO
- Official site
- Yolo: Keras implementation, step-by-step notebook
- Yolo v2: Keras implementation, step-by-step notebook
- Object Detection by Nikhil Sardana
- Comparison of object detection algorithms
- Review of Deep Learning Algorithms for Object Detection
- Step-by-Step Intro to Object Detection Algorithms
- Faster R-CNN Implementation in Python
Disclaimer:
Dis docu don use AI translation service Co-op Translator take translate am. Even though we dey try make e accurate, abeg sabi say automated translations fit get mistake or no dey 100% correct. Di original docu for di language wey dem write am first na di main correct one. For important information, e good make una use professional human translation. We no go fit take blame for any misunderstanding or wrong interpretation wey fit happen because of dis translation.











