{
  "id": 362787,
  "title": "1st Place Solution -- Code",
  "url": "/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362787",
  "author_name": "Qishen Ha",
  "post_date": "2022-10-29T06:17:20.263000",
  "votes": 147,
  "comment_count": 39,
  "views": 0,
  "content": "<p>Hi all, I've finished all my notebooks and made it public!</p>\n<ul>\n<li><p>Stage1: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage1\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage1</a></p></li>\n<li><p>Stage2 Type1: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type1\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type1</a></p></li>\n<li><p>Stage2 Type2: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type2\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type2</a></p></li>\n<li><p>Inference: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-inference\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-inference</a></p></li>\n<li><p>Solution Summary: <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></p></li>\n</ul>\n<p>If you find the notebooks helpful, please <strong>upvote the NOTEBOOKS.</strong></p>\n<p>But if you have any questions for the code, please <strong>left comment at HERE</strong> instead of at the notebooks</p>",
  "messages": [
    {
      "id": 2008502,
      "postDate": "2022-10-29T06:17:20.263Z",
      "content": "<p>Hi all, I've finished all my notebooks and made it public!</p>\n<ul>\n<li><p>Stage1: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage1\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage1</a></p></li>\n<li><p>Stage2 Type1: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type1\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type1</a></p></li>\n<li><p>Stage2 Type2: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type2\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type2</a></p></li>\n<li><p>Inference: <a href=\"https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-inference\" target=\"_blank\">https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-inference</a></p></li>\n<li><p>Solution Summary: <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></p></li>\n</ul>\n<p>If you find the notebooks helpful, please <strong>upvote the NOTEBOOKS.</strong></p>\n<p>But if you have any questions for the code, please <strong>left comment at HERE</strong> instead of at the notebooks</p>",
      "rawMarkdown": "Hi all, I've finished all my notebooks and made it public!\n\n* Stage1: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage1\n* Stage2 Type1: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type1\n* Stage2 Type2: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type2\n* Inference: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-inference\n\n\n* Solution Summary: https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607\n\nIf you find the notebooks helpful, please **upvote the NOTEBOOKS.**\n\nBut if you have any questions for the code, please **left comment at HERE** instead of at the notebooks",
      "votes": 147
    },
    {
      "id": 2009663,
      "postDate": "2022-10-30T08:07:13.963Z",
      "content": "<p>Hi all, I've finished all my notebooks and made it public!</p>",
      "rawMarkdown": "Hi all, I've finished all my notebooks and made it public!",
      "votes": 13,
      "replies": [
        {
          "id": 2066841,
          "postDate": "2022-12-16T05:30:40.490Z",
          "content": "<p>Thanks a lot, really it's helpful.</p>",
          "rawMarkdown": "Thanks a lot, really it's helpful."
        }
      ]
    },
    {
      "id": 2008632,
      "postDate": "2022-10-29T08:12:58.907Z",
      "content": "<p>Thank you very much. The people like you make Kaggle the best place to learn AI.  </p>",
      "rawMarkdown": "Thank you very much. The people like you make Kaggle the best place to learn AI.  ",
      "votes": 8
    },
    {
      "id": 2401654,
      "postDate": "2023-08-21T17:51:34.423Z",
      "content": "<p>Hi, thank you so much for sharing.<br>\nI keep encountering excessive CPU RAM usage when trying to run the first stage.<br>\nI attempted to run the code as you shared on Kaggle.</p>",
      "rawMarkdown": "Hi, thank you so much for sharing.\nI keep encountering excessive CPU RAM usage when trying to run the first stage.\nI attempted to run the code as you shared on Kaggle.",
      "votes": 1
    },
    {
      "id": 2062709,
      "postDate": "2022-12-12T10:18:37.510Z",
      "content": "<p>stage2-type1<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F87c1f6f9f1421601e91c543e1dfa5d6d%2Fcsfd21.drawio.png?generation=1670840257221021&amp;alt=media\" alt=\"\"></p>\n<p>stage2-type2<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F858396e63ccb4ee142d97af97f752740%2Fcsfd22.drawio.png?generation=1670840308317246&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "stage2-type1\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F87c1f6f9f1421601e91c543e1dfa5d6d%2Fcsfd21.drawio.png?generation=1670840257221021&alt=media)\n\nstage2-type2\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F858396e63ccb4ee142d97af97f752740%2Fcsfd22.drawio.png?generation=1670840308317246&alt=media)",
      "votes": 2
    },
    {
      "id": 3022668,
      "postDate": "2024-10-19T20:12:35.567Z",
      "content": "<p>Hi<br>\nDid you calculate F1 score? If so how was it?</p>",
      "rawMarkdown": "Hi\nDid you calculate F1 score? If so how was it?"
    },
    {
      "id": 2996820,
      "postDate": "2024-09-23T23:30:08.350Z",
      "content": "<p>Hi, I recently started reviewing RSNA's competition proposal and I am very interested in multi-channel image fusion. However, I don't seem to have found any information on it in the public notebooks (I think I might have missed it). I would greatly appreciate it if you could post the detailed code for multi-channel image fusion. Thank you.</p>",
      "rawMarkdown": "Hi, I recently started reviewing RSNA's competition proposal and I am very interested in multi-channel image fusion. However, I don't seem to have found any information on it in the public notebooks (I think I might have missed it). I would greatly appreciate it if you could post the detailed code for multi-channel image fusion. Thank you."
    },
    {
      "id": 2468576,
      "postDate": "2023-10-05T16:06:30.380Z",
      "content": "<p>is this helpful for RSNA abdominal trauma competition</p>",
      "rawMarkdown": "is this helpful for RSNA abdominal trauma competition"
    },
    {
      "id": 2216579,
      "postDate": "2023-04-10T07:02:04.793Z",
      "content": "<p>Hi! could you provide your code of predicting 3D maks for 2k images <br>\nand cropping vertebraes?</p>",
      "rawMarkdown": "Hi! could you provide your code of predicting 3D maks for 2k images \nand cropping vertebraes?"
    },
    {
      "id": 2060298,
      "postDate": "2022-12-09T17:47:16.100Z",
      "content": "<p>Great solution! <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a>, could you explain why in stage1 (3D semantic segmentation) you repeat the input 3 times? Below is the piece of code I'm talking about. It is inside <code>load_sample</code> function.</p>\n<pre><code> image.ndim &lt; :\n        image = np.expand_dims(image, ).repeat(, )  \n</code></pre>\n<p>It copies the input of shape <code>(128, 128, 128)</code> 3 times and stacks the copies up on top of each other so that the shape becomes <code>(3, 128, 128, 128)</code>.</p>",
      "rawMarkdown": "Great solution! @haqishen, could you explain why in stage1 (3D semantic segmentation) you repeat the input 3 times? Below is the piece of code I'm talking about. It is inside `load_sample` function.\n\n```py\nif image.ndim < 4:\n        image = np.expand_dims(image, 0).repeat(3, 0)  # to 3ch\n```\n\nIt copies the input of shape `(128, 128, 128)` 3 times and stacks the copies up on top of each other so that the shape becomes `(3, 128, 128, 128)`."
    },
    {
      "id": 2023757,
      "postDate": "2022-11-10T02:21:12.003Z",
      "content": "<p>Congratulations! Also thank you for sharing your remarkable idea and code.</p>\n<p>Maybe this is a naive question, In the stage 2  Type 2, what was your loss weight <strong>lw</strong>?</p>",
      "rawMarkdown": "Congratulations! Also thank you for sharing your remarkable idea and code.\n\nMaybe this is a naive question, In the stage 2  Type 2, what was your loss weight **lw**?",
      "replies": [
        {
          "id": 2026056,
          "postDate": "2022-11-11T17:55:47.273Z",
          "content": "<p>Oh, my bad… fixed in new version.</p>",
          "rawMarkdown": "Oh, my bad... fixed in new version."
        },
        {
          "id": 2028913,
          "postDate": "2022-11-14T10:23:17.083Z",
          "content": "<p>Thank for your reply, share and kindness.<br>\nAgain, congratulate on your remarkable achievement in this competition.</p>",
          "rawMarkdown": "Thank for your reply, share and kindness.\nAgain, congratulate on your remarkable achievement in this competition."
        }
      ]
    },
    {
      "id": 2020074,
      "postDate": "2022-11-07T07:14:23.493Z",
      "content": "<p>Helpful Notebook.</p>",
      "rawMarkdown": "Helpful Notebook.\n"
    },
    {
      "id": 2017598,
      "postDate": "2022-11-05T01:46:44.067Z",
      "content": "<p>Thanks for the great note! <br>\nWhat were your final CVs for your stage1/stage2-type1/stage2-type2? And what was the batch size of your train environment?</p>",
      "rawMarkdown": "Thanks for the great note! \nWhat were your final CVs for your stage1/stage2-type1/stage2-type2? And what was the batch size of your train environment?",
      "replies": [
        {
          "id": 2017908,
          "postDate": "2022-11-05T08:02:27.020Z",
          "content": "<p>Final ensemble CV is around ~0.20<br>\nFor type1 model bs &gt;=8, for type2 model bs &gt;=4</p>",
          "rawMarkdown": "Final ensemble CV is around ~0.20\nFor type1 model bs >=8, for type2 model bs >=4",
          "votes": 1
        },
        {
          "id": 2019760,
          "postDate": "2022-11-07T00:23:30.190Z",
          "content": "<p>Thank you for the detailed explanation. I look forward to seeing you achieve #1 ranking!</p>",
          "rawMarkdown": "Thank you for the detailed explanation. I look forward to seeing you achieve #1 ranking!"
        },
        {
          "id": 2019917,
          "postDate": "2022-11-07T04:34:39.847Z",
          "content": "<p>😂 That's not my objective.<br>\nP.S. Congrats for your team's win in Kaggle Days Barcelona!</p>",
          "rawMarkdown": "😂 That's not my objective.\nP.S. Congrats for your team's win in Kaggle Days Barcelona!",
          "votes": 1
        }
      ]
    },
    {
      "id": 2014293,
      "postDate": "2022-11-02T13:43:04.630Z",
      "content": "<p>Thank you for sharing the code. We are learning a lot from them. </p>\n<p>In the stage 1 notebook you put n_epochs=1000. Did you really train this model for 1000 epochs or it's just an example?<br>\nHow long it takes to train the 3D segmentation model?</p>\n<p>Would be possible to share the prediction code for that model?</p>\n<p>Thanks again.</p>",
      "rawMarkdown": "Thank you for sharing the code. We are learning a lot from them. \n\nIn the stage 1 notebook you put n_epochs=1000. Did you really train this model for 1000 epochs or it's just an example?\nHow long it takes to train the 3D segmentation model?\n\nWould be possible to share the prediction code for that model?\n\nThanks again.",
      "replies": [
        {
          "id": 2014634,
          "postDate": "2022-11-02T17:41:26.870Z",
          "content": "<p>Hi, it's really 1000ep, but only 87 samples so it's not slow.</p>",
          "rawMarkdown": "Hi, it's really 1000ep, but only 87 samples so it's not slow."
        }
      ]
    },
    {
      "id": 2013911,
      "postDate": "2022-11-02T07:48:09.493Z",
      "content": "<p>Your grace ! </p>",
      "rawMarkdown": "Your grace ! "
    },
    {
      "id": 2012932,
      "postDate": "2022-11-01T14:36:02.093Z",
      "content": "<p>Thanks for posting your solution in such a detailed way.<br>\nFrom Stage 1, where do you get <code>binary_dice_iou_score</code> ? I can't find it.</p>",
      "rawMarkdown": "Thanks for posting your solution in such a detailed way.\nFrom Stage 1, where do you get `binary_dice_iou_score` ? I can't find it.",
      "replies": [
        {
          "id": 2013077,
          "postDate": "2022-11-01T15:52:51.427Z",
          "content": "<p>I believe you should change it to <code>binary_dice_score</code> and remove the type variable </p>",
          "rawMarkdown": "I believe you should change it to `binary_dice_score` and remove the type variable "
        },
        {
          "id": 2013102,
          "postDate": "2022-11-01T16:12:38.287Z",
          "content": "<p>You might need to comment out the <code>type='dice',</code> line in the <code>valid_func</code> if you want to run it. Seems like there was some refactoring done on the code.</p>",
          "rawMarkdown": "You might need to comment out the `type='dice',` line in the `valid_func` if you want to run it. Seems like there was some refactoring done on the code."
        },
        {
          "id": 2014640,
          "postDate": "2022-11-02T17:47:33.043Z",
          "content": "<p>yes youre right.. fixed in ver.7</p>",
          "rawMarkdown": "yes youre right.. fixed in ver.7",
          "votes": 1
        },
        {
          "id": 2014674,
          "postDate": "2022-11-02T18:31:10.933Z",
          "content": "<p>thanks for your help <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a> <br>\nI also noticed that in <code>valid_fun</code> you don't use <code>pred = (logits.sigmoid() &gt; th).float().detach()</code><br>\nShould we use <code>pred</code> in somewhere or just discard this line?</p>",
          "rawMarkdown": "thanks for your help @haqishen \nI also noticed that in `valid_fun` you don't use `pred = (logits.sigmoid() > th).float().detach()`\nShould we use `pred` in somewhere or just discard this line?"
        },
        {
          "id": 2015952,
          "postDate": "2022-11-03T16:40:11.077Z",
          "content": "<p>You can ignore this line.</p>",
          "rawMarkdown": "You can ignore this line.",
          "votes": 1
        }
      ]
    },
    {
      "id": 2009620,
      "postDate": "2022-10-30T07:14:48.670Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a>! Gone through your amazing work. 😃</p>\n<p>However kernal link is not working on my system. Just wanted to know how to run that? </p>",
      "rawMarkdown": "Hi @haqishen! Gone through your amazing work. 😃\n\nHowever kernal link is not working on my system. Just wanted to know how to run that? ",
      "replies": [
        {
          "id": 2009643,
          "postDate": "2022-10-30T07:51:10.267Z",
          "content": "<p>Hi, what do you mean by <code>not working</code> ?<br>\nCan you share a screen shot or any error message?</p>",
          "rawMarkdown": "Hi, what do you mean by `not working` ?\nCan you share a screen shot or any error message?"
        }
      ]
    },
    {
      "id": 2008863,
      "postDate": "2022-10-29T12:01:39.817Z",
      "content": "<p>thanks for sharing!!</p>\n<p>Why is the output of your type1 model n_slice_per_c(=15) dim instead of 1?<br>\nI thought the output of MIL is one for multiple slices like PANDA comp.<br>\n<code>labels = torch.tensor([row.label] * n_slice_per_c).float()</code></p>",
      "rawMarkdown": "thanks for sharing!!\n\nWhy is the output of your type1 model n_slice_per_c(=15) dim instead of 1?\nI thought the output of MIL is one for multiple slices like PANDA comp.\n`labels = torch.tensor([row.label] * n_slice_per_c).float()`",
      "replies": [
        {
          "id": 2009000,
          "postDate": "2022-10-29T14:36:00.340Z",
          "content": "<p>the performance is not so different, just to make the output format the same as Type2 models.</p>",
          "rawMarkdown": "the performance is not so different, just to make the output format the same as Type2 models.",
          "votes": 1
        }
      ]
    },
    {
      "id": 2008505,
      "postDate": "2022-10-29T06:19:37.907Z",
      "content": "<p>Hearty congratulations for the result <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a>, can you please relook at the kernel link? It did not work for me. </p>\n<p>Many thanks and regards.</p>",
      "rawMarkdown": "Hearty congratulations for the result @haqishen, can you please relook at the kernel link? It did not work for me. \n\nMany thanks and regards.",
      "replies": [
        {
          "id": 2008507,
          "postDate": "2022-10-29T06:21:29.343Z",
          "content": "<p>Ouch, forgot to make it public, try again now!</p>",
          "rawMarkdown": "Ouch, forgot to make it public, try again now!",
          "votes": 1
        }
      ]
    },
    {
      "id": 2391943,
      "postDate": "2023-08-15T11:38:31.607Z",
      "content": "<p>how did you get the revert list of masks</p>",
      "rawMarkdown": "how did you get the revert list of masks",
      "isDeleted": true
    },
    {
      "id": 2015509,
      "postDate": "2022-11-03T10:41:15.250Z",
      "content": "<p>Congratulations.<br>\nStage1 : you take evenly spaced images to equal the image_size (np.quantile…). Why did'nt use this same technique when loading the mask ?</p>",
      "rawMarkdown": "Congratulations.\nStage1 : you take evenly spaced images to equal the image_size (np.quantile...). Why did'nt use this same technique when loading the mask ?",
      "isDeleted": true,
      "replies": [
        {
          "id": 2017909,
          "postDate": "2022-11-05T08:03:37.807Z",
          "content": "<p>It's not that different, just for no reason…</p>",
          "rawMarkdown": "It's not that different, just for no reason..."
        }
      ]
    },
    {
      "id": 2010341,
      "postDate": "2022-10-30T17:48:35.157Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 2468860,
      "postDate": "2023-10-05T22:32:07.907Z",
      "content": "<p><strong>Thanks a lot</strong></p>",
      "rawMarkdown": "**Thanks a lot**"
    },
    {
      "id": 2015104,
      "postDate": "2022-11-03T05:07:44.943Z",
      "content": "<p>Thank you for sharing</p>",
      "rawMarkdown": "Thank you for sharing\n"
    }
  ],
  "comments": [
    {
      "id": 2009663,
      "author_name": "Qishen Ha",
      "author_url": "",
      "post_date": "2022-10-30T08:07:13.963000",
      "content": "<p>Hi all, I've finished all my notebooks and made it public!</p>",
      "votes": 13,
      "replies": [
        {
          "id": 2066841,
          "author_name": "Rayane Aggoune",
          "author_url": "",
          "post_date": "2022-12-16T05:30:40.490000",
          "content": "<p>Thanks a lot, really it's helpful.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2008632,
      "author_name": "Behnam Molaee",
      "author_url": "",
      "post_date": "2022-10-29T08:12:58.907000",
      "content": "<p>Thank you very much. The people like you make Kaggle the best place to learn AI.  </p>",
      "votes": 8,
      "replies": []
    },
    {
      "id": 2401654,
      "author_name": "irotem98",
      "author_url": "",
      "post_date": "2023-08-21T17:51:34.423000",
      "content": "<p>Hi, thank you so much for sharing.<br>\nI keep encountering excessive CPU RAM usage when trying to run the first stage.<br>\nI attempted to run the code as you shared on Kaggle.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2062709,
      "author_name": "README",
      "author_url": "",
      "post_date": "2022-12-12T10:18:37.510000",
      "content": "<p>stage2-type1<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F87c1f6f9f1421601e91c543e1dfa5d6d%2Fcsfd21.drawio.png?generation=1670840257221021&amp;alt=media\" alt=\"\"></p>\n<p>stage2-type2<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F858396e63ccb4ee142d97af97f752740%2Fcsfd22.drawio.png?generation=1670840308317246&amp;alt=media\" alt=\"\"></p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 3022668,
      "author_name": "Rusab Sarmun",
      "author_url": "",
      "post_date": "2024-10-19T20:12:35.567000",
      "content": "<p>Hi<br>\nDid you calculate F1 score? If so how was it?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2996820,
      "author_name": "SEVEN",
      "author_url": "",
      "post_date": "2024-09-23T23:30:08.350000",
      "content": "<p>Hi, I recently started reviewing RSNA's competition proposal and I am very interested in multi-channel image fusion. However, I don't seem to have found any information on it in the public notebooks (I think I might have missed it). I would greatly appreciate it if you could post the detailed code for multi-channel image fusion. Thank you.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2468576,
      "author_name": "Satheesh Bhukya",
      "author_url": "",
      "post_date": "2023-10-05T16:06:30.380000",
      "content": "<p>is this helpful for RSNA abdominal trauma competition</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2216579,
      "author_name": "Ifthika Kadhar basha",
      "author_url": "",
      "post_date": "2023-04-10T07:02:04.793000",
      "content": "<p>Hi! could you provide your code of predicting 3D maks for 2k images <br>\nand cropping vertebraes?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2060298,
      "author_name": "Mariusz Wiśniewski",
      "author_url": "",
      "post_date": "2022-12-09T17:47:16.100000",
      "content": "<p>Great solution! <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a>, could you explain why in stage1 (3D semantic segmentation) you repeat the input 3 times? Below is the piece of code I'm talking about. It is inside <code>load_sample</code> function.</p>\n<pre><code> image.ndim &lt; :\n        image = np.expand_dims(image, ).repeat(, )  \n</code></pre>\n<p>It copies the input of shape <code>(128, 128, 128)</code> 3 times and stacks the copies up on top of each other so that the shape becomes <code>(3, 128, 128, 128)</code>.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2023757,
      "author_name": "Chun-Ting, Lin",
      "author_url": "",
      "post_date": "2022-11-10T02:21:12.003000",
      "content": "<p>Congratulations! Also thank you for sharing your remarkable idea and code.</p>\n<p>Maybe this is a naive question, In the stage 2  Type 2, what was your loss weight <strong>lw</strong>?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2026056,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-11-11T17:55:47.273000",
          "content": "<p>Oh, my bad… fixed in new version.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2028913,
          "author_name": "Chun-Ting, Lin",
          "author_url": "",
          "post_date": "2022-11-14T10:23:17.083000",
          "content": "<p>Thank for your reply, share and kindness.<br>\nAgain, congratulate on your remarkable achievement in this competition.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2020074,
      "author_name": "Shovon Ahmed",
      "author_url": "",
      "post_date": "2022-11-07T07:14:23.493000",
      "content": "<p>Helpful Notebook.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2017598,
      "author_name": "YujiAriyasu",
      "author_url": "",
      "post_date": "2022-11-05T01:46:44.067000",
      "content": "<p>Thanks for the great note! <br>\nWhat were your final CVs for your stage1/stage2-type1/stage2-type2? And what was the batch size of your train environment?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2017908,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-11-05T08:02:27.020000",
          "content": "<p>Final ensemble CV is around ~0.20<br>\nFor type1 model bs &gt;=8, for type2 model bs &gt;=4</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2019760,
          "author_name": "YujiAriyasu",
          "author_url": "",
          "post_date": "2022-11-07T00:23:30.190000",
          "content": "<p>Thank you for the detailed explanation. I look forward to seeing you achieve #1 ranking!</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2019917,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-11-07T04:34:39.847000",
          "content": "<p>😂 That's not my objective.<br>\nP.S. Congrats for your team's win in Kaggle Days Barcelona!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2014293,
      "author_name": "IgorMuniz",
      "author_url": "",
      "post_date": "2022-11-02T13:43:04.630000",
      "content": "<p>Thank you for sharing the code. We are learning a lot from them. </p>\n<p>In the stage 1 notebook you put n_epochs=1000. Did you really train this model for 1000 epochs or it's just an example?<br>\nHow long it takes to train the 3D segmentation model?</p>\n<p>Would be possible to share the prediction code for that model?</p>\n<p>Thanks again.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2014634,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-11-02T17:41:26.870000",
          "content": "<p>Hi, it's really 1000ep, but only 87 samples so it's not slow.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2013911,
      "author_name": "Priyanshu S. Prajapati",
      "author_url": "",
      "post_date": "2022-11-02T07:48:09.493000",
      "content": "<p>Your grace ! </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2012932,
      "author_name": "Igor Kuivjogi Fernandes",
      "author_url": "",
      "post_date": "2022-11-01T14:36:02.093000",
      "content": "<p>Thanks for posting your solution in such a detailed way.<br>\nFrom Stage 1, where do you get <code>binary_dice_iou_score</code> ? I can't find it.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2013077,
          "author_name": "Pfamgmt",
          "author_url": "",
          "post_date": "2022-11-01T15:52:51.427000",
          "content": "<p>I believe you should change it to <code>binary_dice_score</code> and remove the type variable </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2013102,
          "author_name": "Pfamgmt",
          "author_url": "",
          "post_date": "2022-11-01T16:12:38.287000",
          "content": "<p>You might need to comment out the <code>type='dice',</code> line in the <code>valid_func</code> if you want to run it. Seems like there was some refactoring done on the code.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2014640,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-11-02T17:47:33.043000",
          "content": "<p>yes youre right.. fixed in ver.7</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2014674,
          "author_name": "Igor Kuivjogi Fernandes",
          "author_url": "",
          "post_date": "2022-11-02T18:31:10.933000",
          "content": "<p>thanks for your help <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a> <br>\nI also noticed that in <code>valid_fun</code> you don't use <code>pred = (logits.sigmoid() &gt; th).float().detach()</code><br>\nShould we use <code>pred</code> in somewhere or just discard this line?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2015952,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-11-03T16:40:11.077000",
          "content": "<p>You can ignore this line.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2009620,
      "author_name": "Shreyansh Dubey",
      "author_url": "",
      "post_date": "2022-10-30T07:14:48.670000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a>! Gone through your amazing work. 😃</p>\n<p>However kernal link is not working on my system. Just wanted to know how to run that? </p>",
      "votes": 0,
      "replies": [
        {
          "id": 2009643,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-10-30T07:51:10.267000",
          "content": "<p>Hi, what do you mean by <code>not working</code> ?<br>\nCan you share a screen shot or any error message?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2008863,
      "author_name": "patriot",
      "author_url": "",
      "post_date": "2022-10-29T12:01:39.817000",
      "content": "<p>thanks for sharing!!</p>\n<p>Why is the output of your type1 model n_slice_per_c(=15) dim instead of 1?<br>\nI thought the output of MIL is one for multiple slices like PANDA comp.<br>\n<code>labels = torch.tensor([row.label] * n_slice_per_c).float()</code></p>",
      "votes": 0,
      "replies": [
        {
          "id": 2009000,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-10-29T14:36:00.340000",
          "content": "<p>the performance is not so different, just to make the output format the same as Type2 models.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2008505,
      "author_name": "Ravi Ramakrishnan",
      "author_url": "",
      "post_date": "2022-10-29T06:19:37.907000",
      "content": "<p>Hearty congratulations for the result <a href=\"https://www.kaggle.com/haqishen\" target=\"_blank\">@haqishen</a>, can you please relook at the kernel link? It did not work for me. </p>\n<p>Many thanks and regards.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2008507,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-10-29T06:21:29.343000",
          "content": "<p>Ouch, forgot to make it public, try again now!</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2391943,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-08-15T11:38:31.607000",
      "content": "<p>how did you get the revert list of masks</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2015509,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-11-03T10:41:15.250000",
      "content": "<p>Congratulations.<br>\nStage1 : you take evenly spaced images to equal the image_size (np.quantile…). Why did'nt use this same technique when loading the mask ?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2017909,
          "author_name": "Qishen Ha",
          "author_url": "",
          "post_date": "2022-11-05T08:03:37.807000",
          "content": "<p>It's not that different, just for no reason…</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2010341,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-10-30T17:48:35.157000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2468860,
      "author_name": "Ibrahim Elsheikh",
      "author_url": "",
      "post_date": "2023-10-05T22:32:07.907000",
      "content": "<p><strong>Thanks a lot</strong></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2015104,
      "author_name": "Hiten",
      "author_url": "",
      "post_date": "2022-11-03T05:07:44.943000",
      "content": "<p>Thank you for sharing</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2008502": "Hi all, I've finished all my notebooks and made it public!\n\n* Stage1: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage1\n* Stage2 Type1: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type1\n* Stage2 Type2: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-train-stage2-type2\n* Inference: https://www.kaggle.com/code/haqishen/rsna-2022-1st-place-solution-inference\n\n\n* Solution Summary: https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/362607\n\nIf you find the notebooks helpful, please **upvote the NOTEBOOKS.**\n\nBut if you have any questions for the code, please **left comment at HERE** instead of at the notebooks",
    "2009663": "Hi all, I've finished all my notebooks and made it public!",
    "2008632": "Thank you very much. The people like you make Kaggle the best place to learn AI.  ",
    "2401654": "Hi, thank you so much for sharing.\nI keep encountering excessive CPU RAM usage when trying to run the first stage.\nI attempted to run the code as you shared on Kaggle.",
    "2062709": "stage2-type1\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F87c1f6f9f1421601e91c543e1dfa5d6d%2Fcsfd21.drawio.png?generation=1670840257221021&alt=media)\n\nstage2-type2\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1214223%2F858396e63ccb4ee142d97af97f752740%2Fcsfd22.drawio.png?generation=1670840308317246&alt=media)",
    "3022668": "Hi\nDid you calculate F1 score? If so how was it?",
    "2996820": "Hi, I recently started reviewing RSNA's competition proposal and I am very interested in multi-channel image fusion. However, I don't seem to have found any information on it in the public notebooks (I think I might have missed it). I would greatly appreciate it if you could post the detailed code for multi-channel image fusion. Thank you.",
    "2468576": "is this helpful for RSNA abdominal trauma competition",
    "2216579": "Hi! could you provide your code of predicting 3D maks for 2k images \nand cropping vertebraes?",
    "2060298": "Great solution! @haqishen, could you explain why in stage1 (3D semantic segmentation) you repeat the input 3 times? Below is the piece of code I'm talking about. It is inside `load_sample` function.\n\n```py\nif image.ndim < 4:\n        image = np.expand_dims(image, 0).repeat(3, 0)  # to 3ch\n```\n\nIt copies the input of shape `(128, 128, 128)` 3 times and stacks the copies up on top of each other so that the shape becomes `(3, 128, 128, 128)`.",
    "2023757": "Congratulations! Also thank you for sharing your remarkable idea and code.\n\nMaybe this is a naive question, In the stage 2  Type 2, what was your loss weight **lw**?",
    "2020074": "Helpful Notebook.\n",
    "2017598": "Thanks for the great note! \nWhat were your final CVs for your stage1/stage2-type1/stage2-type2? And what was the batch size of your train environment?",
    "2014293": "Thank you for sharing the code. We are learning a lot from them. \n\nIn the stage 1 notebook you put n_epochs=1000. Did you really train this model for 1000 epochs or it's just an example?\nHow long it takes to train the 3D segmentation model?\n\nWould be possible to share the prediction code for that model?\n\nThanks again.",
    "2013911": "Your grace ! ",
    "2012932": "Thanks for posting your solution in such a detailed way.\nFrom Stage 1, where do you get `binary_dice_iou_score` ? I can't find it.",
    "2009620": "Hi @haqishen! Gone through your amazing work. 😃\n\nHowever kernal link is not working on my system. Just wanted to know how to run that? ",
    "2008863": "thanks for sharing!!\n\nWhy is the output of your type1 model n_slice_per_c(=15) dim instead of 1?\nI thought the output of MIL is one for multiple slices like PANDA comp.\n`labels = torch.tensor([row.label] * n_slice_per_c).float()`",
    "2008505": "Hearty congratulations for the result @haqishen, can you please relook at the kernel link? It did not work for me. \n\nMany thanks and regards.",
    "2391943": "how did you get the revert list of masks",
    "2015509": "Congratulations.\nStage1 : you take evenly spaced images to equal the image_size (np.quantile...). Why did'nt use this same technique when loading the mask ?",
    "2010341": "",
    "2468860": "**Thanks a lot**",
    "2015104": "Thank you for sharing\n"
  }
}