How to boost object detection accuracy by understanding data
By: Tushar Kolhe
Tags: Machine Learning, Computer Vision, Yolov5, Yolo, Object Detection

Introduction

Object detection powers many vision tasks like instance segmentation, pose estimation, tracking and action recognition. These computer visions tasks have many applications in surveillance, autonomous driving and visual question answering domain. With this wide range of real-world application, Object Detection naturally becomes an active research area.

Our research team at Fynd has been training a Person Detection model to power our object tracking model (more on tracking in an upcoming blog). In this article, we will explain how we selected a model architecture, created a dataset and trained it for our specific use case.

What is Object Detection?

Object detection is a computer vision technique that allows us to identify and locate objects in an image or video. Object Detection can be understood in two parts, Object Localisation and Object Classification. Localisation can be understood as predicting the exact location (bounding box) of an object in the image and Classification is to define from which class (person/car/dog etc. ) it belongs to.

Photo by Michael Weidemann on Unsplash

Approaches for object detection

There are various approaches to solve the task of object detection. We can use multiple approaches to classify the models into three categories.

Two-stage Detectors : Model has 2 types of networks, one region proposal and other detection. Some classic examples are RCNN family.

: Model has 2 types of networks, one region proposal and other detection. Some classic examples are RCNN family. Single Stage Detectors with anchor boxes: These type of architectures do not have a separate region proposal network but depend on predefined anchor boxes. We can look into YOLO family for understanding such networks.

These type of architectures do not have a separate region proposal network but depend on predefined anchor boxes. We can look into YOLO family for understanding such networks. Single Stage Detectors without anchor boxes: This is a fairly new approach for solving object detection, such networks are end-to differentiable and do not depend on Region of Interests (ROI). Rather they predict objects in a single shot. This is a very interesting approach that has shaped thinking of the new researches. To learn more dive into CornerNet or CenterNet paper to know the depth of it.

What is COCO dataset?

In order to compare the models, a common dataset know as COCO (Common Objects in Context) is widely used. This is a challenging dataset with 80 classes and over 1.5 million object instances, thus this dataset is a very good benchmark for initial model selection. Every year various new and innovative approaches are up and competing to improve on task.

How to check the performance?

Various metrics to evaluate object detection are proposed. Some of them are defined by the challenges like:

To understand these metrics you need a good understanding of basic concepts like precision, recall and IOU. Following is just a brief definition of the formula.

Average Precision

AP can then be defined as the area under the interpolated precision-recall curve, which can be calculated using the following formula:

Mean average precision

The calculation of AP only involves one class. However, in object detection, there are usually K>1 classes. Mean average precision (mAP) is defined as the mean of AP across all K classes:

TIDE

TIDE is an easy-to-use, general toolbox to compute and evaluate the effect of object detection and instance segmentation on overall performance. TIDE helps to understand your model errors in a more detailed way. Using just mAP value its not possible to figure out which segment of error is contributing to this mAP. TIDE can plot simple charts that makes this analysis effortless.