Body: <p>Good day. I have a custom dataset for object detection, which has imbalance that <strong>each image has only one object annotation</strong>.</p>
  <p>I trained the object detection model(Efficientdet-dx) on TensorFlow object detection API with this dataset. But the model predicts only one object in image, even though it has many trackable objects when the training has finished. It looks like the model learned in the wrong way that it should find only one object in a image.</p>
  <p><a href="https://i.sstatic.net/xPnG5.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xPnG5.jpg" alt="Sample trainset" /></a></p>
  <p>Here's my question: In which way should I train the model, so the model find objects independently to the number of objects in the trainset?</p>
  <p>It should be very helpful, if you help me.</p>
  <p>What I tried:</p>
  <ul>
  <li><a href="https://paperswithcode.com/paper/simple-copy-paste-is-a-strong-data" rel="nofollow noreferrer">Copy and Paste augmentation(CAP)</a>
  <ul>
  <li>result: The dataset has no mask annotation unfortunately, so I used a deep learning model trained on open dataset for background subtraction, but the subtraction did not work well. As you can see, the edge of pasted objects is not clear. and some part of the objects are missing.</li>
  </ul>
  </li>
  </ul>
  <p><a href="https://i.sstatic.net/YB0Nr.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YB0Nr.jpg" alt="CAP augmentation" /></a></p>
  <ul>
  <li>Mix another dataset like COCO, PASCAL VOC.
  <ul>
  <li>result: It wasn't that bad such like CAP. However, the mixed dataset becomes very big size and the unrelated labels also are in the predictable label list.</li>
  </ul>
  </li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-01T04:56:30.403Z
Comments.Text: So to clarify - you're saying you have a training set comprised solely of images with only one object in them, but then at testing time you're inputting images that have multiple objects?
Comments.UserDisplayName: Recessive
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-01T06:02:56.370Z
Comments.Text: Yes. I put images with multiple objects into my model trained with the dataset that have only 1 object per image. @Recessive
Comments.UserDisplayName: Kim
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-03T03:19:40.970Z
Comments.Text: That is highly unusual, you should never train on a dataset that isn't representative of the actual data. It's like training a classifier to classify horses then trying to test it on classifying cars. Obviously it wont perform. Is there anyway you can include the images with multiple objects into your training set?
Comments.UserDisplayName: Recessive
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-06T02:29:21.717Z
Comments.Text: Sorry for the late reply. Shortly answer to your question about including other images is 'no'. And that's why I'm embarassed when I got this dataset and realized what's wrong. @Recessive
Comments.UserDisplayName: Kim
Tags: <deep-learning><computer-vision><tensorflow><object-detection>
Title: Object detection: when there's only 1 object in each image
UserDisplayName: Kim
ThreadText: # Object detection: when there's only 1 object in each image
  
  (Asked by: username_0 on 2021-12-01)
  
  Good day. I have a custom dataset for object detection, which has imbalance that **each image has only one object annotation**.
  
  I trained the object detection model(Efficientdet-dx) on TensorFlow object detection API with this dataset. But the model predicts only one object in image, even though it has many trackable objects when the training has finished. It looks like the model learned in the wrong way that it should find only one object in a image.
  
  [![Sample trainset](https://i.sstatic.net/xPnG5.jpg)](https://i.sstatic.net/xPnG5.jpg)
  
  Here's my question: In which way should I train the model, so the model find objects independently to the number of objects in the trainset?
  
  It should be very helpful, if you help me.
  
  What I tried:
  
  * [Copy and Paste augmentation(CAP)](https://paperswithcode.com/paper/simple-copy-paste-is-a-strong-data)
    + result: The dataset has no mask annotation unfortunately, so I used a deep learning model trained on open dataset for background subtraction, but the subtraction did not work well. As you can see, the edge of pasted objects is not clear. and some part of the objects are missing.
  
  [![CAP augmentation](https://i.sstatic.net/YB0Nr.jpg)](https://i.sstatic.net/YB0Nr.jpg)
  
  * Mix another dataset like COCO, PASCAL VOC.
    + result: It wasn't that bad such like CAP. However, the mixed dataset becomes very big size and the unrelated labels also are in the predictable label list.
  
  **Tags:** deep-learning, computer-vision, tensorflow, object-detection
  
  > **Comments:**
  > **username_1**: So to clarify - you're saying you have a training set comprised solely of images with only one object in them, but then at testing time you're inputting images that have multiple objects?  
  > **username_0**: Yes. I put images with multiple objects into my model trained with the dataset that have only 1 object per image. @username_1  
  > **username_1**: That is highly unusual, you should never train on a dataset that isn't representative of the actual data. It's like training a classifier to classify horses then trying to test it on classifying cars. Obviously it wont perform. Is there anyway you can include the images with multiple objects into your training set?  
  > **username_0**: Sorry for the late reply. Shortly answer to your question about including other images is 'no'. And that's why I'm embarassed when I got this dataset and realized what's wrong. @username_1  
  
  ---
  
  ## 0 answers
  
  