{
  "id": 320644,
  "title": "Solo silver - minimum resources solution with heavy postprocessing",
  "url": "/competitions/happy-whale-and-dolphin/discussion/320644",
  "author_name": "Allie K.",
  "post_date": "2022-04-22T16:51:38.861000",
  "votes": 9,
  "comment_count": 0,
  "views": 0,
  "content": "<p>It was an amazing but tough competition especially for those who went solo. <br>\nHW : Kaggle TPU for models' weights, Kaggle GPU for embeddings and nearest neighbours calculations, home mostly CPU for final postprocessing<br>\nUsed public datasets: backfintfrecords by <a href=\"https://www.kaggle.com/jpbremer\" target=\"_blank\">@jpbremer</a>, happywhale-tfrecords-fullbody-768 and happywhale-tfrecords-backfin-768 by <a href=\"https://www.kaggle.com/ragner123\" target=\"_blank\">@ragner123</a> - big thanks to both the authors, before all to <a href=\"https://www.kaggle.com/jpbremer\" target=\"_blank\">@jpbremer</a> for all the annotations!<br>\nPrivate dataset for species classification.<br>\nModels : effnetv1_b7 with ArcFace loss, image resolution: 768, batch size: 64 and 80, basic little bit tuned augmentation.</p>\n<p><strong>Postprocessing</strong><br>\nTraining models and calculating embeddings meant for me 5 weeks of suffering with tensorflow. This fact together with different folds' distributions and species/individual_id encodings for used datasets led me to the decision to use only <strong>nearest neighbours dataframes</strong>  calculated for each single model (fold), not concatenating directly the embeddings.</p>\n<p>I divided the test images into 4 categories based on the species predictions and the species body characteristics (before all fins). For each category I took a different set of NN DFs, limited them only to images from the particular category, concatenated them, grouped by [image, target] pairs, calculated mean and count of present predictions. I left only pairs with high enough count of presence (e.g. 6 of 7), set the threshold for new_individual based on  the category and calculated the appropriate part of the final submission. In the end I concatenated the 4 parts of the submission together.</p>\n<p>What I tried and was only lost time: training inside groups of species (e.g. no-fin separately) didn't work for me<br>\nWhat could have been done better:<br>\nNearly everything about the models - tuning parameters, trying other backbones …<br>\nWhat I regret most, that I didn't have time to realize my original idea to create a bigger training set with augmented images of the individual_ids with less than 3 images. This could be the key to better results.</p>\n<p>My big thanks and deepest respect go to the host organization Happywhale and to all their contributors for preparing such a great dataset and for spreading awareness about the world of these magnificent creatures.<br>\nCongrats and thanks to all those who created and presented their great solutions, the host will have really something to choose from.</p>",
  "messages": [
    {
      "id": 1764640,
      "postDate": "2022-04-22T16:51:38.863Z",
      "content": "<p>It was an amazing but tough competition especially for those who went solo. <br>\nHW : Kaggle TPU for models' weights, Kaggle GPU for embeddings and nearest neighbours calculations, home mostly CPU for final postprocessing<br>\nUsed public datasets: backfintfrecords by <a href=\"https://www.kaggle.com/jpbremer\" target=\"_blank\">@jpbremer</a>, happywhale-tfrecords-fullbody-768 and happywhale-tfrecords-backfin-768 by <a href=\"https://www.kaggle.com/ragner123\" target=\"_blank\">@ragner123</a> - big thanks to both the authors, before all to <a href=\"https://www.kaggle.com/jpbremer\" target=\"_blank\">@jpbremer</a> for all the annotations!<br>\nPrivate dataset for species classification.<br>\nModels : effnetv1_b7 with ArcFace loss, image resolution: 768, batch size: 64 and 80, basic little bit tuned augmentation.</p>\n<p><strong>Postprocessing</strong><br>\nTraining models and calculating embeddings meant for me 5 weeks of suffering with tensorflow. This fact together with different folds' distributions and species/individual_id encodings for used datasets led me to the decision to use only <strong>nearest neighbours dataframes</strong>  calculated for each single model (fold), not concatenating directly the embeddings.</p>\n<p>I divided the test images into 4 categories based on the species predictions and the species body characteristics (before all fins). For each category I took a different set of NN DFs, limited them only to images from the particular category, concatenated them, grouped by [image, target] pairs, calculated mean and count of present predictions. I left only pairs with high enough count of presence (e.g. 6 of 7), set the threshold for new_individual based on  the category and calculated the appropriate part of the final submission. In the end I concatenated the 4 parts of the submission together.</p>\n<p>What I tried and was only lost time: training inside groups of species (e.g. no-fin separately) didn't work for me<br>\nWhat could have been done better:<br>\nNearly everything about the models - tuning parameters, trying other backbones …<br>\nWhat I regret most, that I didn't have time to realize my original idea to create a bigger training set with augmented images of the individual_ids with less than 3 images. This could be the key to better results.</p>\n<p>My big thanks and deepest respect go to the host organization Happywhale and to all their contributors for preparing such a great dataset and for spreading awareness about the world of these magnificent creatures.<br>\nCongrats and thanks to all those who created and presented their great solutions, the host will have really something to choose from.</p>",
      "rawMarkdown": "It was an amazing but tough competition especially for those who went solo. \nHW : Kaggle TPU for models' weights, Kaggle GPU for embeddings and nearest neighbours calculations, home mostly CPU for final postprocessing\nUsed public datasets: backfintfrecords by @jpbremer, happywhale-tfrecords-fullbody-768 and happywhale-tfrecords-backfin-768 by @ragner123 - big thanks to both the authors, before all to @jpbremer for all the annotations!\nPrivate dataset for species classification.\nModels : effnetv1_b7 with ArcFace loss, image resolution: 768, batch size: 64 and 80, basic little bit tuned augmentation.\n\n**Postprocessing**\nTraining models and calculating embeddings meant for me 5 weeks of suffering with tensorflow. This fact together with different folds' distributions and species/individual_id encodings for used datasets led me to the decision to use only **nearest neighbours dataframes**  calculated for each single model (fold), not concatenating directly the embeddings.\n\nI divided the test images into 4 categories based on the species predictions and the species body characteristics (before all fins). For each category I took a different set of NN DFs, limited them only to images from the particular category, concatenated them, grouped by [image, target] pairs, calculated mean and count of present predictions. I left only pairs with high enough count of presence (e.g. 6 of 7), set the threshold for new_individual based on  the category and calculated the appropriate part of the final submission. In the end I concatenated the 4 parts of the submission together.\n\nWhat I tried and was only lost time: training inside groups of species (e.g. no-fin separately) didn't work for me\nWhat could have been done better:\nNearly everything about the models - tuning parameters, trying other backbones ...\nWhat I regret most, that I didn't have time to realize my original idea to create a bigger training set with augmented images of the individual_ids with less than 3 images. This could be the key to better results.\n\nMy big thanks and deepest respect go to the host organization Happywhale and to all their contributors for preparing such a great dataset and for spreading awareness about the world of these magnificent creatures.\nCongrats and thanks to all those who created and presented their great solutions, the host will have really something to choose from.",
      "votes": 9
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1764640": "It was an amazing but tough competition especially for those who went solo. \nHW : Kaggle TPU for models' weights, Kaggle GPU for embeddings and nearest neighbours calculations, home mostly CPU for final postprocessing\nUsed public datasets: backfintfrecords by @jpbremer, happywhale-tfrecords-fullbody-768 and happywhale-tfrecords-backfin-768 by @ragner123 - big thanks to both the authors, before all to @jpbremer for all the annotations!\nPrivate dataset for species classification.\nModels : effnetv1_b7 with ArcFace loss, image resolution: 768, batch size: 64 and 80, basic little bit tuned augmentation.\n\n**Postprocessing**\nTraining models and calculating embeddings meant for me 5 weeks of suffering with tensorflow. This fact together with different folds' distributions and species/individual_id encodings for used datasets led me to the decision to use only **nearest neighbours dataframes**  calculated for each single model (fold), not concatenating directly the embeddings.\n\nI divided the test images into 4 categories based on the species predictions and the species body characteristics (before all fins). For each category I took a different set of NN DFs, limited them only to images from the particular category, concatenated them, grouped by [image, target] pairs, calculated mean and count of present predictions. I left only pairs with high enough count of presence (e.g. 6 of 7), set the threshold for new_individual based on  the category and calculated the appropriate part of the final submission. In the end I concatenated the 4 parts of the submission together.\n\nWhat I tried and was only lost time: training inside groups of species (e.g. no-fin separately) didn't work for me\nWhat could have been done better:\nNearly everything about the models - tuning parameters, trying other backbones ...\nWhat I regret most, that I didn't have time to realize my original idea to create a bigger training set with augmented images of the individual_ids with less than 3 images. This could be the key to better results.\n\nMy big thanks and deepest respect go to the host organization Happywhale and to all their contributors for preparing such a great dataset and for spreading awareness about the world of these magnificent creatures.\nCongrats and thanks to all those who created and presented their great solutions, the host will have really something to choose from."
  }
}