ultralytics / yolov5

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

Precision and mAP not high enough #11766

Closed brys17 closed 1 year ago

brys17 commented 1 year ago

Search before asking

Question

Hi everyone! I am new to YOLOv5 and this is my first time using it. I have trained my own custom dataset regarding tea leaves diseases. I have trained using multiple YOLOv5 (n,s,m,l) and got the result of only 50-60%. Does anyone know what is the problem and how to improve the results?

Here are the parameters of my training:

Here are the results I got confusion_matrix F1_curve results val_batch1_pred

And here are the example of the dataset images IMG_20230612_152201 IMG_20230612_152924 IMG_20230612_153520 IMG_20230612_152424 IMG_20230612_153537 IMG_20230612_154643 IMG_20230612_152145 IMG_20230612_152935 IMG_20230612_153332

Additional

Any help will be appreciated! Thank you!

github-actions[bot] commented 1 year ago

👋 Hello @brys17, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics
glenn-jocher commented 1 year ago

@brys17 hi there! Thank you for reaching out and providing detailed information about your training setup.

Based on the information you provided, here are a few suggestions to improve the results of your YOLOv5 model:

  1. Increase the number of training epochs: Training for more epochs might allow the model to learn more and improve performance. You can try increasing the number of epochs and observe if it leads to better results.

  2. Try different anchor box settings: Experimenting with anchor box sizes can improve detection accuracy for different object sizes. You might want to adjust the anchor sizes in the yolov5/models/yolov5m.yaml file and retrain the model to see if it helps capture the tea leaves diseases better.

  3. Check the quality of the labeled dataset: Make sure that the tea leaves and their diseases are properly labeled in your dataset. Inspecting the annotations and ensuring they align with the tea leaves' actual locations can significantly impact the performance of the model.

  4. Explore other training techniques: You can try different techniques like mixup, mosaic augmentation, or using focal loss to improve the model's ability to handle overlapping or small objects. The YOLOv5 repository provides options to enable these techniques during training.

  5. Consider model architecture: YOLOv5 comes in different sizes (s, m, l, and x), and choosing the right architecture can impact performance. You can experiment with different architectures and assess their impact on your task.

It's worth noting that improving accuracy might require some fine-tuning and iterations. You may need to try different combinations of the above suggestions, experiment with hyperparameters, and potentially gather more training data if necessary.

Lastly, I recommend checking out the YOLOv5 GitHub Discussions and GitHub Issues as they contain valuable insights from the YOLO community. Others may have faced similar challenges and found effective solutions that could benefit you.

I wish you the best of luck with your tea leaves disease detection project! Let us know if you have any further questions or need additional assistance.

brys17 commented 1 year ago

Hi there @glenn-jocher ! Thank you for your suggestions! I will try to apply it on my work

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 ⭐

glenn-jocher commented 11 months ago

@brys17 you're very welcome! If you have any more questions or need further assistance as you apply these suggestions, feel free to ask. Best of luck with your work, and I hope the improvements yield the results you're looking for!