ultralytics / ultralytics

Ultralytics YOLO11 🚀
https://docs.ultralytics.com
GNU Affero General Public License v3.0
36.33k stars 7k forks source link

How do you distinguish between two similar objects? #19062

Open Dasadaly opened 6 days ago

Dasadaly commented 6 days ago

Search before asking

Question

I'm trying to train the model to recognize houses from satellite or drone images, the point is to find residential houses. But on some plots there are gazebos or garages in addition to residential houses. They may have the same roof, the size may also be big enough to be confused with a house, just a small house. How to distinguish in such a situation exactly residential houses from gazebos, garages, bathhouses, etc.

Additional

No response

UltralyticsAssistant commented 6 days ago

👋 Hello @Dasadaly, thank you for your interest in Ultralytics 🚀! We recommend exploring our Docs for guidance on leveraging YOLO's capabilities, where you’ll find helpful resources for Python and CLI usage. You might find valuable insights there to help distinguish between visually similar objects during custom training.

If this is a ❓ Question regarding custom training, please provide more details about your dataset (e.g., example images showing the differences between residential houses, gazebos, and garages) and any training logs you might have. Also, make sure to check out our Tips for Best Training Results which could help improve object detection accuracy for your use case.

For more in-depth discussions and assistance regarding your task:

Upgrade

Ensure you're using the latest version of ultralytics to access the latest features and fixes. Upgrade all required dependencies in a Python>=3.8 environment as follows:

pip install -U ultralytics

Environments

You can also experiment with your models in the following verified environments offering pre-configured setups with CUDA/CUDNN, Python, and PyTorch:

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify the correct operation of all YOLO Modes and Tasks across macOS, Windows, and Ubuntu environments.

🔥 This is an automated response to provide initial assistance. An Ultralytics engineer will follow up with you shortly to provide further guidance! 😊

glenn-jocher commented 5 days ago

@Dasadaly to distinguish similar objects like houses vs. gazebos/garages in satellite imagery:

  1. Enhance your dataset with detailed annotations of non-house structures as separate classes
  2. Use segmentation (YOLO11 Segment) to capture structural differences in shape/layout
  3. Add OBB (Oriented Bounding Boxes) for better angle/size discrimination in aerial imagery
  4. Incorporate contextual features like proximity to roads/vegetation via multi-modal inputs

For commercial use, ensure compliance with our Enterprise License.

Dasadaly commented 5 days ago

1.Since these buildings happen to be very similar, would it interfere with the model if put in a separate class? Wouldn't it get confused?

  1. Yeah, I'm using segmentation as it is
  2. Like I said, the dimensions and angles can be very similar. There could be a 10 by 10 meter house, or there could be a garage or a bathhouse like that. And it's segmentation that I'm looking for.
  3. Is this approach already built into YOLO or can/should it be customized independently? Where can I find more documentation about this?
glenn-jocher commented 4 days ago

@Dasadaly for distinguishing similar structures in segmentation:

  1. Separate classes work best with detailed annotations highlighting subtle differences (window/door presence, internal layouts)
  2. YOLO11's segmentation inherently captures shape/texture differences - combine with OBB for angular cues (OBB Docs)
  3. Built-in functionality exists - see Segmentation Training Guide for custom dataset setup

For commercial use, ensure compliance with our Enterprise License.