first of all some info about the model I'm using. I'm using YOLOR, which uses a YOLOV5 formatted dataset. I'm trying to detect components off of PCB's which are divided into some groups (visible on picture below).
I'm using a dataset which I annotated myself but I'm having the issue that my model doesn't peform as well as I want it to. My guess is ultimately that the following class imbalances is the reason for this as I think my model will probably prefer assigning Capcitor or Chip to one of the other classes because it's not sure. I made sure to not include super small components as these have no value to the predictions that I want to make.
I now want to ask how I could "level" out these graphs so they all have (at least) a similar amount of samples by using image augmentation but I have no idea how to eliminate the capacitors/chips from the dataset without the hop of it actually learning these anomalies. The reason I'm saying this is because I was thinking about the following steps:
- Augment the complete dataset and include all labels etc
- gather labels per image and count the amount of labels per class
- edit the images for a certain (random) selection of labels so that the object in question gets a "black box" applied to it, so it actually vanishes from the dataset. (image backgrounds are all black)
- evaluate class balance after doing this step and verifying that classes all have similar occurrences.
Would this be a good approach? Anyone got any experience with these kinds of issues?