Yolov8 does not learn to detect small objects, while segmentation model detects objects #2780
SixtyTrees
started this conversation in
General
Replies: 1 comment 1 reply
-
Solved the problem. See this answer: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to train Yolov8 to detect black dots on human skin. An example of skin and markup is shown below. I've cropped images to 256x256 pixels (with some overlap). Then selected crops that have at least one label. This way I got train, test and validation datasets (4270, 1391 and 1400 images respectively). I cannot resize or skew images because the objects are too small. Cannot do random crop either because a significant portion of an image does not have objects.
A segmentation model from
segmentation_models_pytorch
predicts black dots with IoU=0.15. This is decent, given that the markup is rectangular (while after image rotation augmentation the best guess is a circle) and that the object doesn't have a clear boundary (unlike a car or a chair).I've tried training Yolov8 with command
yolo detect train data=D:\workspace\ultralytics\my_coco.yaml model=yolov8n.yaml epochs=100 imgsz=256 workers=2 close_mosaic=100 project='bd' flipud=0.5 mosaic=0.0
Each epoch reports
Full output can be found here
https://pastebin.com/TLz32ZRv
What should I change in the image preparation, command arguments, etc to train Yolov8?
A different command yields better results
yolo detect train data=D:\workspace\ultralytics\my_coco.yaml model=yolov8n.pt epochs=100 imgsz=256 workers=2 close_mosaic=0 project='bd' flipud=0.5 mosaic=0.5
I still get nan for training after epoch and some values during epoch. For example:
6/100 1.05G 3.279 2.164 0.937 565 256: 47%|████▋ | 126/267 [00:20<00:22, 6.22it/s]
Also, note that validation gets stuck at values from the first epoch.
https://i.stack.imgur.com/O1Cxl.png
https://i.stack.imgur.com/X0laM.png
Beta Was this translation helpful? Give feedback.
All reactions