Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Machine Learning by (19k points)

I was playing with TensorFlow's brand new Object Detection API and decided to train it on some other publicly available datasets.

I happened to stumble upon this grocery dataset which consists of images of various brands of cigarette boxes on the supermarket shelf along with a text file that lists out the bounding boxes of each cigarette box in each image. 10 major brands have been labeled in the dataset and all other brands fall into the 11th "miscellaneous" category.

I followed their tutorial and managed to train the model on this dataset. Due to limitations on processing power, I used only a third of the dataset and performed a 70:30 split for training and testing data. I used the faster_rcnn_resnet101 model. All parameters in my config file are the same as the default parameters provided by TF.

After 16491 global steps, I tested the model on some images but I am not too happy with the results -

image

It detects cigarette boxes with 99% confidence even in negative images!

Can somebody help me with what is going wrong? What can I do to improve the accuracy? And why does it detect all products to belong in category 1 even though I have mentioned that there are 11 classes in total?

1 Answer

0 votes
by (33.1k points)

After exploring the dataset, I found that it is skewed towards objects of category 1. You can relate the skewness of data with the cause of inductive bias in the model. You need to remove that skewness in data towards one point.Below given is the frequency distribution of each category from 1 to 11 (in 0 based indexing):

0 10440

1 304

2 998

3 67

4 412

5 114

6 190

7 311

8 195

9 78

10 75

Due to the inductive bias in the data, as shown above, your model is hitting local minima, instead of global minima. That’s why the labeling of points as category 1 more than others.

Model is not detecting the boxes, because the dimensions of the input image were much larger than the 600 x 1024 that is received by the model, So, it was scaling down these images to 600 x 1024 which meant that the boxes were losing their details :

You should test the original model which was trained on all classes on cropped images and it would work definitely well.

To gain more insights on this, study Tensorflow Tutorial. Studying Artificial Intelligence Course would also be beneficial.

Hope this answer helps you!

Browse Categories

...