I have a YOLO V5 m model for a dataset to detect a certain product but after training a dataset of a variety of pictures for the product in different cases and scenarios and various lighting conditions with no repetition for the cases, on 50 epochs and the Yolo v5 medium architecture and batch size of 16.
What I have noticed is that the model is dependent on the color features, meaning that the objects that are getting detected have colors yellow and its shades. I used the train.py that comes with the yolo github clone. What should I do to fix this problem?
The dataset used in training (approx 450 images) in google drive.
The product desired to be detected:
The other products that are detected:
You're not wrong in thinking that your model is associating the yellow/red color combination to presence of this object in the image. From your dataset, it seems you have already added some augmentations to your train data (rotations, brightness etc.). Your model may work well with positive examples but it also needs negative examples. You have to train your model to understand what is NOT this object - similar to the yellow box in your 3rd picture. You don't have to specifically label them as negative example, just having such objects in your image in the background or near the object that you want to detect will suffice. When trained, the model will optimize to not detect these as the object of interest.