WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.26k stars 4.18k forks source link

Suggestion to distinguish digital digit 2 and 5 in images. #1428

Open dsbyprateekg opened 1 year ago

dsbyprateekg commented 1 year ago

Hi,

I need your suggestion to improve my custom-trained model based on YOLOv7W. In the following type of images, my model is getting confused between the digits 2 and 5- image

The model is creating 2 bbox around digit 2. The confidence score for digit 2 is 82% and for digit 5 it is 87% although digit 5 is not present here. In my training, I only enabled the rotation hyperparameter to 90.0, the rest are default settings.

Please suggest to me how to fix this issue?

faizan1234567 commented 1 year ago

When you rotate 2, it will be like 5. It is recommended to use data augmentation options that capture your real-world scenario. Further, add more images of digit 2 in the training dataset to make it diverse. Hope it helps

faizan1234567 commented 1 year ago

did you enable horizontal flip? This might cause making making 5 from 2.

dsbyprateekg commented 1 year ago

@faizan1234567 I had enabled the rotation option and disabled the fliplr option but issue still exists.

faizan1234567 commented 1 year ago

Could you please tell what's your performance metric on training, val, and test. And are you testing on a video? Do you have enough images that differentiate 5 from 2. Could you reduce your rotation range? I think adding more data for 2 and 5 in different settings will improve.

dsbyprateekg commented 1 year ago

I am testing on images only. And this was the metric result when I trained with no rotation (0.0) and no fliplr option: image

faizan1234567 commented 1 year ago

is it on test set?

dsbyprateekg commented 1 year ago

No, training and val accuracy.

faizan1234567 commented 1 year ago

Your model has good performance on validation set on 2 and 5 classes. Did you measure it's accuracy on test set? Where does it make errors?

dsbyprateekg commented 1 year ago

Yes, I tested 185 images and among them, in 27 images it is failing.

damvantai commented 1 year ago

@faizan1234567 I had enabled the rotation option and disabled the fliplr option but issue still exists.

You disable in file hyp.scratch.p5 or in code with option --evolve? you should access /run/train/name_train{}/trainbatch{}.jpg? to watch image have flipup or flipleft right?