{
  "id": 447464,
  "title": "3rd Place Solution",
  "url": "/competitions/rsna-2023-abdominal-trauma-detection/discussion/447464",
  "author_name": "YujiAriyasu",
  "post_date": "2023-10-16T01:57:04.331000",
  "votes": 53,
  "comment_count": 10,
  "views": 0,
  "content": "<p>I salute you all for fighting to the end. Thanks also to the RSNA for their support. It was another great competition.</p>\n<h2>Overview</h2>\n<p>1, The 3D segmentation was trained with the given masks and each organ was cut into a cube shape using the predicted results.<br>\n2, Multiple organ cubes were each entered into various 2.5D+3D classification models and the results enumerated.</p>\n<h2>Segmentation</h2>\n<p>I used Qishen's 3D segmentation code. <a href=\"https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607</a><br>\nThe models used were resnet18 and resnet50. The average of the output of all models was used as a mask.</p>\n<h2>Crop</h2>\n<p>Since information around the organs is essential for trauma detection, the mask was slightly enlarged before the boxes were cut out. Two patterns of mask sizes were employed and two datasets were created for each organ.</p>\n<h2>Classification</h2>\n<p>All classification models follow a 2.5D + 3D structure. Typically, multiple 2.5D images are generated from the organ box and input into the model. The input sizes are (8, 15, 3, 128, 128), where 8 is batch_size, 15 is image, and 3 is channel. Each image is transformed into a feature map through a 2D CNN and input to subsequent processes such as pooling and lstm.<br>\nBecause of the correlation in injuries between organs, the problem was solved in a multiclass problem, using essentially all targets. I trained a variety of model patterns, including:</p>\n<p>・Multiple Image Sizes<br>\n・Multiple image counts<br>\n・Multiple necks (average pooling / max pooling / lstm / gru)<br>\n・Multiple crop sizes<br>\n・Multiple backbones (convnext / se_resnext / maxvit / caformer / xcit)<br>\n・Multiple augmentation sets<br>\n・Multiple epochs(without early stop)<br>\n・Multiple targets (all targets / single organ targets)<br>\n・Some models are pre-trained with image-level bowel / extravasation labels and used as initial values for weights.<br>\n・Some models reduce noise by using box<em>mask as input. There is also a model that uses box</em>mask as input to reduce noise. This type of model is specific to the liver. Because of its shape, the liver has a lot of noise information if you just crop it with a box, so masking was very effective.<br>\n・Some models use all organ boxes for training. Different image sizes/number of images are used for each organ to ensure the same resolution. A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers.</p>\n<p>The following are those that have made a particularly significant contribution to accuracy:<br>\n・masking for liver model<br>\n・custom sampler for all class models<br>\n・2types of crops</p>\n<h2>Ensemble</h2>\n<p>A simple weighted average was performed for each target.<br>\nBelow is a simplified weights.</p>\n<pre><code>{\n'bowel_injury':\n    {\n        'liver_gru_chaug_256_cropv1': ,\n        'liver_maxvit_224_cropv1': ,\n        'liver_maxvit_224_cropv2': ,\n        'spleen_gru_128_cropv1': ,\n        'spleen_maxvit_224_25epochs_cropv1': ,\n        'kidney_maxvit_224_cropv1': ,\n        'kidney_caformer_192_cropv2_pretrain': ,\n        'kidney_maxvit_224_cropv2': ,\n        'kidney_maxvit_224_25epochs_cropv2': ,\n        'bowel_lstm_256_n15_cropv1': ,\n        'bowel_288_n25_cropv1_pretrain': ,\n        'bowel_288_n25_25epochs_cropv1_pretrain': ,\n        'all_pretrain_cropv1_input_bowel': ,\n        'all_pretrain_cropv1_input_kidney': ,\n        'all_lstm_pretrain_cropv2_input_kidney': ,\n    },\n'kidney_healthy':\n    {\n        'liver_gru_chaug_256_cropv1': ,\n        'liver_maxvit_224_cropv1': ,\n        'liver_maxvit_224_cropv2': ,\n        'spleen_gru_128_cropv1': ,\n        'spleen_maxvit_224_25epochs_cropv1': ,\n        'kidney_maxvit_224_cropv1': ,\n        'kidney_caformer_192_cropv2_pretrain': ,\n        'kidney_maxvit_224_cropv2': ,\n        'kidney_maxvit_224_25epochs_cropv2': ,\n        'bowel_lstm_256_n15_cropv1': ,\n        'bowel_288_n25_cropv1_pretrain': ,\n        'bowel_288_n25_25epochs_cropv1_pretrain': ,\n        'all_pretrain_cropv1_input_bowel': ,\n        'all_pretrain_cropv1_input_kidney': ,\n        'all_lstm_pretrain_cropv2_input_kidney': ,\n    },\n}\n</code></pre>\n<p>The final oof log loss is as follows:</p>\n<pre><code>{\n'bowel_injury': ,\n'extravasation_injury': ,\n'kidney_healthy': ,\n'kidney_low': ,\n'kidney_high': ,\n'liver_healthy': ,\n'liver_low': ,\n'liver_high': ,\n'spleen_healthy': ,\n'spleen_low': ,\n'spleen_high': \n}  \n</code></pre>\n<h2>Post processing</h2>\n<p>After a simple weighted average of each model, each prediction was further weighted. This is the same post-processing as in the public notebook.<br>\nI also tried stacking which directly optimizes the metric, but the results were slightly worse than the simple pp due to overfit.<br>\nThe final CV is 0.3316 and the respective scores are as follows.</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>bowel</th>\n<th>extravasation</th>\n<th>kidney</th>\n<th>liver</th>\n<th>spleen</th>\n<th>any</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td></td>\n<td>0.095</td>\n<td>0.4853</td>\n<td>0.2434</td>\n<td>0.3489</td>\n<td>0.3751</td>\n<td>0.4417</td>\n</tr>\n</tbody>\n</table>\n<p><br></p>\n<p>train  code: <a href=\"https://github.com/yujiariyasu/rsna_2023_abdominal_trauma_detection\" target=\"_blank\">https://github.com/yujiariyasu/rsna_2023_abdominal_trauma_detection</a><br>\ninference code: <a href=\"https://www.kaggle.com/code/yujiariyasu/3rd-place-inf-code/notebook\" target=\"_blank\">https://www.kaggle.com/code/yujiariyasu/3rd-place-inf-code/notebook</a></p>\n<p>Thanks everyone for your hard work!</p>",
  "messages": [
    {
      "id": 2483792,
      "postDate": "2023-10-16T01:57:04.330Z",
      "content": "<p>I salute you all for fighting to the end. Thanks also to the RSNA for their support. It was another great competition.</p>\n<h2>Overview</h2>\n<p>1, The 3D segmentation was trained with the given masks and each organ was cut into a cube shape using the predicted results.<br>\n2, Multiple organ cubes were each entered into various 2.5D+3D classification models and the results enumerated.</p>\n<h2>Segmentation</h2>\n<p>I used Qishen's 3D segmentation code. <a href=\"https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607</a><br>\nThe models used were resnet18 and resnet50. The average of the output of all models was used as a mask.</p>\n<h2>Crop</h2>\n<p>Since information around the organs is essential for trauma detection, the mask was slightly enlarged before the boxes were cut out. Two patterns of mask sizes were employed and two datasets were created for each organ.</p>\n<h2>Classification</h2>\n<p>All classification models follow a 2.5D + 3D structure. Typically, multiple 2.5D images are generated from the organ box and input into the model. The input sizes are (8, 15, 3, 128, 128), where 8 is batch_size, 15 is image, and 3 is channel. Each image is transformed into a feature map through a 2D CNN and input to subsequent processes such as pooling and lstm.<br>\nBecause of the correlation in injuries between organs, the problem was solved in a multiclass problem, using essentially all targets. I trained a variety of model patterns, including:</p>\n<p>・Multiple Image Sizes<br>\n・Multiple image counts<br>\n・Multiple necks (average pooling / max pooling / lstm / gru)<br>\n・Multiple crop sizes<br>\n・Multiple backbones (convnext / se_resnext / maxvit / caformer / xcit)<br>\n・Multiple augmentation sets<br>\n・Multiple epochs(without early stop)<br>\n・Multiple targets (all targets / single organ targets)<br>\n・Some models are pre-trained with image-level bowel / extravasation labels and used as initial values for weights.<br>\n・Some models reduce noise by using box<em>mask as input. There is also a model that uses box</em>mask as input to reduce noise. This type of model is specific to the liver. Because of its shape, the liver has a lot of noise information if you just crop it with a box, so masking was very effective.<br>\n・Some models use all organ boxes for training. Different image sizes/number of images are used for each organ to ensure the same resolution. A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers.</p>\n<p>The following are those that have made a particularly significant contribution to accuracy:<br>\n・masking for liver model<br>\n・custom sampler for all class models<br>\n・2types of crops</p>\n<h2>Ensemble</h2>\n<p>A simple weighted average was performed for each target.<br>\nBelow is a simplified weights.</p>\n<pre><code>{\n'bowel_injury':\n    {\n        'liver_gru_chaug_256_cropv1': ,\n        'liver_maxvit_224_cropv1': ,\n        'liver_maxvit_224_cropv2': ,\n        'spleen_gru_128_cropv1': ,\n        'spleen_maxvit_224_25epochs_cropv1': ,\n        'kidney_maxvit_224_cropv1': ,\n        'kidney_caformer_192_cropv2_pretrain': ,\n        'kidney_maxvit_224_cropv2': ,\n        'kidney_maxvit_224_25epochs_cropv2': ,\n        'bowel_lstm_256_n15_cropv1': ,\n        'bowel_288_n25_cropv1_pretrain': ,\n        'bowel_288_n25_25epochs_cropv1_pretrain': ,\n        'all_pretrain_cropv1_input_bowel': ,\n        'all_pretrain_cropv1_input_kidney': ,\n        'all_lstm_pretrain_cropv2_input_kidney': ,\n    },\n'kidney_healthy':\n    {\n        'liver_gru_chaug_256_cropv1': ,\n        'liver_maxvit_224_cropv1': ,\n        'liver_maxvit_224_cropv2': ,\n        'spleen_gru_128_cropv1': ,\n        'spleen_maxvit_224_25epochs_cropv1': ,\n        'kidney_maxvit_224_cropv1': ,\n        'kidney_caformer_192_cropv2_pretrain': ,\n        'kidney_maxvit_224_cropv2': ,\n        'kidney_maxvit_224_25epochs_cropv2': ,\n        'bowel_lstm_256_n15_cropv1': ,\n        'bowel_288_n25_cropv1_pretrain': ,\n        'bowel_288_n25_25epochs_cropv1_pretrain': ,\n        'all_pretrain_cropv1_input_bowel': ,\n        'all_pretrain_cropv1_input_kidney': ,\n        'all_lstm_pretrain_cropv2_input_kidney': ,\n    },\n}\n</code></pre>\n<p>The final oof log loss is as follows:</p>\n<pre><code>{\n'bowel_injury': ,\n'extravasation_injury': ,\n'kidney_healthy': ,\n'kidney_low': ,\n'kidney_high': ,\n'liver_healthy': ,\n'liver_low': ,\n'liver_high': ,\n'spleen_healthy': ,\n'spleen_low': ,\n'spleen_high': \n}  \n</code></pre>\n<h2>Post processing</h2>\n<p>After a simple weighted average of each model, each prediction was further weighted. This is the same post-processing as in the public notebook.<br>\nI also tried stacking which directly optimizes the metric, but the results were slightly worse than the simple pp due to overfit.<br>\nThe final CV is 0.3316 and the respective scores are as follows.</p>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>bowel</th>\n<th>extravasation</th>\n<th>kidney</th>\n<th>liver</th>\n<th>spleen</th>\n<th>any</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td></td>\n<td>0.095</td>\n<td>0.4853</td>\n<td>0.2434</td>\n<td>0.3489</td>\n<td>0.3751</td>\n<td>0.4417</td>\n</tr>\n</tbody>\n</table>\n<p><br></p>\n<p>train  code: <a href=\"https://github.com/yujiariyasu/rsna_2023_abdominal_trauma_detection\" target=\"_blank\">https://github.com/yujiariyasu/rsna_2023_abdominal_trauma_detection</a><br>\ninference code: <a href=\"https://www.kaggle.com/code/yujiariyasu/3rd-place-inf-code/notebook\" target=\"_blank\">https://www.kaggle.com/code/yujiariyasu/3rd-place-inf-code/notebook</a></p>\n<p>Thanks everyone for your hard work!</p>",
      "rawMarkdown": "I salute you all for fighting to the end. Thanks also to the RSNA for their support. It was another great competition.\n\n## Overview\n1, The 3D segmentation was trained with the given masks and each organ was cut into a cube shape using the predicted results.\n2, Multiple organ cubes were each entered into various 2.5D+3D classification models and the results enumerated.\n\n## Segmentation\nI used Qishen's 3D segmentation code. https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607\nThe models used were resnet18 and resnet50. The average of the output of all models was used as a mask.\n\n## Crop\nSince information around the organs is essential for trauma detection, the mask was slightly enlarged before the boxes were cut out. Two patterns of mask sizes were employed and two datasets were created for each organ.\n\n## Classification\n\nAll classification models follow a 2.5D + 3D structure. Typically, multiple 2.5D images are generated from the organ box and input into the model. The input sizes are (8, 15, 3, 128, 128), where 8 is batch_size, 15 is image, and 3 is channel. Each image is transformed into a feature map through a 2D CNN and input to subsequent processes such as pooling and lstm.\nBecause of the correlation in injuries between organs, the problem was solved in a multiclass problem, using essentially all targets. I trained a variety of model patterns, including:\n\n・Multiple Image Sizes\n・Multiple image counts\n・Multiple necks (average pooling / max pooling / lstm / gru)\n・Multiple crop sizes\n・Multiple backbones (convnext / se_resnext / maxvit / caformer / xcit)\n・Multiple augmentation sets\n・Multiple epochs(without early stop)\n・Multiple targets (all targets / single organ targets)\n・Some models are pre-trained with image-level bowel / extravasation labels and used as initial values for weights.\n・Some models reduce noise by using box*mask as input. There is also a model that uses box*mask as input to reduce noise. This type of model is specific to the liver. Because of its shape, the liver has a lot of noise information if you just crop it with a box, so masking was very effective.\n・Some models use all organ boxes for training. Different image sizes/number of images are used for each organ to ensure the same resolution. A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers.\n\nThe following are those that have made a particularly significant contribution to accuracy:\n・masking for liver model\n・custom sampler for all class models\n・2types of crops\n\n## Ensemble\nA simple weighted average was performed for each target.\nBelow is a simplified weights.\n\n```\n{\n'bowel_injury':\n    {\n        'liver_gru_chaug_256_cropv1': 0.0,\n        'liver_maxvit_224_cropv1': 0.0,\n        'liver_maxvit_224_cropv2': 0.2,\n        'spleen_gru_128_cropv1': 0.0,\n        'spleen_maxvit_224_25epochs_cropv1': 0.0,\n        'kidney_maxvit_224_cropv1': 0.0,\n        'kidney_caformer_192_cropv2_pretrain': 0.2,\n        'kidney_maxvit_224_cropv2': 0.0,\n        'kidney_maxvit_224_25epochs_cropv2': 0.0,\n        'bowel_lstm_256_n15_cropv1': 0.0,\n        'bowel_288_n25_cropv1_pretrain': 0.3,\n        'bowel_288_n25_25epochs_cropv1_pretrain': 0.2,\n        'all_pretrain_cropv1_input_bowel': 0.1,\n        'all_pretrain_cropv1_input_kidney': 0.0,\n        'all_lstm_pretrain_cropv2_input_kidney': 0.0,\n    },\n'kidney_healthy':\n    {\n        'liver_gru_chaug_256_cropv1': 0.1,\n        'liver_maxvit_224_cropv1': 0.0,\n        'liver_maxvit_224_cropv2': 0.0,\n        'spleen_gru_128_cropv1': 0.0,\n        'spleen_maxvit_224_25epochs_cropv1': 0.0,\n        'kidney_maxvit_224_cropv1': 0.2,\n        'kidney_caformer_192_cropv2_pretrain': 0.1,\n        'kidney_maxvit_224_cropv2': 0.2,\n        'kidney_maxvit_224_25epochs_cropv2': 0.2,\n        'bowel_lstm_256_n15_cropv1': 0.0,\n        'bowel_288_n25_cropv1_pretrain': 0.0,\n        'bowel_288_n25_25epochs_cropv1_pretrain': 0.0,\n        'all_pretrain_cropv1_input_bowel': 0.0,\n        'all_pretrain_cropv1_input_kidney': 0.1,\n        'all_lstm_pretrain_cropv2_input_kidney': 0.1,\n    },\n}\n```\n\nThe final oof log loss is as follows:\n```\n{\n'bowel_injury': 0.0592,\n'extravasation_injury': 0.2004,\n'kidney_healthy': 0.1101,\n'kidney_low': 0.0958,\n'kidney_high': 0.0451,\n'liver_healthy': 0.189,\n'liver_low': 0.1984,\n'liver_high': 0.0346,\n'spleen_healthy': 0.1746,\n'spleen_low': 0.1651,\n'spleen_high': 0.0788\n}  \n\n```\n## Post processing\nAfter a simple weighted average of each model, each prediction was further weighted. This is the same post-processing as in the public notebook.\nI also tried stacking which directly optimizes the metric, but the results were slightly worse than the simple pp due to overfit.\nThe final CV is 0.3316 and the respective scores are as follows.\n\n|           | bowel   | extravasation | kidney | liver  | spleen | any    |\n|-----------|---------|---------------|--------|--------|--------|--------|\n|  | 0.095  | 0.4853   | 0.2434 | 0.3489 | 0.3751 | 0.4417  |  \n\n<br>\n\ntrain  code: https://github.com/yujiariyasu/rsna_2023_abdominal_trauma_detection\ninference code: https://www.kaggle.com/code/yujiariyasu/3rd-place-inf-code/notebook\n\nThanks everyone for your hard work!",
      "votes": 53
    },
    {
      "id": 2484376,
      "postDate": "2023-10-16T12:47:53.273Z",
      "content": "<p>Thank you for the clear explanations and congratulation for the 3rd place !</p>",
      "rawMarkdown": "Thank you for the clear explanations and congratulation for the 3rd place !",
      "votes": 1
    },
    {
      "id": 2484268,
      "postDate": "2023-10-16T10:57:56.533Z",
      "content": "<p>Congratulations on winning the 3rd position. Thanks for sharing the details of your approach. </p>",
      "rawMarkdown": "Congratulations on winning the 3rd position. Thanks for sharing the details of your approach. ",
      "votes": 1
    },
    {
      "id": 2483897,
      "postDate": "2023-10-16T04:47:17.083Z",
      "content": "<p>Well done, and thanks for sharing your solution <a href=\"https://www.kaggle.com/yujiariyasu\" target=\"_blank\">@yujiariyasu</a>! Do you think you could elaborate on this point?</p>\n<blockquote>\n  <p>A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers</p>\n</blockquote>",
      "rawMarkdown": "Well done, and thanks for sharing your solution @yujiariyasu! Do you think you could elaborate on this point?\n\n>A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers",
      "votes": 1,
      "replies": [
        {
          "id": 2483947,
          "postDate": "2023-10-16T05:43:55.457Z",
          "content": "<p>In my normal model, the box of one organ is the input. The number of records is 4711(= patient-series unique num).<br>\nIn the model that uses the box of all organs, all organs will be inputs. since there are 4 organs, the number of records and the training time will be quadrupled.<br>\nSince each organ has a different size, the appropriate image size and number of images should be different. Therefore, I used a custom sampler to ensure that only boxes of the same organ are included in the same batch. (If batch_size is 4, for example, 4 liver boxes will be included in one batch.)</p>\n<p>This is the part that is hard to understand, so if you have any other questions, please feel free to ask!<br>\nCongratulations on your silver medal!</p>",
          "rawMarkdown": "In my normal model, the box of one organ is the input. The number of records is 4711(= patient-series unique num).\nIn the model that uses the box of all organs, all organs will be inputs. since there are 4 organs, the number of records and the training time will be quadrupled.\nSince each organ has a different size, the appropriate image size and number of images should be different. Therefore, I used a custom sampler to ensure that only boxes of the same organ are included in the same batch. (If batch_size is 4, for example, 4 liver boxes will be included in one batch.)\n\nThis is the part that is hard to understand, so if you have any other questions, please feel free to ask!\nCongratulations on your silver medal!",
          "votes": 1,
          "replies": [
            {
              "id": 2483968,
              "postDate": "2023-10-16T06:11:31.993Z",
              "content": "<p>Thanks for the reply! I tried some 2.5D/3D organ-level experiments early on, but I didn't succeed. I'm glad it worked for you and other competitors though!</p>",
              "rawMarkdown": "Thanks for the reply! I tried some 2.5D/3D organ-level experiments early on, but I didn't succeed. I'm glad it worked for you and other competitors though!",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2484022,
      "postDate": "2023-10-16T07:16:45.030Z",
      "content": "<p>Congratulations on solo 3rd place, nice jump in private :)</p>",
      "rawMarkdown": "Congratulations on solo 3rd place, nice jump in private :)",
      "votes": 2,
      "replies": [
        {
          "id": 2484047,
          "postDate": "2023-10-16T07:25:00.910Z",
          "content": "<p>My CV was not bad, so I was expecting a jump:) But your CV are even more amazing! Congratulations!</p>",
          "rawMarkdown": "My CV was not bad, so I was expecting a jump:) But your CV are even more amazing! Congratulations!",
          "votes": 1
        }
      ]
    },
    {
      "id": 2484014,
      "postDate": "2023-10-16T07:05:01.143Z",
      "content": "<p>Another solo gold! Congrats!</p>",
      "rawMarkdown": "Another solo gold! Congrats!",
      "votes": 2,
      "replies": [
        {
          "id": 2484046,
          "postDate": "2023-10-16T07:23:24.930Z",
          "content": "<p>Anoter 1st!! Whenever I look up, I see your back haha. Congrats!</p>",
          "rawMarkdown": "Anoter 1st!! Whenever I look up, I see your back haha. Congrats!",
          "votes": 1
        }
      ]
    },
    {
      "id": 2484512,
      "postDate": "2023-10-16T14:34:51.673Z",
      "content": "<p>Congratulations on 3rd place, nice solution</p>",
      "rawMarkdown": "Congratulations on 3rd place, nice solution"
    }
  ],
  "comments": [
    {
      "id": 2484376,
      "author_name": "Kiurtis",
      "author_url": "",
      "post_date": "2023-10-16T12:47:53.273000",
      "content": "<p>Thank you for the clear explanations and congratulation for the 3rd place !</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2484268,
      "author_name": "C R Suthikshn Kumar",
      "author_url": "",
      "post_date": "2023-10-16T10:57:56.533000",
      "content": "<p>Congratulations on winning the 3rd position. Thanks for sharing the details of your approach. </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2483897,
      "author_name": "Romain Hardy",
      "author_url": "",
      "post_date": "2023-10-16T04:47:17.083000",
      "content": "<p>Well done, and thanks for sharing your solution <a href=\"https://www.kaggle.com/yujiariyasu\" target=\"_blank\">@yujiariyasu</a>! Do you think you could elaborate on this point?</p>\n<blockquote>\n  <p>A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers</p>\n</blockquote>",
      "votes": 1,
      "replies": [
        {
          "id": 2483947,
          "author_name": "YujiAriyasu",
          "author_url": "",
          "post_date": "2023-10-16T05:43:55.457000",
          "content": "<p>In my normal model, the box of one organ is the input. The number of records is 4711(= patient-series unique num).<br>\nIn the model that uses the box of all organs, all organs will be inputs. since there are 4 organs, the number of records and the training time will be quadrupled.<br>\nSince each organ has a different size, the appropriate image size and number of images should be different. Therefore, I used a custom sampler to ensure that only boxes of the same organ are included in the same batch. (If batch_size is 4, for example, 4 liver boxes will be included in one batch.)</p>\n<p>This is the part that is hard to understand, so if you have any other questions, please feel free to ask!<br>\nCongratulations on your silver medal!</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2483968,
              "author_name": "Romain Hardy",
              "author_url": "",
              "post_date": "2023-10-16T06:11:31.993000",
              "content": "<p>Thanks for the reply! I tried some 2.5D/3D organ-level experiments early on, but I didn't succeed. I'm glad it worked for you and other competitors though!</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2484022,
      "author_name": "Harshit Sheoran",
      "author_url": "",
      "post_date": "2023-10-16T07:16:45.030000",
      "content": "<p>Congratulations on solo 3rd place, nice jump in private :)</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2484047,
          "author_name": "YujiAriyasu",
          "author_url": "",
          "post_date": "2023-10-16T07:25:00.910000",
          "content": "<p>My CV was not bad, so I was expecting a jump:) But your CV are even more amazing! Congratulations!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2484014,
      "author_name": "Qishen Ha",
      "author_url": "",
      "post_date": "2023-10-16T07:05:01.143000",
      "content": "<p>Another solo gold! Congrats!</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2484046,
          "author_name": "YujiAriyasu",
          "author_url": "",
          "post_date": "2023-10-16T07:23:24.930000",
          "content": "<p>Anoter 1st!! Whenever I look up, I see your back haha. Congrats!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2484512,
      "author_name": "ls",
      "author_url": "",
      "post_date": "2023-10-16T14:34:51.673000",
      "content": "<p>Congratulations on 3rd place, nice solution</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2483792": "I salute you all for fighting to the end. Thanks also to the RSNA for their support. It was another great competition.\n\n## Overview\n1, The 3D segmentation was trained with the given masks and each organ was cut into a cube shape using the predicted results.\n2, Multiple organ cubes were each entered into various 2.5D+3D classification models and the results enumerated.\n\n## Segmentation\nI used Qishen's 3D segmentation code. https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607\nThe models used were resnet18 and resnet50. The average of the output of all models was used as a mask.\n\n## Crop\nSince information around the organs is essential for trauma detection, the mask was slightly enlarged before the boxes were cut out. Two patterns of mask sizes were employed and two datasets were created for each organ.\n\n## Classification\n\nAll classification models follow a 2.5D + 3D structure. Typically, multiple 2.5D images are generated from the organ box and input into the model. The input sizes are (8, 15, 3, 128, 128), where 8 is batch_size, 15 is image, and 3 is channel. Each image is transformed into a feature map through a 2D CNN and input to subsequent processes such as pooling and lstm.\nBecause of the correlation in injuries between organs, the problem was solved in a multiclass problem, using essentially all targets. I trained a variety of model patterns, including:\n\n・Multiple Image Sizes\n・Multiple image counts\n・Multiple necks (average pooling / max pooling / lstm / gru)\n・Multiple crop sizes\n・Multiple backbones (convnext / se_resnext / maxvit / caformer / xcit)\n・Multiple augmentation sets\n・Multiple epochs(without early stop)\n・Multiple targets (all targets / single organ targets)\n・Some models are pre-trained with image-level bowel / extravasation labels and used as initial values for weights.\n・Some models reduce noise by using box*mask as input. There is also a model that uses box*mask as input to reduce noise. This type of model is specific to the liver. Because of its shape, the liver has a lot of noise information if you just crop it with a box, so masking was very effective.\n・Some models use all organ boxes for training. Different image sizes/number of images are used for each organ to ensure the same resolution. A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers.\n\nThe following are those that have made a particularly significant contribution to accuracy:\n・masking for liver model\n・custom sampler for all class models\n・2types of crops\n\n## Ensemble\nA simple weighted average was performed for each target.\nBelow is a simplified weights.\n\n```\n{\n'bowel_injury':\n    {\n        'liver_gru_chaug_256_cropv1': 0.0,\n        'liver_maxvit_224_cropv1': 0.0,\n        'liver_maxvit_224_cropv2': 0.2,\n        'spleen_gru_128_cropv1': 0.0,\n        'spleen_maxvit_224_25epochs_cropv1': 0.0,\n        'kidney_maxvit_224_cropv1': 0.0,\n        'kidney_caformer_192_cropv2_pretrain': 0.2,\n        'kidney_maxvit_224_cropv2': 0.0,\n        'kidney_maxvit_224_25epochs_cropv2': 0.0,\n        'bowel_lstm_256_n15_cropv1': 0.0,\n        'bowel_288_n25_cropv1_pretrain': 0.3,\n        'bowel_288_n25_25epochs_cropv1_pretrain': 0.2,\n        'all_pretrain_cropv1_input_bowel': 0.1,\n        'all_pretrain_cropv1_input_kidney': 0.0,\n        'all_lstm_pretrain_cropv2_input_kidney': 0.0,\n    },\n'kidney_healthy':\n    {\n        'liver_gru_chaug_256_cropv1': 0.1,\n        'liver_maxvit_224_cropv1': 0.0,\n        'liver_maxvit_224_cropv2': 0.0,\n        'spleen_gru_128_cropv1': 0.0,\n        'spleen_maxvit_224_25epochs_cropv1': 0.0,\n        'kidney_maxvit_224_cropv1': 0.2,\n        'kidney_caformer_192_cropv2_pretrain': 0.1,\n        'kidney_maxvit_224_cropv2': 0.2,\n        'kidney_maxvit_224_25epochs_cropv2': 0.2,\n        'bowel_lstm_256_n15_cropv1': 0.0,\n        'bowel_288_n25_cropv1_pretrain': 0.0,\n        'bowel_288_n25_25epochs_cropv1_pretrain': 0.0,\n        'all_pretrain_cropv1_input_bowel': 0.0,\n        'all_pretrain_cropv1_input_kidney': 0.1,\n        'all_lstm_pretrain_cropv2_input_kidney': 0.1,\n    },\n}\n```\n\nThe final oof log loss is as follows:\n```\n{\n'bowel_injury': 0.0592,\n'extravasation_injury': 0.2004,\n'kidney_healthy': 0.1101,\n'kidney_low': 0.0958,\n'kidney_high': 0.0451,\n'liver_healthy': 0.189,\n'liver_low': 0.1984,\n'liver_high': 0.0346,\n'spleen_healthy': 0.1746,\n'spleen_low': 0.1651,\n'spleen_high': 0.0788\n}  \n\n```\n## Post processing\nAfter a simple weighted average of each model, each prediction was further weighted. This is the same post-processing as in the public notebook.\nI also tried stacking which directly optimizes the metric, but the results were slightly worse than the simple pp due to overfit.\nThe final CV is 0.3316 and the respective scores are as follows.\n\n|           | bowel   | extravasation | kidney | liver  | spleen | any    |\n|-----------|---------|---------------|--------|--------|--------|--------|\n|  | 0.095  | 0.4853   | 0.2434 | 0.3489 | 0.3751 | 0.4417  |  \n\n<br>\n\ntrain  code: https://github.com/yujiariyasu/rsna_2023_abdominal_trauma_detection\ninference code: https://www.kaggle.com/code/yujiariyasu/3rd-place-inf-code/notebook\n\nThanks everyone for your hard work!",
    "2484376": "Thank you for the clear explanations and congratulation for the 3rd place !",
    "2484268": "Congratulations on winning the 3rd position. Thanks for sharing the details of your approach. ",
    "2483897": "Well done, and thanks for sharing your solution @yujiariyasu! Do you think you could elaborate on this point?\n\n>A custom sampler was defined so that only boxes of the same organ exist in the same batch, allowing simultaneous training with different sizes/numbers",
    "2484022": "Congratulations on solo 3rd place, nice jump in private :)",
    "2484014": "Another solo gold! Congrats!",
    "2484512": "Congratulations on 3rd place, nice solution"
  }
}