{
  "id": 436943,
  "title": "My 3D model learns nothing",
  "url": "/competitions/rsna-2023-abdominal-trauma-detection/discussion/436943",
  "author_name": "JanGlinko2",
  "post_date": "2023-09-04T17:53:03.919000",
  "votes": 0,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Hello, <br>\nI'm creating 3D stacks with spacing 5mm, then resizing it to [1, 80, 256, 256] with <code>scipy.ndimage.zoom</code>. Then I use 3D ResNet50 model from <code>pytorchvideo</code>. I wanted to start from predicting <code>any_injuries</code>, because class imbalance is not as high as in other classes. The problem is my model learns nothing. Training loss is fluctuating. </p>\n<p>What I've tried:</p>\n<ul>\n<li>class weighting</li>\n<li>standarization (with mean and std)</li>\n<li>different learning rates</li>\n<li>different optimizers</li>\n</ul>\n<p>Using all classes, model is learning class imbalance.</p>\n<p>Can you provide me with any tips how to continue? I'm stuck.</p>",
  "messages": [
    {
      "id": 2425581,
      "postDate": "2023-09-06T03:48:22.520Z",
      "content": "<p>this should help:<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/435053#2425570\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/435053#2425570</a></p>",
      "rawMarkdown": "this should help:\nhttps://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/435053#2425570",
      "votes": 1,
      "replies": [
        {
          "id": 2426276,
          "postDate": "2023-09-06T14:21:53.307Z",
          "content": "<p>Have you changed (increased) number of input/output channels for the whole ResNet50d or have you only modified number of input channels for the first layer?</p>",
          "rawMarkdown": "Have you changed (increased) number of input/output channels for the whole ResNet50d or have you only modified number of input channels for the first layer?",
          "replies": [
            {
              "id": 2426285,
              "postDate": "2023-09-06T14:28:35.513Z",
              "content": "<pre><code>from timm.models.resnet  *\n\n\n        .encoder_in_dim =  \n\n        .encoder = resnet50d(pretrained=, in_chans=.encoder_in_dim)  \n        .decoder = nn.Sequential(\n            nn.Conv3d(, , kernel_size=(,,),stride=(,,), padding=(,,)),\n            nn.BatchNorm3d(),\n\n</code></pre>",
              "rawMarkdown": "```\nfrom timm.models.resnet import *\n\n...\n\t\tself.encoder_in_dim = 4 \n \n\t\tself.encoder = resnet50d(pretrained=True, in_chans=self.encoder_in_dim)  \n\t\tself.decoder = nn.Sequential(\n\t\t\tnn.Conv3d(2048, 256, kernel_size=(3,3,3),stride=(2,1,1), padding=(1,1,1)),\n\t\t\tnn.BatchNorm3d(256),\n...\n\n```"
            },
            {
              "id": 2426441,
              "postDate": "2023-09-06T15:54:10.857Z",
              "content": "<p>So you use 4 slices to extract features and probably you perform multiple runs to stack features from many slices?</p>",
              "rawMarkdown": "So you use 4 slices to extract features and probably you perform multiple runs to stack features from many slices?"
            }
          ]
        }
      ]
    },
    {
      "id": 2429424,
      "postDate": "2023-09-08T15:35:58.483Z",
      "content": "<p>Update: My 3D model still learns nothing, I can't find way data preprocessing to have a signal in 3D. Moreover, its awfully slow.<br>\n2.5D works better and 2D much much better.</p>",
      "rawMarkdown": "Update: My 3D model still learns nothing, I can't find way data preprocessing to have a signal in 3D. Moreover, its awfully slow.\n2.5D works better and 2D much much better."
    },
    {
      "id": 2423730,
      "postDate": "2023-09-04T18:29:15.597Z",
      "content": "<p>You should work on your data pipeline. Model isn't that important at this stage. I'm still experimenting with EfficientNet b0.</p>",
      "rawMarkdown": "You should work on your data pipeline. Model isn't that important at this stage. I'm still experimenting with EfficientNet b0.",
      "replies": [
        {
          "id": 2424068,
          "postDate": "2023-09-05T03:17:36.640Z",
          "content": "<p>Thank you for the reminder. I just discovered this. The prediction score of the VIT model I used dummy is actually higher than the LB score I trained on the patient-level data. Data quality determines the upper limit of the model.</p>",
          "rawMarkdown": "Thank you for the reminder. I just discovered this. The prediction score of the VIT model I used dummy is actually higher than the LB score I trained on the patient-level data. Data quality determines the upper limit of the model.\n\n",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 2423666,
      "postDate": "2023-09-04T17:53:03.920Z",
      "content": "<p>Hello, <br>\nI'm creating 3D stacks with spacing 5mm, then resizing it to [1, 80, 256, 256] with <code>scipy.ndimage.zoom</code>. Then I use 3D ResNet50 model from <code>pytorchvideo</code>. I wanted to start from predicting <code>any_injuries</code>, because class imbalance is not as high as in other classes. The problem is my model learns nothing. Training loss is fluctuating. </p>\n<p>What I've tried:</p>\n<ul>\n<li>class weighting</li>\n<li>standarization (with mean and std)</li>\n<li>different learning rates</li>\n<li>different optimizers</li>\n</ul>\n<p>Using all classes, model is learning class imbalance.</p>\n<p>Can you provide me with any tips how to continue? I'm stuck.</p>",
      "rawMarkdown": "Hello, \nI'm creating 3D stacks with spacing 5mm, then resizing it to [1, 80, 256, 256] with `scipy.ndimage.zoom`. Then I use 3D ResNet50 model from `pytorchvideo`. I wanted to start from predicting `any_injuries`, because class imbalance is not as high as in other classes. The problem is my model learns nothing. Training loss is fluctuating. \n\nWhat I've tried:\n* class weighting\n* standarization (with mean and std)\n* different learning rates\n* different optimizers\n\nUsing all classes, model is learning class imbalance.\n\nCan you provide me with any tips how to continue? I'm stuck."
    }
  ],
  "comments": [
    {
      "id": 2425581,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2023-09-06T03:48:22.520000",
      "content": "<p>this should help:<br>\n<a href=\"https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/435053#2425570\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/435053#2425570</a></p>",
      "votes": 1,
      "replies": [
        {
          "id": 2426276,
          "author_name": "JanGlinko2",
          "author_url": "",
          "post_date": "2023-09-06T14:21:53.307000",
          "content": "<p>Have you changed (increased) number of input/output channels for the whole ResNet50d or have you only modified number of input channels for the first layer?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2426285,
              "author_name": "hengck23",
              "author_url": "",
              "post_date": "2023-09-06T14:28:35.513000",
              "content": "<pre><code>from timm.models.resnet  *\n\n\n        .encoder_in_dim =  \n\n        .encoder = resnet50d(pretrained=, in_chans=.encoder_in_dim)  \n        .decoder = nn.Sequential(\n            nn.Conv3d(, , kernel_size=(,,),stride=(,,), padding=(,,)),\n            nn.BatchNorm3d(),\n\n</code></pre>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2426441,
              "author_name": "JanGlinko2",
              "author_url": "",
              "post_date": "2023-09-06T15:54:10.857000",
              "content": "<p>So you use 4 slices to extract features and probably you perform multiple runs to stack features from many slices?</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2429424,
      "author_name": "JanGlinko2",
      "author_url": "",
      "post_date": "2023-09-08T15:35:58.483000",
      "content": "<p>Update: My 3D model still learns nothing, I can't find way data preprocessing to have a signal in 3D. Moreover, its awfully slow.<br>\n2.5D works better and 2D much much better.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2423730,
      "author_name": "Gunes Evitan",
      "author_url": "",
      "post_date": "2023-09-04T18:29:15.597000",
      "content": "<p>You should work on your data pipeline. Model isn't that important at this stage. I'm still experimenting with EfficientNet b0.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2424068,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-09-05T03:17:36.640000",
          "content": "<p>Thank you for the reminder. I just discovered this. The prediction score of the VIT model I used dummy is actually higher than the LB score I trained on the patient-level data. Data quality determines the upper limit of the model.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2425581": "this should help:\nhttps://www.kaggle.com/competitions/rsna-2023-abdominal-trauma-detection/discussion/435053#2425570",
    "2429424": "Update: My 3D model still learns nothing, I can't find way data preprocessing to have a signal in 3D. Moreover, its awfully slow.\n2.5D works better and 2D much much better.",
    "2423730": "You should work on your data pipeline. Model isn't that important at this stage. I'm still experimenting with EfficientNet b0.",
    "2423666": "Hello, \nI'm creating 3D stacks with spacing 5mm, then resizing it to [1, 80, 256, 256] with `scipy.ndimage.zoom`. Then I use 3D ResNet50 model from `pytorchvideo`. I wanted to start from predicting `any_injuries`, because class imbalance is not as high as in other classes. The problem is my model learns nothing. Training loss is fluctuating. \n\nWhat I've tried:\n* class weighting\n* standarization (with mean and std)\n* different learning rates\n* different optimizers\n\nUsing all classes, model is learning class imbalance.\n\nCan you provide me with any tips how to continue? I'm stuck."
  }
}