{
  "id": 220898,
  "title": "2nd Place - Summary of Approach",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/220898",
  "author_name": "Devon Stanfield",
  "post_date": "2021-02-20T02:21:48.784000",
  "votes": 125,
  "comment_count": 31,
  "views": 0,
  "content": "<p>I joined the competition late, played around with some ideas, couldn't get a good model going, but I learned a lot though. As it neared the end of the competition, I figured I'd submit a simple fine-tuned model for the sake of having a submission.</p>\n<p>I looked up cassava pre-trained models and found <a href=\"url\" target=\"_blank\">https://tfhub.dev/google/cropnet/classifier/cassava_disease_V1/2</a>.<br>\nTo setup the model on the TPU, I referred to tensorflow's tpu setup guides. </p>\n<p>Training: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-train</a><br>\nMy image preprocessing was minor, just a quick resize and rescale. Most of the functions in the data pipeline were to handle TFRecords. I also extended the training labels from 5 to 6 as to match the cassava model's output which included a \"background\" label.<br>\nDuring training, I used \"EarlyStopping\" and \"ReduceLROnPlateau\". <br>\nThe callbacks would cutoff training around ~30 epochs.<br>\nI saved the model weights: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-model</a> to a dataset, since we weren't allowed to perform inference on the TPU. I also saved the cached version of the tfhub layer to a dataset: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-layer</a> since we weren't allowed the internet during inference.</p>\n<p>Inference: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-infer</a><br>\nBefore inference, I loaded the previously cached version of the model and the saved weights. The preprocessing pipeline was the same as training, mostly dealing with TFRecords. After passing the data through the model, I saved the results.</p>\n<p>Overall, I am surprised I placed 2nd. My approach was pretty much by-the-book basic. This was demonstrated by my model placing 660th in the public leaderboard with a score of 0.9025, landing right in the middle of a bunch of other people. I assumed they did the same thing I did. Go figure :)</p>",
  "messages": [
    {
      "id": 1211157,
      "postDate": "2021-02-20T02:21:48.783Z",
      "content": "<p>I joined the competition late, played around with some ideas, couldn't get a good model going, but I learned a lot though. As it neared the end of the competition, I figured I'd submit a simple fine-tuned model for the sake of having a submission.</p>\n<p>I looked up cassava pre-trained models and found <a href=\"url\" target=\"_blank\">https://tfhub.dev/google/cropnet/classifier/cassava_disease_V1/2</a>.<br>\nTo setup the model on the TPU, I referred to tensorflow's tpu setup guides. </p>\n<p>Training: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-train</a><br>\nMy image preprocessing was minor, just a quick resize and rescale. Most of the functions in the data pipeline were to handle TFRecords. I also extended the training labels from 5 to 6 as to match the cassava model's output which included a \"background\" label.<br>\nDuring training, I used \"EarlyStopping\" and \"ReduceLROnPlateau\". <br>\nThe callbacks would cutoff training around ~30 epochs.<br>\nI saved the model weights: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-model</a> to a dataset, since we weren't allowed to perform inference on the TPU. I also saved the cached version of the tfhub layer to a dataset: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-layer</a> since we weren't allowed the internet during inference.</p>\n<p>Inference: <a href=\"url\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-infer</a><br>\nBefore inference, I loaded the previously cached version of the model and the saved weights. The preprocessing pipeline was the same as training, mostly dealing with TFRecords. After passing the data through the model, I saved the results.</p>\n<p>Overall, I am surprised I placed 2nd. My approach was pretty much by-the-book basic. This was demonstrated by my model placing 660th in the public leaderboard with a score of 0.9025, landing right in the middle of a bunch of other people. I assumed they did the same thing I did. Go figure :)</p>",
      "rawMarkdown": "I joined the competition late, played around with some ideas, couldn't get a good model going, but I learned a lot though. As it neared the end of the competition, I figured I'd submit a simple fine-tuned model for the sake of having a submission.\n\nI looked up cassava pre-trained models and found [https://tfhub.dev/google/cropnet/classifier/cassava_disease_V1/2](url).\nTo setup the model on the TPU, I referred to tensorflow's tpu setup guides. \n\nTraining: [https://www.kaggle.com/devonstanfield/cassava-train](url)\nMy image preprocessing was minor, just a quick resize and rescale. Most of the functions in the data pipeline were to handle TFRecords. I also extended the training labels from 5 to 6 as to match the cassava model's output which included a \"background\" label.\nDuring training, I used \"EarlyStopping\" and \"ReduceLROnPlateau\". \nThe callbacks would cutoff training around ~30 epochs.\nI saved the model weights: [https://www.kaggle.com/devonstanfield/cassava-model](url) to a dataset, since we weren't allowed to perform inference on the TPU. I also saved the cached version of the tfhub layer to a dataset: [https://www.kaggle.com/devonstanfield/cassava-layer](url) since we weren't allowed the internet during inference.\n\nInference: [https://www.kaggle.com/devonstanfield/cassava-infer](url)\nBefore inference, I loaded the previously cached version of the model and the saved weights. The preprocessing pipeline was the same as training, mostly dealing with TFRecords. After passing the data through the model, I saved the results.\n\nOverall, I am surprised I placed 2nd. My approach was pretty much by-the-book basic. This was demonstrated by my model placing 660th in the public leaderboard with a score of 0.9025, landing right in the middle of a bunch of other people. I assumed they did the same thing I did. Go figure :)\n",
      "votes": 125
    },
    {
      "id": 1213177,
      "postDate": "2021-02-21T23:14:13.443Z",
      "content": "<p>Absolutely no disrespect intended, but I wonder if the pretraining performed by Makerere AI Lab included the private test set. I have a very hard time believing that a MobileNetV3-based model performed so well.</p>",
      "rawMarkdown": "Absolutely no disrespect intended, but I wonder if the pretraining performed by Makerere AI Lab included the private test set. I have a very hard time believing that a MobileNetV3-based model performed so well.",
      "votes": 27,
      "replies": [
        {
          "id": 1213603,
          "postDate": "2021-02-22T08:07:11.190Z",
          "content": "<p>A valid concern tbh. I was also wondering if this is kind of a data leak. But oh well, there are always unexpected competitions on Kaggle with chaotic leaderboard.</p>",
          "rawMarkdown": "A valid concern tbh. I was also wondering if this is kind of a data leak. But oh well, there are always unexpected competitions on Kaggle with chaotic leaderboard.",
          "votes": 2
        },
        {
          "id": 1213663,
          "postDate": "2021-02-22T09:04:25.717Z",
          "content": "<p>FYI: <a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220904#1211915\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220904#1211915</a></p>",
          "rawMarkdown": "FYI: https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220904#1211915",
          "votes": 2
        }
      ]
    },
    {
      "id": 1211590,
      "postDate": "2021-02-20T10:46:00.753Z",
      "content": "<p>The pretrained model from Makerere University AI Lab. Amazing! </p>",
      "rawMarkdown": "The pretrained model from Makerere University AI Lab. Amazing! ",
      "votes": 8
    },
    {
      "id": 1211679,
      "postDate": "2021-02-20T12:46:45.477Z",
      "content": "<p>haha!! nice!! you break it with less than 20 cells code ;)👍 you should give Google+Mak-AI lab a big hug :)</p>\n<p>Edit: it is even simpler than I thought - you have used only 75% of data to train (simple train/val split not kfold)</p>",
      "rawMarkdown": "haha!! nice!! you break it with less than 20 cells code ;)👍 you should give Google+Mak-AI lab a big hug :)\n\nEdit: it is even simpler than I thought - you have used only 75% of data to train (simple train/val split not kfold)",
      "votes": 3
    },
    {
      "id": 1212102,
      "postDate": "2021-02-20T21:47:35.690Z",
      "content": "<p>haha it was really funny to read this, congratulation <a href=\"https://www.kaggle.com/devonstanfield\" target=\"_blank\">@devonstanfield</a> , this is the proof the the basics can go a long way.</p>",
      "rawMarkdown": "haha it was really funny to read this, congratulation @devonstanfield , this is the proof the the basics can go a long way.",
      "votes": 4
    },
    {
      "id": 1213630,
      "postDate": "2021-02-22T08:36:42.820Z",
      "content": "<p>Occam's razor personified. The simplest solution is almost always the right one. Great work </p>",
      "rawMarkdown": "Occam's razor personified. The simplest solution is almost always the right one. Great work ",
      "votes": 2
    },
    {
      "id": 1211542,
      "postDate": "2021-02-20T10:11:34.597Z",
      "content": "<p>Congratulations! I am shocked by this simple solution. It means that a simple pretrained MobileNet model killed a lot of complicated networks in this competition. Well done!!</p>\n<p>By the way, it seems that you use a resolution of 224x224 which is much lower than what is commonly used like 512x512. The result is amazing.</p>\n<p>Perhaps the problem in itself is a bit tricky. We can see noticeable shake-ups in the private leaderboard.</p>",
      "rawMarkdown": "Congratulations! I am shocked by this simple solution. It means that a simple pretrained MobileNet model killed a lot of complicated networks in this competition. Well done!!\n\nBy the way, it seems that you use a resolution of 224x224 which is much lower than what is commonly used like 512x512. The result is amazing.\n\nPerhaps the problem in itself is a bit tricky. We can see noticeable shake-ups in the private leaderboard.",
      "votes": 1
    },
    {
      "id": 1211439,
      "postDate": "2021-02-20T08:15:09.700Z",
      "content": "<p>Simple is best! Congratulations!</p>",
      "rawMarkdown": "Simple is best! Congratulations!",
      "votes": 1
    },
    {
      "id": 1211369,
      "postDate": "2021-02-20T06:54:39.143Z",
      "content": "<p>Mate, you'd better  change  your  title  to  2nd place solution  for  others'  convenient.<br>\nBest  wishes .    :)</p>",
      "rawMarkdown": "Mate, you'd better  change  your  title  to  2nd place solution  for  others'  convenient.\nBest  wishes .    :)",
      "votes": 1
    },
    {
      "id": 1211329,
      "postDate": "2021-02-20T06:18:39.777Z",
      "content": "<p>Congratulations on 2nd place! Your solution is simple, but effective on pb</p>",
      "rawMarkdown": "Congratulations on 2nd place! Your solution is simple, but effective on pb",
      "votes": 1
    },
    {
      "id": 1211201,
      "postDate": "2021-02-20T04:04:43.100Z",
      "content": "<p>Thanks for sharing! Can you update the title to reflect 2nd place solution? Congratulations on 2nd place!</p>",
      "rawMarkdown": "Thanks for sharing! Can you update the title to reflect 2nd place solution? Congratulations on 2nd place!",
      "votes": 1
    },
    {
      "id": 1246861,
      "postDate": "2021-03-21T07:23:54.327Z",
      "content": "<p><a href=\"https://www.kaggle.com/devonstanfield\" target=\"_blank\">@devonstanfield</a> , Great solution! Thanks for sharing. I added it to my collection in <a href=\"https://www.kaggle.com/vbmokin/data-science-with-dl-nlp-advanced-techniques\" target=\"_blank\">\"Data Science with DL &amp; NLP: Advanced Techniques\"</a>, section \"Prize Competition Winners: notebooks (kernels) and posts with Magic\".</p>",
      "rawMarkdown": "@devonstanfield , Great solution! Thanks for sharing. I added it to my collection in [\"Data Science with DL & NLP: Advanced Techniques\"](https://www.kaggle.com/vbmokin/data-science-with-dl-nlp-advanced-techniques), section \"Prize Competition Winners: notebooks (kernels) and posts with Magic\"."
    },
    {
      "id": 1211687,
      "postDate": "2021-02-20T12:59:24.450Z",
      "content": "<p>congrats man,  that's the true 'working smart' way 👋👋👋</p>",
      "rawMarkdown": "congrats man,  that's the true 'working smart' way 👋👋👋",
      "votes": 2
    },
    {
      "id": 2235402,
      "postDate": "2023-04-26T02:31:42.020Z",
      "content": "<p>Great idea to use fine-tuning here, I had tried ResNet34 to train from scratch, but it never converged. </p>",
      "rawMarkdown": "Great idea to use fine-tuning here, I had tried ResNet34 to train from scratch, but it never converged. "
    },
    {
      "id": 1338128,
      "postDate": "2021-06-06T07:53:25.197Z",
      "content": "<p>Good Solution , its really surprising how simple approaches are winning solution to this competition.</p>",
      "rawMarkdown": "Good Solution , its really surprising how simple approaches are winning solution to this competition."
    },
    {
      "id": 1258077,
      "postDate": "2021-03-31T10:16:34.777Z",
      "content": "<p>I have just 1 doubt. The TFHub model is classifying the images into 6 categories. How did you manage to make predictions of 5 labels? </p>\n<p>I saw your code but I could not understand how!!</p>\n<p>I might sound stupid, but I am just a novice</p>",
      "rawMarkdown": "I have just 1 doubt. The TFHub model is classifying the images into 6 categories. How did you manage to make predictions of 5 labels? \n\nI saw your code but I could not understand how!!\n\nI might sound stupid, but I am just a novice",
      "replies": [
        {
          "id": 1258444,
          "postDate": "2021-03-31T16:00:34.647Z",
          "content": "<p>For training, I appended a zero to the training set labels, extending it from 5 to 6 in order to get around this issue. I assumed it wouldn't be a problem as every image in the dataset they gave would have a cassava plant and would not be \"background\". During the fine-tuning, the model should learn to ignore the 6th label.</p>\n<p>Here is the training code if you were still looking for it: <a href=\"https://www.kaggle.com/devonstanfield/cassava-train\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-train</a>.<br>\nNote that my code isn't very clean, I figured I shouldn't change it for posterity. Some of the code/functions are unused.</p>\n<p>I looked over your colab notebook as well. I had the same problem you are having with low accuracy. I tried resnet50 at the start and didn't get good results. Looking at the TFHub model, they based their design around MobileNetV2, so if you're looking to improve upon it further, that would be a good place to start. </p>",
          "rawMarkdown": "For training, I appended a zero to the training set labels, extending it from 5 to 6 in order to get around this issue. I assumed it wouldn't be a problem as every image in the dataset they gave would have a cassava plant and would not be \"background\". During the fine-tuning, the model should learn to ignore the 6th label.\n\nHere is the training code if you were still looking for it: https://www.kaggle.com/devonstanfield/cassava-train.\nNote that my code isn't very clean, I figured I shouldn't change it for posterity. Some of the code/functions are unused.\n\nI looked over your colab notebook as well. I had the same problem you are having with low accuracy. I tried resnet50 at the start and didn't get good results. Looking at the TFHub model, they based their design around MobileNetV2, so if you're looking to improve upon it further, that would be a good place to start. ",
          "replies": [
            {
              "id": 2816593,
              "postDate": "2024-05-16T12:19:02.050Z",
              "content": "<p>Impressive, I was also wondering how you managed to make prediction with just 5 labels given that your TFHub model is classifying the model into 6 categories. </p>\n<p>Great work, congrats!</p>",
              "rawMarkdown": "Impressive, I was also wondering how you managed to make prediction with just 5 labels given that your TFHub model is classifying the model into 6 categories. \n\nGreat work, congrats!"
            }
          ]
        },
        {
          "id": 1258452,
          "postDate": "2021-03-31T16:10:17.517Z",
          "content": "<p>Thank you so much for this comment. It has really inspired me now!</p>",
          "rawMarkdown": "Thank you so much for this comment. It has really inspired me now!"
        }
      ]
    },
    {
      "id": 1213623,
      "postDate": "2021-02-22T08:33:02.880Z",
      "content": "<p>Hahaha congratz. I was curious about your solution considering the low number of submissions. I should have looked for this type of pretrained model too, I used tf hub to train an efficient net at the beginning of the competition haha </p>",
      "rawMarkdown": "Hahaha congratz. I was curious about your solution considering the low number of submissions. I should have looked for this type of pretrained model too, I used tf hub to train an efficient net at the beginning of the competition haha "
    },
    {
      "id": 1212891,
      "postDate": "2021-02-21T17:40:30.170Z",
      "content": "<p>Finally, you have found the secret to success and that's \"you will never know what works\"!!! Congrat <a href=\"https://www.kaggle.com/devonstanfield\" target=\"_blank\">@devonstanfield</a>!!</p>",
      "rawMarkdown": "Finally, you have found the secret to success and that's \"you will never know what works\"!!! Congrat @devonstanfield!!"
    },
    {
      "id": 1212859,
      "postDate": "2021-02-21T17:06:32.073Z",
      "content": "<p>hey, thanks a lot for sharing!! congrats great work. </p>",
      "rawMarkdown": "hey, thanks a lot for sharing!! congrats great work. "
    },
    {
      "id": 1212820,
      "postDate": "2021-02-21T16:27:30.873Z",
      "content": "<p>Great soltuion! Couldn't wait to check it out haha. Wow, I had a 0.900 whilst using TF records PB LB. What helped you the most? tfhub layer?</p>",
      "rawMarkdown": "Great soltuion! Couldn't wait to check it out haha. Wow, I had a 0.900 whilst using TF records PB LB. What helped you the most? tfhub layer?"
    },
    {
      "id": 1212255,
      "postDate": "2021-02-21T03:46:59.703Z",
      "content": "<p>Congratulation to your 2nd place!</p>\n<p>Your solution is very simple. OMG this is funny and irony at the same time. To put into context, I also submitted several  simple solutions with EffnetB3-B4 image size 512 and only train_test_split, only reach 0.883 and 0.884 public LB, no where near 0.9.</p>",
      "rawMarkdown": "Congratulation to your 2nd place!\n\nYour solution is very simple. OMG this is funny and irony at the same time. To put into context, I also submitted several  simple solutions with EffnetB3-B4 image size 512 and only train_test_split, only reach 0.883 and 0.884 public LB, no where near 0.9."
    },
    {
      "id": 1212199,
      "postDate": "2021-02-21T01:50:36.427Z",
      "content": "<p>thank you for your sharing! and congrats! </p>",
      "rawMarkdown": "thank you for your sharing! and congrats! "
    },
    {
      "id": 1211829,
      "postDate": "2021-02-20T15:39:17.707Z",
      "content": "<p>Congratulations! This is really a funny story… but very good that you sticked to your own approach!</p>",
      "rawMarkdown": "Congratulations! This is really a funny story... but very good that you sticked to your own approach!"
    },
    {
      "id": 1211214,
      "postDate": "2021-02-20T04:25:24.410Z",
      "content": "<p>Holy crab. Congratulations</p>",
      "rawMarkdown": "Holy crab. Congratulations"
    },
    {
      "id": 1212188,
      "postDate": "2021-02-21T01:30:20.133Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 1211950,
      "postDate": "2021-02-20T17:31:31.977Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 1211703,
      "postDate": "2021-02-20T13:14:00.393Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1213177,
      "author_name": "eschibli",
      "author_url": "",
      "post_date": "2021-02-21T23:14:13.443000",
      "content": "<p>Absolutely no disrespect intended, but I wonder if the pretraining performed by Makerere AI Lab included the private test set. I have a very hard time believing that a MobileNetV3-based model performed so well.</p>",
      "votes": 27,
      "replies": [
        {
          "id": 1213603,
          "author_name": "Chan Kha Vu",
          "author_url": "",
          "post_date": "2021-02-22T08:07:11.190000",
          "content": "<p>A valid concern tbh. I was also wondering if this is kind of a data leak. But oh well, there are always unexpected competitions on Kaggle with chaotic leaderboard.</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1213663,
          "author_name": "Serhii Parakhin",
          "author_url": "",
          "post_date": "2021-02-22T09:04:25.717000",
          "content": "<p>FYI: <a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220904#1211915\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/220904#1211915</a></p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 1211590,
      "author_name": "cuteffff",
      "author_url": "",
      "post_date": "2021-02-20T10:46:00.753000",
      "content": "<p>The pretrained model from Makerere University AI Lab. Amazing! </p>",
      "votes": 8,
      "replies": []
    },
    {
      "id": 1211679,
      "author_name": "Ioannis M",
      "author_url": "",
      "post_date": "2021-02-20T12:46:45.477000",
      "content": "<p>haha!! nice!! you break it with less than 20 cells code ;)👍 you should give Google+Mak-AI lab a big hug :)</p>\n<p>Edit: it is even simpler than I thought - you have used only 75% of data to train (simple train/val split not kfold)</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1212102,
      "author_name": "DimitreOliveira",
      "author_url": "",
      "post_date": "2021-02-20T21:47:35.690000",
      "content": "<p>haha it was really funny to read this, congratulation <a href=\"https://www.kaggle.com/devonstanfield\" target=\"_blank\">@devonstanfield</a> , this is the proof the the basics can go a long way.</p>",
      "votes": 4,
      "replies": []
    },
    {
      "id": 1213630,
      "author_name": "DragonPG",
      "author_url": "",
      "post_date": "2021-02-22T08:36:42.820000",
      "content": "<p>Occam's razor personified. The simplest solution is almost always the right one. Great work </p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 1211542,
      "author_name": "Frank",
      "author_url": "",
      "post_date": "2021-02-20T10:11:34.597000",
      "content": "<p>Congratulations! I am shocked by this simple solution. It means that a simple pretrained MobileNet model killed a lot of complicated networks in this competition. Well done!!</p>\n<p>By the way, it seems that you use a resolution of 224x224 which is much lower than what is commonly used like 512x512. The result is amazing.</p>\n<p>Perhaps the problem in itself is a bit tricky. We can see noticeable shake-ups in the private leaderboard.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1211439,
      "author_name": "HungNT",
      "author_url": "",
      "post_date": "2021-02-20T08:15:09.700000",
      "content": "<p>Simple is best! Congratulations!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1211369,
      "author_name": "哈尔的移动城堡",
      "author_url": "",
      "post_date": "2021-02-20T06:54:39.143000",
      "content": "<p>Mate, you'd better  change  your  title  to  2nd place solution  for  others'  convenient.<br>\nBest  wishes .    :)</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1211329,
      "author_name": "mihtw",
      "author_url": "",
      "post_date": "2021-02-20T06:18:39.777000",
      "content": "<p>Congratulations on 2nd place! Your solution is simple, but effective on pb</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1211201,
      "author_name": "Trushant Kalyanpur",
      "author_url": "",
      "post_date": "2021-02-20T04:04:43.100000",
      "content": "<p>Thanks for sharing! Can you update the title to reflect 2nd place solution? Congratulations on 2nd place!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1246861,
      "author_name": "Vitalii Mokin",
      "author_url": "",
      "post_date": "2021-03-21T07:23:54.327000",
      "content": "<p><a href=\"https://www.kaggle.com/devonstanfield\" target=\"_blank\">@devonstanfield</a> , Great solution! Thanks for sharing. I added it to my collection in <a href=\"https://www.kaggle.com/vbmokin/data-science-with-dl-nlp-advanced-techniques\" target=\"_blank\">\"Data Science with DL &amp; NLP: Advanced Techniques\"</a>, section \"Prize Competition Winners: notebooks (kernels) and posts with Magic\".</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1211687,
      "author_name": "malek.badreddine",
      "author_url": "",
      "post_date": "2021-02-20T12:59:24.450000",
      "content": "<p>congrats man,  that's the true 'working smart' way 👋👋👋</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2235402,
      "author_name": "Yukai",
      "author_url": "",
      "post_date": "2023-04-26T02:31:42.020000",
      "content": "<p>Great idea to use fine-tuning here, I had tried ResNet34 to train from scratch, but it never converged. </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1338128,
      "author_name": "Athar Sayed",
      "author_url": "",
      "post_date": "2021-06-06T07:53:25.197000",
      "content": "<p>Good Solution , its really surprising how simple approaches are winning solution to this competition.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1258077,
      "author_name": "Yogeshwar Shendye",
      "author_url": "",
      "post_date": "2021-03-31T10:16:34.777000",
      "content": "<p>I have just 1 doubt. The TFHub model is classifying the images into 6 categories. How did you manage to make predictions of 5 labels? </p>\n<p>I saw your code but I could not understand how!!</p>\n<p>I might sound stupid, but I am just a novice</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1258444,
          "author_name": "Devon Stanfield",
          "author_url": "",
          "post_date": "2021-03-31T16:00:34.647000",
          "content": "<p>For training, I appended a zero to the training set labels, extending it from 5 to 6 in order to get around this issue. I assumed it wouldn't be a problem as every image in the dataset they gave would have a cassava plant and would not be \"background\". During the fine-tuning, the model should learn to ignore the 6th label.</p>\n<p>Here is the training code if you were still looking for it: <a href=\"https://www.kaggle.com/devonstanfield/cassava-train\" target=\"_blank\">https://www.kaggle.com/devonstanfield/cassava-train</a>.<br>\nNote that my code isn't very clean, I figured I shouldn't change it for posterity. Some of the code/functions are unused.</p>\n<p>I looked over your colab notebook as well. I had the same problem you are having with low accuracy. I tried resnet50 at the start and didn't get good results. Looking at the TFHub model, they based their design around MobileNetV2, so if you're looking to improve upon it further, that would be a good place to start. </p>",
          "votes": 0,
          "replies": [
            {
              "id": 2816593,
              "author_name": "Pixel9",
              "author_url": "",
              "post_date": "2024-05-16T12:19:02.050000",
              "content": "<p>Impressive, I was also wondering how you managed to make prediction with just 5 labels given that your TFHub model is classifying the model into 6 categories. </p>\n<p>Great work, congrats!</p>",
              "votes": 0,
              "replies": []
            }
          ]
        },
        {
          "id": 1258452,
          "author_name": "Yogeshwar Shendye",
          "author_url": "",
          "post_date": "2021-03-31T16:10:17.517000",
          "content": "<p>Thank you so much for this comment. It has really inspired me now!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1213623,
      "author_name": "Etienne R",
      "author_url": "",
      "post_date": "2021-02-22T08:33:02.880000",
      "content": "<p>Hahaha congratz. I was curious about your solution considering the low number of submissions. I should have looked for this type of pretrained model too, I used tf hub to train an efficient net at the beginning of the competition haha </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1212891,
      "author_name": "Jyot Makadiya",
      "author_url": "",
      "post_date": "2021-02-21T17:40:30.170000",
      "content": "<p>Finally, you have found the secret to success and that's \"you will never know what works\"!!! Congrat <a href=\"https://www.kaggle.com/devonstanfield\" target=\"_blank\">@devonstanfield</a>!!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1212859,
      "author_name": "TheStoneMX",
      "author_url": "",
      "post_date": "2021-02-21T17:06:32.073000",
      "content": "<p>hey, thanks a lot for sharing!! congrats great work. </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1212820,
      "author_name": "Andy Jian Zhou",
      "author_url": "",
      "post_date": "2021-02-21T16:27:30.873000",
      "content": "<p>Great soltuion! Couldn't wait to check it out haha. Wow, I had a 0.900 whilst using TF records PB LB. What helped you the most? tfhub layer?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1212255,
      "author_name": "Zungmann",
      "author_url": "",
      "post_date": "2021-02-21T03:46:59.703000",
      "content": "<p>Congratulation to your 2nd place!</p>\n<p>Your solution is very simple. OMG this is funny and irony at the same time. To put into context, I also submitted several  simple solutions with EffnetB3-B4 image size 512 and only train_test_split, only reach 0.883 and 0.884 public LB, no where near 0.9.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1212199,
      "author_name": "AhhA",
      "author_url": "",
      "post_date": "2021-02-21T01:50:36.427000",
      "content": "<p>thank you for your sharing! and congrats! </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1211829,
      "author_name": "tmoroder",
      "author_url": "",
      "post_date": "2021-02-20T15:39:17.707000",
      "content": "<p>Congratulations! This is really a funny story… but very good that you sticked to your own approach!</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1211214,
      "author_name": "Mohammed Rizin V K",
      "author_url": "",
      "post_date": "2021-02-20T04:25:24.410000",
      "content": "<p>Holy crab. Congratulations</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1212188,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-02-21T01:30:20.133000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1211950,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-02-20T17:31:31.977000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1211703,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-02-20T13:14:00.393000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1211157": "I joined the competition late, played around with some ideas, couldn't get a good model going, but I learned a lot though. As it neared the end of the competition, I figured I'd submit a simple fine-tuned model for the sake of having a submission.\n\nI looked up cassava pre-trained models and found [https://tfhub.dev/google/cropnet/classifier/cassava_disease_V1/2](url).\nTo setup the model on the TPU, I referred to tensorflow's tpu setup guides. \n\nTraining: [https://www.kaggle.com/devonstanfield/cassava-train](url)\nMy image preprocessing was minor, just a quick resize and rescale. Most of the functions in the data pipeline were to handle TFRecords. I also extended the training labels from 5 to 6 as to match the cassava model's output which included a \"background\" label.\nDuring training, I used \"EarlyStopping\" and \"ReduceLROnPlateau\". \nThe callbacks would cutoff training around ~30 epochs.\nI saved the model weights: [https://www.kaggle.com/devonstanfield/cassava-model](url) to a dataset, since we weren't allowed to perform inference on the TPU. I also saved the cached version of the tfhub layer to a dataset: [https://www.kaggle.com/devonstanfield/cassava-layer](url) since we weren't allowed the internet during inference.\n\nInference: [https://www.kaggle.com/devonstanfield/cassava-infer](url)\nBefore inference, I loaded the previously cached version of the model and the saved weights. The preprocessing pipeline was the same as training, mostly dealing with TFRecords. After passing the data through the model, I saved the results.\n\nOverall, I am surprised I placed 2nd. My approach was pretty much by-the-book basic. This was demonstrated by my model placing 660th in the public leaderboard with a score of 0.9025, landing right in the middle of a bunch of other people. I assumed they did the same thing I did. Go figure :)\n",
    "1213177": "Absolutely no disrespect intended, but I wonder if the pretraining performed by Makerere AI Lab included the private test set. I have a very hard time believing that a MobileNetV3-based model performed so well.",
    "1211590": "The pretrained model from Makerere University AI Lab. Amazing! ",
    "1211679": "haha!! nice!! you break it with less than 20 cells code ;)👍 you should give Google+Mak-AI lab a big hug :)\n\nEdit: it is even simpler than I thought - you have used only 75% of data to train (simple train/val split not kfold)",
    "1212102": "haha it was really funny to read this, congratulation @devonstanfield , this is the proof the the basics can go a long way.",
    "1213630": "Occam's razor personified. The simplest solution is almost always the right one. Great work ",
    "1211542": "Congratulations! I am shocked by this simple solution. It means that a simple pretrained MobileNet model killed a lot of complicated networks in this competition. Well done!!\n\nBy the way, it seems that you use a resolution of 224x224 which is much lower than what is commonly used like 512x512. The result is amazing.\n\nPerhaps the problem in itself is a bit tricky. We can see noticeable shake-ups in the private leaderboard.",
    "1211439": "Simple is best! Congratulations!",
    "1211369": "Mate, you'd better  change  your  title  to  2nd place solution  for  others'  convenient.\nBest  wishes .    :)",
    "1211329": "Congratulations on 2nd place! Your solution is simple, but effective on pb",
    "1211201": "Thanks for sharing! Can you update the title to reflect 2nd place solution? Congratulations on 2nd place!",
    "1246861": "@devonstanfield , Great solution! Thanks for sharing. I added it to my collection in [\"Data Science with DL & NLP: Advanced Techniques\"](https://www.kaggle.com/vbmokin/data-science-with-dl-nlp-advanced-techniques), section \"Prize Competition Winners: notebooks (kernels) and posts with Magic\".",
    "1211687": "congrats man,  that's the true 'working smart' way 👋👋👋",
    "2235402": "Great idea to use fine-tuning here, I had tried ResNet34 to train from scratch, but it never converged. ",
    "1338128": "Good Solution , its really surprising how simple approaches are winning solution to this competition.",
    "1258077": "I have just 1 doubt. The TFHub model is classifying the images into 6 categories. How did you manage to make predictions of 5 labels? \n\nI saw your code but I could not understand how!!\n\nI might sound stupid, but I am just a novice",
    "1213623": "Hahaha congratz. I was curious about your solution considering the low number of submissions. I should have looked for this type of pretrained model too, I used tf hub to train an efficient net at the beginning of the competition haha ",
    "1212891": "Finally, you have found the secret to success and that's \"you will never know what works\"!!! Congrat @devonstanfield!!",
    "1212859": "hey, thanks a lot for sharing!! congrats great work. ",
    "1212820": "Great soltuion! Couldn't wait to check it out haha. Wow, I had a 0.900 whilst using TF records PB LB. What helped you the most? tfhub layer?",
    "1212255": "Congratulation to your 2nd place!\n\nYour solution is very simple. OMG this is funny and irony at the same time. To put into context, I also submitted several  simple solutions with EffnetB3-B4 image size 512 and only train_test_split, only reach 0.883 and 0.884 public LB, no where near 0.9.",
    "1212199": "thank you for your sharing! and congrats! ",
    "1211829": "Congratulations! This is really a funny story... but very good that you sticked to your own approach!",
    "1211214": "Holy crab. Congratulations",
    "1212188": "",
    "1211950": "",
    "1211703": ""
  }
}