{
  "id": 71739,
  "title": "What's your lb score jump with increase in image size?",
  "url": "/competitions/human-protein-atlas-image-classification/discussion/71739",
  "author_name": "",
  "post_date": "2018-11-16T04:56:56.633221300Z",
  "votes": 5,
  "comment_count": 18,
  "views": 0,
  "content": "<p>I was initially using 224x224 images with a resnet50 backbone and topping at around 0.400 in the lb. I started using the 512x512 images with some changes to my network to adjust for the image size and used the weights from the smaller images and got a score of 0.450, a 0.05 point jump.</p>\n\n<p>What's been your jump? I also want to know the jump in score in case you're using the full sized images. I'm contemplating using them, but I want to be sure before I download a ludicrous 250GB archive.</p>",
  "messages": [
    {
      "id": "422339",
      "postDate": "11/16/2018 04:56:56",
      "content": "<p>I was initially using 224x224 images with a resnet50 backbone and topping at around 0.400 in the lb. I started using the 512x512 images with some changes to my network to adjust for the image size and used the weights from the smaller images and got a score of 0.450, a 0.05 point jump.</p>\n\n<p>What's been your jump? I also want to know the jump in score in case you're using the full sized images. I'm contemplating using them, but I want to be sure before I download a ludicrous 250GB archive.</p>",
      "rawMarkdown": "I was initially using 224x224 images with a resnet50 backbone and topping at around 0.400 in the lb. I started using the 512x512 images with some changes to my network to adjust for the image size and used the weights from the smaller images and got a score of 0.450, a 0.05 point jump.\n\nWhat's been your jump? I also want to know the jump in score in case you're using the full sized images. I'm contemplating using them, but I want to be sure before I download a ludicrous 250GB archive.",
      "votes": null
    },
    {
      "id": "422382",
      "postDate": "11/16/2018 06:28:50",
      "content": "<p>So far my best comes from my 512x512 models. Going to be days still for the larger models, they are taking a long time to train.</p>",
      "rawMarkdown": "So far my best comes from my 512x512 models. Going to be days still for the larger models, they are taking a long time to train.",
      "votes": null
    },
    {
      "id": "422547",
      "postDate": "11/16/2018 11:45:41",
      "content": "<p>With 224 by 224 and RestNet50, I also got around 0.400, when I increased to 512 by 512, the best result is 0.498. So I think the resolution is really important. Now I am gonna try full size, 2048 by 2048</p>",
      "rawMarkdown": "With 224 by 224 and RestNet50, I also got around 0.400, when I increased to 512 by 512, the best result is 0.498. So I think the resolution is really important. Now I am gonna try full size, 2048 by 2048",
      "votes": null
    },
    {
      "id": "422581",
      "postDate": "11/16/2018 12:50:59",
      "content": "<p>I'm optimizing my models at 224px and was planning to up to 512px. In the \"real world\" I rarely see huge performance gains from resolution increases past a certain point, but this is largely because the classes are quite large objects, or clusters of small objects.</p>\n\n<p>For small cell components the fine details may prove essential for success. Some of the classes requested here are quite small. At some point increasing the pixel resolution will make no difference as you reach optical limits (or you are looking a big group of labels in one place), and your cluster of fluorescent labels stuck to your target protein is likely larger than the target protein itself anyway. I am ASSUMING they are imaged at 40X/1.25NA(???).</p>\n\n<p>I do think 2048px should still provide more information. This may be helpful to some: <a href=\"http://www.bio.brandeis.edu/CIL/Applications%20notes/Leica%20tutorials/Zoom%20and%20Resolution.pdf\">http://www.bio.brandeis.edu/CIL/Applications%20notes/Leica%20tutorials/Zoom%20and%20Resolution.pdf</a></p>\n\n<p>I'm curious what hardware people are using for 2048px images? I have access to a single GTX 1080, and I am hoping this will be enough. With augmentation and a deep network I expect it to be like swimming through concrete...</p>",
      "rawMarkdown": "I'm optimizing my models at 224px and was planning to up to 512px. In the \"real world\" I rarely see huge performance gains from resolution increases past a certain point, but this is largely because the classes are quite large objects, or clusters of small objects.\n\nFor small cell components the fine details may prove essential for success. Some of the classes requested here are quite small. At some point increasing the pixel resolution will make no difference as you reach optical limits (or you are looking a big group of labels in one place), and your cluster of fluorescent labels stuck to your target protein is likely larger than the target protein itself anyway. I am ASSUMING they are imaged at 40X/1.25NA(???).\n\nI do think 2048px should still provide more information. This may be helpful to some: http://www.bio.brandeis.edu/CIL/Applications%20notes/Leica%20tutorials/Zoom%20and%20Resolution.pdf\n\nI'm curious what hardware people are using for 2048px images? I have access to a single GTX 1080, and I am hoping this will be enough. With augmentation and a deep network I expect it to be like swimming through concrete...",
      "votes": null
    },
    {
      "id": "422668",
      "postDate": "11/16/2018 15:43:44",
      "content": "<p>I don't think a 1080 has enough memory. I am using a Titan X Maxwell and with 12gb ram and 2048px is difficult. With only 8gb, I'd think 1024 would be the upper limit. </p>",
      "rawMarkdown": "I don't think a 1080 has enough memory. I am using a Titan X Maxwell and with 12gb ram and 2048px is difficult. With only 8gb, I'd think 1024 would be the upper limit.",
      "votes": null
    },
    {
      "id": "422670",
      "postDate": "11/16/2018 15:45:01",
      "content": "<p>I'm not even trying 1024 anymore,  my largest model in testing use 768px.</p>",
      "rawMarkdown": "I'm not even trying 1024 anymore,  my largest model in testing use 768px.",
      "votes": null
    },
    {
      "id": "422677",
      "postDate": "11/16/2018 16:01:12",
      "content": "<p>Indeed, to be able to use 2048px images, I think 32 GB memory is needed.</p>",
      "rawMarkdown": "Indeed, to be able to use 2048px images, I think 32 GB memory is needed.",
      "votes": null
    },
    {
      "id": "422716",
      "postDate": "11/16/2018 17:01:20",
      "content": "<p>Interesting thread. I can run 512 with batch size 32 but not 64, on my Ti1080 (12 GB). But I do not have a reasonable calculation that shows why this is so. Can anyone enlighten me?</p>",
      "rawMarkdown": "Interesting thread. I can run 512 with batch size 32 but not 64, on my Ti1080 (12 GB). But I do not have a reasonable calculation that shows why this is so. Can anyone enlighten me?",
      "votes": null
    },
    {
      "id": "422745",
      "postDate": "11/16/2018 17:57:28",
      "content": "<p>Thanks for your inputs everyone. BTW I have a gtx1070 8GB. Before I started downloading the full sized images, I wanted to make sure that I could get some dummy 2048 sized images through my network but it appears that I get \"Out of Memory\" issues. So hardware wise, it appears Im tapped out for that size at least.</p>",
      "rawMarkdown": "Thanks for your inputs everyone. BTW I have a gtx1070 8GB. Before I started downloading the full sized images, I wanted to make sure that I could get some dummy 2048 sized images through my network but it appears that I get \"Out of Memory\" issues. So hardware wise, it appears Im tapped out for that size at least.",
      "votes": null
    },
    {
      "id": "422747",
      "postDate": "11/16/2018 18:04:09",
      "content": "<p>I'm guessing that at that image size, batch size and network parameters, all the weights matrices that the network constructs is what maxes out the memory. When I got OOM (Out of memory) issues in Keras/Tensorflow, it would usually say something like \"resource exhausted when allocating tensor of shape [4, 256, 256, 512]\".</p>",
      "rawMarkdown": "I'm guessing that at that image size, batch size and network parameters, all the weights matrices that the network constructs is what maxes out the memory. When I got OOM (Out of memory) issues in Keras/Tensorflow, it would usually say something like \"resource exhausted when allocating tensor of shape [4, 256, 256, 512]\".",
      "votes": null
    },
    {
      "id": "422780",
      "postDate": "11/16/2018 19:11:45",
      "content": "<p>About 0.03 for me, going from 256 to 512. But I expect diminished returns when you keep going up, which I don't have the resources for anyway.</p>",
      "rawMarkdown": "About 0.03 for me, going from 256 to 512. But I expect diminished returns when you keep going up, which I don't have the resources for anyway.",
      "votes": null
    },
    {
      "id": "423047",
      "postDate": "11/17/2018 10:38:17",
      "content": "<p>I can train at 1024px with a batch size of 32 on a single 1080 ti and it takes about 20 mins per epoch. Currently it's no better than at 512 and is far too slow to iterate so I'm going to abandon for now, sick of memory issues. </p>\n\n<p>I really think one can get far in this competition by ignoring the larger images and spending more time on CV design to address class imbalance.</p>",
      "rawMarkdown": "I can train at 1024px with a batch size of 32 on a single 1080 ti and it takes about 20 mins per epoch. Currently it's no better than at 512 and is far too slow to iterate so I'm going to abandon for now, sick of memory issues. \n\nI really think one can get far in this competition by ignoring the larger images and spending more time on CV design to address class imbalance.",
      "votes": null
    },
    {
      "id": "423101",
      "postDate": "11/17/2018 13:28:11",
      "content": "<p>Good to know, thanks. I think I'll stick to 512. I have a Tesla at work with more memory but I don't think it's worth it.</p>",
      "rawMarkdown": "Good to know, thanks. I think I'll stick to 512. I have a Tesla at work with more memory but I don't think it's worth it.",
      "votes": null
    },
    {
      "id": "424910",
      "postDate": "11/20/2018 21:44:42",
      "content": "<p>256-&gt;512 LB 0.454 -&gt; 0.49, all other things equal</p>",
      "rawMarkdown": "256-&gt;512 LB 0.454 -&gt; 0.49, all other things equal",
      "votes": null
    },
    {
      "id": "425373",
      "postDate": "11/21/2018 14:04:45",
      "content": "<p>I see an improvement of about +0.04 when going from 256 -&gt; 512\nI am currently limited by the memory of my 1080 Ti and I can hardly increase the size any more</p>",
      "rawMarkdown": "I see an improvement of about +0.04 when going from 256 -&gt; 512\nI am currently limited by the memory of my 1080 Ti and I can hardly increase the size any more",
      "votes": null
    },
    {
      "id": "432706",
      "postDate": "12/04/2018 08:18:32",
      "content": "<p>Hi, what loss function do you use?</p>",
      "rawMarkdown": "Hi, what loss function do you use?",
      "votes": null
    },
    {
      "id": "433059",
      "postDate": "12/04/2018 16:06:11",
      "content": "<p>I used BCE loss function.</p>",
      "rawMarkdown": "I used BCE loss function.",
      "votes": null
    },
    {
      "id": "433486",
      "postDate": "12/05/2018 05:55:55",
      "content": "",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "433488",
      "postDate": "12/05/2018 05:57:24",
      "content": "<p>hi, have you tried focal loss, does it give better result than bce loss ? In my case, focal loss does not help much.</p>\n\n<p>emm, I found it in <a href=\"https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/70365\">https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/70365</a> thanks.</p>\n\n<blockquote>\n  <p><strong>Zhijian Li wrote</strong></p>\n  \n  <blockquote>\n    <p>I used BCE loss function.</p>\n  </blockquote>\n</blockquote>",
      "rawMarkdown": "hi, have you tried focal loss, does it give better result than bce loss ? In my case, focal loss does not help much.\n\n\nemm, I found it in https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/70365 thanks.\n&gt; **Zhijian Li wrote**\n&gt; \n&gt; &gt; I used BCE loss function.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 422382,
      "author_name": "ldm314",
      "author_url": "",
      "post_date": "11/16/2018 06:28:50",
      "content": "<p>So far my best comes from my 512x512 models. Going to be days still for the larger models, they are taking a long time to train.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 422547,
      "author_name": "zhijianli",
      "author_url": "",
      "post_date": "11/16/2018 11:45:41",
      "content": "<p>With 224 by 224 and RestNet50, I also got around 0.400, when I increased to 512 by 512, the best result is 0.498. So I think the resolution is really important. Now I am gonna try full size, 2048 by 2048</p>",
      "votes": null,
      "replies": [
        {
          "id": 432706,
          "author_name": "yiwei2016",
          "author_url": "",
          "post_date": "12/04/2018 08:18:32",
          "content": "<p>Hi, what loss function do you use?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 433059,
          "author_name": "zhijianli",
          "author_url": "",
          "post_date": "12/04/2018 16:06:11",
          "content": "<p>I used BCE loss function.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 433486,
          "author_name": "zjucor",
          "author_url": "",
          "post_date": "12/05/2018 05:55:55",
          "content": "",
          "votes": null,
          "replies": []
        },
        {
          "id": 433488,
          "author_name": "zjucor",
          "author_url": "",
          "post_date": "12/05/2018 05:57:24",
          "content": "<p>hi, have you tried focal loss, does it give better result than bce loss ? In my case, focal loss does not help much.</p>\n\n<p>emm, I found it in <a href=\"https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/70365\">https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/70365</a> thanks.</p>\n\n<blockquote>\n  <p><strong>Zhijian Li wrote</strong></p>\n  \n  <blockquote>\n    <p>I used BCE loss function.</p>\n  </blockquote>\n</blockquote>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 422581,
      "author_name": "dstjhb",
      "author_url": "",
      "post_date": "11/16/2018 12:50:59",
      "content": "<p>I'm optimizing my models at 224px and was planning to up to 512px. In the \"real world\" I rarely see huge performance gains from resolution increases past a certain point, but this is largely because the classes are quite large objects, or clusters of small objects.</p>\n\n<p>For small cell components the fine details may prove essential for success. Some of the classes requested here are quite small. At some point increasing the pixel resolution will make no difference as you reach optical limits (or you are looking a big group of labels in one place), and your cluster of fluorescent labels stuck to your target protein is likely larger than the target protein itself anyway. I am ASSUMING they are imaged at 40X/1.25NA(???).</p>\n\n<p>I do think 2048px should still provide more information. This may be helpful to some: <a href=\"http://www.bio.brandeis.edu/CIL/Applications%20notes/Leica%20tutorials/Zoom%20and%20Resolution.pdf\">http://www.bio.brandeis.edu/CIL/Applications%20notes/Leica%20tutorials/Zoom%20and%20Resolution.pdf</a></p>\n\n<p>I'm curious what hardware people are using for 2048px images? I have access to a single GTX 1080, and I am hoping this will be enough. With augmentation and a deep network I expect it to be like swimming through concrete...</p>",
      "votes": null,
      "replies": [
        {
          "id": 422668,
          "author_name": "ldm314",
          "author_url": "",
          "post_date": "11/16/2018 15:43:44",
          "content": "<p>I don't think a 1080 has enough memory. I am using a Titan X Maxwell and with 12gb ram and 2048px is difficult. With only 8gb, I'd think 1024 would be the upper limit. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 422670,
          "author_name": "ldm314",
          "author_url": "",
          "post_date": "11/16/2018 15:45:01",
          "content": "<p>I'm not even trying 1024 anymore,  my largest model in testing use 768px.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 422677,
          "author_name": "zhijianli",
          "author_url": "",
          "post_date": "11/16/2018 16:01:12",
          "content": "<p>Indeed, to be able to use 2048px images, I think 32 GB memory is needed.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 423047,
          "author_name": "maw501",
          "author_url": "",
          "post_date": "11/17/2018 10:38:17",
          "content": "<p>I can train at 1024px with a batch size of 32 on a single 1080 ti and it takes about 20 mins per epoch. Currently it's no better than at 512 and is far too slow to iterate so I'm going to abandon for now, sick of memory issues. </p>\n\n<p>I really think one can get far in this competition by ignoring the larger images and spending more time on CV design to address class imbalance.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 423101,
          "author_name": "dstjhb",
          "author_url": "",
          "post_date": "11/17/2018 13:28:11",
          "content": "<p>Good to know, thanks. I think I'll stick to 512. I have a Tesla at work with more memory but I don't think it's worth it.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 422716,
      "author_name": "petewills",
      "author_url": "",
      "post_date": "11/16/2018 17:01:20",
      "content": "<p>Interesting thread. I can run 512 with batch size 32 but not 64, on my Ti1080 (12 GB). But I do not have a reasonable calculation that shows why this is so. Can anyone enlighten me?</p>",
      "votes": null,
      "replies": [
        {
          "id": 422747,
          "author_name": "varunvprabhu",
          "author_url": "",
          "post_date": "11/16/2018 18:04:09",
          "content": "<p>I'm guessing that at that image size, batch size and network parameters, all the weights matrices that the network constructs is what maxes out the memory. When I got OOM (Out of memory) issues in Keras/Tensorflow, it would usually say something like \"resource exhausted when allocating tensor of shape [4, 256, 256, 512]\".</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 422745,
      "author_name": "varunvprabhu",
      "author_url": "",
      "post_date": "11/16/2018 17:57:28",
      "content": "<p>Thanks for your inputs everyone. BTW I have a gtx1070 8GB. Before I started downloading the full sized images, I wanted to make sure that I could get some dummy 2048 sized images through my network but it appears that I get \"Out of Memory\" issues. So hardware wise, it appears Im tapped out for that size at least.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 422780,
      "author_name": "suicaokhoailang",
      "author_url": "",
      "post_date": "11/16/2018 19:11:45",
      "content": "<p>About 0.03 for me, going from 256 to 512. But I expect diminished returns when you keep going up, which I don't have the resources for anyway.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 424910,
      "author_name": "thundo",
      "author_url": "",
      "post_date": "11/20/2018 21:44:42",
      "content": "<p>256-&gt;512 LB 0.454 -&gt; 0.49, all other things equal</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 425373,
      "author_name": "stecasasso",
      "author_url": "",
      "post_date": "11/21/2018 14:04:45",
      "content": "<p>I see an improvement of about +0.04 when going from 256 -&gt; 512\nI am currently limited by the memory of my 1080 Ti and I can hardly increase the size any more</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "422339": "I was initially using 224x224 images with a resnet50 backbone and topping at around 0.400 in the lb. I started using the 512x512 images with some changes to my network to adjust for the image size and used the weights from the smaller images and got a score of 0.450, a 0.05 point jump.\n\nWhat's been your jump? I also want to know the jump in score in case you're using the full sized images. I'm contemplating using them, but I want to be sure before I download a ludicrous 250GB archive.",
    "422382": "So far my best comes from my 512x512 models. Going to be days still for the larger models, they are taking a long time to train.",
    "422547": "With 224 by 224 and RestNet50, I also got around 0.400, when I increased to 512 by 512, the best result is 0.498. So I think the resolution is really important. Now I am gonna try full size, 2048 by 2048",
    "422581": "I'm optimizing my models at 224px and was planning to up to 512px. In the \"real world\" I rarely see huge performance gains from resolution increases past a certain point, but this is largely because the classes are quite large objects, or clusters of small objects.\n\nFor small cell components the fine details may prove essential for success. Some of the classes requested here are quite small. At some point increasing the pixel resolution will make no difference as you reach optical limits (or you are looking a big group of labels in one place), and your cluster of fluorescent labels stuck to your target protein is likely larger than the target protein itself anyway. I am ASSUMING they are imaged at 40X/1.25NA(???).\n\nI do think 2048px should still provide more information. This may be helpful to some: http://www.bio.brandeis.edu/CIL/Applications%20notes/Leica%20tutorials/Zoom%20and%20Resolution.pdf\n\nI'm curious what hardware people are using for 2048px images? I have access to a single GTX 1080, and I am hoping this will be enough. With augmentation and a deep network I expect it to be like swimming through concrete...",
    "422668": "I don't think a 1080 has enough memory. I am using a Titan X Maxwell and with 12gb ram and 2048px is difficult. With only 8gb, I'd think 1024 would be the upper limit.",
    "422670": "I'm not even trying 1024 anymore,  my largest model in testing use 768px.",
    "422677": "Indeed, to be able to use 2048px images, I think 32 GB memory is needed.",
    "422716": "Interesting thread. I can run 512 with batch size 32 but not 64, on my Ti1080 (12 GB). But I do not have a reasonable calculation that shows why this is so. Can anyone enlighten me?",
    "422745": "Thanks for your inputs everyone. BTW I have a gtx1070 8GB. Before I started downloading the full sized images, I wanted to make sure that I could get some dummy 2048 sized images through my network but it appears that I get \"Out of Memory\" issues. So hardware wise, it appears Im tapped out for that size at least.",
    "422747": "I'm guessing that at that image size, batch size and network parameters, all the weights matrices that the network constructs is what maxes out the memory. When I got OOM (Out of memory) issues in Keras/Tensorflow, it would usually say something like \"resource exhausted when allocating tensor of shape [4, 256, 256, 512]\".",
    "422780": "About 0.03 for me, going from 256 to 512. But I expect diminished returns when you keep going up, which I don't have the resources for anyway.",
    "423047": "I can train at 1024px with a batch size of 32 on a single 1080 ti and it takes about 20 mins per epoch. Currently it's no better than at 512 and is far too slow to iterate so I'm going to abandon for now, sick of memory issues. \n\nI really think one can get far in this competition by ignoring the larger images and spending more time on CV design to address class imbalance.",
    "423101": "Good to know, thanks. I think I'll stick to 512. I have a Tesla at work with more memory but I don't think it's worth it.",
    "424910": "256-&gt;512 LB 0.454 -&gt; 0.49, all other things equal",
    "425373": "I see an improvement of about +0.04 when going from 256 -&gt; 512\nI am currently limited by the memory of my 1080 Ti and I can hardly increase the size any more",
    "432706": "Hi, what loss function do you use?",
    "433059": "I used BCE loss function.",
    "433486": "",
    "433488": "hi, have you tried focal loss, does it give better result than bce loss ? In my case, focal loss does not help much.\n\n\nemm, I found it in https://www.kaggle.com/c/human-protein-atlas-image-classification/discussion/70365 thanks.\n&gt; **Zhijian Li wrote**\n&gt; \n&gt; &gt; I used BCE loss function."
  },
  "source": "meta"
}