ultralytics / yolov5

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

Object occlusion and overlapping issue #8793

Closed zyakubova86 closed 2 years ago

zyakubova86 commented 2 years ago

Search before asking

Question

Trained custom object with more than 30 thousand images passing on conveyor belt. The issue is when more than one object is on conveyor occluded or overlapped each other model is detecting them as one object and putting one bbox. How can I fix this issue? How can I improve my model? I really appreciate any suggesstion.

Additional

No response

glenn-jocher commented 2 years ago

@zyakubova86 👋 Hello! Thanks for asking about improving YOLOv5 🚀 training results.

Most of the time good results can be obtained with no changes to the models or training settings, provided your dataset is sufficiently large and well labelled. If at first you don't get good results, there are steps you might be able to take to improve, but we always recommend users first train with all default settings before considering any changes. This helps establish a performance baseline and spot areas for improvement.

If you have questions about your training results we recommend you provide the maximum amount of information possible if you expect a helpful response, including results plots (train losses, val losses, P, R, mAP), PR curve, confusion matrix, training mosaics, test results and dataset statistics images such as labels.png. All of these are located in your project/name directory, typically yolov5/runs/train/exp.

We've put together a full guide for users looking to get the best results on their YOLOv5 trainings below.

Dataset

COCO Analysis

Model Selection

Larger models like YOLOv5x and YOLOv5x6 will produce better results in nearly all cases, but have more parameters, require more CUDA memory to train, and are slower to run. For mobile deployments we recommend YOLOv5s/m, for cloud deployments we recommend YOLOv5l/x. See our README table for a full comparison of all models.

YOLOv5 Models

Training Settings

Before modifying anything, first train with default settings to establish a performance baseline. A full list of train.py settings can be found in the train.py argparser.

Further Reading

If you'd like to know more a good place to start is Karpathy's 'Recipe for Training Neural Networks', which has great ideas for training that apply broadly across all ML domains: http://karpathy.github.io/2019/04/25/recipe/

Good luck 🍀 and let us know if you have any other questions!

github-actions[bot] commented 2 years ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

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 YOLOv5 🚀 and Vision AI ⭐!

aarwitz commented 11 months ago

Having this issue as well. Anyone aware of an object detector used for multiple objects overlapping?

glenn-jocher commented 11 months ago

@aarwitz yOLOv5 is a popular and widely-used object detection algorithm, and it has been trained on datasets that contain overlapping objects. However, detecting multiple objects that are overlapping can still be a challenging task for any object detector, including YOLOv5.

To improve the performance of your model in detecting overlapping objects, I would suggest considering the following steps:

  1. Increase the size of your dataset: A larger and more diverse dataset can help the model learn better representations of overlapping objects.

  2. Improve the labeling accuracy: Ensure that the bounding box labels accurately enclose each object, leaving no space between the boxes and the objects themselves.

  3. Increase the model complexity: You can try using larger YOLOv5 models, such as yolov5l or yolov5x, which have more parameters and can capture more fine-grained details.

  4. Experiment with different hyperparameters: Try adjusting hyperparameters like the learning rate, weight decay, and augmentation strategies to find optimal settings for your dataset.

  5. Consider post-processing techniques: You could explore additional post-processing techniques like non-maximum suppression (NMS) with lower overlap thresholds to improve the handling of overlapping objects.

Remember that it is important to evaluate the performance of your model using appropriate metrics like precision, recall, and mean Average Precision (mAP) to assess the impact of the changes you make.

Please note that successfully detecting overlapping objects is still an active area of research, and while YOLOv5 provides a solid starting point, it may not always produce perfect results in these scenarios.