Bharathi S
Bharathi S

Reputation: 11

Why does YOLO add 'background' class to the object detection even when we have not added that class? How to remove it?

Why does YOLO add 'background' class to the object detection even when we have not added that class? How to remove it?

I am trying to train YOLO v8x model on custom data. In the confusion matrix I saw that background class has been added which I haven't annotated. Later I observed this happening with YOLO v5 as well. If anyone has any idea on this , could you please tell me? Also, how to remove this class? and where can we check which all classes are considered in the model for training?

Upvotes: 1

Views: 4036

Answers (1)

hanna_liavoshka
hanna_liavoshka

Reputation: 1323

You can access the model's classes list by calling model.names. It will not contain the 'background' class because this is the default concept defining false-positive predictions of your model when it sees non-existing objects in the background. No need to try to remove it. It is useful to show it in a confusion matrix, so you can estimate the model performance relative to if it tends to generate false-positive predictions and which of your classes are subject to this mistake.

Upvotes: 0

Related Questions