{
  "id": 305942,
  "title": "Create your own Cropped Dataset with [YOLOv5]",
  "url": "/competitions/happy-whale-and-dolphin/discussion/305942",
  "author_name": "",
  "post_date": "2022-02-07T15:29:16.746124Z",
  "votes": 45,
  "comment_count": 10,
  "views": 0,
  "content": "<p>I think the cropped images will be a key factor in this competition due as the model tends to focus on the background. You can use the following notebooks to create your own <strong>Cropped Dataset</strong>.  You can use one notebook to generate <strong>Bounding Box</strong> and the other one to create <strong>Cropped Dataset</strong>.  To create your own dataset simply use the  <strong>notebook output</strong> as dataset.</p>\n<blockquote>\n  <p>These notebooks haven't been tuned so there is a lot of room for improvement. I'll be adding some <strong>tips</strong> at the end on how to improve the <strong>detection</strong>, make sure you don't miss them.</p>\n</blockquote>\n<h2>Notebooks:</h2>\n<ul>\n<li><a href=\"https://www.kaggle.com/awsaf49/happywhale-boundingbox-yolov5\" target=\"_blank\">Happywhale: BoundingBox [YOLOv5] 🐋🐬</a></li>\n<li><a href=\"https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5\" target=\"_blank\">Happywhale: Cropped Dataset [YOLOv5] ✂️</a></li>\n</ul>\n<h2>Dataset:</h2>\n<ul>\n<li><a href=\"https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds\" target=\"_blank\">Happywhale: Cropped Dataset [YOLOv5] ds</a> - <code>(256x256)</code></li>\n</ul>\n<h2>Procedure</h2>\n<p>This notebook uses the <strong>YOLOv5</strong> model to create <strong>Bounding Box</strong>. For <strong>train</strong> and <strong>test</strong> data <a href=\"https://www.kaggle.com/martinpiotte/humpback-whale-identification-fluke-location\" target=\"_blank\"><strong>Whale Fluke</strong> </a> dataset was used. This dataset contains labels for <code>1200</code> samples. These <code>1200</code> labeled images were used for both <strong>train</strong> and <strong>test</strong>. We can get a pretty good score (0.98 map@0.50) in the <strong>Whale Fluke</strong> Dataset.</p>\n<p>Finally, the <strong>Whale Fluke</strong> model was used to create labels for <strong>Whales &amp; Dolphin</strong> Dataset. There are some <strong>False Positives</strong> and <strong>False Negatives</strong>. We can tune the notebook for better results. As you may already have figured out, this is somewhat an <strong>Out of Distribution (OOD)</strong> task. So, we may need to use the data carefully.</p>\n<h2>Whale Fluke:</h2>\n<p><a href=\"https://ibb.co/Sm0BbPM\"><img src=\"https://i.ibb.co/Yd8hm31/whale-fluke.png\" alt=\"whale-fluke\"></a></p>\n<h2>Whale &amp; Dolhpin(Train):</h2>\n<p><a href=\"https://ibb.co/BcZmVsr\"><img src=\"https://i.ibb.co/dj2S0KL/train.png\" alt=\"train\"></a></p>\n<h2>Whale &amp; Dolphin(Test):</h2>\n<p><a href=\"https://ibb.co/WnDnN01\"><img src=\"https://i.ibb.co/zs8sWFw/test.png\" alt=\"test\"></a></p>\n<h2>Tips:</h2>\n<ul>\n<li>You can try <strong>large</strong> models such as <strong>YOLOv5x6</strong> with large imge_size such as <code>640x640</code> or <code>768x768</code>.</li>\n<li>Bounding Boxes in <strong>Whales Fluke</strong> dataset are <strong>large</strong> whereas <strong>Whales &amp; Dolphin</strong> dataset has both <strong>small</strong> and <strong>large</strong> bounding box. To adjust this issue you can try changing the <strong>scale</strong> parameter in the <strong>hyp.yaml</strong> file. The default value is <code>0.5</code>, you can try increasing the value.</li>\n</ul>\n<div><img src=\"https://i.ibb.co/BZNh4Qt/areaplot.png\" alt=\"areaplot\"></div>\n<ul>\n<li>You can also try enlarging the bbox for example <code>1.5x or 1.7x</code>. This will make sure you don't crop the <strong>Whale/Dolphin</strong>.</li>\n<li>You can tune the <strong>confidence</strong> and <strong>iou</strong> parameter in <strong>YOLOv5</strong> to get a better bounding box. Just to you know there are images with <strong>multiple dolphins or whales</strong> so choose the <strong>confidence</strong> and <strong>iou</strong> accordingly.</li>\n<li>And of course you can try <strong>ensembling</strong> multiple models using <strong>nms</strong> or <strong>wbf</strong>.</li>\n<li>Finally, to tackle the <strong>OOD</strong> task you can try a few rounds of <strong>Pseudo Training</strong>, which will help the model to adapt for <strong>Whale &amp; Dolphin</strong> dataset.</li>\n</ul>",
  "messages": [
    {
      "id": "1680107",
      "postDate": "02/07/2022 15:29:16",
      "content": "<p>I think the cropped images will be a key factor in this competition due as the model tends to focus on the background. You can use the following notebooks to create your own <strong>Cropped Dataset</strong>.  You can use one notebook to generate <strong>Bounding Box</strong> and the other one to create <strong>Cropped Dataset</strong>.  To create your own dataset simply use the  <strong>notebook output</strong> as dataset.</p>\n<blockquote>\n  <p>These notebooks haven't been tuned so there is a lot of room for improvement. I'll be adding some <strong>tips</strong> at the end on how to improve the <strong>detection</strong>, make sure you don't miss them.</p>\n</blockquote>\n<h2>Notebooks:</h2>\n<ul>\n<li><a href=\"https://www.kaggle.com/awsaf49/happywhale-boundingbox-yolov5\" target=\"_blank\">Happywhale: BoundingBox [YOLOv5] 🐋🐬</a></li>\n<li><a href=\"https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5\" target=\"_blank\">Happywhale: Cropped Dataset [YOLOv5] ✂️</a></li>\n</ul>\n<h2>Dataset:</h2>\n<ul>\n<li><a href=\"https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds\" target=\"_blank\">Happywhale: Cropped Dataset [YOLOv5] ds</a> - <code>(256x256)</code></li>\n</ul>\n<h2>Procedure</h2>\n<p>This notebook uses the <strong>YOLOv5</strong> model to create <strong>Bounding Box</strong>. For <strong>train</strong> and <strong>test</strong> data <a href=\"https://www.kaggle.com/martinpiotte/humpback-whale-identification-fluke-location\" target=\"_blank\"><strong>Whale Fluke</strong> </a> dataset was used. This dataset contains labels for <code>1200</code> samples. These <code>1200</code> labeled images were used for both <strong>train</strong> and <strong>test</strong>. We can get a pretty good score (0.98 map@0.50) in the <strong>Whale Fluke</strong> Dataset.</p>\n<p>Finally, the <strong>Whale Fluke</strong> model was used to create labels for <strong>Whales &amp; Dolphin</strong> Dataset. There are some <strong>False Positives</strong> and <strong>False Negatives</strong>. We can tune the notebook for better results. As you may already have figured out, this is somewhat an <strong>Out of Distribution (OOD)</strong> task. So, we may need to use the data carefully.</p>\n<h2>Whale Fluke:</h2>\n<p><a href=\"https://ibb.co/Sm0BbPM\"><img src=\"https://i.ibb.co/Yd8hm31/whale-fluke.png\" alt=\"whale-fluke\"></a></p>\n<h2>Whale &amp; Dolhpin(Train):</h2>\n<p><a href=\"https://ibb.co/BcZmVsr\"><img src=\"https://i.ibb.co/dj2S0KL/train.png\" alt=\"train\"></a></p>\n<h2>Whale &amp; Dolphin(Test):</h2>\n<p><a href=\"https://ibb.co/WnDnN01\"><img src=\"https://i.ibb.co/zs8sWFw/test.png\" alt=\"test\"></a></p>\n<h2>Tips:</h2>\n<ul>\n<li>You can try <strong>large</strong> models such as <strong>YOLOv5x6</strong> with large imge_size such as <code>640x640</code> or <code>768x768</code>.</li>\n<li>Bounding Boxes in <strong>Whales Fluke</strong> dataset are <strong>large</strong> whereas <strong>Whales &amp; Dolphin</strong> dataset has both <strong>small</strong> and <strong>large</strong> bounding box. To adjust this issue you can try changing the <strong>scale</strong> parameter in the <strong>hyp.yaml</strong> file. The default value is <code>0.5</code>, you can try increasing the value.</li>\n</ul>\n<div><img src=\"https://i.ibb.co/BZNh4Qt/areaplot.png\" alt=\"areaplot\"></div>\n<ul>\n<li>You can also try enlarging the bbox for example <code>1.5x or 1.7x</code>. This will make sure you don't crop the <strong>Whale/Dolphin</strong>.</li>\n<li>You can tune the <strong>confidence</strong> and <strong>iou</strong> parameter in <strong>YOLOv5</strong> to get a better bounding box. Just to you know there are images with <strong>multiple dolphins or whales</strong> so choose the <strong>confidence</strong> and <strong>iou</strong> accordingly.</li>\n<li>And of course you can try <strong>ensembling</strong> multiple models using <strong>nms</strong> or <strong>wbf</strong>.</li>\n<li>Finally, to tackle the <strong>OOD</strong> task you can try a few rounds of <strong>Pseudo Training</strong>, which will help the model to adapt for <strong>Whale &amp; Dolphin</strong> dataset.</li>\n</ul>",
      "rawMarkdown": "I think the cropped images will be a key factor in this competition due as the model tends to focus on the background. You can use the following notebooks to create your own **Cropped Dataset**.  You can use one notebook to generate **Bounding Box** and the other one to create **Cropped Dataset**.  To create your own dataset simply use the  **notebook output** as dataset.\n\n> These notebooks haven't been tuned so there is a lot of room for improvement. I'll be adding some **tips** at the end on how to improve the **detection**, make sure you don't miss them.\n\n## Notebooks:\n* [Happywhale: BoundingBox [YOLOv5] 🐋🐬](https://www.kaggle.com/awsaf49/happywhale-boundingbox-yolov5)\n* [Happywhale: Cropped Dataset [YOLOv5] ✂️](https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5)\n\n## Dataset:\n* [Happywhale: Cropped Dataset [YOLOv5] ds](https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds) - `(256x256)`\n\n## Procedure\nThis notebook uses the **YOLOv5** model to create **Bounding Box**. For **train** and **test** data [**Whale Fluke** ](https://www.kaggle.com/martinpiotte/humpback-whale-identification-fluke-location) dataset was used. This dataset contains labels for `1200` samples. These `1200` labeled images were used for both **train** and **test**. We can get a pretty good score (0.98 map@0.50) in the **Whale Fluke** Dataset.\n\nFinally, the **Whale Fluke** model was used to create labels for **Whales & Dolphin** Dataset. There are some **False Positives** and **False Negatives**. We can tune the notebook for better results. As you may already have figured out, this is somewhat an **Out of Distribution (OOD)** task. So, we may need to use the data carefully.\n\n## Whale Fluke:\n<a href=\"https://ibb.co/Sm0BbPM\"><img src=\"https://i.ibb.co/Yd8hm31/whale-fluke.png\" alt=\"whale-fluke\" border=\"0\"></a>\n\n## Whale & Dolhpin(Train):\n<a href=\"https://ibb.co/BcZmVsr\"><img src=\"https://i.ibb.co/dj2S0KL/train.png\" alt=\"train\" border=\"0\"></a>\n\n## Whale & Dolphin(Test):\n<a href=\"https://ibb.co/WnDnN01\"><img src=\"https://i.ibb.co/zs8sWFw/test.png\" alt=\"test\" border=\"0\"></a>\n\n## Tips:\n* You can try **large** models such as **YOLOv5x6** with large imge_size such as `640x640` or `768x768`.\n* Bounding Boxes in **Whales Fluke** dataset are **large** whereas **Whales & Dolphin** dataset has both **small** and **large** bounding box. To adjust this issue you can try changing the **scale** parameter in the **hyp.yaml** file. The default value is `0.5`, you can try increasing the value.\n<div align=\"center\"><img src=\"https://i.ibb.co/BZNh4Qt/areaplot.png\" alt=\"areaplot\" border=\"0\" width=500></div>\n* You can also try enlarging the bbox for example `1.5x or 1.7x`. This will make sure you don't crop the **Whale/Dolphin**.\n* You can tune the **confidence** and **iou** parameter in **YOLOv5** to get a better bounding box. Just to you know there are images with **multiple dolphins or whales** so choose the **confidence** and **iou** accordingly.\n* And of course you can try **ensembling** multiple models using **nms** or **wbf**.\n* Finally, to tackle the **OOD** task you can try a few rounds of **Pseudo Training**, which will help the model to adapt for **Whale & Dolphin** dataset.",
      "votes": null
    },
    {
      "id": "1680341",
      "postDate": "02/07/2022 18:34:44",
      "content": "<p>Thank you <strong><a href=\"@awsaf49\" target=\"_blank\">Awsaf</a></strong> for sharing your insightful pieces of information about <strong><em>\"Happywhale - Whale and Dolphin Identification\"</em></strong> competition and the <strong>YOLOv5</strong> model.</p>",
      "rawMarkdown": "Thank you **[Awsaf](@awsaf49)** for sharing your insightful pieces of information about ***\"Happywhale - Whale and Dolphin Identification\"*** competition and the **YOLOv5** model.",
      "votes": null
    },
    {
      "id": "1680910",
      "postDate": "02/08/2022 04:55:21",
      "content": "<p>Thanks for sharing</p>",
      "rawMarkdown": "Thanks for sharing",
      "votes": null
    },
    {
      "id": "1680932",
      "postDate": "02/08/2022 05:13:20",
      "content": "<p>good work <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> </p>",
      "rawMarkdown": "good work @awsaf49",
      "votes": null
    },
    {
      "id": "1682026",
      "postDate": "02/08/2022 21:31:37",
      "content": "<p>Good tips 🤟👍!</p>",
      "rawMarkdown": "Good tips 🤟👍!",
      "votes": null
    },
    {
      "id": "1682822",
      "postDate": "02/09/2022 11:58:34",
      "content": "<p>Thanks, I totally agree that there has to be some stage of detection like yolo5, because the images are so different in terms of the depicted scene. E.g. showing the complete sea surface with boats or just showing the zoomed in fluke.</p>",
      "rawMarkdown": "Thanks, I totally agree that there has to be some stage of detection like yolo5, because the images are so different in terms of the depicted scene. E.g. showing the complete sea surface with boats or just showing the zoomed in fluke.",
      "votes": null
    },
    {
      "id": "1682913",
      "postDate": "02/09/2022 13:15:26",
      "content": "<p>Hey again, I just noted, that the images in <a href=\"https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds\" target=\"_blank\">your linked dataset</a> seem to be in a different color space?</p>\n<p>cropped:</p>\n<h2><img src=\"https://storage.googleapis.com/kagglesdsdata/datasets/1918672/3159968/train_images/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&amp;X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220209%2Fauto%2Fstorage%2Fgoog4_request&amp;X-Goog-Date=20220209T130258Z&amp;X-Goog-Expires=345599&amp;X-Goog-SignedHeaders=host&amp;X-Goog-Signature=715485aa3fc5f689b51f4c268add7f9b452f169d4e045a815948468db8e7863748a3b834a21c876bdaadd51dde72f27cdbbb1166330b03dda4e618920364798610bc4450278d0c1a1c350f55cd5433278bdd1c700c5f40b25f0c62c443cb25206cd91e2f92a700a17896bce72bc7cd04067dfd8000e491ef19dd1c53f50af7ed2ff0440eec08db73c21dca8e10308956ade9cd62b2579ab839c3c87950cb1d179e5f1dc1e77374db5f5c4bc22fb98b8b25656e83273d90796a05f145cad28d3433f1fe1db3232584dae439ff29711280adda369ca88f1ee44341f0573ccf487218e62ea3d73df09a3162417d2ca147e0a7b538de061b774ee0ddb62c3e91247a\" alt=\"cropped\"></h2>\n<p>original:<br>\n<img src=\"https://storage.googleapis.com/kagglesdsdata/competitions/22962/3171193/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&amp;X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220207%2Fauto%2Fstorage%2Fgoog4_request&amp;X-Goog-Date=20220207T200443Z&amp;X-Goog-Expires=345599&amp;X-Goog-SignedHeaders=host&amp;X-Goog-Signature=811952ddcf8ec0667108720e28a37ebbb2bd9b282c9faa13f639dd3bacac81237c68d1be0f86181b8919fcdf8aa0b0724f1ec5a371f310cd286da2daa90037024ae692ac2fbd0c47d92a74c27ad26ab7b80e1bf2580970164d58c42d58c8a20613037e1e383befa0c6f9f58107ad36f71e64880e3ffee21b6c04a70e9cccd2ca236d5f9c08c47e97c9219f7b852ca2d8295c5c30d63dea58d483906bf6fd45fd23d46849adefe8c888f46a51e9579c134eb3df248b1b1a332544b155c558fa40ecaf32665cebe1741a3657e81d34164e0780edb65ec3d1abf0ef5f6959f84c06371de06c6c982be617221ca0c35c06be45265927e7882285277d62c1aac7115d\" alt=\"original\"></p>",
      "rawMarkdown": "Hey again, I just noted, that the images in [your linked dataset](https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds) seem to be in a different color space?\n\ncropped:\n![cropped](https://storage.googleapis.com/kagglesdsdata/datasets/1918672/3159968/train_images/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220209%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20220209T130258Z&X-Goog-Expires=345599&X-Goog-SignedHeaders=host&X-Goog-Signature=715485aa3fc5f689b51f4c268add7f9b452f169d4e045a815948468db8e7863748a3b834a21c876bdaadd51dde72f27cdbbb1166330b03dda4e618920364798610bc4450278d0c1a1c350f55cd5433278bdd1c700c5f40b25f0c62c443cb25206cd91e2f92a700a17896bce72bc7cd04067dfd8000e491ef19dd1c53f50af7ed2ff0440eec08db73c21dca8e10308956ade9cd62b2579ab839c3c87950cb1d179e5f1dc1e77374db5f5c4bc22fb98b8b25656e83273d90796a05f145cad28d3433f1fe1db3232584dae439ff29711280adda369ca88f1ee44341f0573ccf487218e62ea3d73df09a3162417d2ca147e0a7b538de061b774ee0ddb62c3e91247a)\n--\n\noriginal:\n![original](https://storage.googleapis.com/kagglesdsdata/competitions/22962/3171193/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220207%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20220207T200443Z&X-Goog-Expires=345599&X-Goog-SignedHeaders=host&X-Goog-Signature=811952ddcf8ec0667108720e28a37ebbb2bd9b282c9faa13f639dd3bacac81237c68d1be0f86181b8919fcdf8aa0b0724f1ec5a371f310cd286da2daa90037024ae692ac2fbd0c47d92a74c27ad26ab7b80e1bf2580970164d58c42d58c8a20613037e1e383befa0c6f9f58107ad36f71e64880e3ffee21b6c04a70e9cccd2ca236d5f9c08c47e97c9219f7b852ca2d8295c5c30d63dea58d483906bf6fd45fd23d46849adefe8c888f46a51e9579c134eb3df248b1b1a332544b155c558fa40ecaf32665cebe1741a3657e81d34164e0780edb65ec3d1abf0ef5f6959f84c06371de06c6c982be617221ca0c35c06be45265927e7882285277d62c1aac7115d)",
      "votes": null
    },
    {
      "id": "1682981",
      "postDate": "02/09/2022 13:53:19",
      "content": "<p>thanks for letting me know, I'll get back to you..</p>",
      "rawMarkdown": "thanks for letting me know, I'll get back to you..",
      "votes": null
    },
    {
      "id": "1683795",
      "postDate": "02/10/2022 03:58:15",
      "content": "<p><a href=\"https://www.kaggle.com/gordonbee\" target=\"_blank\">@gordonbee</a> Issue is resolved, images were being saved as <strong>BGR</strong> instead of <strong>RGB</strong>.</p>",
      "rawMarkdown": "gordonbee Issue is resolved, images were being saved as **BGR** instead of **RGB**.",
      "votes": null
    },
    {
      "id": "1683978",
      "postDate": "02/10/2022 07:14:39",
      "content": "<p>Great Idea !</p>",
      "rawMarkdown": "Great Idea !",
      "votes": null
    },
    {
      "id": "1685606",
      "postDate": "02/11/2022 12:27:36",
      "content": "<p>Thanks for sharing….</p>",
      "rawMarkdown": "Thanks for sharing....",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1680341,
      "author_name": "imuhammadismail",
      "author_url": "",
      "post_date": "02/07/2022 18:34:44",
      "content": "<p>Thank you <strong><a href=\"@awsaf49\" target=\"_blank\">Awsaf</a></strong> for sharing your insightful pieces of information about <strong><em>\"Happywhale - Whale and Dolphin Identification\"</em></strong> competition and the <strong>YOLOv5</strong> model.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1680910,
      "author_name": "sakuragi01",
      "author_url": "",
      "post_date": "02/08/2022 04:55:21",
      "content": "<p>Thanks for sharing</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1680932,
      "author_name": "mahipalsingh",
      "author_url": "",
      "post_date": "02/08/2022 05:13:20",
      "content": "<p>good work <a href=\"https://www.kaggle.com/awsaf49\" target=\"_blank\">@awsaf49</a> </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1682026,
      "author_name": "vad13irt",
      "author_url": "",
      "post_date": "02/08/2022 21:31:37",
      "content": "<p>Good tips 🤟👍!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1682822,
      "author_name": "gordonbee",
      "author_url": "",
      "post_date": "02/09/2022 11:58:34",
      "content": "<p>Thanks, I totally agree that there has to be some stage of detection like yolo5, because the images are so different in terms of the depicted scene. E.g. showing the complete sea surface with boats or just showing the zoomed in fluke.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1682913,
      "author_name": "gordonbee",
      "author_url": "",
      "post_date": "02/09/2022 13:15:26",
      "content": "<p>Hey again, I just noted, that the images in <a href=\"https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds\" target=\"_blank\">your linked dataset</a> seem to be in a different color space?</p>\n<p>cropped:</p>\n<h2><img src=\"https://storage.googleapis.com/kagglesdsdata/datasets/1918672/3159968/train_images/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&amp;X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220209%2Fauto%2Fstorage%2Fgoog4_request&amp;X-Goog-Date=20220209T130258Z&amp;X-Goog-Expires=345599&amp;X-Goog-SignedHeaders=host&amp;X-Goog-Signature=715485aa3fc5f689b51f4c268add7f9b452f169d4e045a815948468db8e7863748a3b834a21c876bdaadd51dde72f27cdbbb1166330b03dda4e618920364798610bc4450278d0c1a1c350f55cd5433278bdd1c700c5f40b25f0c62c443cb25206cd91e2f92a700a17896bce72bc7cd04067dfd8000e491ef19dd1c53f50af7ed2ff0440eec08db73c21dca8e10308956ade9cd62b2579ab839c3c87950cb1d179e5f1dc1e77374db5f5c4bc22fb98b8b25656e83273d90796a05f145cad28d3433f1fe1db3232584dae439ff29711280adda369ca88f1ee44341f0573ccf487218e62ea3d73df09a3162417d2ca147e0a7b538de061b774ee0ddb62c3e91247a\" alt=\"cropped\"></h2>\n<p>original:<br>\n<img src=\"https://storage.googleapis.com/kagglesdsdata/competitions/22962/3171193/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&amp;X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220207%2Fauto%2Fstorage%2Fgoog4_request&amp;X-Goog-Date=20220207T200443Z&amp;X-Goog-Expires=345599&amp;X-Goog-SignedHeaders=host&amp;X-Goog-Signature=811952ddcf8ec0667108720e28a37ebbb2bd9b282c9faa13f639dd3bacac81237c68d1be0f86181b8919fcdf8aa0b0724f1ec5a371f310cd286da2daa90037024ae692ac2fbd0c47d92a74c27ad26ab7b80e1bf2580970164d58c42d58c8a20613037e1e383befa0c6f9f58107ad36f71e64880e3ffee21b6c04a70e9cccd2ca236d5f9c08c47e97c9219f7b852ca2d8295c5c30d63dea58d483906bf6fd45fd23d46849adefe8c888f46a51e9579c134eb3df248b1b1a332544b155c558fa40ecaf32665cebe1741a3657e81d34164e0780edb65ec3d1abf0ef5f6959f84c06371de06c6c982be617221ca0c35c06be45265927e7882285277d62c1aac7115d\" alt=\"original\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 1682981,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "02/09/2022 13:53:19",
          "content": "<p>thanks for letting me know, I'll get back to you..</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1683795,
          "author_name": "awsaf49",
          "author_url": "",
          "post_date": "02/10/2022 03:58:15",
          "content": "<p><a href=\"https://www.kaggle.com/gordonbee\" target=\"_blank\">@gordonbee</a> Issue is resolved, images were being saved as <strong>BGR</strong> instead of <strong>RGB</strong>.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1683978,
      "author_name": "vatsalgabani2709",
      "author_url": "",
      "post_date": "02/10/2022 07:14:39",
      "content": "<p>Great Idea !</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1685606,
      "author_name": "abdulmanankhalid",
      "author_url": "",
      "post_date": "02/11/2022 12:27:36",
      "content": "<p>Thanks for sharing….</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1680107": "I think the cropped images will be a key factor in this competition due as the model tends to focus on the background. You can use the following notebooks to create your own **Cropped Dataset**.  You can use one notebook to generate **Bounding Box** and the other one to create **Cropped Dataset**.  To create your own dataset simply use the  **notebook output** as dataset.\n\n> These notebooks haven't been tuned so there is a lot of room for improvement. I'll be adding some **tips** at the end on how to improve the **detection**, make sure you don't miss them.\n\n## Notebooks:\n* [Happywhale: BoundingBox [YOLOv5] 🐋🐬](https://www.kaggle.com/awsaf49/happywhale-boundingbox-yolov5)\n* [Happywhale: Cropped Dataset [YOLOv5] ✂️](https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5)\n\n## Dataset:\n* [Happywhale: Cropped Dataset [YOLOv5] ds](https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds) - `(256x256)`\n\n## Procedure\nThis notebook uses the **YOLOv5** model to create **Bounding Box**. For **train** and **test** data [**Whale Fluke** ](https://www.kaggle.com/martinpiotte/humpback-whale-identification-fluke-location) dataset was used. This dataset contains labels for `1200` samples. These `1200` labeled images were used for both **train** and **test**. We can get a pretty good score (0.98 map@0.50) in the **Whale Fluke** Dataset.\n\nFinally, the **Whale Fluke** model was used to create labels for **Whales & Dolphin** Dataset. There are some **False Positives** and **False Negatives**. We can tune the notebook for better results. As you may already have figured out, this is somewhat an **Out of Distribution (OOD)** task. So, we may need to use the data carefully.\n\n## Whale Fluke:\n<a href=\"https://ibb.co/Sm0BbPM\"><img src=\"https://i.ibb.co/Yd8hm31/whale-fluke.png\" alt=\"whale-fluke\" border=\"0\"></a>\n\n## Whale & Dolhpin(Train):\n<a href=\"https://ibb.co/BcZmVsr\"><img src=\"https://i.ibb.co/dj2S0KL/train.png\" alt=\"train\" border=\"0\"></a>\n\n## Whale & Dolphin(Test):\n<a href=\"https://ibb.co/WnDnN01\"><img src=\"https://i.ibb.co/zs8sWFw/test.png\" alt=\"test\" border=\"0\"></a>\n\n## Tips:\n* You can try **large** models such as **YOLOv5x6** with large imge_size such as `640x640` or `768x768`.\n* Bounding Boxes in **Whales Fluke** dataset are **large** whereas **Whales & Dolphin** dataset has both **small** and **large** bounding box. To adjust this issue you can try changing the **scale** parameter in the **hyp.yaml** file. The default value is `0.5`, you can try increasing the value.\n<div align=\"center\"><img src=\"https://i.ibb.co/BZNh4Qt/areaplot.png\" alt=\"areaplot\" border=\"0\" width=500></div>\n* You can also try enlarging the bbox for example `1.5x or 1.7x`. This will make sure you don't crop the **Whale/Dolphin**.\n* You can tune the **confidence** and **iou** parameter in **YOLOv5** to get a better bounding box. Just to you know there are images with **multiple dolphins or whales** so choose the **confidence** and **iou** accordingly.\n* And of course you can try **ensembling** multiple models using **nms** or **wbf**.\n* Finally, to tackle the **OOD** task you can try a few rounds of **Pseudo Training**, which will help the model to adapt for **Whale & Dolphin** dataset.",
    "1680341": "Thank you **[Awsaf](@awsaf49)** for sharing your insightful pieces of information about ***\"Happywhale - Whale and Dolphin Identification\"*** competition and the **YOLOv5** model.",
    "1680910": "Thanks for sharing",
    "1680932": "good work @awsaf49",
    "1682026": "Good tips 🤟👍!",
    "1682822": "Thanks, I totally agree that there has to be some stage of detection like yolo5, because the images are so different in terms of the depicted scene. E.g. showing the complete sea surface with boats or just showing the zoomed in fluke.",
    "1682913": "Hey again, I just noted, that the images in [your linked dataset](https://www.kaggle.com/awsaf49/happywhale-cropped-dataset-yolov5-ds) seem to be in a different color space?\n\ncropped:\n![cropped](https://storage.googleapis.com/kagglesdsdata/datasets/1918672/3159968/train_images/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220209%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20220209T130258Z&X-Goog-Expires=345599&X-Goog-SignedHeaders=host&X-Goog-Signature=715485aa3fc5f689b51f4c268add7f9b452f169d4e045a815948468db8e7863748a3b834a21c876bdaadd51dde72f27cdbbb1166330b03dda4e618920364798610bc4450278d0c1a1c350f55cd5433278bdd1c700c5f40b25f0c62c443cb25206cd91e2f92a700a17896bce72bc7cd04067dfd8000e491ef19dd1c53f50af7ed2ff0440eec08db73c21dca8e10308956ade9cd62b2579ab839c3c87950cb1d179e5f1dc1e77374db5f5c4bc22fb98b8b25656e83273d90796a05f145cad28d3433f1fe1db3232584dae439ff29711280adda369ca88f1ee44341f0573ccf487218e62ea3d73df09a3162417d2ca147e0a7b538de061b774ee0ddb62c3e91247a)\n--\n\noriginal:\n![original](https://storage.googleapis.com/kagglesdsdata/competitions/22962/3171193/train_images/00021adfb725ed.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=databundle-worker-v2%40kaggle-161607.iam.gserviceaccount.com%2F20220207%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20220207T200443Z&X-Goog-Expires=345599&X-Goog-SignedHeaders=host&X-Goog-Signature=811952ddcf8ec0667108720e28a37ebbb2bd9b282c9faa13f639dd3bacac81237c68d1be0f86181b8919fcdf8aa0b0724f1ec5a371f310cd286da2daa90037024ae692ac2fbd0c47d92a74c27ad26ab7b80e1bf2580970164d58c42d58c8a20613037e1e383befa0c6f9f58107ad36f71e64880e3ffee21b6c04a70e9cccd2ca236d5f9c08c47e97c9219f7b852ca2d8295c5c30d63dea58d483906bf6fd45fd23d46849adefe8c888f46a51e9579c134eb3df248b1b1a332544b155c558fa40ecaf32665cebe1741a3657e81d34164e0780edb65ec3d1abf0ef5f6959f84c06371de06c6c982be617221ca0c35c06be45265927e7882285277d62c1aac7115d)",
    "1682981": "thanks for letting me know, I'll get back to you..",
    "1683795": "gordonbee Issue is resolved, images were being saved as **BGR** instead of **RGB**.",
    "1683978": "Great Idea !",
    "1685606": "Thanks for sharing...."
  },
  "source": "meta"
}