{
  "id": 314862,
  "title": "Starter notebook - classification",
  "url": "/competitions/hotel-id-to-combat-human-trafficking-2022-fgvc9/discussion/314862",
  "author_name": "",
  "post_date": "2022-03-24T22:13:01.022277900Z",
  "votes": 7,
  "comment_count": 5,
  "views": 0,
  "content": "<p>I've noticed there is no starter notebook this year so I prepared a simple example how to train a classification model and do inference on the hidden test dataset. I also prepared preprocessed images to make training faster and easier.</p>\n<p>Classification might not be very useful in real life application because it will not be able to handle new hotels but gives a decent score for now and is the easiest to implement. You can improve the solution by using higher resolution images, better training, sampling, better models or just use a different approach.</p>\n<p>Training notebook: <a href=\"https://www.kaggle.com/code/michaln/hotel-id-starter-classification-traning\" target=\"_blank\">Hotel-ID starter - classification - traning</a><br>\nInference notebook: <a href=\"https://www.kaggle.com/code/michaln/hotel-id-starter-classification-inference\" target=\"_blank\">Hotel-ID starter - classification - inference</a></p>\n<p>Training notebook uses resized and padded images to speed up training.</p>\n<p>Image preprocessing notebooks: <br>\n<a href=\"https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-256x256\" target=\"_blank\">Hotel-ID - image preprocessing - 256x256\n</a><br>\n<a href=\"https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-512x512\" target=\"_blank\">Hotel-ID - image preprocessing - 512x512\n</a></p>\n<p>And datasets with resized and padded images:<br>\n<a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256\" target=\"_blank\">Hotel-ID 2022 train images 256x256</a><br>\n<a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-512x512\" target=\"_blank\">Hotel-ID 2022 train images 512x512</a></p>\n<p>You can find better approaches than classification in the last year <a href=\"https://www.kaggle.com/competitions/hotel-id-2021-fgvc8\" target=\"_blank\">Hotel-ID to Combat Human Trafficking 2021 - FGVC8</a> competition. </p>\n<p>Here are top published solutions:<br>\n<a href=\"https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242087\" target=\"_blank\">1st place solution: Swin + Arcface + Label-constrained DBA</a><br>\n<a href=\"https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242207\" target=\"_blank\">8th place solution: arcface + cosface + classification</a><br>\n<a href=\"https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242030\" target=\"_blank\">14th place solution - fastai ensemble</a></p>\n<p>And here is a video with the 2021 competition summary <a href=\"https://www.youtube.com/watch?v=HZ97taSHwjU&amp;ab_channel=LearnDataScience\" target=\"_blank\">Kaggle meetup: Hotel ID</a></p>",
  "messages": [
    {
      "id": "1734024",
      "postDate": "03/24/2022 22:13:01",
      "content": "<p>I've noticed there is no starter notebook this year so I prepared a simple example how to train a classification model and do inference on the hidden test dataset. I also prepared preprocessed images to make training faster and easier.</p>\n<p>Classification might not be very useful in real life application because it will not be able to handle new hotels but gives a decent score for now and is the easiest to implement. You can improve the solution by using higher resolution images, better training, sampling, better models or just use a different approach.</p>\n<p>Training notebook: <a href=\"https://www.kaggle.com/code/michaln/hotel-id-starter-classification-traning\" target=\"_blank\">Hotel-ID starter - classification - traning</a><br>\nInference notebook: <a href=\"https://www.kaggle.com/code/michaln/hotel-id-starter-classification-inference\" target=\"_blank\">Hotel-ID starter - classification - inference</a></p>\n<p>Training notebook uses resized and padded images to speed up training.</p>\n<p>Image preprocessing notebooks: <br>\n<a href=\"https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-256x256\" target=\"_blank\">Hotel-ID - image preprocessing - 256x256\n</a><br>\n<a href=\"https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-512x512\" target=\"_blank\">Hotel-ID - image preprocessing - 512x512\n</a></p>\n<p>And datasets with resized and padded images:<br>\n<a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256\" target=\"_blank\">Hotel-ID 2022 train images 256x256</a><br>\n<a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-512x512\" target=\"_blank\">Hotel-ID 2022 train images 512x512</a></p>\n<p>You can find better approaches than classification in the last year <a href=\"https://www.kaggle.com/competitions/hotel-id-2021-fgvc8\" target=\"_blank\">Hotel-ID to Combat Human Trafficking 2021 - FGVC8</a> competition. </p>\n<p>Here are top published solutions:<br>\n<a href=\"https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242087\" target=\"_blank\">1st place solution: Swin + Arcface + Label-constrained DBA</a><br>\n<a href=\"https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242207\" target=\"_blank\">8th place solution: arcface + cosface + classification</a><br>\n<a href=\"https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242030\" target=\"_blank\">14th place solution - fastai ensemble</a></p>\n<p>And here is a video with the 2021 competition summary <a href=\"https://www.youtube.com/watch?v=HZ97taSHwjU&amp;ab_channel=LearnDataScience\" target=\"_blank\">Kaggle meetup: Hotel ID</a></p>",
      "rawMarkdown": "I've noticed there is no starter notebook this year so I prepared a simple example how to train a classification model and do inference on the hidden test dataset. I also prepared preprocessed images to make training faster and easier.\n\nClassification might not be very useful in real life application because it will not be able to handle new hotels but gives a decent score for now and is the easiest to implement. You can improve the solution by using higher resolution images, better training, sampling, better models or just use a different approach.\n\nTraining notebook: [Hotel-ID starter - classification - traning](https://www.kaggle.com/code/michaln/hotel-id-starter-classification-traning)\nInference notebook: [Hotel-ID starter - classification - inference](https://www.kaggle.com/code/michaln/hotel-id-starter-classification-inference)\n\nTraining notebook uses resized and padded images to speed up training.\n\nImage preprocessing notebooks: \n[Hotel-ID - image preprocessing - 256x256\n](https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-256x256)\n[Hotel-ID - image preprocessing - 512x512\n](https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-512x512)\n\nAnd datasets with resized and padded images:\n[Hotel-ID 2022 train images 256x256](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256)\n[Hotel-ID 2022 train images 512x512](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-512x512)\n\nYou can find better approaches than classification in the last year [Hotel-ID to Combat Human Trafficking 2021 - FGVC8](https://www.kaggle.com/competitions/hotel-id-2021-fgvc8) competition. \n\nHere are top published solutions:\n[1st place solution: Swin + Arcface + Label-constrained DBA](https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242087)\n[8th place solution: arcface + cosface + classification](https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242207)\n[14th place solution - fastai ensemble](https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242030)\n\nAnd here is a video with the 2021 competition summary [Kaggle meetup: Hotel ID](https://www.youtube.com/watch?v=HZ97taSHwjU&ab_channel=LearnDataScience)",
      "votes": null
    },
    {
      "id": "1771205",
      "postDate": "04/29/2022 01:56:47",
      "content": "<p>Cool! Thanks for sharing!</p>",
      "rawMarkdown": "Cool! Thanks for sharing!",
      "votes": null
    },
    {
      "id": "1779537",
      "postDate": "05/06/2022 15:00:06",
      "content": "<p>Did you think about smaller images, like 128x128 or 64x64?</p>",
      "rawMarkdown": "Did you think about smaller images, like 128x128 or 64x64?",
      "votes": null
    },
    {
      "id": "1796892",
      "postDate": "05/21/2022 09:40:50",
      "content": "<p>Not really, I think 256x256 is small enough to do some quick experiments but not good enough for real submission. Switching to 512x512 dataset gives a nice boost in leaderboard score so I didn't consider generating smaller images. You can easily do it by forking the <a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256\" target=\"_blank\">notebook</a> used to generate the data and change the image output size</p>\n<p>I did create <a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-384x384\" target=\"_blank\">384x384 dataset</a> for transformer models so maybe somebody will find it useful.</p>",
      "rawMarkdown": "Not really, I think 256x256 is small enough to do some quick experiments but not good enough for real submission. Switching to 512x512 dataset gives a nice boost in leaderboard score so I didn't consider generating smaller images. You can easily do it by forking the [notebook](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256) used to generate the data and change the image output size\n\nI did create [384x384 dataset](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-384x384) for transformer models so maybe somebody will find it useful.",
      "votes": null
    },
    {
      "id": "1806250",
      "postDate": "05/31/2022 00:39:21",
      "content": "<p>Just want to publicly thank <a href=\"https://www.kaggle.com/michaln\" target=\"_blank\">@michaln</a> for posting these resources. I found them very helpful!</p>",
      "rawMarkdown": "Just want to publicly thank @michaln for posting these resources. I found them very helpful!",
      "votes": null
    },
    {
      "id": "1806575",
      "postDate": "05/31/2022 10:02:43",
      "content": "<p>Thanks, I was just trying to help out people to start in this competition because this year there was no starter notebook and it might be hard to start with nothing. Happy to hear that it was helpful to you  :-)</p>\n<p>And big congrats on 9th place on your first competition, that's an amazing result. Good job!</p>",
      "rawMarkdown": "Thanks, I was just trying to help out people to start in this competition because this year there was no starter notebook and it might be hard to start with nothing. Happy to hear that it was helpful to you  :-)\n\nAnd big congrats on 9th place on your first competition, that's an amazing result. Good job!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1771205,
      "author_name": "houzhuo",
      "author_url": "",
      "post_date": "04/29/2022 01:56:47",
      "content": "<p>Cool! Thanks for sharing!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1779537,
      "author_name": "mateuszmiler",
      "author_url": "",
      "post_date": "05/06/2022 15:00:06",
      "content": "<p>Did you think about smaller images, like 128x128 or 64x64?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1796892,
          "author_name": "michaln",
          "author_url": "",
          "post_date": "05/21/2022 09:40:50",
          "content": "<p>Not really, I think 256x256 is small enough to do some quick experiments but not good enough for real submission. Switching to 512x512 dataset gives a nice boost in leaderboard score so I didn't consider generating smaller images. You can easily do it by forking the <a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256\" target=\"_blank\">notebook</a> used to generate the data and change the image output size</p>\n<p>I did create <a href=\"https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-384x384\" target=\"_blank\">384x384 dataset</a> for transformer models so maybe somebody will find it useful.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1806250,
      "author_name": "dfrankow",
      "author_url": "",
      "post_date": "05/31/2022 00:39:21",
      "content": "<p>Just want to publicly thank <a href=\"https://www.kaggle.com/michaln\" target=\"_blank\">@michaln</a> for posting these resources. I found them very helpful!</p>",
      "votes": null,
      "replies": [
        {
          "id": 1806575,
          "author_name": "michaln",
          "author_url": "",
          "post_date": "05/31/2022 10:02:43",
          "content": "<p>Thanks, I was just trying to help out people to start in this competition because this year there was no starter notebook and it might be hard to start with nothing. Happy to hear that it was helpful to you  :-)</p>\n<p>And big congrats on 9th place on your first competition, that's an amazing result. Good job!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1734024": "I've noticed there is no starter notebook this year so I prepared a simple example how to train a classification model and do inference on the hidden test dataset. I also prepared preprocessed images to make training faster and easier.\n\nClassification might not be very useful in real life application because it will not be able to handle new hotels but gives a decent score for now and is the easiest to implement. You can improve the solution by using higher resolution images, better training, sampling, better models or just use a different approach.\n\nTraining notebook: [Hotel-ID starter - classification - traning](https://www.kaggle.com/code/michaln/hotel-id-starter-classification-traning)\nInference notebook: [Hotel-ID starter - classification - inference](https://www.kaggle.com/code/michaln/hotel-id-starter-classification-inference)\n\nTraining notebook uses resized and padded images to speed up training.\n\nImage preprocessing notebooks: \n[Hotel-ID - image preprocessing - 256x256\n](https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-256x256)\n[Hotel-ID - image preprocessing - 512x512\n](https://www.kaggle.com/code/michaln/hotel-id-image-preprocessing-512x512)\n\nAnd datasets with resized and padded images:\n[Hotel-ID 2022 train images 256x256](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256)\n[Hotel-ID 2022 train images 512x512](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-512x512)\n\nYou can find better approaches than classification in the last year [Hotel-ID to Combat Human Trafficking 2021 - FGVC8](https://www.kaggle.com/competitions/hotel-id-2021-fgvc8) competition. \n\nHere are top published solutions:\n[1st place solution: Swin + Arcface + Label-constrained DBA](https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242087)\n[8th place solution: arcface + cosface + classification](https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242207)\n[14th place solution - fastai ensemble](https://www.kaggle.com/c/hotel-id-2021-fgvc8/discussion/242030)\n\nAnd here is a video with the 2021 competition summary [Kaggle meetup: Hotel ID](https://www.youtube.com/watch?v=HZ97taSHwjU&ab_channel=LearnDataScience)",
    "1771205": "Cool! Thanks for sharing!",
    "1779537": "Did you think about smaller images, like 128x128 or 64x64?",
    "1796892": "Not really, I think 256x256 is small enough to do some quick experiments but not good enough for real submission. Switching to 512x512 dataset gives a nice boost in leaderboard score so I didn't consider generating smaller images. You can easily do it by forking the [notebook](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-256x256) used to generate the data and change the image output size\n\nI did create [384x384 dataset](https://www.kaggle.com/datasets/michaln/hotelid-2022-train-images-384x384) for transformer models so maybe somebody will find it useful.",
    "1806250": "Just want to publicly thank @michaln for posting these resources. I found them very helpful!",
    "1806575": "Thanks, I was just trying to help out people to start in this competition because this year there was no starter notebook and it might be hard to start with nothing. Happy to hear that it was helpful to you  :-)\n\nAnd big congrats on 9th place on your first competition, that's an amazing result. Good job!"
  },
  "source": "meta"
}