yolov9 icon indicating copy to clipboard operation
yolov9 copied to clipboard

High False Positives with Background Class in Confusion Matrix

Open Nomiluks opened this issue 10 months ago • 1 comments

After training my model on a single class, I noticed that it performed well on both the validation and test datasets when I looked into the predictions. However, upon closer inspection of the confusion matrix generated during training, I observed a significant number of false positives associated with the background class.

confusion_matrix

Additional Context: In the dataset, I provided an empty label.txt file when there was no object present in the image.

Request: I would appreciate any insights or suggestions on why this issue might be occurring and how to address it effectively. Thank you for your assistance!

Nomiluks avatar Mar 27 '24 12:03 Nomiluks

@WongKinYiu, @Youho99, I would greatly value your insights on this matter. Thank you kindly.

Nomiluks avatar Mar 27 '24 19:03 Nomiluks

Can you show your mAP:0.5 and F1 Score curves?

This could be due to many things... And also, How many epochs have you done your training for? Is your training in detection, or in classification?

Youho99 avatar Mar 28 '24 10:03 Youho99

Can you show your mAP:0.5 and F1 Score curves?

This could be due to many things... And also, How many epochs have you done your training for? Is your training in detection, or in classification?

I have posted the graphs, could you please have a look at the post again at the top? I used the train.py file at the root level of the repo yolov9/train.py which doesn't belong to any other folder

Nomiluks avatar Mar 28 '24 10:03 Nomiluks

It's strange... What is the distribution of your dataset, in%, and in raw number of images (for train/val, and your test dataset if you have)

Youho99 avatar Mar 29 '24 08:03 Youho99

It's strange... What is the distribution of your dataset, in%, and in raw number of images (for train/val, and your test dataset if you have)

train: 80%, val: 10%, test: 10%

train: 4490 samples test: 560 samples val: 560 samples

Nomiluks avatar Mar 29 '24 08:03 Nomiluks

And the distribution between images with detection object, and background images?

Also, is it possible to see a val_batch_label and its corresponding val_batch_predict?

Youho99 avatar Mar 29 '24 09:03 Youho99

And the distribution between images with detection object, and background images?

Also, is it possible to see a val_batch_label and its corresponding val_batch_predict?

Images with object: 2837 Images without object: 2776

val_batch_label and its corresponding val_batch_predict:

Label: val_batch2_labels

Prediction: val_batch2_pred

Nomiluks avatar Mar 29 '24 10:03 Nomiluks

What we can say is that the confusion matrix does not agree with the val_batches

Maybe there is a bug in calculating the confusion matrix, I don't know In any case, personally, I have never experienced this

Youho99 avatar Mar 29 '24 10:03 Youho99

What we can say is that the confusion matrix does not agree with the val_batches

Maybe there is a bug in calculating the confusion matrix, I don't know In any case, personally, I have never experienced this

Yup, thanks for your time. I really appreciate.

Nomiluks avatar Mar 29 '24 10:03 Nomiluks