Coder Social home page Coder Social logo

Is yolov5 sensitive to the size of defects and what structural improvements are needed to increase its sensitivity to defects? about yolov5 HOT 6 CLOSED

AFallDay avatar AFallDay commented on September 26, 2024
Is yolov5 sensitive to the size of defects and what structural improvements are needed to increase its sensitivity to defects?

from yolov5.

Comments (6)

glenn-jocher avatar glenn-jocher commented on September 26, 2024 1

Hi @SwHaraday,

Thank you for sharing your observations! 😊

You bring up a valid point about the potential impact of Mosaic Augmentation on small defects. Indeed, when ground truth boxes are cut during augmentation, it can lead to unintended training data and over-detection issues.

To address this, you can modify the Mosaic Augmentation process to ensure that ground truth boxes remain intact. This can be done by adding a function to check and adjust the placement of boxes during augmentation.

Additionally, you might consider experimenting with other augmentation techniques or adjusting the augmentation parameters to better suit your specific use case.

Your insights are valuable to the community, and we appreciate your contribution!

from yolov5.

glenn-jocher avatar glenn-jocher commented on September 26, 2024 1

Hi @SwHaraday,

Thank you for sharing your implementation! 😊 Your contribution is valuable, and it's great to see the community working together to solve common issues. Every improvement, no matter how small, helps us all move forward.

For anyone facing similar challenges, your solution could be a helpful resource. Keep up the great work!

from yolov5.

glenn-jocher avatar glenn-jocher commented on September 26, 2024

@AFallDay hello! 😊 YOLOv5 can indeed be sensitive to the size of defects, especially very small or very large ones compared to the overall image size. To enhance sensitivity to defect sizes, consider the following:

  1. Adjust Anchor Boxes: Customize anchor boxes to better match the typical sizes of defects in your dataset. This can be done by analyzing the distribution of defect sizes and adjusting the anchor box dimensions accordingly in the model's configuration.

  2. Image Resolution: Training and inference with higher image resolutions can help in detecting smaller defects. You can adjust the --img-size parameter during training and detection to a higher value suitable for your needs.

  3. Data Augmentation: Use augmentation techniques that emphasize size variations, like scaling and cropping, to make the model more robust to different defect sizes.

  4. Model Layers: Experiment with adding more layers or adjusting the depth of the network, as deeper networks might capture more detailed features, though at the cost of increased computational resources.

For more detailed guidance on customizing your model, you might find the documentation on model configuration and training tips helpful: https://docs.ultralytics.com/yolov5/.

Hope this helps! Let us know if you have any more questions.

from yolov5.

SwHaraday avatar SwHaraday commented on September 26, 2024

Hi,
If your deffects are small like 25x25 pixels in 640x640 image and have just slight defference from normal part, model tends to over-detect.
One possible reason is that Ground Truth Boxes are cut during Mosaic Augmentation and used as unintended training data.
In our case of surface deffect detection, I observed about 30% Ground Truth Boxes in trainig batch were cut and not as I anotated.
Model trained in default way works nice, but you may struggle with over detection.

You may need to add some function to keep Ground Truth Boxes as you intended during Mosaic Augmentation.

from yolov5.

SwHaraday avatar SwHaraday commented on September 26, 2024

Hi Glenn,
Thank you for reply. I never expected to have comment from you.
I hope this helps someone who has the same problem.
The implimentation is poor and childish, but at least it works.

https://github.com/SwHaraday/YOLOv5-dataloaders-for-industrial-purpose

from yolov5.

github-actions avatar github-actions commented on September 26, 2024

πŸ‘‹ 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 ⭐

from yolov5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.