{
  "id": 82444,
  "title": "Half fluke trick (+0.02 LB)",
  "url": "/competitions/humpback-whale-identification/writeups/scarfluke-half-fluke-trick-0-02-lb",
  "author_name": "",
  "post_date": "2019-03-01T11:40:26.009421300Z",
  "votes": 12,
  "comment_count": 8,
  "views": 0,
  "content": "<p>I want to share a simple trick: <br>\n1. extract cropped images using bounding boxes <br>\n2. split each image by a half and horizontally flip the right part <br>\n3. [your training procedure here] <br>\n4. at test time compare the corresponding halves and combine the results <br></p>\n\n<p>Pros: <br>\n - doubles the training dataset <br>\n - higher image resolution <br></p>\n\n<p>Cons: <br>\n - bounding box dependency <br>\n - the center of the object is split <br></p>\n\n<p>In my case private / public LB scores: <br>\n - full-fluke 0.93686 / 0.93642 <br>\n - half-fluke 0.95398 / 0.95214 <br>\n - ensemble 0.95652 / 0.95722 <br></p>\n\n<p>Has anyone else used this strategy? Please share your experience.</p>",
  "messages": [
    {
      "id": "481420",
      "postDate": "03/01/2019 11:40:26",
      "content": "<p>I want to share a simple trick: <br>\n1. extract cropped images using bounding boxes <br>\n2. split each image by a half and horizontally flip the right part <br>\n3. [your training procedure here] <br>\n4. at test time compare the corresponding halves and combine the results <br></p>\n\n<p>Pros: <br>\n - doubles the training dataset <br>\n - higher image resolution <br></p>\n\n<p>Cons: <br>\n - bounding box dependency <br>\n - the center of the object is split <br></p>\n\n<p>In my case private / public LB scores: <br>\n - full-fluke 0.93686 / 0.93642 <br>\n - half-fluke 0.95398 / 0.95214 <br>\n - ensemble 0.95652 / 0.95722 <br></p>\n\n<p>Has anyone else used this strategy? Please share your experience.</p>",
      "rawMarkdown": "I want to share a simple trick: <br>\n1. extract cropped images using bounding boxes <br>\n2. split each image by a half and horizontally flip the right part <br>\n3. [your training procedure here] <br>\n4. at test time compare the corresponding halves and combine the results <br>\n\nPros: <br>\n - doubles the training dataset <br>\n - higher image resolution <br>\n\nCons: <br>\n - bounding box dependency <br>\n - the center of the object is split <br>\n\nIn my case private / public LB scores: <br>\n - full-fluke 0.93686 / 0.93642 <br>\n - half-fluke 0.95398 / 0.95214 <br>\n - ensemble 0.95652 / 0.95722 <br>\n\nHas anyone else used this strategy? Please share your experience.",
      "votes": null
    },
    {
      "id": "481489",
      "postDate": "03/01/2019 13:26:48",
      "content": "<p>I was also thinking on using this strategy, my idea was to use landmarks to split the images right on the middle of the fluke. But I had no time to test this idea. I ended up splitting the last activations of the encoder in two (I used image ratio 1:2), apply the pooling layer for each branch and concatenate the resulting features (more details here <a href=\"https://www.kaggle.com/c/humpback-whale-identification/discussion/82364\">https://www.kaggle.com/c/humpback-whale-identification/discussion/82364</a> ).</p>",
      "rawMarkdown": "I was also thinking on using this strategy, my idea was to use landmarks to split the images right on the middle of the fluke. But I had no time to test this idea. I ended up splitting the last activations of the encoder in two (I used image ratio 1:2), apply the pooling layer for each branch and concatenate the resulting features (more details here https://www.kaggle.com/c/humpback-whale-identification/discussion/82364 ).",
      "votes": null
    },
    {
      "id": "481510",
      "postDate": "03/01/2019 13:48:16",
      "content": "<p>I am not sure I follow - could you please explain again how are you flipping the fluke? You are only flipping one side of the fluke? So right side is flipped and left is not?</p>",
      "rawMarkdown": "I am not sure I follow - could you please explain again how are you flipping the fluke? You are only flipping one side of the fluke? So right side is flipped and left is not?",
      "votes": null
    },
    {
      "id": "481514",
      "postDate": "03/01/2019 13:58:59",
      "content": "<p>Yes, only one side is flipped. I also didn’t use any flip augmentation during the training.</p>",
      "rawMarkdown": "Yes, only one side is flipped. I also didn’t use any flip augmentation during the training.",
      "votes": null
    },
    {
      "id": "481565",
      "postDate": "03/01/2019 15:06:33",
      "content": "<p>But it is not flipped upside down but left to right? You end up with both pieces of fluke facing left? Something like this: &lt;__ &lt;__ instead of the I unflipped version &lt;__ __&gt;</p>\n\n<p>Thank you very much for your explanation!</p>",
      "rawMarkdown": "But it is not flipped upside down but left to right? You end up with both pieces of fluke facing left? Something like this: &lt;__ &lt;__ instead of the I unflipped version &lt;__ __&gt;\n\nThank you very much for your explanation!",
      "votes": null
    },
    {
      "id": "482449",
      "postDate": "03/03/2019 02:06:03",
      "content": "<p>Congrats <a href=\"/sorokin\">@sorokin</a> on the gold medal. Thanks for sharing this trick.</p>",
      "rawMarkdown": "Congrats @sorokin on the gold medal. Thanks for sharing this trick.",
      "votes": null
    },
    {
      "id": "482527",
      "postDate": "03/03/2019 06:33:30",
      "content": "<p>Mhmm what I typed on my phone didn't show up...</p>\n\n<p>I meant this is how the fluke looks like before the flipping: &lt;__ <strong>&gt;\nand this is how it would look after? &lt;</strong> &lt;__\nBoth tips facing in the same direction?</p>",
      "rawMarkdown": "Mhmm what I typed on my phone didn't show up...\n\nI meant this is how the fluke looks like before the flipping: &lt;__ __&gt;\nand this is how it would look after? &lt;__ &lt;__\nBoth tips facing in the same direction?",
      "votes": null
    },
    {
      "id": "482586",
      "postDate": "03/03/2019 09:41:30",
      "content": "<p>It's exactly what I meant. And thanks, Radek, for sharing your bounding box solution. I also had one based on Tensorflow Object Detection model with about 83% IoU for your 400 annotated samples. Finally, different bounding boxes helped in TTA.</p>",
      "rawMarkdown": "It's exactly what I meant. And thanks, Radek, for sharing your bounding box solution. I also had one based on Tensorflow Object Detection model with about 83% IoU for your 400 annotated samples. Finally, different bounding boxes helped in TTA.",
      "votes": null
    },
    {
      "id": "482658",
      "postDate": "03/03/2019 13:06:01",
      "content": "<p>That's great to hear! Thank you very much for the answer and very happy the bounding boxes were of use! :)</p>",
      "rawMarkdown": "That's great to hear! Thank you very much for the answer and very happy the bounding boxes were of use! :)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 481489,
      "author_name": "mnpinto",
      "author_url": "",
      "post_date": "03/01/2019 13:26:48",
      "content": "<p>I was also thinking on using this strategy, my idea was to use landmarks to split the images right on the middle of the fluke. But I had no time to test this idea. I ended up splitting the last activations of the encoder in two (I used image ratio 1:2), apply the pooling layer for each branch and concatenate the resulting features (more details here <a href=\"https://www.kaggle.com/c/humpback-whale-identification/discussion/82364\">https://www.kaggle.com/c/humpback-whale-identification/discussion/82364</a> ).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 481510,
      "author_name": "radek1",
      "author_url": "",
      "post_date": "03/01/2019 13:48:16",
      "content": "<p>I am not sure I follow - could you please explain again how are you flipping the fluke? You are only flipping one side of the fluke? So right side is flipped and left is not?</p>",
      "votes": null,
      "replies": [
        {
          "id": 481514,
          "author_name": "sorokin",
          "author_url": "",
          "post_date": "03/01/2019 13:58:59",
          "content": "<p>Yes, only one side is flipped. I also didn’t use any flip augmentation during the training.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 481565,
          "author_name": "radek1",
          "author_url": "",
          "post_date": "03/01/2019 15:06:33",
          "content": "<p>But it is not flipped upside down but left to right? You end up with both pieces of fluke facing left? Something like this: &lt;__ &lt;__ instead of the I unflipped version &lt;__ __&gt;</p>\n\n<p>Thank you very much for your explanation!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 482527,
          "author_name": "radek1",
          "author_url": "",
          "post_date": "03/03/2019 06:33:30",
          "content": "<p>Mhmm what I typed on my phone didn't show up...</p>\n\n<p>I meant this is how the fluke looks like before the flipping: &lt;__ <strong>&gt;\nand this is how it would look after? &lt;</strong> &lt;__\nBoth tips facing in the same direction?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 482586,
          "author_name": "sorokin",
          "author_url": "",
          "post_date": "03/03/2019 09:41:30",
          "content": "<p>It's exactly what I meant. And thanks, Radek, for sharing your bounding box solution. I also had one based on Tensorflow Object Detection model with about 83% IoU for your 400 annotated samples. Finally, different bounding boxes helped in TTA.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 482658,
          "author_name": "radek1",
          "author_url": "",
          "post_date": "03/03/2019 13:06:01",
          "content": "<p>That's great to hear! Thank you very much for the answer and very happy the bounding boxes were of use! :)</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 482449,
      "author_name": "sheriytm",
      "author_url": "",
      "post_date": "03/03/2019 02:06:03",
      "content": "<p>Congrats <a href=\"/sorokin\">@sorokin</a> on the gold medal. Thanks for sharing this trick.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "481420": "I want to share a simple trick: <br>\n1. extract cropped images using bounding boxes <br>\n2. split each image by a half and horizontally flip the right part <br>\n3. [your training procedure here] <br>\n4. at test time compare the corresponding halves and combine the results <br>\n\nPros: <br>\n - doubles the training dataset <br>\n - higher image resolution <br>\n\nCons: <br>\n - bounding box dependency <br>\n - the center of the object is split <br>\n\nIn my case private / public LB scores: <br>\n - full-fluke 0.93686 / 0.93642 <br>\n - half-fluke 0.95398 / 0.95214 <br>\n - ensemble 0.95652 / 0.95722 <br>\n\nHas anyone else used this strategy? Please share your experience.",
    "481489": "I was also thinking on using this strategy, my idea was to use landmarks to split the images right on the middle of the fluke. But I had no time to test this idea. I ended up splitting the last activations of the encoder in two (I used image ratio 1:2), apply the pooling layer for each branch and concatenate the resulting features (more details here https://www.kaggle.com/c/humpback-whale-identification/discussion/82364 ).",
    "481510": "I am not sure I follow - could you please explain again how are you flipping the fluke? You are only flipping one side of the fluke? So right side is flipped and left is not?",
    "481514": "Yes, only one side is flipped. I also didn’t use any flip augmentation during the training.",
    "481565": "But it is not flipped upside down but left to right? You end up with both pieces of fluke facing left? Something like this: &lt;__ &lt;__ instead of the I unflipped version &lt;__ __&gt;\n\nThank you very much for your explanation!",
    "482449": "Congrats @sorokin on the gold medal. Thanks for sharing this trick.",
    "482527": "Mhmm what I typed on my phone didn't show up...\n\nI meant this is how the fluke looks like before the flipping: &lt;__ __&gt;\nand this is how it would look after? &lt;__ &lt;__\nBoth tips facing in the same direction?",
    "482586": "It's exactly what I meant. And thanks, Radek, for sharing your bounding box solution. I also had one based on Tensorflow Object Detection model with about 83% IoU for your 400 annotated samples. Finally, different bounding boxes helped in TTA.",
    "482658": "That's great to hear! Thank you very much for the answer and very happy the bounding boxes were of use! :)"
  },
  "source": "meta"
}