{
  "id": 347267,
  "title": "Why my lb score only achieves 0.04?",
  "url": "/competitions/hubmap-organ-segmentation/discussion/347267",
  "author_name": "",
  "post_date": "2022-08-23T15:09:51.148113600Z",
  "votes": 1,
  "comment_count": 11,
  "views": 0,
  "content": "<p>In my local machince, the model performace is good and the code  is the same as the submited, what's the possible reason for it?</p>",
  "messages": [
    {
      "id": "1910630",
      "postDate": "08/23/2022 15:09:51",
      "content": "<p>In my local machince, the model performace is good and the code  is the same as the submited, what's the possible reason for it?</p>",
      "rawMarkdown": "In my local machince, the model performace is good and the code  is the same as the submited, what's the possible reason for it?",
      "votes": null
    },
    {
      "id": "1910945",
      "postDate": "08/23/2022 19:48:22",
      "content": "<p>In your local machine you are calculating the model performance on the test data from the public data… On the other hand on lb your model performance is calculated on hidden test data… Now the possible reason is that:<br>\n0.) You are overfitting badly on the train set<br>\n1.) You haven't split the data properly<br>\n2.) The distribution of test set is different from training set (but given the people achieving good score on lb, I'd rule out this possibility)</p>",
      "rawMarkdown": "In your local machine you are calculating the model performance on the test data from the public data... On the other hand on lb your model performance is calculated on hidden test data... Now the possible reason is that:\n0.) You are overfitting badly on the train set\n1.) You haven't split the data properly\n2.) The distribution of test set is different from training set (but given the people achieving good score on lb, I'd rule out this possibility)",
      "votes": null
    },
    {
      "id": "1911009",
      "postDate": "08/23/2022 21:32:05",
      "content": "<p>Even for a poor model I'd expect a bit more than 0.04, perhaps your preprocessing of the test image is poor eg. your train pipeline might be using BGR2RGB but your kaggle submission missed this , maybe image size related issues?<br>\nAnother could be your RLE function not working as intended.</p>\n<p>I would check your submission on the test image they give us and compare to some of the posts in this thread: <a href=\"https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/343117\" target=\"_blank\">https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/343117</a></p>",
      "rawMarkdown": "Even for a poor model I'd expect a bit more than 0.04, perhaps your preprocessing of the test image is poor eg. your train pipeline might be using BGR2RGB but your kaggle submission missed this , maybe image size related issues?\nAnother could be your RLE function not working as intended.\n\nI would check your submission on the test image they give us and compare to some of the posts in this thread: https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/343117",
      "votes": null
    },
    {
      "id": "1911777",
      "postDate": "08/24/2022 09:57:41",
      "content": "<p><a href=\"https://www.kaggle.com/maxvandijck\" target=\"_blank\">@maxvandijck</a> I think my model prediction is not quite different from those posts, thanks very much if you can help me check with it! That's really strange, I set the mask to random values to submit and the lb is 0.12😂, better than mine</p>",
      "rawMarkdown": "maxvandijck I think my model prediction is not quite different from those posts, thanks very much if you can help me check with it! That's really strange, I set the mask to random values to submit and the lb is 0.12😂, better than mine",
      "votes": null
    },
    {
      "id": "1911809",
      "postDate": "08/24/2022 10:26:25",
      "content": "<p>That's my model predict on the test image:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F11197532%2Ff87d46b3adb41618cd855e2364813e27%2Fpredict.png?generation=1661336742733126&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "That's my model predict on the test image:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F11197532%2Ff87d46b3adb41618cd855e2364813e27%2Fpredict.png?generation=1661336742733126&alt=media)",
      "votes": null
    },
    {
      "id": "1912015",
      "postDate": "08/24/2022 13:08:42",
      "content": "<p>Check if your rle is transposed</p>",
      "rawMarkdown": "Check if your rle is transposed",
      "votes": null
    },
    {
      "id": "1912096",
      "postDate": "08/24/2022 14:00:01",
      "content": "<p>Thanks. I have been thinking about it and here is my rle code:<br>\ndef rle_encode(img):<br>\n    pixels = img.T.flatten()<br>\n    pixels[0] = 0<br>\n    pixels[-1] = 0<br>\n    runs = np.where(pixels[1:] != pixels[:-1])[0] + 2<br>\n    runs[1::2] -= runs[::2]<br>\n    return ' '.join(str(x) for x in runs)</p>\n<p>I have tried to drop <strong>.T</strong> and the result is still very low ☹️.</p>",
      "rawMarkdown": "Thanks. I have been thinking about it and here is my rle code:\ndef rle_encode(img):\n    pixels = img.T.flatten()\n    pixels[0] = 0\n    pixels[-1] = 0\n    runs = np.where(pixels[1:] != pixels[:-1])[0] + 2\n    runs[1::2] -= runs[::2]\n    return ' '.join(str(x) for x in runs)\n\nI have tried to drop **.T** and the result is still very low ☹️.",
      "votes": null
    },
    {
      "id": "1912411",
      "postDate": "08/24/2022 17:48:43",
      "content": "<p>That looks fine. May be something happens when running on the public test set  which results in blank rle 🤔</p>",
      "rawMarkdown": "That looks fine. May be something happens when running on the public test set  which results in blank rle 🤔",
      "votes": null
    },
    {
      "id": "1912449",
      "postDate": "08/24/2022 18:17:53",
      "content": "<p>This is a quite good prediction for the hubmap spleen. but your score is quite low. <br>\nHubmap scales should be considered when making a submission</p>",
      "rawMarkdown": "This is a quite good prediction for the hubmap spleen. but your score is quite low. \nHubmap scales should be considered when making a submission",
      "votes": null
    },
    {
      "id": "1912911",
      "postDate": "08/25/2022 03:27:29",
      "content": "<p>Solved! Thanks everyone. What I did is avoiding reading test.csv，all the information are obtained from dir test_images </p>",
      "rawMarkdown": "Solved! Thanks everyone. What I did is avoiding reading test.csv，all the information are obtained from dir test_images",
      "votes": null
    },
    {
      "id": "1913257",
      "postDate": "08/25/2022 09:02:04",
      "content": "<p>there is some bug in you code.<br>\nusing csv file is ok for me.<br>\n'../input/hubmap-organ-segmentation/test.csv'</p>",
      "rawMarkdown": "there is some bug in you code.\nusing csv file is ok for me.\n'../input/hubmap-organ-segmentation/test.csv'",
      "votes": null
    },
    {
      "id": "1913929",
      "postDate": "08/25/2022 15:27:23",
      "content": "<p>I doubt the possible bug is that I used  'os.path.join' to create the path of test.csv instead of '../input/hubmap-organ-segmentation/test.csv', but I haven't checked it.</p>",
      "rawMarkdown": "I doubt the possible bug is that I used  'os.path.join' to create the path of test.csv instead of '../input/hubmap-organ-segmentation/test.csv', but I haven't checked it.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1910945,
      "author_name": "anitho2910",
      "author_url": "",
      "post_date": "08/23/2022 19:48:22",
      "content": "<p>In your local machine you are calculating the model performance on the test data from the public data… On the other hand on lb your model performance is calculated on hidden test data… Now the possible reason is that:<br>\n0.) You are overfitting badly on the train set<br>\n1.) You haven't split the data properly<br>\n2.) The distribution of test set is different from training set (but given the people achieving good score on lb, I'd rule out this possibility)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1911009,
      "author_name": "maxvandijck",
      "author_url": "",
      "post_date": "08/23/2022 21:32:05",
      "content": "<p>Even for a poor model I'd expect a bit more than 0.04, perhaps your preprocessing of the test image is poor eg. your train pipeline might be using BGR2RGB but your kaggle submission missed this , maybe image size related issues?<br>\nAnother could be your RLE function not working as intended.</p>\n<p>I would check your submission on the test image they give us and compare to some of the posts in this thread: <a href=\"https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/343117\" target=\"_blank\">https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/343117</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1911777,
      "author_name": "resonwang",
      "author_url": "",
      "post_date": "08/24/2022 09:57:41",
      "content": "<p><a href=\"https://www.kaggle.com/maxvandijck\" target=\"_blank\">@maxvandijck</a> I think my model prediction is not quite different from those posts, thanks very much if you can help me check with it! That's really strange, I set the mask to random values to submit and the lb is 0.12😂, better than mine</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1911809,
      "author_name": "resonwang",
      "author_url": "",
      "post_date": "08/24/2022 10:26:25",
      "content": "<p>That's my model predict on the test image:<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F11197532%2Ff87d46b3adb41618cd855e2364813e27%2Fpredict.png?generation=1661336742733126&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 1912449,
          "author_name": "deepkim",
          "author_url": "",
          "post_date": "08/24/2022 18:17:53",
          "content": "<p>This is a quite good prediction for the hubmap spleen. but your score is quite low. <br>\nHubmap scales should be considered when making a submission</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1912015,
      "author_name": "riyasvk",
      "author_url": "",
      "post_date": "08/24/2022 13:08:42",
      "content": "<p>Check if your rle is transposed</p>",
      "votes": null,
      "replies": [
        {
          "id": 1912096,
          "author_name": "resonwang",
          "author_url": "",
          "post_date": "08/24/2022 14:00:01",
          "content": "<p>Thanks. I have been thinking about it and here is my rle code:<br>\ndef rle_encode(img):<br>\n    pixels = img.T.flatten()<br>\n    pixels[0] = 0<br>\n    pixels[-1] = 0<br>\n    runs = np.where(pixels[1:] != pixels[:-1])[0] + 2<br>\n    runs[1::2] -= runs[::2]<br>\n    return ' '.join(str(x) for x in runs)</p>\n<p>I have tried to drop <strong>.T</strong> and the result is still very low ☹️.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1912411,
          "author_name": "riyasvk",
          "author_url": "",
          "post_date": "08/24/2022 17:48:43",
          "content": "<p>That looks fine. May be something happens when running on the public test set  which results in blank rle 🤔</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1912911,
      "author_name": "resonwang",
      "author_url": "",
      "post_date": "08/25/2022 03:27:29",
      "content": "<p>Solved! Thanks everyone. What I did is avoiding reading test.csv，all the information are obtained from dir test_images </p>",
      "votes": null,
      "replies": [
        {
          "id": 1913257,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "08/25/2022 09:02:04",
          "content": "<p>there is some bug in you code.<br>\nusing csv file is ok for me.<br>\n'../input/hubmap-organ-segmentation/test.csv'</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1913929,
          "author_name": "resonwang",
          "author_url": "",
          "post_date": "08/25/2022 15:27:23",
          "content": "<p>I doubt the possible bug is that I used  'os.path.join' to create the path of test.csv instead of '../input/hubmap-organ-segmentation/test.csv', but I haven't checked it.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1910630": "In my local machince, the model performace is good and the code  is the same as the submited, what's the possible reason for it?",
    "1910945": "In your local machine you are calculating the model performance on the test data from the public data... On the other hand on lb your model performance is calculated on hidden test data... Now the possible reason is that:\n0.) You are overfitting badly on the train set\n1.) You haven't split the data properly\n2.) The distribution of test set is different from training set (but given the people achieving good score on lb, I'd rule out this possibility)",
    "1911009": "Even for a poor model I'd expect a bit more than 0.04, perhaps your preprocessing of the test image is poor eg. your train pipeline might be using BGR2RGB but your kaggle submission missed this , maybe image size related issues?\nAnother could be your RLE function not working as intended.\n\nI would check your submission on the test image they give us and compare to some of the posts in this thread: https://www.kaggle.com/competitions/hubmap-organ-segmentation/discussion/343117",
    "1911777": "maxvandijck I think my model prediction is not quite different from those posts, thanks very much if you can help me check with it! That's really strange, I set the mask to random values to submit and the lb is 0.12😂, better than mine",
    "1911809": "That's my model predict on the test image:\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F11197532%2Ff87d46b3adb41618cd855e2364813e27%2Fpredict.png?generation=1661336742733126&alt=media)",
    "1912015": "Check if your rle is transposed",
    "1912096": "Thanks. I have been thinking about it and here is my rle code:\ndef rle_encode(img):\n    pixels = img.T.flatten()\n    pixels[0] = 0\n    pixels[-1] = 0\n    runs = np.where(pixels[1:] != pixels[:-1])[0] + 2\n    runs[1::2] -= runs[::2]\n    return ' '.join(str(x) for x in runs)\n\nI have tried to drop **.T** and the result is still very low ☹️.",
    "1912411": "That looks fine. May be something happens when running on the public test set  which results in blank rle 🤔",
    "1912449": "This is a quite good prediction for the hubmap spleen. but your score is quite low. \nHubmap scales should be considered when making a submission",
    "1912911": "Solved! Thanks everyone. What I did is avoiding reading test.csv，all the information are obtained from dir test_images",
    "1913257": "there is some bug in you code.\nusing csv file is ok for me.\n'../input/hubmap-organ-segmentation/test.csv'",
    "1913929": "I doubt the possible bug is that I used  'os.path.join' to create the path of test.csv instead of '../input/hubmap-organ-segmentation/test.csv', but I haven't checked it."
  },
  "source": "meta"
}