0

I used the Open Images dataset to train the CNN for two classes: Person, Mobile phone. The problem is that Yolo detects only 1 class per image. For example, if an image contains a human and a mobile phone, only mobile phones will be detected. Example Output. If there are only humans, then all humans will be detected successfully. I think the problem is that the dataset has only images with 1 class marked per image. I have many images in dataset where both classes are present, but only one of them is marked with labels. Can that be the problem?

How can I solve the problem?

  1. Add several images with both classes marked
  2. Mark all images to make sure that every image that contains both phone and person has appropriate label for each object
  3. Or maybe there is a way to download the dataset so that both classes are marked correctly?

Here is what in my .names file:

Person
Mobile_phone

And here is .data file:

classes = 2
train = data/train.txt
valid = data/test.txt
names = data/obj.names
backup = /mydrive/yolov4/backup

Thanks for your help!

WefPok
  • 13
  • 5
  • Could you please provide your *.data file, *.names file and cfg file? – Addie Ira B. Parico Feb 01 '21 at 17:24
  • @A.Parico Added the contents of the .names and .data files. The config file is too big, but if you think the problem is in yolo layers, I'm 100% sure that I edited filters and classes correctly at all 3 layers. – WefPok Feb 02 '21 at 18:45

2 Answers2

0

Upon checking the Open Images Dataset V6 (Type: Bounding Boxes) with the class "Mobile Phone," I saw that the bounding boxes containing what we consider under the class "person" were inconsistently labeled as "Man, Woman, Girl, Human Face, etc." These should be labeled as "Person."

I recommend these two choices:

  • Make sure all images are correctly and labeled with the corresponding classes consistently. Do not let an image with a person go unlabeled (unless it's too truncated).
  • Tip: I recommend using negative samples -- images without the objects of interest to avoid cases of false positives such as swirls on the floor that look like people
  • You can also try using other datasets where you can have what I said above. Example: MSCOCO (https://cocodataset.org/)
0

Check the label or the .txt file. If it has two classes the first column in the .txt file will have 0 and 1, where 0 indicates for person class and 1 for mobile phone or vise versa.