{
  "id": 568930,
  "title": "3d unet not working",
  "url": "/competitions/byu-locating-bacterial-flagellar-motors-2025/discussion/568930",
  "author_name": "snehal",
  "post_date": "2025-03-18T21:04:32.064000",
  "votes": 15,
  "comment_count": 20,
  "views": 0,
  "content": "<p>How come everyone is using YOLO in this comp? I can't seem to get unet style arch to work has anyone else had success with this?</p>",
  "messages": [
    {
      "id": 3153463,
      "postDate": "2025-03-18T21:04:32.063Z",
      "content": "<p>How come everyone is using YOLO in this comp? I can't seem to get unet style arch to work has anyone else had success with this?</p>",
      "rawMarkdown": "How come everyone is using YOLO in this comp? I can't seem to get unet style arch to work has anyone else had success with this?",
      "votes": 15
    },
    {
      "id": 3158612,
      "postDate": "2025-03-24T17:45:31.233Z",
      "content": "<p>I currently work on label development. I found that 3d unet is very hard to capture the motor if we give a single voxel, even using class_weight. Gaussian ball does not work as well cause it cannot show strong connection between label and image. Other methods from czii do not work. Their performance are bad. Maybe structural target can show up.</p>",
      "rawMarkdown": "I currently work on label development. I found that 3d unet is very hard to capture the motor if we give a single voxel, even using class_weight. Gaussian ball does not work as well cause it cannot show strong connection between label and image. Other methods from czii do not work. Their performance are bad. Maybe structural target can show up.",
      "votes": 5,
      "replies": [
        {
          "id": 3159232,
          "postDate": "2025-03-25T11:51:05.980Z",
          "content": "<p>Hello, have you tried multi - scale 3D UNet?</p>",
          "rawMarkdown": "Hello, have you tried multi - scale 3D UNet?",
          "replies": [
            {
              "id": 3159809,
              "postDate": "2025-03-26T00:00:43.767Z",
              "content": "<p>Yeah. Also deep supervision. They all suck.</p>",
              "rawMarkdown": "Yeah. Also deep supervision. They all suck.",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 3157180,
      "postDate": "2025-03-23T05:01:54.497Z",
      "content": "<p>I tried 3d unet at early stages as well, it was easy to overfit the train data (of which I can confirm there should be no bug in the pipeline), but hard to generalize even on local validations.  </p>",
      "rawMarkdown": "I tried 3d unet at early stages as well, it was easy to overfit the train data (of which I can confirm there should be no bug in the pipeline), but hard to generalize even on local validations.  ",
      "votes": 3
    },
    {
      "id": 3156105,
      "postDate": "2025-03-21T18:25:22.947Z",
      "content": "<p>I tried some minimal unets but always faced outofmemory errors</p>",
      "rawMarkdown": "I tried some minimal unets but always faced outofmemory errors",
      "votes": 3
    },
    {
      "id": 3159571,
      "postDate": "2025-03-25T18:41:44.123Z",
      "content": "<p>Hey <a href=\"https://www.kaggle.com/snehalverma10\" target=\"_blank\">@snehalverma10</a>, my experiments with U-Net didn't achieved competitive results so far, but it's possible to \"make it work\" and score with it. I got a 0.387 LB score with a u-net arch.</p>",
      "rawMarkdown": "Hey @snehalverma10, my experiments with U-Net didn't achieved competitive results so far, but it's possible to \"make it work\" and score with it. I got a 0.387 LB score with a u-net arch.",
      "votes": 1,
      "replies": [
        {
          "id": 3163485,
          "postDate": "2025-03-30T20:59:23.793Z",
          "content": "<p>What loss function / other hyperparams did you use to get this on Unet?</p>",
          "rawMarkdown": "What loss function / other hyperparams did you use to get this on Unet?"
        }
      ]
    },
    {
      "id": 3153467,
      "postDate": "2025-03-18T21:10:21.873Z",
      "content": "<p><code>I can't seem to get unet style arch to work</code><br>\nWhat exactly do you mean by that? That it performs poorly compared to YOLO in ur experiments, it takes too much time for inference or something else?　<a href=\"https://www.kaggle.com/snehalverma10\" target=\"_blank\">@snehalverma10</a></p>",
      "rawMarkdown": "`I can't seem to get unet style arch to work`\nWhat exactly do you mean by that? That it performs poorly compared to YOLO in ur experiments, it takes too much time for inference or something else?　@snehalverma10",
      "votes": 1,
      "replies": [
        {
          "id": 3153472,
          "postDate": "2025-03-18T21:24:04.283Z",
          "content": "<p>Yes it performs poorly. I haven't tried yolo yet but unet is struggling to reduce dice loss at all/converges very slowly which I find unusual</p>",
          "rawMarkdown": "Yes it performs poorly. I haven't tried yolo yet but unet is struggling to reduce dice loss at all/converges very slowly which I find unusual",
          "votes": 1,
          "replies": [
            {
              "id": 3153474,
              "postDate": "2025-03-18T21:34:25.030Z",
              "rawMarkdown": "",
              "isDeleted": true
            },
            {
              "id": 3153511,
              "postDate": "2025-03-18T23:01:36.773Z",
              "content": "<p>What are your labels looking like?</p>",
              "rawMarkdown": "What are your labels looking like?",
              "votes": 1
            },
            {
              "id": 3153519,
              "postDate": "2025-03-18T23:18:55.880Z",
              "content": "<p>Dice loss will collapse with sparse labels. </p>\n<p>This is because the model \"cheats\" and predicts all 0s. See this CZII post <a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/551740\" target=\"_blank\">here</a>.</p>\n<p>I would recommend trying out <code>BCEWithLogitsLoss</code> and setting the <code>pos_weight</code> parameter. This is much more stable. </p>",
              "rawMarkdown": "Dice loss will collapse with sparse labels. \n\nThis is because the model \"cheats\" and predicts all 0s. See this CZII post [here] (https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/551740).\n\nI would recommend trying out `BCEWithLogitsLoss` and setting the `pos_weight` parameter. This is much more stable. ",
              "votes": 9
            },
            {
              "id": 3153546,
              "postDate": "2025-03-19T00:49:24.780Z",
              "content": "<p><a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> if i understood correctly it's just logloss with sigmoid in one line, so u don't need to include sigmoid into the model class. If so, i don't really get how you use it. Are you predicting class label for each voxel? </p>",
              "rawMarkdown": "@brendanartley if i understood correctly it's just logloss with sigmoid in one line, so u don't need to include sigmoid into the model class. If so, i don't really get how you use it. Are you predicting class label for each voxel? ",
              "votes": 1
            },
            {
              "id": 3153700,
              "postDate": "2025-03-19T04:34:26.667Z",
              "content": "<p>Correct. Currently predicting a class label for each voxel.</p>",
              "rawMarkdown": "Correct. Currently predicting a class label for each voxel.",
              "votes": 2
            },
            {
              "id": 3155564,
              "postDate": "2025-03-21T06:47:00.570Z",
              "content": "<p>Have you solved the slow convergence problem? In my implementation, I also got this problem.</p>",
              "rawMarkdown": "Have you solved the slow convergence problem? In my implementation, I also got this problem.",
              "votes": 1
            },
            {
              "id": 3155842,
              "postDate": "2025-03-21T13:15:27.883Z",
              "content": "<p>Not yet. Currently working on this as well!</p>",
              "rawMarkdown": "Not yet. Currently working on this as well!"
            },
            {
              "id": 3156174,
              "postDate": "2025-03-21T20:29:37.160Z",
              "content": "<p><a href=\"https://www.kaggle.com/andreizamfir\" target=\"_blank\">@andreizamfir</a> Labels are spheres with radius 1000angstroms divided by the given voxel_spacing. Is this a mistake?</p>",
              "rawMarkdown": "@andreizamfir Labels are spheres with radius 1000angstroms divided by the given voxel_spacing. Is this a mistake?",
              "votes": 2
            },
            {
              "id": 3156777,
              "postDate": "2025-03-22T14:21:03.467Z",
              "content": "<p>What drove your decision of using 1000 angstroms divided by voxel spacing? The threshold, I assume. In most cases, labels should not be derived by objective metrics like this, they're a crucial part of supervised learning and it's what the model learns to detect. </p>\n<p>Imagine you train YOLO to detect cars in diverse scenery. Would you want the label to include as much of the car as possible and as little of the background as possible or would you want to include trees/pavement/people? This example can be extrapolated to 3D.</p>\n<p>In short, labels should be representative for features you want your model to be able to learn. Flagellar motors are nowhere near 1000 angstroms in size.</p>",
              "rawMarkdown": "What drove your decision of using 1000 angstroms divided by voxel spacing? The threshold, I assume. In most cases, labels should not be derived by objective metrics like this, they're a crucial part of supervised learning and it's what the model learns to detect. \n\nImagine you train YOLO to detect cars in diverse scenery. Would you want the label to include as much of the car as possible and as little of the background as possible or would you want to include trees/pavement/people? This example can be extrapolated to 3D.\n\nIn short, labels should be representative for features you want your model to be able to learn. Flagellar motors are nowhere near 1000 angstroms in size.",
              "votes": 6
            },
            {
              "id": 3157024,
              "postDate": "2025-03-22T21:07:56.717Z",
              "content": "<p>That makes a lot of sense thanks so much <a href=\"https://www.kaggle.com/andreizamfir\" target=\"_blank\">@andreizamfir</a> </p>",
              "rawMarkdown": "That makes a lot of sense thanks so much @andreizamfir "
            }
          ]
        }
      ]
    },
    {
      "id": 3160011,
      "postDate": "2025-03-26T08:06:40.867Z",
      "content": "<p>I also used 3DUNet at first, but I got a out of memory error and ended up trying it with a batch size of 1, and the LB score was less than 0.2.</p>",
      "rawMarkdown": "I also used 3DUNet at first, but I got a out of memory error and ended up trying it with a batch size of 1, and the LB score was less than 0.2."
    }
  ],
  "comments": [
    {
      "id": 3158612,
      "author_name": "Tom",
      "author_url": "",
      "post_date": "2025-03-24T17:45:31.233000",
      "content": "<p>I currently work on label development. I found that 3d unet is very hard to capture the motor if we give a single voxel, even using class_weight. Gaussian ball does not work as well cause it cannot show strong connection between label and image. Other methods from czii do not work. Their performance are bad. Maybe structural target can show up.</p>",
      "votes": 5,
      "replies": [
        {
          "id": 3159232,
          "author_name": "Switch9527",
          "author_url": "",
          "post_date": "2025-03-25T11:51:05.980000",
          "content": "<p>Hello, have you tried multi - scale 3D UNet?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 3159809,
              "author_name": "Tom",
              "author_url": "",
              "post_date": "2025-03-26T00:00:43.767000",
              "content": "<p>Yeah. Also deep supervision. They all suck.</p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3157180,
      "author_name": "Yksin Young",
      "author_url": "",
      "post_date": "2025-03-23T05:01:54.497000",
      "content": "<p>I tried 3d unet at early stages as well, it was easy to overfit the train data (of which I can confirm there should be no bug in the pipeline), but hard to generalize even on local validations.  </p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 3156105,
      "author_name": "Umar IGAN",
      "author_url": "",
      "post_date": "2025-03-21T18:25:22.947000",
      "content": "<p>I tried some minimal unets but always faced outofmemory errors</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 3159571,
      "author_name": "Sergio Alvarez",
      "author_url": "",
      "post_date": "2025-03-25T18:41:44.123000",
      "content": "<p>Hey <a href=\"https://www.kaggle.com/snehalverma10\" target=\"_blank\">@snehalverma10</a>, my experiments with U-Net didn't achieved competitive results so far, but it's possible to \"make it work\" and score with it. I got a 0.387 LB score with a u-net arch.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 3163485,
          "author_name": "Henry Hornung",
          "author_url": "",
          "post_date": "2025-03-30T20:59:23.793000",
          "content": "<p>What loss function / other hyperparams did you use to get this on Unet?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 3153467,
      "author_name": "eikyou",
      "author_url": "",
      "post_date": "2025-03-18T21:10:21.873000",
      "content": "<p><code>I can't seem to get unet style arch to work</code><br>\nWhat exactly do you mean by that? That it performs poorly compared to YOLO in ur experiments, it takes too much time for inference or something else?　<a href=\"https://www.kaggle.com/snehalverma10\" target=\"_blank\">@snehalverma10</a></p>",
      "votes": 1,
      "replies": [
        {
          "id": 3153472,
          "author_name": "snehal",
          "author_url": "",
          "post_date": "2025-03-18T21:24:04.283000",
          "content": "<p>Yes it performs poorly. I haven't tried yolo yet but unet is struggling to reduce dice loss at all/converges very slowly which I find unusual</p>",
          "votes": 1,
          "replies": [
            {
              "id": 3153474,
              "author_name": "",
              "author_url": "",
              "post_date": "2025-03-18T21:34:25.030000",
              "content": "",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3153511,
              "author_name": "Andrei Zamfir",
              "author_url": "",
              "post_date": "2025-03-18T23:01:36.773000",
              "content": "<p>What are your labels looking like?</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3153519,
              "author_name": "Bartley",
              "author_url": "",
              "post_date": "2025-03-18T23:18:55.880000",
              "content": "<p>Dice loss will collapse with sparse labels. </p>\n<p>This is because the model \"cheats\" and predicts all 0s. See this CZII post <a href=\"https://www.kaggle.com/competitions/czii-cryo-et-object-identification/discussion/551740\" target=\"_blank\">here</a>.</p>\n<p>I would recommend trying out <code>BCEWithLogitsLoss</code> and setting the <code>pos_weight</code> parameter. This is much more stable. </p>",
              "votes": 9,
              "replies": []
            },
            {
              "id": 3153546,
              "author_name": "eikyou",
              "author_url": "",
              "post_date": "2025-03-19T00:49:24.780000",
              "content": "<p><a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> if i understood correctly it's just logloss with sigmoid in one line, so u don't need to include sigmoid into the model class. If so, i don't really get how you use it. Are you predicting class label for each voxel? </p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3153700,
              "author_name": "Bartley",
              "author_url": "",
              "post_date": "2025-03-19T04:34:26.667000",
              "content": "<p>Correct. Currently predicting a class label for each voxel.</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 3155564,
              "author_name": "AnnieGo",
              "author_url": "",
              "post_date": "2025-03-21T06:47:00.570000",
              "content": "<p>Have you solved the slow convergence problem? In my implementation, I also got this problem.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 3155842,
              "author_name": "Bartley",
              "author_url": "",
              "post_date": "2025-03-21T13:15:27.883000",
              "content": "<p>Not yet. Currently working on this as well!</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3156174,
              "author_name": "snehal",
              "author_url": "",
              "post_date": "2025-03-21T20:29:37.160000",
              "content": "<p><a href=\"https://www.kaggle.com/andreizamfir\" target=\"_blank\">@andreizamfir</a> Labels are spheres with radius 1000angstroms divided by the given voxel_spacing. Is this a mistake?</p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 3156777,
              "author_name": "Andrei Zamfir",
              "author_url": "",
              "post_date": "2025-03-22T14:21:03.467000",
              "content": "<p>What drove your decision of using 1000 angstroms divided by voxel spacing? The threshold, I assume. In most cases, labels should not be derived by objective metrics like this, they're a crucial part of supervised learning and it's what the model learns to detect. </p>\n<p>Imagine you train YOLO to detect cars in diverse scenery. Would you want the label to include as much of the car as possible and as little of the background as possible or would you want to include trees/pavement/people? This example can be extrapolated to 3D.</p>\n<p>In short, labels should be representative for features you want your model to be able to learn. Flagellar motors are nowhere near 1000 angstroms in size.</p>",
              "votes": 6,
              "replies": []
            },
            {
              "id": 3157024,
              "author_name": "snehal",
              "author_url": "",
              "post_date": "2025-03-22T21:07:56.717000",
              "content": "<p>That makes a lot of sense thanks so much <a href=\"https://www.kaggle.com/andreizamfir\" target=\"_blank\">@andreizamfir</a> </p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3160011,
      "author_name": "sakaitt",
      "author_url": "",
      "post_date": "2025-03-26T08:06:40.867000",
      "content": "<p>I also used 3DUNet at first, but I got a out of memory error and ended up trying it with a batch size of 1, and the LB score was less than 0.2.</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3153463": "How come everyone is using YOLO in this comp? I can't seem to get unet style arch to work has anyone else had success with this?",
    "3158612": "I currently work on label development. I found that 3d unet is very hard to capture the motor if we give a single voxel, even using class_weight. Gaussian ball does not work as well cause it cannot show strong connection between label and image. Other methods from czii do not work. Their performance are bad. Maybe structural target can show up.",
    "3157180": "I tried 3d unet at early stages as well, it was easy to overfit the train data (of which I can confirm there should be no bug in the pipeline), but hard to generalize even on local validations.  ",
    "3156105": "I tried some minimal unets but always faced outofmemory errors",
    "3159571": "Hey @snehalverma10, my experiments with U-Net didn't achieved competitive results so far, but it's possible to \"make it work\" and score with it. I got a 0.387 LB score with a u-net arch.",
    "3153467": "`I can't seem to get unet style arch to work`\nWhat exactly do you mean by that? That it performs poorly compared to YOLO in ur experiments, it takes too much time for inference or something else?　@snehalverma10",
    "3160011": "I also used 3DUNet at first, but I got a out of memory error and ended up trying it with a batch size of 1, and the LB score was less than 0.2."
  }
}