-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
A Problem Concerning the Custom Dataset for Object Detection Using YOLOv5 #13113
Comments
👋 Hello @MatthewCarryOn, 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. RequirementsPython>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf 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 |
Hello @MatthewCarryOn, Welcome to the YOLOv5 community! It's great to see your interest in applying YOLOv5 to your custom object detection task. Let's address your questions one by one:
For best practices, ensure that your labels are consistent and accurate, and consider adding some background images (images with no objects) to reduce false positives. You can refer to our Tips for Best Training Results for more detailed guidance. Here's a quick example of how you might start training with your custom dataset: python train.py --data custom.yaml --weights yolov5s.pt --epochs 300 --img 640 This command uses the small YOLOv5 model ( Feel free to share any training results, plots, or additional questions you have. The community and the Ultralytics team are here to help! Best of luck with your project! 🍀 |
Thank you for your quick, concise and effective explanation! It's my great honor and really helps a lot for a beginner. |
Hello @MatthewCarryOn, Thank you for your kind words! We're thrilled to hear that the information was helpful to you. The credit goes to the amazing YOLO community and the dedicated Ultralytics team who continuously strive to make these tools accessible and effective for everyone. If you encounter any further questions or need additional assistance as you progress with your project, please don't hesitate to reach out. Sharing your training results, plots, or any specific issues you face can help us provide more targeted support. Remember, the Tips for Best Training Results guide is a valuable resource as you refine your dataset and training process. It covers a wide range of best practices that can significantly enhance your model's performance. Best of luck with your object detection task, and happy training! 🚀 Warm |
Hi @glenn-jocher and everyone, I built a custom dataset composed of:
I'm a bit confused about how these background images will impact the CNNs to improve my model's performance, beyond just mathematically reducing false positives (FPs). From my superficial perspective, it "reminds" the network of its original background through detecting nothing, but I cannot fully understand why. Could someone explain the mechanisms or benefits involved intuitively? Furthermore, I'm fascinated by the relationship between target objects and their correlation with the background. My current thought is that because of multi-dimensional feature extraction(backbone) and merging(neck), the CNNs learn the features of the target objects themselves as well as their correlative features with the background(which should be irrelative to the objects). This seems paradoxical and quite perplexing to me. Any further suggestions for the construction of my dataset are welcome! I would be more than delighted if anyone could provide me with effective ideas or reference materials about my perplexity. I'm working hard to better the foundation of the task, which is the dataset. Best regards, |
Hi @MatthewCarryOn, Thank you for sharing the detailed composition of your custom dataset and for your insightful questions! It's fantastic to see your dedication to understanding and improving your model's performance. Impact of Background ImagesIncluding pure background images (images without any objects) in your dataset can indeed help reduce false positives. Here's an intuitive explanation of the mechanism:
Feature Extraction and Background CorrelationYour understanding of the multi-dimensional feature extraction and merging in CNNs is on point. Here's a bit more detail:
The key is that while the model does learn some correlation between objects and their backgrounds, the training process (especially with diverse and augmented data) helps it prioritize object-specific features over background noise. Suggestions for Dataset ConstructionYour dataset composition looks well thought out. Here are a few additional suggestions:
For more detailed insights, you can refer to the YOLOv5 Architecture Description, which provides an in-depth look at the model's components and their functions. Feel free to share any further results or questions you have. The community and the Ultralytics team are here to support you! Best regards and happy training! 🚀 Warm |
Search before asking
Question
Hi everyone and @glenn-jocher.
I am a beginner at using YOLOv5. My task is to detect objects from 4 classes of garbage (recyclable, harmful, kitchen, and other), which include various specific items in each class (e.g., recyclable: tin cans, plastic bottles, beer bottles, etc.), on a self-built platform equipped with a camera connected to a Raspberry Pi 4B that has YOLOv5 deployed on it. The camera’s position is fixed. Initially, when creating my own dataset, I simply collected pictures of garbage from each class on my platform and labeled them (I collected about 300 pictures for each class). Later on, I realized that the garbage I collected and pictured is far less than required (e.g., I only collected 3 specific types of plastic bottles and pictured various of their postures on the platform and when some new type of plastic bottles is placed on the platform, perheps the trained model doesn't work well in detect them). So I’m planning to collect more data from different backgrounds to improve robustness. I’m really curious about that:
I'm really curious about that :
Ps. This is the first time I’ve asked questions in an ‘issue’, please forgive any ignorance. I would be more than delighted if anyone could provide me with effective ideas or referencing materials about my perplexity.
Thanks. Best Wishes.
Additional
No thanks.
The text was updated successfully, but these errors were encountered: