ultralytics / ultralytics

NEW - YOLOv8 🚀 in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
28.73k stars 5.7k forks source link

Inaccurate segmentation boundary #962

Closed jiaqizhang123-stack closed 1 year ago

jiaqizhang123-stack commented 1 year ago

Search before asking

Question

Hello, when I use yolov8 to train and test my dataset, the evaluation index is very high, but the segmentation boundary of the image will have the following problems. How can I solve this problem? The problem still exists when using large models image

Additional

No response

glenn-jocher commented 1 year ago

Here are some suggestions to improve the quality of the generated segmentation mask:

Increase the training data: Having more training data, especially for the specific objects you are trying to detect and segment, can help improve the quality of the segmentation mask.

Use more advanced augmentation techniques: Augmentations like random crops, random rotations, and color jitter can help the model learn more robust features and improve the accuracy of the segmentation mask.

Adjust hyperparameters: Try adjusting the learning rate, batch size, and other hyperparameters to optimize the model's performance.

Experiment with different architectures: Some architectures might be better suited for your specific problem than others. Consider trying different architectures and see which one gives you the best results.

Fine-tune the model: If you have a pre-trained model, fine-tuning it on your specific dataset can improve the quality of the segmentation mask.

Use post-processing techniques: Post-processing techniques like morphological operations and contour detection can help refine the segmentation mask and extract the object contour more accurately.

Use a combination of detection and segmentation: In some cases, using a combination of object detection and segmentation can help improve the accuracy of the segmentation mask. For example, you can use object detection to identify the objects in the image and then use segmentation to extract the exact contour of the objects.

jiaqizhang123-stack commented 1 year ago

Thanks. For "Use a combination of detection and segmentation: In some cases, using a combination of object detection and segmentation can help improve the accuracy of the segmentation mask. For example, you can use object detection to identify the objects in the image and then use segmentation to extract the exact contour of the objects.", I don't quite understand. Can you explain it in detail And, by increasing the size of the ground truth frame clipping mask,the problem of inaccurate segmentation boundary can be reduced

github-actions[bot] commented 1 year ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

pderrenger commented 10 months ago

@jiaqizhang123-stack certainly! When using a combination of object detection and segmentation, the idea is to first use object detection to identify the objects within an image. Object detection can accurately locate and classify different objects but does not provide precise boundaries for segmentation.

Once the objects are detected, segmentation can be applied to each identified object individually to extract the exact contour or boundary of the object. This additional segmentation step fine-tunes the results obtained from object detection, providing more accurate and precise boundaries for the objects.

By increasing the size of the ground truth frame clipping mask, you can indeed reduce the problem of inaccurate segmentation boundaries. This adjustment basically expands the area surrounding the object of interest in the ground truth data, helping the model learn to better capture the full extent of the object during training. This, in turn, can lead to more accurate segmentation boundaries in the resulting predictions.