Optimizing YOLOv8 for detecting defective capsules: annotation strategy

I am working on a model to detect defective gelatin capsules. I use YOLOv8 and annotate capsules in two classes: “normal” and “defective”. My dataset currently has 2,000 images and 10,000 annotations (5,000 per class). However, I have some doubts about this approach.

Defects can be very different: cracks, dents, chips, open or damaged halves. Because of this, the shape of the capsules changes, which may make classification more difficult.

Would it be better to annotate all capsules as one class and train the model separately to detect defects? Or maybe there are other approaches that work better for this task?

I would appreciate any advice!

Hey there

I would say labelling each defect as a separate class would make it easier and improve the accuracy like Instead of a single “defective” class, you could label defects separately e.g. “cracked,” “dented,” etc.

you could also train the model on only normal capsules and use an anomaly detection method (autoencoder, one-class SVM, or YOLO-based outlier detection) to flag anything unusual as defective but since you have a lot of data on defects and normal i would suggest the first approach

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.