{
  "id": 183121,
  "title": "Has anyone tried label-smoothing at the element level, when using random cropping in such tasks?",
  "url": "/competitions/rsna-str-pulmonary-embolism-detection/discussion/183121",
  "author_name": "James Howard",
  "post_date": "2020-09-15T15:45:11.130000",
  "votes": 3,
  "comment_count": 1,
  "views": 0,
  "content": "<p>One of the issue about using random cropping/random resized cropping in tasks like this, is in cases where there's a small PE, there's a decent chance your new crop wont include the PE in a case which is labelled as PE present.</p>\n<p>Because of that, the label is no longer appropriate. This is in contrast to other settings, like say ImageNet, where an image of a dog is likely to include <em>part</em> of a dog, even with aggressive cropping.</p>\n<p>I was thinking what would be interesting is a form of labelsmoothing, but instead if using an epsilon of e.g. 0.1 for the entire dataset, we dynamically change the epsilon for each image based on how aggressive the crop is; very aggressive crops we may use labels of say [0.3, 0.7] instead of [0.0, 1.0]; conversely, if we include the entire image, we use the original unsmoothed label.</p>\n<p>This then means incorrect predictions of 'no PE' because we've unfortunately cropped the PE our are now much less punishing.</p>\n<p>The only issue with this approach, is it means the network has to <em>learn</em> that it should temper its predictions based on the ROI present (even if it's seen a PE, it should predict it with low confidence if the crop is aggressive). However, because the CT images are <em>so</em> stereotyped (it's clear if something is missing, because they should be a L-R symmetrical body on a table), I think the network may indeed be able to do this.</p>\n<p>I envisage this requires a <code>random_resized_crop()</code> function to return not only a new image, but also a %area reduction. If we are using pytorch, this should be passed as a tensor from the dataloader, and given as a parameter to the new loss function's <code>forward()</code> method, I imagine.</p>\n<p>Has anyone seen this done before?</p>",
  "messages": [
    {
      "id": 1011622,
      "postDate": "2020-09-15T15:45:11.130Z",
      "content": "<p>One of the issue about using random cropping/random resized cropping in tasks like this, is in cases where there's a small PE, there's a decent chance your new crop wont include the PE in a case which is labelled as PE present.</p>\n<p>Because of that, the label is no longer appropriate. This is in contrast to other settings, like say ImageNet, where an image of a dog is likely to include <em>part</em> of a dog, even with aggressive cropping.</p>\n<p>I was thinking what would be interesting is a form of labelsmoothing, but instead if using an epsilon of e.g. 0.1 for the entire dataset, we dynamically change the epsilon for each image based on how aggressive the crop is; very aggressive crops we may use labels of say [0.3, 0.7] instead of [0.0, 1.0]; conversely, if we include the entire image, we use the original unsmoothed label.</p>\n<p>This then means incorrect predictions of 'no PE' because we've unfortunately cropped the PE our are now much less punishing.</p>\n<p>The only issue with this approach, is it means the network has to <em>learn</em> that it should temper its predictions based on the ROI present (even if it's seen a PE, it should predict it with low confidence if the crop is aggressive). However, because the CT images are <em>so</em> stereotyped (it's clear if something is missing, because they should be a L-R symmetrical body on a table), I think the network may indeed be able to do this.</p>\n<p>I envisage this requires a <code>random_resized_crop()</code> function to return not only a new image, but also a %area reduction. If we are using pytorch, this should be passed as a tensor from the dataloader, and given as a parameter to the new loss function's <code>forward()</code> method, I imagine.</p>\n<p>Has anyone seen this done before?</p>",
      "rawMarkdown": "One of the issue about using random cropping/random resized cropping in tasks like this, is in cases where there's a small PE, there's a decent chance your new crop wont include the PE in a case which is labelled as PE present.\n\nBecause of that, the label is no longer appropriate. This is in contrast to other settings, like say ImageNet, where an image of a dog is likely to include _part_ of a dog, even with aggressive cropping.\n\nI was thinking what would be interesting is a form of labelsmoothing, but instead if using an epsilon of e.g. 0.1 for the entire dataset, we dynamically change the epsilon for each image based on how aggressive the crop is; very aggressive crops we may use labels of say [0.3, 0.7] instead of [0.0, 1.0]; conversely, if we include the entire image, we use the original unsmoothed label.\n\nThis then means incorrect predictions of 'no PE' because we've unfortunately cropped the PE our are now much less punishing.\n\nThe only issue with this approach, is it means the network has to _learn_ that it should temper its predictions based on the ROI present (even if it's seen a PE, it should predict it with low confidence if the crop is aggressive). However, because the CT images are _so_ stereotyped (it's clear if something is missing, because they should be a L-R symmetrical body on a table), I think the network may indeed be able to do this.\n\nI envisage this requires a `random_resized_crop()` function to return not only a new image, but also a %area reduction. If we are using pytorch, this should be passed as a tensor from the dataloader, and given as a parameter to the new loss function's `forward()` method, I imagine.\n\nHas anyone seen this done before?",
      "votes": 3
    },
    {
      "id": 1059308,
      "postDate": "2020-10-24T22:54:44.163Z",
      "content": "<p>Pretty interesting idea!</p>",
      "rawMarkdown": "Pretty interesting idea!"
    }
  ],
  "comments": [
    {
      "id": 1059308,
      "author_name": "عثمان",
      "author_url": "",
      "post_date": "2020-10-24T22:54:44.163000",
      "content": "<p>Pretty interesting idea!</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1011622": "One of the issue about using random cropping/random resized cropping in tasks like this, is in cases where there's a small PE, there's a decent chance your new crop wont include the PE in a case which is labelled as PE present.\n\nBecause of that, the label is no longer appropriate. This is in contrast to other settings, like say ImageNet, where an image of a dog is likely to include _part_ of a dog, even with aggressive cropping.\n\nI was thinking what would be interesting is a form of labelsmoothing, but instead if using an epsilon of e.g. 0.1 for the entire dataset, we dynamically change the epsilon for each image based on how aggressive the crop is; very aggressive crops we may use labels of say [0.3, 0.7] instead of [0.0, 1.0]; conversely, if we include the entire image, we use the original unsmoothed label.\n\nThis then means incorrect predictions of 'no PE' because we've unfortunately cropped the PE our are now much less punishing.\n\nThe only issue with this approach, is it means the network has to _learn_ that it should temper its predictions based on the ROI present (even if it's seen a PE, it should predict it with low confidence if the crop is aggressive). However, because the CT images are _so_ stereotyped (it's clear if something is missing, because they should be a L-R symmetrical body on a table), I think the network may indeed be able to do this.\n\nI envisage this requires a `random_resized_crop()` function to return not only a new image, but also a %area reduction. If we are using pytorch, this should be passed as a tensor from the dataloader, and given as a parameter to the new loss function's `forward()` method, I imagine.\n\nHas anyone seen this done before?",
    "1059308": "Pretty interesting idea!"
  }
}