ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
49.62k stars 16.1k forks source link

How to increase mAP@0.5 and recall value #11120

Open muttahirul opened 1 year ago

muttahirul commented 1 year ago

Search before asking

Question

Hi @glenn-jocher , I trained a custom data using yolov5m pre-trained weight to detect weather a person is pedestrian or not. My data has two classes. I use minibatch size = 16 and epochs=100. These are the hyperparameter I used: lr0: 0.01 lrf: 0.01 momentum: 0.937 weight_decay: 0.0005 warmup_epochs: 3.0 warmup_momentum: 0.8 warmup_bias_lr: 0.1 box: 0.05 cls: 0.5 cls_pw: 1.0 obj: 1.0 obj_pw: 1.0 iou_t: 0.2 anchor_t: 4.0 fl_gamma: 0.0 hsv_h: 0.015 hsv_s: 0.7 hsv_v: 0.4 degrees: 0.0 translate: 0.1 scale: 0.5 shear: 0.0 perspective: 0.0 flipud: 0.0 fliplr: 0.5 mosaic: 1.0 mixup: 0.0 copy_paste: 0.0 I have 2550 train image and 451 validation image. I also added 2% background image with no labels as per previous issues suggestions. I got only 0.508 mAP @0.5 and very low recall value. From result, I can also see the val/obj loss and val/class loss is increasing. Also from confusion matrix, I got 0% correctly predicted background which is very confusing me. Could you give any suggestion or direction to increase mAP value,please?

results train_batch1 confusion_matrix F1_curve labels P_curve PR_curve R_curve

Additional

No response