{
  "id": 38811,
  "title": "any advantage  to use image beyond 1024x1024?",
  "url": "/competitions/carvana-image-masking-challenge/discussion/38811",
  "author_name": "hengck23",
  "post_date": "2017-08-31T14:56:23.424000",
  "votes": 6,
  "comment_count": 23,
  "views": 0,
  "content": "<p>In my experiments, 1024x1024 seems to be sufficient. Beyond that, the gain is not very much. \nCan any kagglers confirmed this?</p>",
  "messages": [
    {
      "id": 217664,
      "postDate": "2017-08-31T14:56:23.423Z",
      "content": "<p>In my experiments, 1024x1024 seems to be sufficient. Beyond that, the gain is not very much. \nCan any kagglers confirmed this?</p>",
      "rawMarkdown": "In my experiments, 1024x1024 seems to be sufficient. Beyond that, the gain is not very much. \nCan any kagglers confirmed this?\n",
      "votes": 6
    },
    {
      "id": 217770,
      "postDate": "2017-08-31T21:08:47.293Z",
      "content": "<p>Something Ive noticed, is that given a pixel budget, keeping the width to be length*1.5 (~original proportion) does slightly better. Have you tried maintaining your 1024^2 budget and formulate an experiment with something close to 1260x840? </p>",
      "rawMarkdown": "Something Ive noticed, is that given a pixel budget, keeping the width to be length*1.5 (~original proportion) does slightly better. Have you tried maintaining your 1024^2 budget and formulate an experiment with something close to 1260x840? ",
      "votes": 3,
      "replies": [
        {
          "id": 217776,
          "postDate": "2017-08-31T21:48:27.497Z",
          "content": "<p>Are you using a unet or some other architecture?</p>",
          "rawMarkdown": "Are you using a unet or some other architecture?"
        },
        {
          "id": 217778,
          "postDate": "2017-08-31T22:00:36.247Z",
          "content": "<p>using u-net based idea, with input (1104x736 since my model needs both l,w to be 16-divisible)</p>",
          "rawMarkdown": "using u-net based idea, with input (1104x736 since my model needs both l,w to be 16-divisible)"
        },
        {
          "id": 217784,
          "postDate": "2017-08-31T22:52:32.690Z",
          "content": "<p>It is interesting to play with the dimensions of the input images.  Some of my results from several aspect ratios are comparable (LB 0.996+) in previous low quality data. I forked Peter's keras starter using unet512.</p>",
          "rawMarkdown": "It is interesting to play with the dimensions of the input images.  Some of my results from several aspect ratios are comparable (LB 0.996+) in previous low quality data. I forked Peter's keras starter using unet512."
        },
        {
          "id": 217823,
          "postDate": "2017-09-01T05:09:24.260Z",
          "content": "<p>Is there any increase in computation speed using the rectangle over the square?</p>",
          "rawMarkdown": "Is there any increase in computation speed using the rectangle over the square?",
          "votes": 2
        },
        {
          "id": 217898,
          "postDate": "2017-09-01T12:58:07.947Z",
          "content": "<p>I haven't tried square yet. But I guess the computing time would respond to pixel counts. FYI, some random clips of one epoch from logs:</p>\n\n<p>w0768h0512 (3:2, pixel counts ~0.39M), 642s</p>\n\n<p>w0960h0640 (3:2  ~0.61M), 975s</p>\n\n<p>w0768h1024 (3:4 ~0.79M), 1257s</p>\n\n<p>w1280h0640 (2:1 ~0.82M), 1316s</p>",
          "rawMarkdown": "I haven't tried square yet. But I guess the computing time would respond to pixel counts. FYI, some random clips of one epoch from logs:\n\nw0768h0512 (3:2, pixel counts ~0.39M), 642s\n\nw0960h0640 (3:2  ~0.61M), 975s\n\nw0768h1024 (3:4 ~0.79M), 1257s\n\nw1280h0640 (2:1 ~0.82M), 1316s",
          "votes": 3
        }
      ]
    },
    {
      "id": 217678,
      "postDate": "2017-08-31T15:46:03.830Z",
      "content": "<p>I am training full resolution, I will try to do an experiment comparing 1024x1024 vs. 1918x1280 and report back. </p>",
      "rawMarkdown": "I am training full resolution, I will try to do an experiment comparing 1024x1024 vs. 1918x1280 and report back. ",
      "votes": 3,
      "replies": [
        {
          "id": 218379,
          "postDate": "2017-09-04T01:59:17.993Z",
          "content": "<p>It seems that 1918x1280 performs better. \nWhat is your batch size? Mine is 8.</p>",
          "rawMarkdown": "It seems that 1918x1280 performs better. \nWhat is your batch size? Mine is 8.",
          "votes": 1
        },
        {
          "id": 218501,
          "postDate": "2017-09-04T14:12:18.073Z",
          "content": "<p>GPU batch size = 1, b/c I cannot fit more in my GPU (11 Gb), but I used the Adam gradient accumulation trick with an effective batch-size (grandient-wise) of 8.</p>",
          "rawMarkdown": "GPU batch size = 1, b/c I cannot fit more in my GPU (11 Gb), but I used the Adam gradient accumulation trick with an effective batch-size (grandient-wise) of 8."
        }
      ]
    },
    {
      "id": 218504,
      "postDate": "2017-09-04T14:18:54.257Z",
      "content": "<p>for those using gradient accumulative trick, please note that computation of moving statistics like mean and var of BN may not be accumulative. You have to check the code and documentation of your respective deep learning tools like pytorch, tf, mxnet, caffe ... So there is still difference for using large batch size of accumulating small batch size. In our case, the BN mean and var over one image may be similar to that over many images, so the results may still be ok.</p>",
      "rawMarkdown": "for those using gradient accumulative trick, please note that computation of moving statistics like mean and var of BN may not be accumulative. You have to check the code and documentation of your respective deep learning tools like pytorch, tf, mxnet, caffe ... So there is still difference for using large batch size of accumulating small batch size. In our case, the BN mean and var over one image may be similar to that over many images, so the results may still be ok.",
      "votes": 1,
      "replies": [
        {
          "id": 218537,
          "postDate": "2017-09-04T17:03:20.657Z",
          "content": "<p>Yeah I encountered this problem as well in TF. I simply disregarded BN for this reason,  but I imagine one could tie the \"with tf.control_dependencies(update_ops)\" to the logits output somehow instead of the training op, but I'm frankly unsure how and when the statistics in BN get updated in Tensorflow\n, so I could be wrong.</p>\n\n<p>One can use weight norm though instead: <a href=\"https://arxiv.org/abs/1602.07868\">https://arxiv.org/abs/1602.07868</a></p>",
          "rawMarkdown": "Yeah I encountered this problem as well in TF. I simply disregarded BN for this reason,  but I imagine one could tie the \"with tf.control_dependencies(update_ops)\" to the logits output somehow instead of the training op, but I'm frankly unsure how and when the statistics in BN get updated in Tensorflow\n, so I could be wrong.\n\nOne can use weight norm though instead: https://arxiv.org/abs/1602.07868"
        }
      ]
    },
    {
      "id": 218149,
      "postDate": "2017-09-02T14:56:57.747Z",
      "content": "<p>In my experiments , 1280*1280 got better LB score(I forked Peter's code with little modification)</p>",
      "rawMarkdown": "In my experiments , 1280*1280 got better LB score(I forked Peter's code with little modification)",
      "votes": 1,
      "replies": [
        {
          "id": 218381,
          "postDate": "2017-09-04T02:11:03.353Z",
          "content": "<p>Could you please show your batch size?</p>",
          "rawMarkdown": "Could you please show your batch size?"
        },
        {
          "id": 218391,
          "postDate": "2017-09-04T03:40:39.967Z",
          "content": "<p>batch size = 3</p>",
          "rawMarkdown": "batch size = 3\n"
        }
      ]
    },
    {
      "id": 217902,
      "postDate": "2017-09-01T13:16:30.650Z",
      "content": "<p>In my experience, going rectangle vs square does not change much (0.0001 in some cases, 0 in others).\nSticking to rectangles though, to feel better with myself! Feels more correct!</p>",
      "rawMarkdown": "In my experience, going rectangle vs square does not change much (0.0001 in some cases, 0 in others).\nSticking to rectangles though, to feel better with myself! Feels more correct!",
      "votes": 2
    },
    {
      "id": 219298,
      "postDate": "2017-09-07T16:35:26.813Z",
      "content": "<p>I get lb score of 0.9966 for 1024 but only 0.9962 for 1280</p>",
      "rawMarkdown": "I get lb score of 0.9966 for 1024 but only 0.9962 for 1280",
      "replies": [
        {
          "id": 219394,
          "postDate": "2017-09-08T01:15:05.457Z",
          "content": "<p>What is your optimizer?RMSprop?</p>",
          "rawMarkdown": "What is your optimizer?RMSprop?"
        },
        {
          "id": 219442,
          "postDate": "2017-09-08T07:37:26.347Z",
          "content": "<p>i am using sdg with clip gradient</p>",
          "rawMarkdown": "i am using sdg with clip gradient"
        },
        {
          "id": 219452,
          "postDate": "2017-09-08T08:27:35.627Z",
          "content": "<p>This is my score, thank you for your advice. In my net, the bigger input size, the better LB score. And my optimizer is RMSprop.\n<a href=\"https://www.kaggle.com/c/carvana-image-masking-challenge/discussion/39148\">https://www.kaggle.com/c/carvana-image-masking-challenge/discussion/39148</a></p>",
          "rawMarkdown": "This is my score, thank you for your advice. In my net, the bigger input size, the better LB score. And my optimizer is RMSprop.\nhttps://www.kaggle.com/c/carvana-image-masking-challenge/discussion/39148\n"
        }
      ]
    },
    {
      "id": 217703,
      "postDate": "2017-08-31T17:24:18.953Z",
      "content": "<p>I've been using full resolution (padding to 1920 though),  haven't really tried any other sizes really, although the boost in batch size would be nice. </p>\n\n<p>Out of curiosity, I guess you are resizing to 1024 not cropping? </p>",
      "rawMarkdown": "I've been using full resolution (padding to 1920 though),  haven't really tried any other sizes really, although the boost in batch size would be nice. \n\nOut of curiosity, I guess you are resizing to 1024 not cropping? "
    },
    {
      "id": 218202,
      "postDate": "2017-09-02T22:14:17.630Z",
      "rawMarkdown": "",
      "votes": 2,
      "isDeleted": true,
      "replies": [
        {
          "id": 218212,
          "postDate": "2017-09-02T23:29:46.700Z",
          "content": "<p>is that just the input or are you changing the size of the convolutions as well?</p>",
          "rawMarkdown": "is that just the input or are you changing the size of the convolutions as well?"
        },
        {
          "id": 218227,
          "postDate": "2017-09-03T02:11:15.117Z",
          "content": "<p>with both. In both case I got better results with 1280*1280</p>",
          "rawMarkdown": "with both. In both case I got better results with 1280*1280"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 217770,
      "author_name": "mshliselberg",
      "author_url": "",
      "post_date": "2017-08-31T21:08:47.293000",
      "content": "<p>Something Ive noticed, is that given a pixel budget, keeping the width to be length*1.5 (~original proportion) does slightly better. Have you tried maintaining your 1024^2 budget and formulate an experiment with something close to 1260x840? </p>",
      "votes": 3,
      "replies": [
        {
          "id": 217776,
          "author_name": "Alan Khoa Nguyen",
          "author_url": "",
          "post_date": "2017-08-31T21:48:27.497000",
          "content": "<p>Are you using a unet or some other architecture?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 217778,
          "author_name": "mshliselberg",
          "author_url": "",
          "post_date": "2017-08-31T22:00:36.247000",
          "content": "<p>using u-net based idea, with input (1104x736 since my model needs both l,w to be 16-divisible)</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 217784,
          "author_name": "Chia-Ta Tsai",
          "author_url": "",
          "post_date": "2017-08-31T22:52:32.690000",
          "content": "<p>It is interesting to play with the dimensions of the input images.  Some of my results from several aspect ratios are comparable (LB 0.996+) in previous low quality data. I forked Peter's keras starter using unet512.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 217823,
          "author_name": "Alan Khoa Nguyen",
          "author_url": "",
          "post_date": "2017-09-01T05:09:24.260000",
          "content": "<p>Is there any increase in computation speed using the rectangle over the square?</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 217898,
          "author_name": "Chia-Ta Tsai",
          "author_url": "",
          "post_date": "2017-09-01T12:58:07.947000",
          "content": "<p>I haven't tried square yet. But I guess the computing time would respond to pixel counts. FYI, some random clips of one epoch from logs:</p>\n\n<p>w0768h0512 (3:2, pixel counts ~0.39M), 642s</p>\n\n<p>w0960h0640 (3:2  ~0.61M), 975s</p>\n\n<p>w0768h1024 (3:4 ~0.79M), 1257s</p>\n\n<p>w1280h0640 (2:1 ~0.82M), 1316s</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 217678,
      "author_name": "Andrés Miguel Torrubia Sáez",
      "author_url": "",
      "post_date": "2017-08-31T15:46:03.830000",
      "content": "<p>I am training full resolution, I will try to do an experiment comparing 1024x1024 vs. 1918x1280 and report back. </p>",
      "votes": 3,
      "replies": [
        {
          "id": 218379,
          "author_name": "Will",
          "author_url": "",
          "post_date": "2017-09-04T01:59:17.993000",
          "content": "<p>It seems that 1918x1280 performs better. \nWhat is your batch size? Mine is 8.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 218501,
          "author_name": "Andrés Miguel Torrubia Sáez",
          "author_url": "",
          "post_date": "2017-09-04T14:12:18.073000",
          "content": "<p>GPU batch size = 1, b/c I cannot fit more in my GPU (11 Gb), but I used the Adam gradient accumulation trick with an effective batch-size (grandient-wise) of 8.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 218504,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2017-09-04T14:18:54.257000",
      "content": "<p>for those using gradient accumulative trick, please note that computation of moving statistics like mean and var of BN may not be accumulative. You have to check the code and documentation of your respective deep learning tools like pytorch, tf, mxnet, caffe ... So there is still difference for using large batch size of accumulating small batch size. In our case, the BN mean and var over one image may be similar to that over many images, so the results may still be ok.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 218537,
          "author_name": "Adam Hart",
          "author_url": "",
          "post_date": "2017-09-04T17:03:20.657000",
          "content": "<p>Yeah I encountered this problem as well in TF. I simply disregarded BN for this reason,  but I imagine one could tie the \"with tf.control_dependencies(update_ops)\" to the logits output somehow instead of the training op, but I'm frankly unsure how and when the statistics in BN get updated in Tensorflow\n, so I could be wrong.</p>\n\n<p>One can use weight norm though instead: <a href=\"https://arxiv.org/abs/1602.07868\">https://arxiv.org/abs/1602.07868</a></p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 218149,
      "author_name": "atom1231",
      "author_url": "",
      "post_date": "2017-09-02T14:56:57.747000",
      "content": "<p>In my experiments , 1280*1280 got better LB score(I forked Peter's code with little modification)</p>",
      "votes": 1,
      "replies": [
        {
          "id": 218381,
          "author_name": "Will",
          "author_url": "",
          "post_date": "2017-09-04T02:11:03.353000",
          "content": "<p>Could you please show your batch size?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 218391,
          "author_name": "atom1231",
          "author_url": "",
          "post_date": "2017-09-04T03:40:39.967000",
          "content": "<p>batch size = 3</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 217902,
      "author_name": "Davide Boschetto",
      "author_url": "",
      "post_date": "2017-09-01T13:16:30.650000",
      "content": "<p>In my experience, going rectangle vs square does not change much (0.0001 in some cases, 0 in others).\nSticking to rectangles though, to feel better with myself! Feels more correct!</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 219298,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2017-09-07T16:35:26.813000",
      "content": "<p>I get lb score of 0.9966 for 1024 but only 0.9962 for 1280</p>",
      "votes": 0,
      "replies": [
        {
          "id": 219394,
          "author_name": "Will",
          "author_url": "",
          "post_date": "2017-09-08T01:15:05.457000",
          "content": "<p>What is your optimizer?RMSprop?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 219442,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "2017-09-08T07:37:26.347000",
          "content": "<p>i am using sdg with clip gradient</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 219452,
          "author_name": "Will",
          "author_url": "",
          "post_date": "2017-09-08T08:27:35.627000",
          "content": "<p>This is my score, thank you for your advice. In my net, the bigger input size, the better LB score. And my optimizer is RMSprop.\n<a href=\"https://www.kaggle.com/c/carvana-image-masking-challenge/discussion/39148\">https://www.kaggle.com/c/carvana-image-masking-challenge/discussion/39148</a></p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 217703,
      "author_name": "Adam Hart",
      "author_url": "",
      "post_date": "2017-08-31T17:24:18.953000",
      "content": "<p>I've been using full resolution (padding to 1920 though),  haven't really tried any other sizes really, although the boost in batch size would be nice. </p>\n\n<p>Out of curiosity, I guess you are resizing to 1024 not cropping? </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 218202,
      "author_name": "",
      "author_url": "",
      "post_date": "2017-09-02T22:14:17.630000",
      "content": "",
      "votes": 2,
      "replies": [
        {
          "id": 218212,
          "author_name": "Alan Khoa Nguyen",
          "author_url": "",
          "post_date": "2017-09-02T23:29:46.700000",
          "content": "<p>is that just the input or are you changing the size of the convolutions as well?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 218227,
          "author_name": "Charles Jansen",
          "author_url": "",
          "post_date": "2017-09-03T02:11:15.117000",
          "content": "<p>with both. In both case I got better results with 1280*1280</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "217664": "In my experiments, 1024x1024 seems to be sufficient. Beyond that, the gain is not very much. \nCan any kagglers confirmed this?\n",
    "217770": "Something Ive noticed, is that given a pixel budget, keeping the width to be length*1.5 (~original proportion) does slightly better. Have you tried maintaining your 1024^2 budget and formulate an experiment with something close to 1260x840? ",
    "217678": "I am training full resolution, I will try to do an experiment comparing 1024x1024 vs. 1918x1280 and report back. ",
    "218504": "for those using gradient accumulative trick, please note that computation of moving statistics like mean and var of BN may not be accumulative. You have to check the code and documentation of your respective deep learning tools like pytorch, tf, mxnet, caffe ... So there is still difference for using large batch size of accumulating small batch size. In our case, the BN mean and var over one image may be similar to that over many images, so the results may still be ok.",
    "218149": "In my experiments , 1280*1280 got better LB score(I forked Peter's code with little modification)",
    "217902": "In my experience, going rectangle vs square does not change much (0.0001 in some cases, 0 in others).\nSticking to rectangles though, to feel better with myself! Feels more correct!",
    "219298": "I get lb score of 0.9966 for 1024 but only 0.9962 for 1280",
    "217703": "I've been using full resolution (padding to 1920 though),  haven't really tried any other sizes really, although the boost in batch size would be nice. \n\nOut of curiosity, I guess you are resizing to 1024 not cropping? ",
    "218202": ""
  }
}