Datasets with "Background Images" #2670
-
Hello everyone, I've finetuned a model on some custom data and am getting many false positives and had been pondering whether there might be a way to introduce "negative" examples that basically provide a way to tell the model that the image does not contain our objects. So, for example, if I trained a one class detection model for goldfish that was getting false positives in images containing beta fish, I might include images with just beta fish in my dataset in order to help reduce the false positives from the similar looking betafish. I have been unable to find the proper terminology for what this is called but I did see it referred to as a "background image" in this post about improving model performance. Does anyone know where I can find more details on this concept? and how can I introduce this kind of data into training with YOLOv5? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@AlexanderJGomez yes that's correct, introducing background images will help reduce False Positives (FPs). You can introduce FPs into your dataset simply by putting them in your Lines 12 to 15 in 2a28ef3 |
Beta Was this translation helpful? Give feedback.
-
Perfect! @glenn-jocher thanks for the quick response. Side note: very much appreciate all the work you're doing with the repository. I hope you continue the great work |
Beta Was this translation helpful? Give feedback.
@AlexanderJGomez yes that's correct, introducing background images will help reduce False Positives (FPs). You can introduce FPs into your dataset simply by putting them in your
train:
andval:
directories (example from voc.yaml shown below). No labels *.txt files are required and no other action is required, YOLOv5 will detect and train with the additional background images next time you train.yolov5/data/voc.yaml
Lines 12 to 15 in 2a28ef3