I am training a YOLO algoriths (yolo26n-seg.pt) to detec blastocysts, an early embryo development stage, in photos. However, I am facing some trouble on the training process.
I labeled the images in ROBOFLOW with Instance segmentation tools and exported the labels in .TXT files.
At the end of the training process, yolo provides some files as output, some of them are images with mosaics of the training batch and the validation batch. Here starts my problem. I noticed that in these images the labels do not fit exactly on the top of the structure I labeled in the image, in fact it leaks a bit to the side. This pathern also happens in the predicted imagens, where there are some leak of mask in the direction of the locating box.
I tried to change some paramethers on the training script, but nothing changed.
Could someone help me to identify why is it happening and how to solve this problem?
Exemple of mosaic with validation_labels . All images in this mosaic have masks larger than the embryo. the same happens with train emages. I expected to have masks fitting perfectly on the top of the embryos in the training and validation data.
Thank you for your help. You advice helped me a lot.
My images are 5120 x 2880, a huge size for training. Adjusting the image size and activating the function retina improved the quality of the masks for training and validation set.
I still have one question. Even improving the quality of masks, the images labeled by prediction display a weird leak of the mask in the direction of the locating box. Do you know if it is normal for YOLO predicted images or do I still have a problem?
Here is an example of a image of a blstocyst correctly covered by te mask, but on the areas close to the locating box it has a extension that toutchs it. At the end, the mask is not completly round due to this extension.
And yes, that’s correct: retina_masks=True is a prediction/rendering option, not a training option. In the segmentation predictor reference it’s used when constructing inference masks, and in the mask plotting code reference it controls high-resolution mask drawing. So it won’t improve model.train() results directly.
For your case, just keep using it in prediction like: