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

data augmentation on yolov8-pose #12703

Open
1 task done
ZZJzhou opened this issue May 15, 2024 · 1 comment
Open
1 task done

data augmentation on yolov8-pose #12703

ZZJzhou opened this issue May 15, 2024 · 1 comment
Labels
question Further information is requested

Comments

@ZZJzhou
Copy link

ZZJzhou commented May 15, 2024

Search before asking

Question

Hello, i have tried apply data augmenation on the training procedure with custom dataset, but i cannot reach the desired result. Can you help me find out where the problem is?

Here is my project backgrounds:

I want to detect the keypoints of object A, and the images of dataset contain object A, B, C, and usually object A exists in the left corner while others exist in the right corner. The model can achieve high accuracy in such datasets. However, in real application, it is possible that object A occurs in the right corner while object B occurs in the left corner, then the model tends to recognize the left object B as detected result and cannot recognize the right object A. Then I assume that model tends to learn the left object, and if I use data augmentation like left-right-flip" then is will be solved.

So I modify the training code like that:

results = model.train(data='config.ymal', epochs=1000, imgsz=1280, augment=True,fliplr=1)

However, the model still can not detect the object A in the filped image while it can detect the object A in the unflipped image.
Is anywhere i miss out to change?

BTW, there is another issue:

I trained a custom model for a dataset_1 with 200+ images(synthesized images) as model_1.pt with high accuracy,
then I wanna use another dataset_2 with 20+ images(real images) to fine-tune the model,
So I train the model_1.pt with dataset_2 to get model_2.pt

model = YOLO("model_1.pt") //load pretrained model

But model_2.pt can only detect object in dataset_v2 but failed on dataset_v1.

I wanna know if my idea appliable and where is the problem ?

Thanks in advance

Additional

No response

@ZZJzhou ZZJzhou added the question Further information is requested label May 15, 2024
@glenn-jocher
Copy link
Member

@ZZJzhou hello,

It sounds like you're facing a couple of issues with data augmentation and model generalization. Let's tackle them one by one.

  1. Data Augmentation:
    For the problem you described with object A's position, your approach with left-right flip augmentation sounds reasonable. However, the key might also be to check if your dataset includes enough varied examples (i.e., object A in different positions relative to other objects). The flip augmentation should work as long as it's activated properly in your configuration. Ensure augment='True' and fliplr=1 are set correctly in your training configuration. Also, verify that your augmentation logic is being applied as expected by examining some of the augmented images.

  2. Model Fine-tuning:
    When you fine-tune model_1.pt with a smaller dataset (dataset_2), the model might become overfitted to the specifics of dataset_2, leading to poor performance on dataset_1. This is a common challenge when the additional training data (dataset_2) is much smaller or not diverse enough compared to the base training data (dataset_1). To mitigate this:

    • Ensure diversity in dataset_2 or increase its size.
    • Introduce regularization techniques during training (like dropout) to prevent overfitting.
    • Consider using a lower learning rate and fewer epochs for fine-tuning to avoid drastic changes to the already learned features.

By addressing these aspects, you should hopefully see improvements in your model's performance and generalization across different datasets and scenarios.

If issues persist, feel free to share more details, like specific logs or example results, so we can dive deeper!

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