Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better performance with older versions of YOLO #995

Open
1 task done
Josephts1 opened this issue Jan 24, 2025 · 2 comments
Open
1 task done

Better performance with older versions of YOLO #995

Josephts1 opened this issue Jan 24, 2025 · 2 comments
Labels
detect Object Detection issues, PR's question Further information is requested

Comments

@Josephts1
Copy link

Search before asking

Question

Hi everyone.
I'm looking for the best YOLO model for detecting mandarin oranges. I'm using my own dataset with 236 images (196 for train, 30 for val and 10 for test).
Without any pre-processing or alteration of other parameters in the YOLO model result=model.train(data="/content/drive/MyDrive/Proyecto_de_grado/data/data.yaml", epochs=100,patience=50,batch=16,plots=True,optimizer="auto",lr0=1e-4,project="/content/drive/MyDrive/Proyecto_de_grado/runs/YOLO10/l")
I've performed a training for each version of YOLO, from the YOLOv8n version to the YOLO11l version (the model used was a new model, without pre-trained weights). I plotted the mAP50-95 performance metric in validation against the number of parameters for each version of YOLO and this was the result (see image 1).
My question is: Why do older versions of YOLO have better mAP50-95 val than newer versions of YOLO?

I attach the model validation code and an image of my data set (see image 2):
metrics = model.val(data='/content/drive/MyDrive/Proyecto_de_grado/data/data.yaml', project='/content/drive/MyDrive/Proyecto_de_grado/runs/YOLO10/l')

image 1

Image

image 2

Image

Thanks for your help

Additional

No response

@Josephts1 Josephts1 added the question Further information is requested label Jan 24, 2025
@UltralyticsAssistant UltralyticsAssistant added the detect Object Detection issues, PR's label Jan 24, 2025
@UltralyticsAssistant
Copy link
Member

👋 Hello @Josephts1, thank you for reaching out and sharing your question about YOLO performance with Ultralytics HUB 🚀! Your interest in model version comparisons is exciting, and we're here to help. Here are some resources you may find useful:

  • Quickstart. Start training and deploying YOLO models with HUB in seconds.
  • Datasets: Preparing and Uploading. Learn how to prepare and upload your datasets to HUB in YOLO format.
  • Models: Training and Exporting. Train YOLOv5 and YOLOv8 models on your custom datasets and export them to various formats for deployment.
  • Projects: Creating and Managing. Group your models into projects for better organization.
  • Integrations. Explore multiple integration options for your trained models, including TensorFlow, ONNX, OpenVINO, CoreML, and PaddlePaddle.
  • Inference API. Understand how to use the Inference API for running your models in the cloud to generate predictions.

If this is a ❓ Question, could you provide additional details? For deeper analysis of the behavior across YOLO versions, it would be helpful to share:

  1. Your full training configurations (data.yaml, image resolutions, etc.) alongside any key differences between model versions, if available.
  2. A summary of your dataset annotations (e.g., number and type of object classes).
  3. Test set performance metrics (mAP50-95, precision, recall) achieved with each model.

If this is a 🐛 Bug Report about performance discrepancies, could you reproduce the issue with a minimum reproducible example (MRE)? You can find instructions for creating an MRE here: Minimum Reproducible Example. Please include any relevant logs or error messages and ensure all images or illustrations (e.g., validation plots like image 1) are correctly embedded for clarity.

We aim to address every issue as promptly as possible. This is an automated response to ensure you receive guidance quickly, but an Ultralytics engineer will follow up soon to assist further. Thank you for your patience! 😊

@pderrenger
Copy link
Member

@Josephts1 hi there,

Thanks for sharing the detailed setup and results of your experiment. It's great to see the effort you've put into systematically testing the models and plotting performance metrics! Let me clarify a few points that may help explain why older YOLO versions might be producing better results on your dataset:

  1. Dataset Size and Complexity:
    With only 236 images in your dataset, the limited data may not provide enough diversity or examples for newer, more complex models (like YOLOv10 or YOLO11) to fully leverage their advanced architectures and features. Older models (e.g., YOLOv8n) are typically smaller and may generalize better on smaller datasets due to their simpler architectures.

  2. Model Architecture vs. Dataset Fit:
    Newer YOLO versions, such as YOLOv10 and YOLO11, are optimized for larger and more complex datasets, often leveraging advanced techniques like large kernel convolutions or partial self-attention to improve performance. However, these features may not be as effective on a smaller dataset like yours, where simpler models can sometimes outperform due to reduced risk of overfitting.

  3. Training Without Pretrained Weights:
    Since you're training all models from scratch without pretrained weights, the newer models may not have had enough data to converge effectively. Pretrained weights, often trained on large datasets like COCO, provide a significant performance boost by giving the model a strong starting point, especially for smaller datasets.

  4. Hyperparameter Optimization:
    While your training parameters look reasonable, newer models might benefit from fine-tuning hyperparameters like learning rate, batch size, and optimizer settings. For example, newer models may require different learning rates or other settings to achieve optimal performance.

  5. Validation Metrics and Trade-offs:
    Newer models are designed to prioritize a balance between speed, accuracy, and efficiency. While they may not always show better mAP50-95 on small custom datasets, they often excel in real-world scenarios with larger datasets or stricter latency requirements.

Recommendations:

  • Use Pretrained Weights: Try training the models with pretrained weights (pretrained=True) to leverage transfer learning. This can significantly improve performance, especially for smaller datasets.

  • Perform Data Augmentation: Enhance your dataset using augmentations (e.g., flips, rotations, color adjustments) to increase variability and help more complex models generalize better.

  • Experiment with Smaller Models: For small datasets, smaller models like YOLOv8n or YOLOv11n may perform better due to their simplicity and fewer parameters.

  • Fine-tune Hyperparameters: Adjust parameters like lr0, batch, or even experiment with advanced optimization techniques such as learning rate schedulers.

  • Expand the Dataset: If possible, collect or augment more images to improve the training process for newer, more advanced models.

Ultimately, model performance depends on a combination of factors, including dataset size, quality, and the model's architecture. Older versions of YOLO might seem to perform better in your specific case due to the reasons outlined, but with the right adjustments, newer models could potentially outperform them.

Feel free to share further details or results if you refine your approach—we’re here to help! 😊

Happy training!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detect Object Detection issues, PR's question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants