{
  "id": 70559,
  "title": "Best single model[LB: 0.928 --> 0.934 --> 0.938]",
  "url": "/competitions/quickdraw-doodle-recognition/discussion/70559",
  "author_name": "Rajesh Shreedhar",
  "post_date": "2018-11-05T07:55:40.247000",
  "votes": 14,
  "comment_count": 31,
  "views": 0,
  "content": "<p>Till now, I was able to get 0.928 on public leaderboard using MobileNet but haven't included\ncountry or no. of strokes information as of now along with image features.</p>\n\n<p>My best single model was MobNet with image size of 256(score: 0.938). </p>",
  "messages": [
    {
      "id": 415479,
      "postDate": "2018-11-05T07:55:40.247Z",
      "content": "<p>Till now, I was able to get 0.928 on public leaderboard using MobileNet but haven't included\ncountry or no. of strokes information as of now along with image features.</p>\n\n<p>My best single model was MobNet with image size of 256(score: 0.938). </p>",
      "rawMarkdown": "Till now, I was able to get 0.928 on public leaderboard using MobileNet but haven't included\ncountry or no. of strokes information as of now along with image features.\n\nMy best single model was MobNet with image size of 256(score: 0.938). ",
      "votes": 14
    },
    {
      "id": 419791,
      "postDate": "2018-11-12T15:06:02.170Z",
      "content": "<p>Could you share how draw in colour plz. I am using the beluga snippet:\n</p><pre><code>\ndef draw_cv2(raw_strokes, size=256, lw=6, time_color=True):\n    img = np.zeros((BASE_SIZE, BASE_SIZE), np.uint8)\n    for t, stroke in enumerate(raw_strokes):\n        for i in range(len(stroke[0]) - 1):\n            color = 255 - min(t, 10) * 13 if time_color else 255\n            _ = cv2.line(img, (stroke[0][i], stroke[1][i]),\n                         (stroke[0][i + 1], stroke[1][i + 1]), color, lw)\n    if size != BASE_SIZE:\n        return cv2.resize(img, (size, size))\n    else:\n        return img\n</code></pre><p></p>",
      "rawMarkdown": "Could you share how draw in colour plz. I am using the beluga snippet:\n<pre><code>\ndef draw_cv2(raw_strokes, size=256, lw=6, time_color=True):\n    img = np.zeros((BASE_SIZE, BASE_SIZE), np.uint8)\n    for t, stroke in enumerate(raw_strokes):\n        for i in range(len(stroke[0]) - 1):\n            color = 255 - min(t, 10) * 13 if time_color else 255\n            _ = cv2.line(img, (stroke[0][i], stroke[1][i]),\n                         (stroke[0][i + 1], stroke[1][i + 1]), color, lw)\n    if size != BASE_SIZE:\n        return cv2.resize(img, (size, size))\n    else:\n        return img\n</code></pre>",
      "votes": 4
    },
    {
      "id": 417144,
      "postDate": "2018-11-07T20:28:42.287Z",
      "content": "<p>Image size and no. of images per class does matter!!  Was able to get  0.934 with images of size 128 :)</p>",
      "rawMarkdown": "Image size and no. of images per class does matter!!  Was able to get  0.934 with images of size 128 :)",
      "votes": 4,
      "replies": [
        {
          "id": 417234,
          "postDate": "2018-11-08T01:06:38.320Z",
          "content": "<p>just mobilenet or mobilenetv2? wow.</p>",
          "rawMarkdown": "just mobilenet or mobilenetv2? wow."
        },
        {
          "id": 417409,
          "postDate": "2018-11-08T08:07:04.200Z",
          "rawMarkdown": "",
          "votes": -1,
          "isDeleted": true
        },
        {
          "id": 418054,
          "postDate": "2018-11-09T07:42:58.930Z",
          "content": "<p>Hi Rajesh, could I know that how many samples do you use for 0.934 model?</p>",
          "rawMarkdown": "Hi Rajesh, could I know that how many samples do you use for 0.934 model?"
        },
        {
          "id": 418070,
          "postDate": "2018-11-09T08:46:40.127Z",
          "content": "<p>maybe, I guessed mobilenet</p>",
          "rawMarkdown": "maybe, I guessed mobilenet"
        },
        {
          "id": 418448,
          "postDate": "2018-11-09T22:53:43.027Z",
          "content": "<p>Great result @Rajesh - would you mind disclosing how many epochs you trained for?</p>",
          "rawMarkdown": "Great result @Rajesh - would you mind disclosing how many epochs you trained for?"
        },
        {
          "id": 418589,
          "postDate": "2018-11-10T08:00:01.993Z",
          "content": "<p>@Gary-DeepLearning above results are using MobileNet and not MobileNet_v2. </p>",
          "rawMarkdown": "@Gary-DeepLearning above results are using MobileNet and not MobileNet_v2. ",
          "votes": 1
        },
        {
          "id": 418652,
          "postDate": "2018-11-10T11:04:41.873Z",
          "content": "<p>only finetuned the MobileNet? wow</p>",
          "rawMarkdown": "only finetuned the MobileNet? wow"
        }
      ]
    },
    {
      "id": 415525,
      "postDate": "2018-11-05T09:07:38.557Z",
      "content": "<p>ResNet18, 50k sample pre class, LB 0.920</p>",
      "rawMarkdown": "ResNet18, 50k sample pre class, LB 0.920",
      "votes": 1,
      "replies": [
        {
          "id": 415530,
          "postDate": "2018-11-05T09:23:21.040Z",
          "content": "<p>Are you training from scratch or initializing model with imagenet weights?</p>",
          "rawMarkdown": "Are you training from scratch or initializing model with imagenet weights?",
          "votes": 1
        },
        {
          "id": 415531,
          "postDate": "2018-11-05T09:25:25.480Z",
          "content": "<p>initializing model with imagenet, sir.</p>",
          "rawMarkdown": "initializing model with imagenet, sir.",
          "votes": 1
        },
        {
          "id": 415949,
          "postDate": "2018-11-06T00:15:23.323Z",
          "content": "<p>Hi, how long does a epoch take?</p>",
          "rawMarkdown": "Hi, how long does a epoch take?"
        },
        {
          "id": 415991,
          "postDate": "2018-11-06T02:33:29.357Z",
          "content": "<p>2h maybe?</p>",
          "rawMarkdown": "2h maybe?"
        },
        {
          "id": 415996,
          "postDate": "2018-11-06T02:39:32.737Z",
          "content": "<p>Thanks for your reply, and what the loss function did you use?</p>",
          "rawMarkdown": "Thanks for your reply, and what the loss function did you use?"
        },
        {
          "id": 416019,
          "postDate": "2018-11-06T03:40:53.337Z",
          "content": "<p>CrossEntropyLoss</p>",
          "rawMarkdown": "CrossEntropyLoss",
          "votes": 1
        },
        {
          "id": 423844,
          "postDate": "2018-11-19T06:17:13.537Z",
          "content": "<p>How many epochs did you train?</p>",
          "rawMarkdown": "How many epochs did you train?"
        }
      ]
    },
    {
      "id": 423890,
      "postDate": "2018-11-19T07:55:44.767Z",
      "content": "<p>I use mobilenet_v1 with pytorch, but I was unable to get a high score. The best result was only 0.86 LB. Do not know what am I missing.</p>",
      "rawMarkdown": "I use mobilenet_v1 with pytorch, but I was unable to get a high score. The best result was only 0.86 LB. Do not know what am I missing.",
      "votes": 2
    },
    {
      "id": 419194,
      "postDate": "2018-11-11T13:41:15.683Z",
      "content": "<p>Hey, Rejesh. Did you used mobilenet pre-trained or train the model from scratch？And the score 0.940 was from mobilenet?</p>",
      "rawMarkdown": "Hey, Rejesh. Did you used mobilenet pre-trained or train the model from scratch？And the score 0.940 was from mobilenet?",
      "replies": [
        {
          "id": 419866,
          "postDate": "2018-11-12T17:04:00.930Z",
          "content": "<p>0.94 is after averaging multiple model predictions and not from a single model. Pre-trained weights were not used for mobilenet. </p>",
          "rawMarkdown": "0.94 is after averaging multiple model predictions and not from a single model. Pre-trained weights were not used for mobilenet. ",
          "votes": 2
        },
        {
          "id": 420847,
          "postDate": "2018-11-14T08:02:03.097Z",
          "content": "<p>Could you share how many model prediction did you use for a simple average? thanks.</p>",
          "rawMarkdown": "Could you share how many model prediction did you use for a simple average? thanks."
        },
        {
          "id": 420976,
          "postDate": "2018-11-14T12:21:33.827Z",
          "content": "<p>As of now 4 models</p>",
          "rawMarkdown": "As of now 4 models",
          "votes": 1
        },
        {
          "id": 423848,
          "postDate": "2018-11-19T06:19:59.927Z",
          "content": "<p>You used four of the same model just retrained four times and averaged or four completely different models?</p>",
          "rawMarkdown": "You used four of the same model just retrained four times and averaged or four completely different models?",
          "votes": 1
        }
      ]
    },
    {
      "id": 415879,
      "postDate": "2018-11-05T21:07:10.193Z",
      "content": "<p>Hi <a href=\"/rajeshbhat\">@rajeshbhat</a> did you use all images to achieve this score? If not how many images per class?</p>",
      "rawMarkdown": "Hi @rajeshbhat did you use all images to achieve this score? If not how many images per class?",
      "replies": [
        {
          "id": 417149,
          "postDate": "2018-11-07T20:37:52.857Z",
          "content": "<p>Yup all images were used. </p>",
          "rawMarkdown": "Yup all images were used. ",
          "votes": 1
        }
      ]
    },
    {
      "id": 415619,
      "postDate": "2018-11-05T11:56:09.060Z",
      "content": "<p>Hey <a href=\"/rajeshbhat\">@rajeshbhat</a>. Nice LB score you got there. Did you achieve it by using only Kaggle kernels? Also did you use pretrained weights on imagenet or did you train it from scratch?</p>",
      "rawMarkdown": "Hey @rajeshbhat. Nice LB score you got there. Did you achieve it by using only Kaggle kernels? Also did you use pretrained weights on imagenet or did you train it from scratch?",
      "replies": [
        {
          "id": 415627,
          "postDate": "2018-11-05T12:14:01.287Z",
          "content": "<p>@Rajath, I did not use kaggle kernels.\nTraining was done from scratch(had single channel for the images). </p>",
          "rawMarkdown": "@Rajath, I did not use kaggle kernels.\nTraining was done from scratch(had single channel for the images). "
        },
        {
          "id": 415629,
          "postDate": "2018-11-05T12:17:28.700Z",
          "content": "<p>@Rajesh is the the same network as Beluga proposed?</p>",
          "rawMarkdown": "@Rajesh is the the same network as Beluga proposed?"
        },
        {
          "id": 415643,
          "postDate": "2018-11-05T12:43:07.973Z",
          "content": "<p>used the same kernel with minor modifications. </p>",
          "rawMarkdown": "used the same kernel with minor modifications. ",
          "votes": 1
        },
        {
          "id": 416421,
          "postDate": "2018-11-06T16:21:26.130Z",
          "content": "<p>Nice, that's a big improvement from just minor modifications. </p>\n\n<p>Did you write custom loss and optimization functions or just modify hyper-parameters?</p>\n\n<p>I think a custom loss function could improve performance greatly.</p>",
          "rawMarkdown": "Nice, that's a big improvement from just minor modifications. \n\nDid you write custom loss and optimization functions or just modify hyper-parameters?\n\nI think a custom loss function could improve performance greatly.",
          "votes": 1
        },
        {
          "id": 416464,
          "postDate": "2018-11-06T17:16:47.090Z",
          "content": "<p>Loss function is still the same(CrossEntropyLoss). Minor tweaks were with hyperparameters and more data used for training. </p>",
          "rawMarkdown": "Loss function is still the same(CrossEntropyLoss). Minor tweaks were with hyperparameters and more data used for training. "
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 419791,
      "author_name": "Mario Parreño Lara",
      "author_url": "",
      "post_date": "2018-11-12T15:06:02.170000",
      "content": "<p>Could you share how draw in colour plz. I am using the beluga snippet:\n</p><pre><code>\ndef draw_cv2(raw_strokes, size=256, lw=6, time_color=True):\n    img = np.zeros((BASE_SIZE, BASE_SIZE), np.uint8)\n    for t, stroke in enumerate(raw_strokes):\n        for i in range(len(stroke[0]) - 1):\n            color = 255 - min(t, 10) * 13 if time_color else 255\n            _ = cv2.line(img, (stroke[0][i], stroke[1][i]),\n                         (stroke[0][i + 1], stroke[1][i + 1]), color, lw)\n    if size != BASE_SIZE:\n        return cv2.resize(img, (size, size))\n    else:\n        return img\n</code></pre><p></p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 417144,
      "author_name": "Rajesh Shreedhar",
      "author_url": "",
      "post_date": "2018-11-07T20:28:42.287000",
      "content": "<p>Image size and no. of images per class does matter!!  Was able to get  0.934 with images of size 128 :)</p>",
      "votes": 4,
      "replies": [
        {
          "id": 417234,
          "author_name": "Gary",
          "author_url": "",
          "post_date": "2018-11-08T01:06:38.320000",
          "content": "<p>just mobilenet or mobilenetv2? wow.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 417409,
          "author_name": "",
          "author_url": "",
          "post_date": "2018-11-08T08:07:04.200000",
          "content": "",
          "votes": -1,
          "replies": []
        },
        {
          "id": 418054,
          "author_name": "Yiheng Wang",
          "author_url": "",
          "post_date": "2018-11-09T07:42:58.930000",
          "content": "<p>Hi Rajesh, could I know that how many samples do you use for 0.934 model?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 418070,
          "author_name": "Gary",
          "author_url": "",
          "post_date": "2018-11-09T08:46:40.127000",
          "content": "<p>maybe, I guessed mobilenet</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 418448,
          "author_name": "RDizzl3",
          "author_url": "",
          "post_date": "2018-11-09T22:53:43.027000",
          "content": "<p>Great result @Rajesh - would you mind disclosing how many epochs you trained for?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 418589,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-10T08:00:01.993000",
          "content": "<p>@Gary-DeepLearning above results are using MobileNet and not MobileNet_v2. </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 418652,
          "author_name": "Gary",
          "author_url": "",
          "post_date": "2018-11-10T11:04:41.873000",
          "content": "<p>only finetuned the MobileNet? wow</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 415525,
      "author_name": "Finlay",
      "author_url": "",
      "post_date": "2018-11-05T09:07:38.557000",
      "content": "<p>ResNet18, 50k sample pre class, LB 0.920</p>",
      "votes": 1,
      "replies": [
        {
          "id": 415530,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-05T09:23:21.040000",
          "content": "<p>Are you training from scratch or initializing model with imagenet weights?</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 415531,
          "author_name": "Finlay",
          "author_url": "",
          "post_date": "2018-11-05T09:25:25.480000",
          "content": "<p>initializing model with imagenet, sir.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 415949,
          "author_name": "Gary",
          "author_url": "",
          "post_date": "2018-11-06T00:15:23.323000",
          "content": "<p>Hi, how long does a epoch take?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 415991,
          "author_name": "Finlay",
          "author_url": "",
          "post_date": "2018-11-06T02:33:29.357000",
          "content": "<p>2h maybe?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 415996,
          "author_name": "Gary",
          "author_url": "",
          "post_date": "2018-11-06T02:39:32.737000",
          "content": "<p>Thanks for your reply, and what the loss function did you use?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 416019,
          "author_name": "Finlay",
          "author_url": "",
          "post_date": "2018-11-06T03:40:53.337000",
          "content": "<p>CrossEntropyLoss</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 423844,
          "author_name": "kdaqlkgjnmaklvmnkankl",
          "author_url": "",
          "post_date": "2018-11-19T06:17:13.537000",
          "content": "<p>How many epochs did you train?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 423890,
      "author_name": "good good study",
      "author_url": "",
      "post_date": "2018-11-19T07:55:44.767000",
      "content": "<p>I use mobilenet_v1 with pytorch, but I was unable to get a high score. The best result was only 0.86 LB. Do not know what am I missing.</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 419194,
      "author_name": "Gary",
      "author_url": "",
      "post_date": "2018-11-11T13:41:15.683000",
      "content": "<p>Hey, Rejesh. Did you used mobilenet pre-trained or train the model from scratch？And the score 0.940 was from mobilenet?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 419866,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-12T17:04:00.930000",
          "content": "<p>0.94 is after averaging multiple model predictions and not from a single model. Pre-trained weights were not used for mobilenet. </p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 420847,
          "author_name": "wh1te",
          "author_url": "",
          "post_date": "2018-11-14T08:02:03.097000",
          "content": "<p>Could you share how many model prediction did you use for a simple average? thanks.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 420976,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-14T12:21:33.827000",
          "content": "<p>As of now 4 models</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 423848,
          "author_name": "kdaqlkgjnmaklvmnkankl",
          "author_url": "",
          "post_date": "2018-11-19T06:19:59.927000",
          "content": "<p>You used four of the same model just retrained four times and averaged or four completely different models?</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 415879,
      "author_name": "James Requa",
      "author_url": "",
      "post_date": "2018-11-05T21:07:10.193000",
      "content": "<p>Hi <a href=\"/rajeshbhat\">@rajeshbhat</a> did you use all images to achieve this score? If not how many images per class?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 417149,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-07T20:37:52.857000",
          "content": "<p>Yup all images were used. </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 415619,
      "author_name": "Rajath",
      "author_url": "",
      "post_date": "2018-11-05T11:56:09.060000",
      "content": "<p>Hey <a href=\"/rajeshbhat\">@rajeshbhat</a>. Nice LB score you got there. Did you achieve it by using only Kaggle kernels? Also did you use pretrained weights on imagenet or did you train it from scratch?</p>",
      "votes": 0,
      "replies": [
        {
          "id": 415627,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-05T12:14:01.287000",
          "content": "<p>@Rajath, I did not use kaggle kernels.\nTraining was done from scratch(had single channel for the images). </p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 415629,
          "author_name": "Aramis",
          "author_url": "",
          "post_date": "2018-11-05T12:17:28.700000",
          "content": "<p>@Rajesh is the the same network as Beluga proposed?</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 415643,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-05T12:43:07.973000",
          "content": "<p>used the same kernel with minor modifications. </p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 416421,
          "author_name": "henry",
          "author_url": "",
          "post_date": "2018-11-06T16:21:26.130000",
          "content": "<p>Nice, that's a big improvement from just minor modifications. </p>\n\n<p>Did you write custom loss and optimization functions or just modify hyper-parameters?</p>\n\n<p>I think a custom loss function could improve performance greatly.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 416464,
          "author_name": "Rajesh Shreedhar",
          "author_url": "",
          "post_date": "2018-11-06T17:16:47.090000",
          "content": "<p>Loss function is still the same(CrossEntropyLoss). Minor tweaks were with hyperparameters and more data used for training. </p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "415479": "Till now, I was able to get 0.928 on public leaderboard using MobileNet but haven't included\ncountry or no. of strokes information as of now along with image features.\n\nMy best single model was MobNet with image size of 256(score: 0.938). ",
    "419791": "Could you share how draw in colour plz. I am using the beluga snippet:\n<pre><code>\ndef draw_cv2(raw_strokes, size=256, lw=6, time_color=True):\n    img = np.zeros((BASE_SIZE, BASE_SIZE), np.uint8)\n    for t, stroke in enumerate(raw_strokes):\n        for i in range(len(stroke[0]) - 1):\n            color = 255 - min(t, 10) * 13 if time_color else 255\n            _ = cv2.line(img, (stroke[0][i], stroke[1][i]),\n                         (stroke[0][i + 1], stroke[1][i + 1]), color, lw)\n    if size != BASE_SIZE:\n        return cv2.resize(img, (size, size))\n    else:\n        return img\n</code></pre>",
    "417144": "Image size and no. of images per class does matter!!  Was able to get  0.934 with images of size 128 :)",
    "415525": "ResNet18, 50k sample pre class, LB 0.920",
    "423890": "I use mobilenet_v1 with pytorch, but I was unable to get a high score. The best result was only 0.86 LB. Do not know what am I missing.",
    "419194": "Hey, Rejesh. Did you used mobilenet pre-trained or train the model from scratch？And the score 0.940 was from mobilenet?",
    "415879": "Hi @rajeshbhat did you use all images to achieve this score? If not how many images per class?",
    "415619": "Hey @rajeshbhat. Nice LB score you got there. Did you achieve it by using only Kaggle kernels? Also did you use pretrained weights on imagenet or did you train it from scratch?"
  }
}