Object Detection using YOLOv3

Lee Ren Xiang
3 min readMay 23, 2021

--

This is a series of Medium posts made by 4 NUS SCALE master students (MSc. in Industry 4.0) who are taking ISY5004 Intelligent Sensing Systems. Here’s a snapshot of what we’ll be sharing:

YOLOv3 is a relatively simple and commonly used real-time object classifier. However in this particular use case, we simply need an object detector, and classifying it correctly is not of utmost importance. For the furniture searching bot, there are 3 requirements:

  1. Detect multiple common household objects.
  2. Differentiate objects of different class
  3. Differentiate objects of the same class (e.g. different types of chairs detected)

Browsing through the class labels of a pre-trained YOLOv3 classifier, we can observe that common household objects or furniture such as “couch”, “chair”, “table”, “bottle”, “vase”, “TV” and many more are present! This easily satisfies requirement 1 and 2. For requirement 3, some modification had to a typical output for a YOLOv3 system had to be done. Typically, YOLOv3 takes in a RGB image as an input, and returns bounding boxes and the class labels for each object identified. In this case, an counter for repeated class labels in the output image is added. If two “chairs” are detected, there would be labelled as “chair1” and “chair2” accordingly. This is to allow users to select which item they would want to run a query on. An example output from YOLOv3:

Example of YOLOv3 meeting all 3 requirements

To do this, we create a function to run YOLOv3, and return an output to include query image with bounding boxes, list of lists containing coordinates of the bounding boxes, and the corresponding list of class labels.

When generating the class labels, a counter is inserted into the function to detect repeated classes, and allow counting (chair1, chair2 etc).

Some success using YOLOv3 as the object detector followed by object query return are shown below:

Search for a Glass Container

However, YOLOv3 performance starts to deteriorate when presence of non-white background increases complexity of the image.

Background Complexity affecting YOLOv3 performance

With a relatively white background, the image provided by YOLOv3 was able to return the exact item. However, presence of background colors distorts the query result performance, as most of the catalog database have white backgrounds. More complex methods to handle complex backgrounds need to be employed! Refer to the next post as we explore more comprehensive methods for object detection along with background removal!

--

--