davisking / dlib

A toolkit for making real world machine learning and data analysis applications in C++

Home Page:http://dlib.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generalization Problem for Object Detector

optimaltaskin opened this issue · comments

Hello,

I have been trying to measure distance between pupils with a precision of 2-3 mm. As a reference length, I'm using a credit card held on forehead. I have trained my object detector with a small training set. Training set consists of two different people's 35 photos. I'm populating training by applying different transformations(color space change, adding noise, changing brightness etc.). In that way I have increased training set size to 220 images. I have trained object detector with following parameters:

options.add_left_right_image_flips = True
options.C = 5
options.num_threads = 8

My object detector find credit card on people who are used among training set. Thus for those two poeple, object detector finds credit card pretty well. Those images are below:

det1 det2

However when I try detector on people who were not present on training set, detector fail to detect properly such as below:

failed_det1 failed_det2
failed_det3

Why detector can not detect a similar pattern in totally different images? It even didn't detect any card in the first image. Is object detector overfitting? I think because object detector can not find credit card properly, shape predictor can not determine landmarks as it should. So first I need to train object detector properly. Is populating training set to increase the number of images for object detector a bad practice? I assumed since increasing image number in that way provides better results with shape predictor, same will happen for object detector as well.

When training set size exceeds ~220 images, training fails because of insufficient memory. So in that case how can I train a detector which can generalize better?

I know that it's difficult to determine a certain reason but any idea for improvement is very welcome. Thanks.

Yes, it is overfitting. You need more data that is more diverse. It's just that. Like it's definitely not going to generalize to other people if there are only two people in the training dataset.

Warning: this issue has been inactive for 35 days and will be automatically closed on 2022-04-19 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

Warning: this issue has been inactive for 43 days and will be automatically closed on 2022-04-19 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.