{
  "id": 447549,
  "title": "7th Place Solution & Code",
  "url": "/competitions/rsna-2023-abdominal-trauma-detection/discussion/447549",
  "author_name": "llreda",
  "post_date": "2023-10-16T11:38:15.285000",
  "votes": 16,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Thank you RSNA for hosting this great competition, which gave me a nice experience and  I believe this will start a wonderful journey on the Kaggel.</p>\n<p>I will briefly introduce the solution I used in this competition.</p>\n<h2>Dataset</h2>\n<h3>sequence image data</h3>\n<ol>\n<li><p>My Solution is a 2.5D pipeline，it's necessary to process the sequence to a certain shapes, that is，<strong>[T * 3, 512, 512]</strong>  , every series will be <strong>sampled</strong> to a length, for example, T = 32. </p></li>\n<li><p>Then each independent slice image  be <strong>croped</strong> to include as much valid data as possible in the image. This can be achieved by counting effective pixels.</p></li>\n<li><p>Finally reshape them to **[256, 384] **shape.</p></li>\n</ol>\n<p>The visualization of cropping and reshaping results is as follows.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F6ff85850d5189bfbba5eae614eb76096%2Fimage-20231016105954580.png?generation=1697456066783359&amp;alt=media\" alt=\"\"></p>\n<h3>sequence organ mask</h3>\n<p>Just use <a href=\"https://pubs.rsna.org/doi/10.1148/ryai.230024\" target=\"_blank\">the total segmentor model</a> to generate segmentation results for all series. The bowel_mask = colon_mask + duodenum_mask + small_bowel_mask + esophagus_mask.</p>\n<p>These masks will be used as mask ground truth, to assist with classification tasks.</p>\n<h2>Models</h2>\n<p><strong>Backbone:</strong> </p>\n<p>InternImage (base)     -&gt;     out stride (8, 16, 32)</p>\n<p><strong>neck:</strong></p>\n<p>UnetPlusPlus      -&gt;      out stride (4, 8)</p>\n<p><strong>head:</strong></p>\n<p>I think the head section is the most valuable and effective part of this scheme.</p>\n<p>The bowel, liver, spleen,and kidneys all have specific shapes and positions，except for extravasation. So there is two heads for classification.</p>\n<p>For the first head, I referred to the decoding idea of mask2Former which learned to predict a mask from a query, and using it as the attention of the decoder layer. This can help each query extract effective information for each organ.</p>\n<p>For the extravasation head, using the image level label to assist feature learning and enable better classification.</p>\n<p>The entire pipeline is as follows.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F186012aa8c3e147e92ece5017bb14650%2Fimage-20231016183612262.png?generation=1697456103599237&amp;alt=media\" alt=\"\"></p>\n<p><strong>loss:</strong></p>\n<p>All cross entropy loss  are weighted according to the status of each organ in each patient. The organ weight consistent with the weight used for official verification.</p>\n<h2>Post processing</h2>\n<p>I simply averaged the results of different series of the same patient id.</p>\n<h2>Ensemble</h2>\n<p>All ensembled models use the same model architecture, only using different sequence lengths(T=24/32/48) and different data folds.</p>\n<h3>train code:</h3>\n<p><a href=\"https://github.com/llreda/RSNA/tree/master\" target=\"_blank\">https://github.com/llreda/RSNA/tree/master</a></p>\n<h3>inference code:</h3>\n<p><a href=\"https://www.kaggle.com/code/hongx0615/rsna-2023-7th-place-solution-inference\" target=\"_blank\">https://www.kaggle.com/code/hongx0615/rsna-2023-7th-place-solution-inference</a></p>",
  "messages": [
    {
      "id": 2484306,
      "postDate": "2023-10-16T11:38:15.287Z",
      "content": "<p>Thank you RSNA for hosting this great competition, which gave me a nice experience and  I believe this will start a wonderful journey on the Kaggel.</p>\n<p>I will briefly introduce the solution I used in this competition.</p>\n<h2>Dataset</h2>\n<h3>sequence image data</h3>\n<ol>\n<li><p>My Solution is a 2.5D pipeline，it's necessary to process the sequence to a certain shapes, that is，<strong>[T * 3, 512, 512]</strong>  , every series will be <strong>sampled</strong> to a length, for example, T = 32. </p></li>\n<li><p>Then each independent slice image  be <strong>croped</strong> to include as much valid data as possible in the image. This can be achieved by counting effective pixels.</p></li>\n<li><p>Finally reshape them to **[256, 384] **shape.</p></li>\n</ol>\n<p>The visualization of cropping and reshaping results is as follows.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F6ff85850d5189bfbba5eae614eb76096%2Fimage-20231016105954580.png?generation=1697456066783359&amp;alt=media\" alt=\"\"></p>\n<h3>sequence organ mask</h3>\n<p>Just use <a href=\"https://pubs.rsna.org/doi/10.1148/ryai.230024\" target=\"_blank\">the total segmentor model</a> to generate segmentation results for all series. The bowel_mask = colon_mask + duodenum_mask + small_bowel_mask + esophagus_mask.</p>\n<p>These masks will be used as mask ground truth, to assist with classification tasks.</p>\n<h2>Models</h2>\n<p><strong>Backbone:</strong> </p>\n<p>InternImage (base)     -&gt;     out stride (8, 16, 32)</p>\n<p><strong>neck:</strong></p>\n<p>UnetPlusPlus      -&gt;      out stride (4, 8)</p>\n<p><strong>head:</strong></p>\n<p>I think the head section is the most valuable and effective part of this scheme.</p>\n<p>The bowel, liver, spleen,and kidneys all have specific shapes and positions，except for extravasation. So there is two heads for classification.</p>\n<p>For the first head, I referred to the decoding idea of mask2Former which learned to predict a mask from a query, and using it as the attention of the decoder layer. This can help each query extract effective information for each organ.</p>\n<p>For the extravasation head, using the image level label to assist feature learning and enable better classification.</p>\n<p>The entire pipeline is as follows.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F186012aa8c3e147e92ece5017bb14650%2Fimage-20231016183612262.png?generation=1697456103599237&amp;alt=media\" alt=\"\"></p>\n<p><strong>loss:</strong></p>\n<p>All cross entropy loss  are weighted according to the status of each organ in each patient. The organ weight consistent with the weight used for official verification.</p>\n<h2>Post processing</h2>\n<p>I simply averaged the results of different series of the same patient id.</p>\n<h2>Ensemble</h2>\n<p>All ensembled models use the same model architecture, only using different sequence lengths(T=24/32/48) and different data folds.</p>\n<h3>train code:</h3>\n<p><a href=\"https://github.com/llreda/RSNA/tree/master\" target=\"_blank\">https://github.com/llreda/RSNA/tree/master</a></p>\n<h3>inference code:</h3>\n<p><a href=\"https://www.kaggle.com/code/hongx0615/rsna-2023-7th-place-solution-inference\" target=\"_blank\">https://www.kaggle.com/code/hongx0615/rsna-2023-7th-place-solution-inference</a></p>",
      "rawMarkdown": "Thank you RSNA for hosting this great competition, which gave me a nice experience and  I believe this will start a wonderful journey on the Kaggel.\n\n I will briefly introduce the solution I used in this competition.\n\n## Dataset\n\n### sequence image data\n\n1. My Solution is a 2.5D pipeline，it's necessary to process the sequence to a certain shapes, that is，**[T * 3, 512, 512]**  , every series will be **sampled** to a length, for example, T = 32. \n\n2. Then each independent slice image  be **croped** to include as much valid data as possible in the image. This can be achieved by counting effective pixels.\n\n3. Finally reshape them to **[256, 384] **shape.\n\nThe visualization of cropping and reshaping results is as follows.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F6ff85850d5189bfbba5eae614eb76096%2Fimage-20231016105954580.png?generation=1697456066783359&alt=media)\n\n\n### sequence organ mask\n\nJust use [the total segmentor model](https://pubs.rsna.org/doi/10.1148/ryai.230024) to generate segmentation results for all series. The bowel_mask = colon_mask + duodenum_mask + small_bowel_mask + esophagus_mask.\n\nThese masks will be used as mask ground truth, to assist with classification tasks.\n\n## Models\n\n**Backbone:** \n\nInternImage (base)     ->     out stride (8, 16, 32)\n\n**neck:**\n\nUnetPlusPlus      ->      out stride (4, 8)\n\n**head:**\n\nI think the head section is the most valuable and effective part of this scheme.\n\nThe bowel, liver, spleen,and kidneys all have specific shapes and positions，except for extravasation. So there is two heads for classification.\n\nFor the first head, I referred to the decoding idea of mask2Former which learned to predict a mask from a query, and using it as the attention of the decoder layer. This can help each query extract effective information for each organ.\n\nFor the extravasation head, using the image level label to assist feature learning and enable better classification.\n\nThe entire pipeline is as follows.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F186012aa8c3e147e92ece5017bb14650%2Fimage-20231016183612262.png?generation=1697456103599237&alt=media)\n\n**loss:**\n\nAll cross entropy loss  are weighted according to the status of each organ in each patient. The organ weight consistent with the weight used for official verification.\n\n## Post processing \n\nI simply averaged the results of different series of the same patient id.\n\n## Ensemble\nAll ensembled models use the same model architecture, only using different sequence lengths(T=24/32/48) and different data folds.\n\n\n### train code:\nhttps://github.com/llreda/RSNA/tree/master\n\n### inference code:\nhttps://www.kaggle.com/code/hongx0615/rsna-2023-7th-place-solution-inference",
      "votes": 16
    },
    {
      "id": 2484901,
      "postDate": "2023-10-16T18:36:24.867Z",
      "content": "<p>Interesting that you separated bowel from extravasation. Very nice work. Congrats <a href=\"https://www.kaggle.com/hongx0615\" target=\"_blank\">@hongx0615</a> !</p>",
      "rawMarkdown": "Interesting that you separated bowel from extravasation. Very nice work. Congrats @hongx0615 !"
    },
    {
      "id": 2484560,
      "postDate": "2023-10-16T15:10:51.147Z",
      "content": "<p>wow, the way you modified the head is very insightful. congrats on the solo gold!</p>",
      "rawMarkdown": "wow, the way you modified the head is very insightful. congrats on the solo gold!"
    }
  ],
  "comments": [
    {
      "id": 2484901,
      "author_name": "David Roberts",
      "author_url": "",
      "post_date": "2023-10-16T18:36:24.867000",
      "content": "<p>Interesting that you separated bowel from extravasation. Very nice work. Congrats <a href=\"https://www.kaggle.com/hongx0615\" target=\"_blank\">@hongx0615</a> !</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2484560,
      "author_name": "Cliche",
      "author_url": "",
      "post_date": "2023-10-16T15:10:51.147000",
      "content": "<p>wow, the way you modified the head is very insightful. congrats on the solo gold!</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2484306": "Thank you RSNA for hosting this great competition, which gave me a nice experience and  I believe this will start a wonderful journey on the Kaggel.\n\n I will briefly introduce the solution I used in this competition.\n\n## Dataset\n\n### sequence image data\n\n1. My Solution is a 2.5D pipeline，it's necessary to process the sequence to a certain shapes, that is，**[T * 3, 512, 512]**  , every series will be **sampled** to a length, for example, T = 32. \n\n2. Then each independent slice image  be **croped** to include as much valid data as possible in the image. This can be achieved by counting effective pixels.\n\n3. Finally reshape them to **[256, 384] **shape.\n\nThe visualization of cropping and reshaping results is as follows.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F6ff85850d5189bfbba5eae614eb76096%2Fimage-20231016105954580.png?generation=1697456066783359&alt=media)\n\n\n### sequence organ mask\n\nJust use [the total segmentor model](https://pubs.rsna.org/doi/10.1148/ryai.230024) to generate segmentation results for all series. The bowel_mask = colon_mask + duodenum_mask + small_bowel_mask + esophagus_mask.\n\nThese masks will be used as mask ground truth, to assist with classification tasks.\n\n## Models\n\n**Backbone:** \n\nInternImage (base)     ->     out stride (8, 16, 32)\n\n**neck:**\n\nUnetPlusPlus      ->      out stride (4, 8)\n\n**head:**\n\nI think the head section is the most valuable and effective part of this scheme.\n\nThe bowel, liver, spleen,and kidneys all have specific shapes and positions，except for extravasation. So there is two heads for classification.\n\nFor the first head, I referred to the decoding idea of mask2Former which learned to predict a mask from a query, and using it as the attention of the decoder layer. This can help each query extract effective information for each organ.\n\nFor the extravasation head, using the image level label to assist feature learning and enable better classification.\n\nThe entire pipeline is as follows.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F16201938%2F186012aa8c3e147e92ece5017bb14650%2Fimage-20231016183612262.png?generation=1697456103599237&alt=media)\n\n**loss:**\n\nAll cross entropy loss  are weighted according to the status of each organ in each patient. The organ weight consistent with the weight used for official verification.\n\n## Post processing \n\nI simply averaged the results of different series of the same patient id.\n\n## Ensemble\nAll ensembled models use the same model architecture, only using different sequence lengths(T=24/32/48) and different data folds.\n\n\n### train code:\nhttps://github.com/llreda/RSNA/tree/master\n\n### inference code:\nhttps://www.kaggle.com/code/hongx0615/rsna-2023-7th-place-solution-inference",
    "2484901": "Interesting that you separated bowel from extravasation. Very nice work. Congrats @hongx0615 !",
    "2484560": "wow, the way you modified the head is very insightful. congrats on the solo gold!"
  }
}