{
  "id": 369754,
  "title": "⭐️ ROI extracted dataset - resolution 768pix and 1024pix⭐️ -> 2023.01.14 = 1280 (windowing)",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/369754",
  "author_name": "Remek Kinas",
  "post_date": "2022-12-01T09:44:06.774000",
  "votes": 70,
  "comment_count": 42,
  "views": 0,
  "content": "<p>I created ROI (Region Of Interest) extracted dataset for this compettion. Hope this improve score a lot.</p>\n<p>Solution:</p>\n<ul>\n<li>ROI extractor -&gt; <a href=\"https://www.kaggle.com/code/remekkinas/breast-cancer-roi-brest-extractor\" target=\"_blank\">https://www.kaggle.com/code/remekkinas/breast-cancer-roi-brest-extractor</a></li>\n<li>ROI is resized to SIZE (I resized only taking into account longer dimension) so no distorision -&gt; you can decide in augumentation step what to do with extracted ROI </li>\n</ul>\n<p><img src=\"https://i.ibb.co/zPBHmT6/br002.jpg\" alt=\"Dataset\"></p>\n<p>Dataset is available here: <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images</a></p>",
  "messages": [
    {
      "id": 2051239,
      "postDate": "2022-12-01T09:44:06.773Z",
      "content": "<p>I created ROI (Region Of Interest) extracted dataset for this compettion. Hope this improve score a lot.</p>\n<p>Solution:</p>\n<ul>\n<li>ROI extractor -&gt; <a href=\"https://www.kaggle.com/code/remekkinas/breast-cancer-roi-brest-extractor\" target=\"_blank\">https://www.kaggle.com/code/remekkinas/breast-cancer-roi-brest-extractor</a></li>\n<li>ROI is resized to SIZE (I resized only taking into account longer dimension) so no distorision -&gt; you can decide in augumentation step what to do with extracted ROI </li>\n</ul>\n<p><img src=\"https://i.ibb.co/zPBHmT6/br002.jpg\" alt=\"Dataset\"></p>\n<p>Dataset is available here: <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images</a></p>",
      "rawMarkdown": "I created ROI (Region Of Interest) extracted dataset for this compettion. Hope this improve score a lot.\n\nSolution:\n- ROI extractor -> https://www.kaggle.com/code/remekkinas/breast-cancer-roi-brest-extractor\n- ROI is resized to SIZE (I resized only taking into account longer dimension) so no distorision -> you can decide in augumentation step what to do with extracted ROI \n\n![Dataset](https://i.ibb.co/zPBHmT6/br002.jpg)\n\nDataset is available here: https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images",
      "votes": 70
    },
    {
      "id": 2051735,
      "postDate": "2022-12-01T15:41:54.020Z",
      "content": "<p>I can confirm your preprocessing gives a 0.02 CV boost. </p>",
      "rawMarkdown": "I can confirm your preprocessing gives a 0.02 CV boost. ",
      "votes": 3,
      "replies": [
        {
          "id": 2057744,
          "postDate": "2022-12-07T10:16:06.470Z",
          "content": "<p>ROI extracted images boost score. Due to my experiments if we leave crops not distorted by resizing it helps a lot.</p>",
          "rawMarkdown": "ROI extracted images boost score. Due to my experiments if we leave crops not distorted by resizing it helps a lot."
        }
      ]
    },
    {
      "id": 2056932,
      "postDate": "2022-12-06T15:31:00.467Z",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> for sharing!</p>\n<p>Can you just clarify your pipeline for me please:</p>\n<ul>\n<li>you trained the yolov5 model on resized images of size (768, 768)</li>\n<li>you inferred the position of the breast on images of size (768, 768)</li>\n<li>from the detected bounding box resize the bounding box area from (h_long, w_smaller) -&gt; (768, w_smaller*h_long/768) then save ?</li>\n</ul>",
      "rawMarkdown": "Thank you @remekkinas for sharing!\n\nCan you just clarify your pipeline for me please:\n- you trained the yolov5 model on resized images of size (768, 768)\n- you inferred the position of the breast on images of size (768, 768)\n- from the detected bounding box resize the bounding box area from (h_long, w_smaller) -> (768, w_smaller*h_long/768) then save ?",
      "votes": 1,
      "replies": [
        {
          "id": 2057765,
          "postDate": "2022-12-07T10:25:56.917Z",
          "content": "<ol>\n<li>Labelled 300 images (taken from competion train DS)</li>\n<li>Trained Yolov5 1024 im size as input</li>\n<li>Validated model_1 (on all images in competion train DS - ~56.000 images) and check missed images - relabeled missed images (50 images - most characteristic patterns). Add new labeled data to train and valid (check to prevent from leak - I was looking on patient_id) - 350 images</li>\n<li>Trained Yolov5 again</li>\n<li>Validated model_2 and check missed images (model_2 improved a lot) - relabeled missed images (50). Add new labeled data to train and valid- 400 images in yolo DS</li>\n<li>Trained Yolov5 again -&gt; model_3 (it performed very well).</li>\n</ol>\n<p>ROI extracted DS</p>\n<ol>\n<li>Read dicom </li>\n<li>Having it in memory make inference using yolo to find ROI</li>\n<li>Extract ROI from image x,y,w,h</li>\n<li>Resize</li>\n</ol>\n<pre><code>def image_resize(image, width = None, height = None, inter = cv2.INTER_LINEAR):\n\n    dim = None\n    (h, w) = image.shape[:2]\n\n    if width is None and height is None:\n        return image\n\n    if width is None:\n        r = height / float(h)\n        dim = (int(w * r), height)\n    else:\n        r = width / float(w)\n        dim = (width, int(h * r))\n    resized = cv2.resize(image, dim, interpolation = inter)\n\n    return resized\n\nh, w, _ = tmp_im.shape\n\nif w &gt; h:\n        img = image_resize(tmp_im, width = size)\n    else:\n        img = image_resize(tmp_im, height = size)\n</code></pre>",
          "rawMarkdown": "1. Labelled 300 images (taken from competion train DS)\n2. Trained Yolov5 1024 im size as input\n3. Validated model_1 (on all images in competion train DS - ~56.000 images) and check missed images - relabeled missed images (50 images - most characteristic patterns). Add new labeled data to train and valid (check to prevent from leak - I was looking on patient_id) - 350 images\n4. Trained Yolov5 again\n5. Validated model_2 and check missed images (model_2 improved a lot) - relabeled missed images (50). Add new labeled data to train and valid- 400 images in yolo DS\n6. Trained Yolov5 again -> model_3 (it performed very well).\n\nROI extracted DS\n1. Read dicom \n2. Having it in memory make inference using yolo to find ROI\n3. Extract ROI from image x,y,w,h\n4. Resize\n\n```\ndef image_resize(image, width = None, height = None, inter = cv2.INTER_LINEAR):\n\n    dim = None\n    (h, w) = image.shape[:2]\n\n    if width is None and height is None:\n        return image\n    \n    if width is None:\n        r = height / float(h)\n        dim = (int(w * r), height)\n    else:\n        r = width / float(w)\n        dim = (width, int(h * r))\n    resized = cv2.resize(image, dim, interpolation = inter)\n    \n    return resized\n\nh, w, _ = tmp_im.shape\n\nif w > h:\n        img = image_resize(tmp_im, width = size)\n    else:\n        img = image_resize(tmp_im, height = size)\n ```",
          "votes": 4
        }
      ]
    },
    {
      "id": 2099972,
      "postDate": "2023-01-14T19:55:50.870Z",
      "content": "<p>Today I updated dataset -&gt; resolution 1280px (longer side of image)  and all imagess were processed using windowing (dicomsdl). I checked them in my notebook and works better for training (maybe due to consistent file processing). Now they look better as well : <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images</a></p>\n<p><img src=\"https://i.ibb.co/2qpHw62/lut.jpg\" alt=\"\"></p>",
      "rawMarkdown": "Today I updated dataset -> resolution 1280px (longer side of image)  and all imagess were processed using windowing (dicomsdl). I checked them in my notebook and works better for training (maybe due to consistent file processing). Now they look better as well : https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\n\n![](https://i.ibb.co/2qpHw62/lut.jpg)\n\n",
      "votes": 2,
      "replies": [
        {
          "id": 2108135,
          "postDate": "2023-01-20T09:26:04.653Z",
          "content": "<p>Could you also please share Kaggle notebook where you have windowing is applied on the dicom files</p>",
          "rawMarkdown": "Could you also please share Kaggle notebook where you have windowing is applied on the dicom files",
          "replies": [
            {
              "id": 2108160,
              "postDate": "2023-01-20T09:52:36.723Z",
              "content": "<p>Hi, <br>\nI described it in Dataset discussion part: <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images/discussion/378201\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images/discussion/378201</a></p>",
              "rawMarkdown": "Hi, \nI described it in Dataset discussion part: https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images/discussion/378201"
            }
          ]
        }
      ]
    },
    {
      "id": 2066520,
      "postDate": "2022-12-15T19:22:58.787Z",
      "content": "<p>Now dataset is updated. I cropped oryginal DS to 1024pix. I can see a lot of improvement using higher cropped resolution. Have a nice Kaggling with this dataset.</p>\n<p>For crop I used yolov5 and nano model. Source:</p>\n<ul>\n<li>model -&gt; 001 -&gt; <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-roi-model\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-roi-model</a></li>\n<li>training notebook -&gt; <a href=\"https://www.kaggle.com/code/remekkinas/roi-detector-yolov5-training-and-annotations\" target=\"_blank\">https://www.kaggle.com/code/remekkinas/roi-detector-yolov5-training-and-annotations</a></li>\n<li>annotations -&gt; <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-roi-detector-annotations-yolo\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-roi-detector-annotations-yolo</a></li>\n</ul>",
      "rawMarkdown": "Now dataset is updated. I cropped oryginal DS to 1024pix. I can see a lot of improvement using higher cropped resolution. Have a nice Kaggling with this dataset.\n\nFor crop I used yolov5 and nano model. Source:\n- model -> 001 -> https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-roi-model\n- training notebook -> https://www.kaggle.com/code/remekkinas/roi-detector-yolov5-training-and-annotations\n- annotations -> https://www.kaggle.com/datasets/remekkinas/rsna-roi-detector-annotations-yolo",
      "votes": 2
    },
    {
      "id": 2061165,
      "postDate": "2022-12-10T18:46:16.220Z",
      "content": "<p>This is ROI extraction test report I made today: <br>\n<img src=\"https://i.ibb.co/wdBy2vk/001.jpg\" alt=\"\"></p>\n<p><a href=\"https://www.kaggle.com/radek1\" target=\"_blank\">@radek1</a> now you can see that speed is ok for yolo.</p>",
      "rawMarkdown": "This is ROI extraction test report I made today: \n![](https://i.ibb.co/wdBy2vk/001.jpg)\n\n@radek1 now you can see that speed is ok for yolo.",
      "votes": 2,
      "replies": [
        {
          "id": 2061270,
          "postDate": "2022-12-10T22:26:15.793Z",
          "content": "<p>Yes, thank you! 🙂 This is blazingly fast! 🔥</p>",
          "rawMarkdown": "Yes, thank you! 🙂 This is blazingly fast! 🔥"
        }
      ]
    },
    {
      "id": 2051288,
      "postDate": "2022-12-01T10:20:55.833Z",
      "content": "<p>Cool dataset !</p>\n<p>Watch out for license issues with yolov5 though =)</p>",
      "rawMarkdown": "Cool dataset !\n\nWatch out for license issues with yolov5 though =)",
      "votes": 2,
      "replies": [
        {
          "id": 2051303,
          "postDate": "2022-12-01T10:30:54.087Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/theoviel\" target=\"_blank\">@theoviel</a> …. theank you for your comment. Any issue with yolov5? I know past competition where it was banned. What about this one?<br>\nWe can convert idea (having labels) to anything else :) (yolov7 e.g. or faster yolov6). No problem.</p>",
          "rawMarkdown": "Hi @theoviel .... theank you for your comment. Any issue with yolov5? I know past competition where it was banned. What about this one?\nWe can convert idea (having labels) to anything else :) (yolov7 e.g. or faster yolov6). No problem."
        },
        {
          "id": 2051320,
          "postDate": "2022-12-01T10:41:15.270Z",
          "content": "<p>I have no idea, we have to ask the kaggle team or the hosts, and neither are usually not giving explicit answers.</p>\n<p>Anyways, I will experiment with your dataset asap.</p>",
          "rawMarkdown": "I have no idea, we have to ask the kaggle team or the hosts, and neither are usually not giving explicit answers.\n\nAnyways, I will experiment with your dataset asap."
        },
        {
          "id": 2057886,
          "postDate": "2022-12-07T12:23:08.887Z",
          "content": "<p>Yolo is always tricky. It all depends if copy-left license is OK, only Kaggle/hosts can tell.</p>\n<p>Personally I would use other object detection models - there are enough good ones with better licenses.</p>",
          "rawMarkdown": "Yolo is always tricky. It all depends if copy-left license is OK, only Kaggle/hosts can tell.\n\nPersonally I would use other object detection models - there are enough good ones with better licenses.",
          "votes": 3
        }
      ]
    },
    {
      "id": 2145560,
      "postDate": "2023-02-15T07:29:57.877Z",
      "content": "<p>Dear <a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a>. I'm training my own experiment and tuning hyperparameter but my validation could not improve.Can you give me some advices to improve my score. Thank you very much.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7879577%2F1aaabac308bf66765a023417ca07d5d7%2FScreenshot%202023-02-15%20142601.png?generation=1676445999616375&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Dear @remekkinas. I'm training my own experiment and tuning hyperparameter but my validation could not improve.Can you give me some advices to improve my score. Thank you very much.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7879577%2F1aaabac308bf66765a023417ca07d5d7%2FScreenshot%202023-02-15%20142601.png?generation=1676445999616375&alt=media)\n"
    },
    {
      "id": 2142375,
      "postDate": "2023-02-13T13:39:08.193Z",
      "content": "<p>Hello, guys can somebody answer me this <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/386518\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/386518</a></p>",
      "rawMarkdown": "Hello, guys can somebody answer me this https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/386518"
    },
    {
      "id": 2112999,
      "postDate": "2023-01-24T02:33:24.570Z",
      "content": "<p>Here is a dumb question…</p>\n<p>I just wonder if my input ROI images are l large like 2048*2048. When inferring could I store it locally in workworking/tem/imgfolder? I remember there is a max storage limitation. </p>\n<p>1536*960 0.5MB for each sample.</p>",
      "rawMarkdown": "Here is a dumb question...\n\nI just wonder if my input ROI images are l large like 2048*2048. When inferring could I store it locally in workworking/tem/imgfolder? I remember there is a max storage limitation. \n\n1536*960 0.5MB for each sample.",
      "replies": [
        {
          "id": 2113051,
          "postDate": "2023-01-24T03:53:04.090Z",
          "content": "<p>os.remove(f'{image_id}.png')</p>\n<p>Okay, I got it. </p>",
          "rawMarkdown": "os.remove(f'{image_id}.png')\n\nOkay, I got it. "
        }
      ]
    },
    {
      "id": 2080969,
      "postDate": "2022-12-30T16:58:20.667Z",
      "content": "<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> I've tested your YoloV5 model, it looks quite good. About <code>Parallel(n_jobs=2)</code> execution, you might experiment the following issue that happens a bit randomly (it happened to me): <a href=\"https://github.com/ultralytics/yolov5/issues/2824\" target=\"_blank\">https://github.com/ultralytics/yolov5/issues/2824</a> that prevents ROI detection for a small number of images. It could be a problem during inference that you won't see if you <code>try/catch</code> the ROI model execution that could affect the final score. I'm testing a fix currently …</p>\n<p>The error I got for a few images:</p>\n<blockquote>\n  <p>The size of tensor a (104) must match the size of tensor b (112) at non-singleton dimension 3</p>\n</blockquote>",
      "rawMarkdown": "@remekkinas I've tested your YoloV5 model, it looks quite good. About `Parallel(n_jobs=2)` execution, you might experiment the following issue that happens a bit randomly (it happened to me): https://github.com/ultralytics/yolov5/issues/2824 that prevents ROI detection for a small number of images. It could be a problem during inference that you won't see if you `try/catch` the ROI model execution that could affect the final score. I'm testing a fix currently ...\n\nThe error I got for a few images:\n>The size of tensor a (104) must match the size of tensor b (112) at non-singleton dimension 3",
      "replies": [
        {
          "id": 2080983,
          "postDate": "2022-12-30T17:28:31.027Z",
          "content": "<p>A possible idea to try is batch processing, it can probably decrease time since batch processing seems to be faster (see the table below from the yolov5 repo). I think since only one model will be loaded and the CPU threads would process the data, it would alleviate this problem.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F547bab5861cee666ce1ed9da7f1f9cf8%2FCapture.PNG?generation=1672421053793971&amp;alt=media\" alt=\"Yolov5 Model Comparison Chart\"></p>\n<p>(for J2K) Maybe with DALI we can load batch on GPU, preprocess, get ROI, crop and save immediately. I am not sure if anyone has done this before but it seems like it is worth a shot. I'll look into it after my experiments.</p>",
          "rawMarkdown": "A possible idea to try is batch processing, it can probably decrease time since batch processing seems to be faster (see the table below from the yolov5 repo). I think since only one model will be loaded and the CPU threads would process the data, it would alleviate this problem.\n\n![Yolov5 Model Comparison Chart](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F547bab5861cee666ce1ed9da7f1f9cf8%2FCapture.PNG?generation=1672421053793971&alt=media)\n\n(for J2K) Maybe with DALI we can load batch on GPU, preprocess, get ROI, crop and save immediately. I am not sure if anyone has done this before but it seems like it is worth a shot. I'll look into it after my experiments.\n",
          "votes": 1
        },
        {
          "id": 2080996,
          "postDate": "2022-12-30T17:55:14.497Z",
          "content": "<p>Thank you for information. I will check my notebook. Let me know when you finish testing.</p>\n<p>I am sure yolo cropped images improve local score.  </p>",
          "rawMarkdown": "Thank you for information. I will check my notebook. Let me know when you finish testing.\n\nI am sure yolo cropped images improve local score.  ",
          "votes": 1,
          "replies": [
            {
              "id": 2081850,
              "postDate": "2022-12-31T18:14:54.300Z",
              "content": "<p>The fix is explained here: <a href=\"https://github.com/ultralytics/yolov5/commit/03fae98d86394fe02804d7e9bc20013311bf5837\" target=\"_blank\">https://github.com/ultralytics/yolov5/commit/03fae98d86394fe02804d7e9bc20013311bf5837</a><br>\nHowever, it's for an old version. For current YoloV5 version, it's quite similar, initialize <code>self.grid</code> and <code>self.anchor_grid</code> in <code>forward()</code> method like:</p>\n<pre><code>def __init__(self, nc=80, anchors=(), ch=(), inplace=True):  # detection layer\n    super().__init__()\n    self.nc = nc  # number of classes\n    self.no = nc + 5  # number of outputs per anchor\n    self.nl = len(anchors)  # number of detection layers\n    self.na = len(anchors[0]) // 2  # number of anchors\n    # self.grid = [torch.empty(0) for _ in range(self.nl)]  # init grid\n    # self.anchor_grid = [torch.empty(0) for _ in range(self.nl)]  # init anchor grid\n    self.register_buffer('anchors', torch.tensor(anchors).float().view(self.nl, -1, 2))  # shape(nl,na,2)\n    self.m = nn.ModuleList(nn.Conv2d(x, self.no * self.na, 1) for x in ch)  # output conv\n    self.inplace = inplace  # use inplace ops (e.g. slice assignment) \n\n\ndef forward(self, x):\n    z = []  # inference output\n    grid = [torch.empty(0) for _ in range(self.nl)]  # init grid\n    anchor_grid = [torch.empty(0) for _ in range(self.nl)]  # init anchor grid        \n    for i in range(self.nl):\n        x[i] = self.m[i](x[i])  # conv\n        bs, _, ny, nx = x[i].shape  # x(bs,255,20,20) to x(bs,3,20,20,85)\n        x[i] = x[i].view(bs, self.na, self.no, ny, nx).permute(0, 1, 3, 4, 2).contiguous()\n\n        if not self.training:  # inference\n            # if self.dynamic or self.grid[i].shape[2:4] != x[i].shape[2:4]:\n            #     self.grid[i], self.anchor_grid[i] = self._make_grid(nx, ny, i)\n            grid[i], anchor_grid[i] = self._make_grid(nx, ny, i)\n    ....  \n</code></pre>\n<p>It worked for me. </p>\n<p>For now with ROI 1024 I'm stuck for single fold CV=0.44, LB=0.41<br>\n<strong>Update</strong>: LB=0.45</p>",
              "rawMarkdown": "The fix is explained here: https://github.com/ultralytics/yolov5/commit/03fae98d86394fe02804d7e9bc20013311bf5837\nHowever, it's for an old version. For current YoloV5 version, it's quite similar, initialize `self.grid` and `self.anchor_grid` in `forward()` method like:\n\n    def __init__(self, nc=80, anchors=(), ch=(), inplace=True):  # detection layer\n        super().__init__()\n        self.nc = nc  # number of classes\n        self.no = nc + 5  # number of outputs per anchor\n        self.nl = len(anchors)  # number of detection layers\n        self.na = len(anchors[0]) // 2  # number of anchors\n        # self.grid = [torch.empty(0) for _ in range(self.nl)]  # init grid\n        # self.anchor_grid = [torch.empty(0) for _ in range(self.nl)]  # init anchor grid\n        self.register_buffer('anchors', torch.tensor(anchors).float().view(self.nl, -1, 2))  # shape(nl,na,2)\n        self.m = nn.ModuleList(nn.Conv2d(x, self.no * self.na, 1) for x in ch)  # output conv\n        self.inplace = inplace  # use inplace ops (e.g. slice assignment) \n\n\n    def forward(self, x):\n        z = []  # inference output\n        grid = [torch.empty(0) for _ in range(self.nl)]  # init grid\n        anchor_grid = [torch.empty(0) for _ in range(self.nl)]  # init anchor grid        \n        for i in range(self.nl):\n            x[i] = self.m[i](x[i])  # conv\n            bs, _, ny, nx = x[i].shape  # x(bs,255,20,20) to x(bs,3,20,20,85)\n            x[i] = x[i].view(bs, self.na, self.no, ny, nx).permute(0, 1, 3, 4, 2).contiguous()\n\n            if not self.training:  # inference\n                # if self.dynamic or self.grid[i].shape[2:4] != x[i].shape[2:4]:\n                #     self.grid[i], self.anchor_grid[i] = self._make_grid(nx, ny, i)\n                grid[i], anchor_grid[i] = self._make_grid(nx, ny, i)\n        ....  \n\nIt worked for me. \n\nFor now with ROI 1024 I'm stuck for single fold CV=0.44, LB=0.41\n**Update**: LB=0.45",
              "votes": 1
            },
            {
              "id": 2081866,
              "postDate": "2022-12-31T18:42:26.180Z",
              "content": "<p>Yes, I checked it as well. I subbed without Paraller processing - score is the same. Thank you for checking and trying to help.</p>\n<p>I have almost the same score for single fold:</p>\n<ul>\n<li>img size 1024</li>\n<li>model - effnet_b2</li>\n</ul>\n<p>What do you mean by CV? Is this f1prob?</p>",
              "rawMarkdown": "Yes, I checked it as well. I subbed without Paraller processing - score is the same. Thank you for checking and trying to help.\n\nI have almost the same score for single fold:\n- img size 1024\n- model - effnet_b2\n\nWhat do you mean by CV? Is this f1prob?\n",
              "votes": 1
            },
            {
              "id": 2081965,
              "postDate": "2022-12-31T22:13:54.653Z",
              "content": "<p>Yes, CV is based on <em>valid_pfbeta_agg_opt</em> score</p>\n<ul>\n<li>agg = groupby([PATIENT_ID, LATERALITY])[[\"probs\"]].max()</li>\n<li>opt = optimal threshold to binarize</li>\n</ul>",
              "rawMarkdown": "Yes, CV is based on *valid_pfbeta_agg_opt* score\n- agg = groupby([PATIENT_ID, LATERALITY])[[\"probs\"]].max()\n- opt = optimal threshold to binarize"
            },
            {
              "id": 2083834,
              "postDate": "2023-01-02T22:30:52.117Z",
              "content": "<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> Are you able to extract ROI if image is already in GPU?</p>\n<pre><code>\nresults = model_roi((image*).astype(np.uint8), size=)\nrow_pd = results.pandas().xyxy[]\n</code></pre>\n<pre><code>\nresults = model_roi(torch_image, size=)\nrow_pd = results.pandas().xyxy[]\n</code></pre>\n<p>I would to avoid the round trip GPU =&gt; CPU =&gt; GPU. It looks that YoloV5 have a \"letterbox\" function to pad numpy image correctly before passing to GPU but nothing if image is already in GPU.</p>",
              "rawMarkdown": "@remekkinas Are you able to extract ROI if image is already in GPU?\n\n```python\n# Numpy image on CPU\nresults = model_roi((image*255).astype(np.uint8), size=1024)\nrow_pd = results.pandas().xyxy[0]\n```\n\n```python\n# Torch image on GPU\nresults = model_roi(torch_image, size=1024)\nrow_pd = results.pandas().xyxy[0]\n```\n\nI would to avoid the round trip GPU => CPU => GPU. It looks that YoloV5 have a \"letterbox\" function to pad numpy image correctly before passing to GPU but nothing if image is already in GPU."
            },
            {
              "id": 2083846,
              "postDate": "2023-01-02T23:21:49.747Z",
              "content": "<p><a href=\"https://www.kaggle.com/mpware\" target=\"_blank\">@mpware</a> Yolov5 returns different results if the input is a tensor vs numpy/list. Here is the code from the Yolov5 repo. It just results raw result so we need to do some post-processing:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F6481f0c7437f56f67c9f7a28184a050c%2Fcode.png?generation=1672701242401995&amp;alt=media\" alt=\"Yolov5 repo code\"><br>\nSee <a href=\"https://github.com/ultralytics/yolov5/blob/632bf485b4ab2adbaef71f4eced5e6b59ecef7e2/models/common.py#L658\" target=\"_blank\">https://github.com/ultralytics/yolov5/blob/632bf485b4ab2adbaef71f4eced5e6b59ecef7e2/models/common.py#L658</a></p>\n<p>If the input is a numpy array, it would take of the preprocessing, so I recommend preprocessing and scaling the input tensor 0-1. The returned tensor is the anchors so you need just to run the postprocessing step.</p>\n<p>Here is how I did it with another postprocessing step to keeping highest conf bboxes:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F7d873f9ef4e3ee1515e4cb84210f61e7%2Fyolov566.PNG?generation=1672701128089222&amp;alt=media\" alt=\"Yolov5 Code\"></p>\n<p>You can import it via</p>\n<pre><code>sys.path.append()\n\n utils.general  non_max_suppression\n</code></pre>\n<p>EDIT: I also got batch preprocessing to work with yolov5 but it very specific to my model which also extracts if the breast is on the left or right side of the image with almost perfect accuracy (this is very helpful, and i will release once I get a E2E solution)</p>",
              "rawMarkdown": "@mpware Yolov5 returns different results if the input is a tensor vs numpy/list. Here is the code from the Yolov5 repo. It just results raw result so we need to do some post-processing:\n\n![Yolov5 repo code](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F6481f0c7437f56f67c9f7a28184a050c%2Fcode.png?generation=1672701242401995&alt=media)\nSee https://github.com/ultralytics/yolov5/blob/632bf485b4ab2adbaef71f4eced5e6b59ecef7e2/models/common.py#L658\n\nIf the input is a numpy array, it would take of the preprocessing, so I recommend preprocessing and scaling the input tensor 0-1. The returned tensor is the anchors so you need just to run the postprocessing step.\n\nHere is how I did it with another postprocessing step to keeping highest conf bboxes:\n\n![Yolov5 Code](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F7d873f9ef4e3ee1515e4cb84210f61e7%2Fyolov566.PNG?generation=1672701128089222&alt=media)\n\nYou can import it via\n\n```python\nsys.path.append('/kaggle/input/yolov5-github-repo-tracker/yolov5')\n\nfrom utils.general import non_max_suppression\n```\n\nEDIT: I also got batch preprocessing to work with yolov5 but it very specific to my model which also extracts if the breast is on the left or right side of the image with almost perfect accuracy (this is very helpful, and i will release once I get a E2E solution)",
              "votes": 1
            },
            {
              "id": 2085321,
              "postDate": "2023-01-04T04:20:52.230Z",
              "content": "<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> <a href=\"https://www.kaggle.com/mpware\" target=\"_blank\">@mpware</a> As promised, </p>\n<p><a href=\"https://www.kaggle.com/code/outwrest/yolov5-roi-batch-dali-preprocessing-pipeline\" target=\"_blank\">https://www.kaggle.com/code/outwrest/yolov5-roi-batch-dali-preprocessing-pipeline</a></p>\n<p>I am unsure about the speedup compared without DALI batch pipeline but I believe it is about ~30 minutes slower than <a href=\"https://www.kaggle.com/code/theoviel/rsna-breast-baseline-faster-inference-with-dali\" target=\"_blank\">Theo's no yolov5 notebook</a>. This means it is probably worse than without a batch pipeline but it is still a good start to what can be done in the future. There are many points where I think there is a bottleneck and I can try to improve. I will keep the weights private (didn't expect it to do well, CV was ~0.3) for now but to use it, one would need to retrain yolov5 to detect the breasts in padded images.</p>\n<p>Hopefully, this helps!</p>",
              "rawMarkdown": "@remekkinas @mpware As promised, \n\nhttps://www.kaggle.com/code/outwrest/yolov5-roi-batch-dali-preprocessing-pipeline\n\nI am unsure about the speedup compared without DALI batch pipeline but I believe it is about ~30 minutes slower than [Theo's no yolov5 notebook](https://www.kaggle.com/code/theoviel/rsna-breast-baseline-faster-inference-with-dali). This means it is probably worse than without a batch pipeline but it is still a good start to what can be done in the future. There are many points where I think there is a bottleneck and I can try to improve. I will keep the weights private (didn't expect it to do well, CV was ~0.3) for now but to use it, one would need to retrain yolov5 to detect the breasts in padded images.\n\nHopefully, this helps!",
              "votes": 2
            },
            {
              "id": 2085411,
              "postDate": "2023-01-04T06:40:08.113Z",
              "content": "<p>Great! Great! Thank you very much. I will use your ideas in my notebook. 👍</p>\n<p>I am wondering if you get some score improvement with ROI images. Do you?</p>",
              "rawMarkdown": "Great! Great! Thank you very much. I will use your ideas in my notebook. 👍\n\nI am wondering if you get some score improvement with ROI images. Do you?",
              "votes": 2
            },
            {
              "id": 2085452,
              "postDate": "2023-01-04T07:05:07.033Z",
              "content": "<p>CV, yes but I am still having trouble keeping a good local setup. I see a lot of variations between folds (0.08+-) and I was even surprised by my LB score. So I am not 100% sure. I haven't submitted any without ROI, this notebook has been my own submission to LB (with some failures 😆).</p>\n<p>Are your score improvements with ROI big? I've only been experimenting with <code>tf_efficientnet_b0_ns</code> and I only saw major improvements with dataset changes (ROI &amp; other preprocessing), and image size. (the 4fold model I submitted was also an efficientnetb0)</p>",
              "rawMarkdown": "CV, yes but I am still having trouble keeping a good local setup. I see a lot of variations between folds (0.08+-) and I was even surprised by my LB score. So I am not 100% sure. I haven't submitted any without ROI, this notebook has been my own submission to LB (with some failures 😆).\n\nAre your score improvements with ROI big? I've only been experimenting with `tf_efficientnet_b0_ns` and I only saw major improvements with dataset changes (ROI & other preprocessing), and image size. (the 4fold model I submitted was also an efficientnetb0)",
              "votes": 1
            },
            {
              "id": 2085474,
              "postDate": "2023-01-04T07:23:43.253Z",
              "content": "<p>I have the same problem - local validation. This is why I do not submit final solution so far (I have solution which uses only one model). Only just checking on LB different setups and looking for improvements. So far I managed to get 0.39 based on one model only. This is actually not good score.</p>\n<p>I can see difference in score locally - with and without ROI. ROI is better (AUC_ROC score - I do not use probf1 score for validation).</p>",
              "rawMarkdown": "I have the same problem - local validation. This is why I do not submit final solution so far (I have solution which uses only one model). Only just checking on LB different setups and looking for improvements. So far I managed to get 0.39 based on one model only. This is actually not good score.\n\nI can see difference in score locally - with and without ROI. ROI is better (AUC_ROC score - I do not use probf1 score for validation).",
              "votes": 2
            },
            {
              "id": 2085494,
              "postDate": "2023-01-04T07:40:02.800Z",
              "content": "<p>That is pretty smart, I feel like I am solely focusing on pF1, but your approach is right. I have doubts about the metric, it is noisy and seems like it is <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/372175#2080720\" target=\"_blank\">not well-suited for this type of competition</a> (maybe it just needs a bit of luck, or <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/370333#2083921\" target=\"_blank\">we don't even have enough data</a>). </p>\n<p>I think the key (as <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> mentions) is to work on different architectures and put them together. I have some ideas to experiment with other datasets but only time will tell.</p>\n<p>Let me run 4k fold and get back to you on metric changes with/without ROI in my setup</p>",
              "rawMarkdown": "That is pretty smart, I feel like I am solely focusing on pF1, but your approach is right. I have doubts about the metric, it is noisy and seems like it is [not well-suited for this type of competition](https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/372175#2080720) (maybe it just needs a bit of luck, or [we don't even have enough data](https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/370333#2083921)). \n\nI think the key (as @hengck23 mentions) is to work on different architectures and put them together. I have some ideas to experiment with other datasets but only time will tell.\n\nLet me run 4k fold and get back to you on metric changes with/without ROI in my setup",
              "votes": 1
            },
            {
              "id": 2085509,
              "postDate": "2023-01-04T07:46:37.303Z",
              "content": "<p>Thanks for it. I'm also working to improve inference time.<br>\n<strong>Update</strong>: All CPU/GPU round trips removed, no image saved on disk, ROI (1024) + inference of a single model with 4 folds is around 4h30min now, single loop (no <code>Parallel</code> usage)</p>",
              "rawMarkdown": "Thanks for it. I'm also working to improve inference time.\n**Update**: All CPU/GPU round trips removed, no image saved on disk, ROI (1024) + inference of a single model with 4 folds is around 4h30min now, single loop (no `Parallel` usage)",
              "votes": 1
            },
            {
              "id": 2085515,
              "postDate": "2023-01-04T07:50:33.163Z",
              "content": "<p>I use AUC_ROC and MCC metrics (matthew correlation coefficient). pf1 score I plot as well  but only to monitor it.</p>",
              "rawMarkdown": "I use AUC_ROC and MCC metrics (matthew correlation coefficient). pf1 score I plot as well  but only to monitor it.",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2074309,
      "postDate": "2022-12-24T01:20:47.677Z",
      "content": "<p>Great dataset!<br>\nIf I understand correctly, you keep the picture long side fixed for 1024, right?<br>\nAlso I have a question that, for submission, will this process be in 9 hours for 1024pix?<br>\nBecause we need to read from dcm, yolo, resize, ensemble… you said 7 hours for 768 but how about 1024?<br>\nThanks!</p>",
      "rawMarkdown": "Great dataset!\nIf I understand correctly, you keep the picture long side fixed for 1024, right?\nAlso I have a question that, for submission, will this process be in 9 hours for 1024pix?\nBecause we need to read from dcm, yolo, resize, ensemble... you said 7 hours for 768 but how about 1024?\nThanks!",
      "replies": [
        {
          "id": 2074458,
          "postDate": "2022-12-24T07:38:04.877Z",
          "content": "<p>I tested 1600px submit (ROI extracted - yolo nano (model 001 from my public available dataset) on 3 models (efficientnetv2_s)  and each has TTA (only flip). It takes 7h. </p>",
          "rawMarkdown": "I tested 1600px submit (ROI extracted - yolo nano (model 001 from my public available dataset) on 3 models (efficientnetv2_s)  and each has TTA (only flip). It takes 7h. \n\n"
        }
      ]
    },
    {
      "id": 2061102,
      "postDate": "2022-12-10T17:30:52.917Z",
      "content": "<p>I checked speed of pipeline:</p>\n<ol>\n<li>dicom convert to jpg using dicomsdl</li>\n<li>extract roi using yolov5 (model small / nano can be even faster)</li>\n<li>convert to 512x512</li>\n<li>blend - 3 models (resnet50d) with TTA (standard inference + flip)</li>\n</ol>\n<p>7h submission time on 1xKaggle GPU</p>",
      "rawMarkdown": "I checked speed of pipeline:\n\n1. dicom convert to jpg using dicomsdl\n2. extract roi using yolov5 (model small / nano can be even faster)\n3. convert to 512x512\n4. blend - 3 models (resnet50d) with TTA (standard inference + flip)\n\n7h submission time on 1xKaggle GPU\n"
    },
    {
      "id": 2051359,
      "postDate": "2022-12-01T11:15:09.027Z",
      "content": "<p>I'm getting this error :/</p>\n<blockquote>\n  <p>Data not available. This dataset may need it's archive recreated. Contact dataset author.</p>\n</blockquote>",
      "rawMarkdown": "I'm getting this error :/\n> Data not available. This dataset may need it's archive recreated. Contact dataset author.",
      "replies": [
        {
          "id": 2051373,
          "postDate": "2022-12-01T11:22:34.073Z",
          "content": "<p><a href=\"https://www.kaggle.com/theoviel\" target=\"_blank\">@theoviel</a>  it is ok -&gt; you have to download it here</p>\n<p><img src=\"https://i.ibb.co/hMQgqxp/004.jpg\" alt=\"\"></p>",
          "rawMarkdown": "@theoviel  it is ok -> you have to download it here\n\n![](https://i.ibb.co/hMQgqxp/004.jpg)",
          "votes": 1
        },
        {
          "id": 2051376,
          "postDate": "2022-12-01T11:24:38.490Z",
          "content": "<p>I use the kaggle dataset API, but it's working now. Thanks anyways !</p>",
          "rawMarkdown": "I use the kaggle dataset API, but it's working now. Thanks anyways !",
          "votes": 1
        }
      ]
    },
    {
      "id": 2051349,
      "postDate": "2022-12-01T11:04:31.443Z",
      "content": "<p>Dataset is available for 768 resolution. It means that longer dimension is 768pix. <br>\nThis is baseline dataset. Now you can create 512, 384, 256 … just using cv2.resize or other methods.</p>\n<p><a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images</a> </p>",
      "rawMarkdown": "Dataset is available for 768 resolution. It means that longer dimension is 768pix. \nThis is baseline dataset. Now you can create 512, 384, 256 ... just using cv2.resize or other methods.\n\nhttps://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images "
    },
    {
      "id": 2051249,
      "postDate": "2022-12-01T09:49:11.993Z",
      "content": "<p>This is awesome work! 🙌 Well be a bit hard to run it on test though… 🤔 But if someone will figure out how to do this, that can give a major LB boost…</p>\n<p>So many interesting avenues to explore in this competition, so little time in a day! </p>",
      "rawMarkdown": "This is awesome work! 🙌 Well be a bit hard to run it on test though... 🤔 But if someone will figure out how to do this, that can give a major LB boost...\n\nSo many interesting avenues to explore in this competition, so little time in a day! ",
      "replies": [
        {
          "id": 2051260,
          "postDate": "2022-12-01T09:59:11.207Z",
          "content": "<p>Not exactly. I am sure it will work without any problem on test. I checked it on my notebook and the most consuming time part is convert dcm file to png file (you have to do anyway). Inference is a tiny amout of processing time (miliseconds). </p>\n<p>You are sure. This is absolutely fantastic competition. Not only because of ML and computer vision (my favourite task) but … idea. </p>",
          "rawMarkdown": "Not exactly. I am sure it will work without any problem on test. I checked it on my notebook and the most consuming time part is convert dcm file to png file (you have to do anyway). Inference is a tiny amout of processing time (miliseconds). \n\nYou are sure. This is absolutely fantastic competition. Not only because of ML and computer vision (my favourite task) but ... idea. ",
          "votes": 2
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2051735,
      "author_name": "Theo Viel",
      "author_url": "",
      "post_date": "2022-12-01T15:41:54.020000",
      "content": "<p>I can confirm your preprocessing gives a 0.02 CV boost. </p>",
      "votes": 3,
      "replies": [
        {
          "id": 2057744,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-07T10:16:06.470000",
          "content": "<p>ROI extracted images boost score. Due to my experiments if we leave crops not distorted by resizing it helps a lot.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2056932,
      "author_name": "Optimo",
      "author_url": "",
      "post_date": "2022-12-06T15:31:00.467000",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> for sharing!</p>\n<p>Can you just clarify your pipeline for me please:</p>\n<ul>\n<li>you trained the yolov5 model on resized images of size (768, 768)</li>\n<li>you inferred the position of the breast on images of size (768, 768)</li>\n<li>from the detected bounding box resize the bounding box area from (h_long, w_smaller) -&gt; (768, w_smaller*h_long/768) then save ?</li>\n</ul>",
      "votes": 1,
      "replies": [
        {
          "id": 2057765,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-07T10:25:56.917000",
          "content": "<ol>\n<li>Labelled 300 images (taken from competion train DS)</li>\n<li>Trained Yolov5 1024 im size as input</li>\n<li>Validated model_1 (on all images in competion train DS - ~56.000 images) and check missed images - relabeled missed images (50 images - most characteristic patterns). Add new labeled data to train and valid (check to prevent from leak - I was looking on patient_id) - 350 images</li>\n<li>Trained Yolov5 again</li>\n<li>Validated model_2 and check missed images (model_2 improved a lot) - relabeled missed images (50). Add new labeled data to train and valid- 400 images in yolo DS</li>\n<li>Trained Yolov5 again -&gt; model_3 (it performed very well).</li>\n</ol>\n<p>ROI extracted DS</p>\n<ol>\n<li>Read dicom </li>\n<li>Having it in memory make inference using yolo to find ROI</li>\n<li>Extract ROI from image x,y,w,h</li>\n<li>Resize</li>\n</ol>\n<pre><code>def image_resize(image, width = None, height = None, inter = cv2.INTER_LINEAR):\n\n    dim = None\n    (h, w) = image.shape[:2]\n\n    if width is None and height is None:\n        return image\n\n    if width is None:\n        r = height / float(h)\n        dim = (int(w * r), height)\n    else:\n        r = width / float(w)\n        dim = (width, int(h * r))\n    resized = cv2.resize(image, dim, interpolation = inter)\n\n    return resized\n\nh, w, _ = tmp_im.shape\n\nif w &gt; h:\n        img = image_resize(tmp_im, width = size)\n    else:\n        img = image_resize(tmp_im, height = size)\n</code></pre>",
          "votes": 4,
          "replies": []
        }
      ]
    },
    {
      "id": 2099972,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2023-01-14T19:55:50.870000",
      "content": "<p>Today I updated dataset -&gt; resolution 1280px (longer side of image)  and all imagess were processed using windowing (dicomsdl). I checked them in my notebook and works better for training (maybe due to consistent file processing). Now they look better as well : <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images</a></p>\n<p><img src=\"https://i.ibb.co/2qpHw62/lut.jpg\" alt=\"\"></p>",
      "votes": 2,
      "replies": [
        {
          "id": 2108135,
          "author_name": "Pranay Barkataki",
          "author_url": "",
          "post_date": "2023-01-20T09:26:04.653000",
          "content": "<p>Could you also please share Kaggle notebook where you have windowing is applied on the dicom files</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2108160,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-20T09:52:36.723000",
              "content": "<p>Hi, <br>\nI described it in Dataset discussion part: <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images/discussion/378201\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images/discussion/378201</a></p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2066520,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2022-12-15T19:22:58.787000",
      "content": "<p>Now dataset is updated. I cropped oryginal DS to 1024pix. I can see a lot of improvement using higher cropped resolution. Have a nice Kaggling with this dataset.</p>\n<p>For crop I used yolov5 and nano model. Source:</p>\n<ul>\n<li>model -&gt; 001 -&gt; <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-roi-model\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-roi-model</a></li>\n<li>training notebook -&gt; <a href=\"https://www.kaggle.com/code/remekkinas/roi-detector-yolov5-training-and-annotations\" target=\"_blank\">https://www.kaggle.com/code/remekkinas/roi-detector-yolov5-training-and-annotations</a></li>\n<li>annotations -&gt; <a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-roi-detector-annotations-yolo\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-roi-detector-annotations-yolo</a></li>\n</ul>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2061165,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2022-12-10T18:46:16.220000",
      "content": "<p>This is ROI extraction test report I made today: <br>\n<img src=\"https://i.ibb.co/wdBy2vk/001.jpg\" alt=\"\"></p>\n<p><a href=\"https://www.kaggle.com/radek1\" target=\"_blank\">@radek1</a> now you can see that speed is ok for yolo.</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2061270,
          "author_name": "Radek Osmulski",
          "author_url": "",
          "post_date": "2022-12-10T22:26:15.793000",
          "content": "<p>Yes, thank you! 🙂 This is blazingly fast! 🔥</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2051288,
      "author_name": "Theo Viel",
      "author_url": "",
      "post_date": "2022-12-01T10:20:55.833000",
      "content": "<p>Cool dataset !</p>\n<p>Watch out for license issues with yolov5 though =)</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2051303,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-01T10:30:54.087000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/theoviel\" target=\"_blank\">@theoviel</a> …. theank you for your comment. Any issue with yolov5? I know past competition where it was banned. What about this one?<br>\nWe can convert idea (having labels) to anything else :) (yolov7 e.g. or faster yolov6). No problem.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2051320,
          "author_name": "Theo Viel",
          "author_url": "",
          "post_date": "2022-12-01T10:41:15.270000",
          "content": "<p>I have no idea, we have to ask the kaggle team or the hosts, and neither are usually not giving explicit answers.</p>\n<p>Anyways, I will experiment with your dataset asap.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2057886,
          "author_name": "Psi",
          "author_url": "",
          "post_date": "2022-12-07T12:23:08.887000",
          "content": "<p>Yolo is always tricky. It all depends if copy-left license is OK, only Kaggle/hosts can tell.</p>\n<p>Personally I would use other object detection models - there are enough good ones with better licenses.</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 2145560,
      "author_name": "Bá Huy Nguyễn",
      "author_url": "",
      "post_date": "2023-02-15T07:29:57.877000",
      "content": "<p>Dear <a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a>. I'm training my own experiment and tuning hyperparameter but my validation could not improve.Can you give me some advices to improve my score. Thank you very much.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7879577%2F1aaabac308bf66765a023417ca07d5d7%2FScreenshot%202023-02-15%20142601.png?generation=1676445999616375&amp;alt=media\" alt=\"\"></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2142375,
      "author_name": "Denis Muriungi",
      "author_url": "",
      "post_date": "2023-02-13T13:39:08.193000",
      "content": "<p>Hello, guys can somebody answer me this <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/386518\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/386518</a></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2112999,
      "author_name": "ChenxiangSun@NJU",
      "author_url": "",
      "post_date": "2023-01-24T02:33:24.570000",
      "content": "<p>Here is a dumb question…</p>\n<p>I just wonder if my input ROI images are l large like 2048*2048. When inferring could I store it locally in workworking/tem/imgfolder? I remember there is a max storage limitation. </p>\n<p>1536*960 0.5MB for each sample.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2113051,
          "author_name": "ChenxiangSun@NJU",
          "author_url": "",
          "post_date": "2023-01-24T03:53:04.090000",
          "content": "<p>os.remove(f'{image_id}.png')</p>\n<p>Okay, I got it. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2080969,
      "author_name": "MPWARE",
      "author_url": "",
      "post_date": "2022-12-30T16:58:20.667000",
      "content": "<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> I've tested your YoloV5 model, it looks quite good. About <code>Parallel(n_jobs=2)</code> execution, you might experiment the following issue that happens a bit randomly (it happened to me): <a href=\"https://github.com/ultralytics/yolov5/issues/2824\" target=\"_blank\">https://github.com/ultralytics/yolov5/issues/2824</a> that prevents ROI detection for a small number of images. It could be a problem during inference that you won't see if you <code>try/catch</code> the ROI model execution that could affect the final score. I'm testing a fix currently …</p>\n<p>The error I got for a few images:</p>\n<blockquote>\n  <p>The size of tensor a (104) must match the size of tensor b (112) at non-singleton dimension 3</p>\n</blockquote>",
      "votes": 0,
      "replies": [
        {
          "id": 2080983,
          "author_name": "outwrest",
          "author_url": "",
          "post_date": "2022-12-30T17:28:31.027000",
          "content": "<p>A possible idea to try is batch processing, it can probably decrease time since batch processing seems to be faster (see the table below from the yolov5 repo). I think since only one model will be loaded and the CPU threads would process the data, it would alleviate this problem.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F547bab5861cee666ce1ed9da7f1f9cf8%2FCapture.PNG?generation=1672421053793971&amp;alt=media\" alt=\"Yolov5 Model Comparison Chart\"></p>\n<p>(for J2K) Maybe with DALI we can load batch on GPU, preprocess, get ROI, crop and save immediately. I am not sure if anyone has done this before but it seems like it is worth a shot. I'll look into it after my experiments.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2080996,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-30T17:55:14.497000",
          "content": "<p>Thank you for information. I will check my notebook. Let me know when you finish testing.</p>\n<p>I am sure yolo cropped images improve local score.  </p>",
          "votes": 1,
          "replies": [
            {
              "id": 2081850,
              "author_name": "MPWARE",
              "author_url": "",
              "post_date": "2022-12-31T18:14:54.300000",
              "content": "<p>The fix is explained here: <a href=\"https://github.com/ultralytics/yolov5/commit/03fae98d86394fe02804d7e9bc20013311bf5837\" target=\"_blank\">https://github.com/ultralytics/yolov5/commit/03fae98d86394fe02804d7e9bc20013311bf5837</a><br>\nHowever, it's for an old version. For current YoloV5 version, it's quite similar, initialize <code>self.grid</code> and <code>self.anchor_grid</code> in <code>forward()</code> method like:</p>\n<pre><code>def __init__(self, nc=80, anchors=(), ch=(), inplace=True):  # detection layer\n    super().__init__()\n    self.nc = nc  # number of classes\n    self.no = nc + 5  # number of outputs per anchor\n    self.nl = len(anchors)  # number of detection layers\n    self.na = len(anchors[0]) // 2  # number of anchors\n    # self.grid = [torch.empty(0) for _ in range(self.nl)]  # init grid\n    # self.anchor_grid = [torch.empty(0) for _ in range(self.nl)]  # init anchor grid\n    self.register_buffer('anchors', torch.tensor(anchors).float().view(self.nl, -1, 2))  # shape(nl,na,2)\n    self.m = nn.ModuleList(nn.Conv2d(x, self.no * self.na, 1) for x in ch)  # output conv\n    self.inplace = inplace  # use inplace ops (e.g. slice assignment) \n\n\ndef forward(self, x):\n    z = []  # inference output\n    grid = [torch.empty(0) for _ in range(self.nl)]  # init grid\n    anchor_grid = [torch.empty(0) for _ in range(self.nl)]  # init anchor grid        \n    for i in range(self.nl):\n        x[i] = self.m[i](x[i])  # conv\n        bs, _, ny, nx = x[i].shape  # x(bs,255,20,20) to x(bs,3,20,20,85)\n        x[i] = x[i].view(bs, self.na, self.no, ny, nx).permute(0, 1, 3, 4, 2).contiguous()\n\n        if not self.training:  # inference\n            # if self.dynamic or self.grid[i].shape[2:4] != x[i].shape[2:4]:\n            #     self.grid[i], self.anchor_grid[i] = self._make_grid(nx, ny, i)\n            grid[i], anchor_grid[i] = self._make_grid(nx, ny, i)\n    ....  \n</code></pre>\n<p>It worked for me. </p>\n<p>For now with ROI 1024 I'm stuck for single fold CV=0.44, LB=0.41<br>\n<strong>Update</strong>: LB=0.45</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2081866,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2022-12-31T18:42:26.180000",
              "content": "<p>Yes, I checked it as well. I subbed without Paraller processing - score is the same. Thank you for checking and trying to help.</p>\n<p>I have almost the same score for single fold:</p>\n<ul>\n<li>img size 1024</li>\n<li>model - effnet_b2</li>\n</ul>\n<p>What do you mean by CV? Is this f1prob?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2081965,
              "author_name": "MPWARE",
              "author_url": "",
              "post_date": "2022-12-31T22:13:54.653000",
              "content": "<p>Yes, CV is based on <em>valid_pfbeta_agg_opt</em> score</p>\n<ul>\n<li>agg = groupby([PATIENT_ID, LATERALITY])[[\"probs\"]].max()</li>\n<li>opt = optimal threshold to binarize</li>\n</ul>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2083834,
              "author_name": "MPWARE",
              "author_url": "",
              "post_date": "2023-01-02T22:30:52.117000",
              "content": "<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> Are you able to extract ROI if image is already in GPU?</p>\n<pre><code>\nresults = model_roi((image*).astype(np.uint8), size=)\nrow_pd = results.pandas().xyxy[]\n</code></pre>\n<pre><code>\nresults = model_roi(torch_image, size=)\nrow_pd = results.pandas().xyxy[]\n</code></pre>\n<p>I would to avoid the round trip GPU =&gt; CPU =&gt; GPU. It looks that YoloV5 have a \"letterbox\" function to pad numpy image correctly before passing to GPU but nothing if image is already in GPU.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2083846,
              "author_name": "outwrest",
              "author_url": "",
              "post_date": "2023-01-02T23:21:49.747000",
              "content": "<p><a href=\"https://www.kaggle.com/mpware\" target=\"_blank\">@mpware</a> Yolov5 returns different results if the input is a tensor vs numpy/list. Here is the code from the Yolov5 repo. It just results raw result so we need to do some post-processing:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F6481f0c7437f56f67c9f7a28184a050c%2Fcode.png?generation=1672701242401995&amp;alt=media\" alt=\"Yolov5 repo code\"><br>\nSee <a href=\"https://github.com/ultralytics/yolov5/blob/632bf485b4ab2adbaef71f4eced5e6b59ecef7e2/models/common.py#L658\" target=\"_blank\">https://github.com/ultralytics/yolov5/blob/632bf485b4ab2adbaef71f4eced5e6b59ecef7e2/models/common.py#L658</a></p>\n<p>If the input is a numpy array, it would take of the preprocessing, so I recommend preprocessing and scaling the input tensor 0-1. The returned tensor is the anchors so you need just to run the postprocessing step.</p>\n<p>Here is how I did it with another postprocessing step to keeping highest conf bboxes:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5918909%2F7d873f9ef4e3ee1515e4cb84210f61e7%2Fyolov566.PNG?generation=1672701128089222&amp;alt=media\" alt=\"Yolov5 Code\"></p>\n<p>You can import it via</p>\n<pre><code>sys.path.append()\n\n utils.general  non_max_suppression\n</code></pre>\n<p>EDIT: I also got batch preprocessing to work with yolov5 but it very specific to my model which also extracts if the breast is on the left or right side of the image with almost perfect accuracy (this is very helpful, and i will release once I get a E2E solution)</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2085321,
              "author_name": "outwrest",
              "author_url": "",
              "post_date": "2023-01-04T04:20:52.230000",
              "content": "<p><a href=\"https://www.kaggle.com/remekkinas\" target=\"_blank\">@remekkinas</a> <a href=\"https://www.kaggle.com/mpware\" target=\"_blank\">@mpware</a> As promised, </p>\n<p><a href=\"https://www.kaggle.com/code/outwrest/yolov5-roi-batch-dali-preprocessing-pipeline\" target=\"_blank\">https://www.kaggle.com/code/outwrest/yolov5-roi-batch-dali-preprocessing-pipeline</a></p>\n<p>I am unsure about the speedup compared without DALI batch pipeline but I believe it is about ~30 minutes slower than <a href=\"https://www.kaggle.com/code/theoviel/rsna-breast-baseline-faster-inference-with-dali\" target=\"_blank\">Theo's no yolov5 notebook</a>. This means it is probably worse than without a batch pipeline but it is still a good start to what can be done in the future. There are many points where I think there is a bottleneck and I can try to improve. I will keep the weights private (didn't expect it to do well, CV was ~0.3) for now but to use it, one would need to retrain yolov5 to detect the breasts in padded images.</p>\n<p>Hopefully, this helps!</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2085411,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-04T06:40:08.113000",
              "content": "<p>Great! Great! Thank you very much. I will use your ideas in my notebook. 👍</p>\n<p>I am wondering if you get some score improvement with ROI images. Do you?</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2085452,
              "author_name": "outwrest",
              "author_url": "",
              "post_date": "2023-01-04T07:05:07.033000",
              "content": "<p>CV, yes but I am still having trouble keeping a good local setup. I see a lot of variations between folds (0.08+-) and I was even surprised by my LB score. So I am not 100% sure. I haven't submitted any without ROI, this notebook has been my own submission to LB (with some failures 😆).</p>\n<p>Are your score improvements with ROI big? I've only been experimenting with <code>tf_efficientnet_b0_ns</code> and I only saw major improvements with dataset changes (ROI &amp; other preprocessing), and image size. (the 4fold model I submitted was also an efficientnetb0)</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2085474,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-04T07:23:43.253000",
              "content": "<p>I have the same problem - local validation. This is why I do not submit final solution so far (I have solution which uses only one model). Only just checking on LB different setups and looking for improvements. So far I managed to get 0.39 based on one model only. This is actually not good score.</p>\n<p>I can see difference in score locally - with and without ROI. ROI is better (AUC_ROC score - I do not use probf1 score for validation).</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2085494,
              "author_name": "outwrest",
              "author_url": "",
              "post_date": "2023-01-04T07:40:02.800000",
              "content": "<p>That is pretty smart, I feel like I am solely focusing on pF1, but your approach is right. I have doubts about the metric, it is noisy and seems like it is <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/372175#2080720\" target=\"_blank\">not well-suited for this type of competition</a> (maybe it just needs a bit of luck, or <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/370333#2083921\" target=\"_blank\">we don't even have enough data</a>). </p>\n<p>I think the key (as <a href=\"https://www.kaggle.com/hengck23\" target=\"_blank\">@hengck23</a> mentions) is to work on different architectures and put them together. I have some ideas to experiment with other datasets but only time will tell.</p>\n<p>Let me run 4k fold and get back to you on metric changes with/without ROI in my setup</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2085509,
              "author_name": "MPWARE",
              "author_url": "",
              "post_date": "2023-01-04T07:46:37.303000",
              "content": "<p>Thanks for it. I'm also working to improve inference time.<br>\n<strong>Update</strong>: All CPU/GPU round trips removed, no image saved on disk, ROI (1024) + inference of a single model with 4 folds is around 4h30min now, single loop (no <code>Parallel</code> usage)</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2085515,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-04T07:50:33.163000",
              "content": "<p>I use AUC_ROC and MCC metrics (matthew correlation coefficient). pf1 score I plot as well  but only to monitor it.</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2074309,
      "author_name": "nicehzj",
      "author_url": "",
      "post_date": "2022-12-24T01:20:47.677000",
      "content": "<p>Great dataset!<br>\nIf I understand correctly, you keep the picture long side fixed for 1024, right?<br>\nAlso I have a question that, for submission, will this process be in 9 hours for 1024pix?<br>\nBecause we need to read from dcm, yolo, resize, ensemble… you said 7 hours for 768 but how about 1024?<br>\nThanks!</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2074458,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-24T07:38:04.877000",
          "content": "<p>I tested 1600px submit (ROI extracted - yolo nano (model 001 from my public available dataset) on 3 models (efficientnetv2_s)  and each has TTA (only flip). It takes 7h. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2061102,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2022-12-10T17:30:52.917000",
      "content": "<p>I checked speed of pipeline:</p>\n<ol>\n<li>dicom convert to jpg using dicomsdl</li>\n<li>extract roi using yolov5 (model small / nano can be even faster)</li>\n<li>convert to 512x512</li>\n<li>blend - 3 models (resnet50d) with TTA (standard inference + flip)</li>\n</ol>\n<p>7h submission time on 1xKaggle GPU</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2051359,
      "author_name": "Theo Viel",
      "author_url": "",
      "post_date": "2022-12-01T11:15:09.027000",
      "content": "<p>I'm getting this error :/</p>\n<blockquote>\n  <p>Data not available. This dataset may need it's archive recreated. Contact dataset author.</p>\n</blockquote>",
      "votes": 0,
      "replies": [
        {
          "id": 2051373,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-01T11:22:34.073000",
          "content": "<p><a href=\"https://www.kaggle.com/theoviel\" target=\"_blank\">@theoviel</a>  it is ok -&gt; you have to download it here</p>\n<p><img src=\"https://i.ibb.co/hMQgqxp/004.jpg\" alt=\"\"></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2051376,
          "author_name": "Theo Viel",
          "author_url": "",
          "post_date": "2022-12-01T11:24:38.490000",
          "content": "<p>I use the kaggle dataset API, but it's working now. Thanks anyways !</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2051349,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2022-12-01T11:04:31.443000",
      "content": "<p>Dataset is available for 768 resolution. It means that longer dimension is 768pix. <br>\nThis is baseline dataset. Now you can create 512, 384, 256 … just using cv2.resize or other methods.</p>\n<p><a href=\"https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\" target=\"_blank\">https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images</a> </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2051249,
      "author_name": "Radek Osmulski",
      "author_url": "",
      "post_date": "2022-12-01T09:49:11.993000",
      "content": "<p>This is awesome work! 🙌 Well be a bit hard to run it on test though… 🤔 But if someone will figure out how to do this, that can give a major LB boost…</p>\n<p>So many interesting avenues to explore in this competition, so little time in a day! </p>",
      "votes": 0,
      "replies": [
        {
          "id": 2051260,
          "author_name": "Remek Kinas",
          "author_url": "",
          "post_date": "2022-12-01T09:59:11.207000",
          "content": "<p>Not exactly. I am sure it will work without any problem on test. I checked it on my notebook and the most consuming time part is convert dcm file to png file (you have to do anyway). Inference is a tiny amout of processing time (miliseconds). </p>\n<p>You are sure. This is absolutely fantastic competition. Not only because of ML and computer vision (my favourite task) but … idea. </p>",
          "votes": 2,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2051239": "I created ROI (Region Of Interest) extracted dataset for this compettion. Hope this improve score a lot.\n\nSolution:\n- ROI extractor -> https://www.kaggle.com/code/remekkinas/breast-cancer-roi-brest-extractor\n- ROI is resized to SIZE (I resized only taking into account longer dimension) so no distorision -> you can decide in augumentation step what to do with extracted ROI \n\n![Dataset](https://i.ibb.co/zPBHmT6/br002.jpg)\n\nDataset is available here: https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images",
    "2051735": "I can confirm your preprocessing gives a 0.02 CV boost. ",
    "2056932": "Thank you @remekkinas for sharing!\n\nCan you just clarify your pipeline for me please:\n- you trained the yolov5 model on resized images of size (768, 768)\n- you inferred the position of the breast on images of size (768, 768)\n- from the detected bounding box resize the bounding box area from (h_long, w_smaller) -> (768, w_smaller*h_long/768) then save ?",
    "2099972": "Today I updated dataset -> resolution 1280px (longer side of image)  and all imagess were processed using windowing (dicomsdl). I checked them in my notebook and works better for training (maybe due to consistent file processing). Now they look better as well : https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images\n\n![](https://i.ibb.co/2qpHw62/lut.jpg)\n\n",
    "2066520": "Now dataset is updated. I cropped oryginal DS to 1024pix. I can see a lot of improvement using higher cropped resolution. Have a nice Kaggling with this dataset.\n\nFor crop I used yolov5 and nano model. Source:\n- model -> 001 -> https://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-roi-model\n- training notebook -> https://www.kaggle.com/code/remekkinas/roi-detector-yolov5-training-and-annotations\n- annotations -> https://www.kaggle.com/datasets/remekkinas/rsna-roi-detector-annotations-yolo",
    "2061165": "This is ROI extraction test report I made today: \n![](https://i.ibb.co/wdBy2vk/001.jpg)\n\n@radek1 now you can see that speed is ok for yolo.",
    "2051288": "Cool dataset !\n\nWatch out for license issues with yolov5 though =)",
    "2145560": "Dear @remekkinas. I'm training my own experiment and tuning hyperparameter but my validation could not improve.Can you give me some advices to improve my score. Thank you very much.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7879577%2F1aaabac308bf66765a023417ca07d5d7%2FScreenshot%202023-02-15%20142601.png?generation=1676445999616375&alt=media)\n",
    "2142375": "Hello, guys can somebody answer me this https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/386518",
    "2112999": "Here is a dumb question...\n\nI just wonder if my input ROI images are l large like 2048*2048. When inferring could I store it locally in workworking/tem/imgfolder? I remember there is a max storage limitation. \n\n1536*960 0.5MB for each sample.",
    "2080969": "@remekkinas I've tested your YoloV5 model, it looks quite good. About `Parallel(n_jobs=2)` execution, you might experiment the following issue that happens a bit randomly (it happened to me): https://github.com/ultralytics/yolov5/issues/2824 that prevents ROI detection for a small number of images. It could be a problem during inference that you won't see if you `try/catch` the ROI model execution that could affect the final score. I'm testing a fix currently ...\n\nThe error I got for a few images:\n>The size of tensor a (104) must match the size of tensor b (112) at non-singleton dimension 3",
    "2074309": "Great dataset!\nIf I understand correctly, you keep the picture long side fixed for 1024, right?\nAlso I have a question that, for submission, will this process be in 9 hours for 1024pix?\nBecause we need to read from dcm, yolo, resize, ensemble... you said 7 hours for 768 but how about 1024?\nThanks!",
    "2061102": "I checked speed of pipeline:\n\n1. dicom convert to jpg using dicomsdl\n2. extract roi using yolov5 (model small / nano can be even faster)\n3. convert to 512x512\n4. blend - 3 models (resnet50d) with TTA (standard inference + flip)\n\n7h submission time on 1xKaggle GPU\n",
    "2051359": "I'm getting this error :/\n> Data not available. This dataset may need it's archive recreated. Contact dataset author.",
    "2051349": "Dataset is available for 768 resolution. It means that longer dimension is 768pix. \nThis is baseline dataset. Now you can create 512, 384, 256 ... just using cv2.resize or other methods.\n\nhttps://www.kaggle.com/datasets/remekkinas/rsna-breast-cancer-detection-poi-images ",
    "2051249": "This is awesome work! 🙌 Well be a bit hard to run it on test though... 🤔 But if someone will figure out how to do this, that can give a major LB boost...\n\nSo many interesting avenues to explore in this competition, so little time in a day! "
  }
}