Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to train the ssd model using negative dataset #1891

Open
mepl432 opened this issue Sep 13, 2024 · 3 comments
Open

How to train the ssd model using negative dataset #1891

mepl432 opened this issue Sep 13, 2024 · 3 comments

Comments

@mepl432
Copy link

mepl432 commented Sep 13, 2024

Hello,

All I read is that dataset for a single object detection in pascal voc format should have labels.txt file containing a single label which is to be identified and that labels.txt should not contain class 0 label of "BACKGROUND" in the dataset. I read that BACKGROUND Label will be generated in the folder where model is stored after training along with the class 1 label for actual object which is detected.

How then do I train the model with my negative samples dataset which does not contain the actual object which is detected in the positive samples with annotated bounding box. Negative samples are used to reduce false positives and there is a major need to train ssd model with it.

@dusty-nv and community could you please guide. Thanks in advance

@dusty-nv
Copy link
Owner

@mepl432 train_ssd.py will automatically add the BACKGROUND class and pull negative training samples from your dataset. Otherwise you can modify the code as needed - mine is just a fork of the upstream repo here - https://github.com/qfgaohao/pytorch-ssd

@mepl432
Copy link
Author

mepl432 commented Sep 13, 2024

Thank you for the prompt response @dusty-nv . When you say pull the negative samples, this is based on their Annotations xml file..correct? so if my negativesample.jpg has corresponding negativesample.xml in Annotations folder as below , then it will be considered negative sample and the model will train on it using the 'BACKGROUND' label automatically?

<annotation>
  <folder>negative_samples</folder>
  <filename>negativesample.jpg</filename>
  <size>
    <width>640</width>
    <height>480</height>
    <depth>3</depth>
  </size>
  <segmented>0</segmented>
  <!-- No object tags -->
</annotation>

@dusty-nv
Copy link
Owner

dusty-nv commented Sep 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@dusty-nv @mepl432 and others