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

Multi-scale of yolov8-obb #11742

Open
1 task done
csh313 opened this issue May 8, 2024 · 8 comments
Open
1 task done

Multi-scale of yolov8-obb #11742

csh313 opened this issue May 8, 2024 · 8 comments
Labels
question Further information is requested

Comments

@csh313
Copy link

csh313 commented May 8, 2024

Search before asking

Question

Hi, I am learning yolov8obb project with DOTAv1 dataset, but the experiments run are not good, the map50 is only about 50%, using default.yaml and provided DOTAv1, how can I boost the map, do I need to use multi-scale? I checked on issues that multi-scale segmentation may be needed, do I need rates=[0.5, 1.0, 1.5], gap=500 to get the data and then train it?
微信截图_20240508100635

Additional

No response

@csh313 csh313 added the question Further information is requested label May 8, 2024
Copy link

github-actions bot commented May 8, 2024

👋 Hello @csh313, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

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.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

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

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@csh313 csh313 changed the title yolov8-obb的多尺度 Multi-scale of yolov8-obb May 8, 2024
@glenn-jocher
Copy link
Member

Hey there! 🙌

Multi-scale training can indeed help improve mAP by making your model more robust to various object sizes, especially in a diverse dataset like DOTAv1. Here's how you can adjust your training settings to include multi-scale:

yolo train data=coco128.yaml model=yolov8n-obb.yaml imgsz=640 multi_scale=True msev=[0.5, 1.0, 1.5] msevp=500

This setup enables multi-scale training with scales ranging from 0.5x to 1.5x, evaluated every 500 batches. Give this configuration a try, and you might see an enhancement in your model's performance. Let us know how it goes! 😊

@csh313
Copy link
Author

csh313 commented May 8, 2024

Hey there! 🙌

Multi-scale training can indeed help improve mAP by making your model more robust to various object sizes, especially in a diverse dataset like DOTAv1. Here's how you can adjust your training settings to include multi-scale:

yolo train data=coco128.yaml model=yolov8n-obb.yaml imgsz=640 multi_scale=True msev=[0.5, 1.0, 1.5] msevp=500

This setup enables multi-scale training with scales ranging from 0.5x to 1.5x, evaluated every 500 batches. Give this configuration a try, and you might see an enhancement in your model's performance. Let us know how it goes! 😊

But I divided them after splitting the TRAIN dataset into about 100000 sheets, the training time is too long, the training reached 76% in 2 days, is it ok to train this way, is it the same as the official training with yolov8n-obb.pt weights?

@glenn-jocher
Copy link
Member

Hey! 👋

For large datasets like yours, it's quite normal for training to take a significant amount of time, especially with multi-scale settings which can add to the computational workload. However, training directly on such a large dataset with additional augmentations will help your model generalize better, even if it's slower.

If training time is a concern, here are a few suggestions:

  1. Reduce the batch size - This might speed up the process slightly, though it could impact training stability.
  2. Use more GPUs - If available, distributing the workload can substantially decrease training time.
  3. Interrupt and resume - YOLOv8 supports interrupting the training process and resuming from the last checkpoint which can be helpful in managing long training sessions.

Training like this isn't quite the same as using pre-trained yolov8n-obb.pt weights directly, as starting from pre-trained weights (transfer learning) can normally achieve good performance faster. Direct training from scratch on your specific dataset helps in fine-tuning the model more meticulously to your data.

Happy training, and let me know how it progresses! 🚀

@csh313
Copy link
Author

csh313 commented May 8, 2024

Hey! 👋

For large datasets like yours, it's quite normal for training to take a significant amount of time, especially with multi-scale settings which can add to the computational workload. However, training directly on such a large dataset with additional augmentations will help your model generalize better, even if it's slower.

If training time is a concern, here are a few suggestions:

  1. Reduce the batch size - This might speed up the process slightly, though it could impact training stability.
  2. Use more GPUs - If available, distributing the workload can substantially decrease training time.
  3. Interrupt and resume - YOLOv8 supports interrupting the training process and resuming from the last checkpoint which can be helpful in managing long training sessions.

Training like this isn't quite the same as using pre-trained yolov8n-obb.pt weights directly, as starting from pre-trained weights (transfer learning) can normally achieve good performance faster. Direct training from scratch on your specific dataset helps in fine-tuning the model more meticulously to your data.

Happy training, and let me know how it progresses! 🚀

I use split_trainval with gap=200, rates=[1.0] from the source code for dota segmentation and then train without using pre-training weights to reach more than 70% after 100 epoch, can this be called multiscale training, and can the training results be taken as a way of augmenting the data using the unsegmented dataset?

@glenn-jocher
Copy link
Member

Hello! 👋

It sounds like you're making great strides with your training! Using split_trainval with gap=200 and rates=[1.0] effectively varies the input data, which can indeed be considered a form of data augmentation. However, true multi-scale training typically involves dynamically adjusting the input sizes during training (imgsz in different scales), which isn't explicitly mentioned in your method.

Your approach is valid and beneficial, but if you want to incorporate multi-scale training, consider varying the imgsz parameter during training. This can help enhance your model's robustness to different object sizes. The results you're seeing are promising, demonstrating that even without traditional multi-scale training or pre-trained weights, your model can achieve substantial accuracy by effectively utilizing data augmentation strategies on your dataset.

Keep up the great work! 🚀

@csh313
Copy link
Author

csh313 commented May 9, 2024

Hello! 👋

It sounds like you're making great strides with your training! Using split_trainval with gap=200 and rates=[1.0] effectively varies the input data, which can indeed be considered a form of data augmentation. However, true multi-scale training typically involves dynamically adjusting the input sizes during training (imgsz in different scales), which isn't explicitly mentioned in your method.

Your approach is valid and beneficial, but if you want to incorporate multi-scale training, consider varying the imgsz parameter during training. This can help enhance your model's robustness to different object sizes. The results you're seeing are promising, demonstrating that even without traditional multi-scale training or pre-trained weights, your model can achieve substantial accuracy by effectively utilizing data augmentation strategies on your dataset.

Keep up the great work! 🚀

I tried to use your ‘yolo train data=coco128.yaml model=yolov8n-obb.yaml imgsz=640 multi_scale=True msev=[0.5, 1.0, 1.5] msevp=500’ but got an error: ‘’msev' is not a msev‘ is not a valid YOLO argument. “msevp” is not a valid YOLO argument’. How to set up multi-scale training?

@glenn-jocher
Copy link
Member

Hello! 👋

It looks like there was a typo in the earlier message. To enable multi-scale training in YOLOv8, use the multi_scale parameter correctly without 'msev' and 'msevp'. Here's how you can set it up:

yolo train data=coco128.yaml model=yolov8n-obb.yaml imgsz=640 multi_scale=True

Just set multi_scale=True, and the system will automatically adjust image sizes during training. This should help boost your model's adaptability to varying object sizes. Let me know if this resolves the issue or if there's anything else you need help with! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants