Malathi K
Malathi K

Reputation: 71

Tensorflow Object Detection API - Detecting the humans not wearing Helmet

*** Please note, my previous problem of detecting withouthelmet as NA is resolved.

Now I have a new issue, I used 1000 images for detecting humans not wearing helmets and also 1000 images for humans wearing helmet and 1000 images for only humans. I used SSD_mobilenet_v1_pets.config file for training.

Here is my pbtxt file

item {
    id: 1
    name: 'withouthelmet'
}
item {
    id: 2
    name: 'withhelmet'
}
item {
    id: 3
    name: 'person'
}

sample training Image enter image description here

After the training my model detect every car as person..

enter image description here

Is that because of using ssd_mobilenet model(id: 1 for person but I used id: 1 as withouthelmet and id:3 for car but I used id:3 for person)

Pls help me to solve this problem

Upvotes: 0

Views: 2530

Answers (2)

Zhichao Lu
Zhichao Lu

Reputation: 244

  1. Have you set num_classes to 1 in your config?
  2. Please note that min_negatives_per_image means min # of negative anchors (instead of images) so you data mix has nothing to do with this parameter.

I had to modify earlier answer - if you add a background image(image with no gt boxes) to the dataset, it should help reduce false positives. Sorry I got confused with some other stuff.

Upvotes: 1

netanel-sam
netanel-sam

Reputation: 1912

Have you used the pre-trained SSD-MobileNetV1 model trained on the pets dataset? I think you better use a model trained on COCO dataset since it has persons, in contrast to pets. Of course that if you train your model it will learn to detect the person as well, but since you don't have a lot of examples of persons without a helmet, it would probably be better to start with a model which knows what a person is.

Regarding your questions, if you only want to detect people without helmet, you can simply drop everything else in the pbtxt file, only put

item {
  id: 1
  name: 'withouthelmet'
  display_name: 'withouthelmet'
}

change the number of categories in the config file to 1, and fine-tune the model.

Upvotes: 0

Related Questions