{
  "id": 359490,
  "title": "18th Private LB Solution –> Silver",
  "content": "<p>Our team would like to deeply appreciate the Kaggle staff and Google for hosting this exciting competition as well as everyone here who compete. My congratulations to all participants!</p>\n<p>Special thanks to <a href=\"https://www.kaggle.com/ammarali32\" target=\"_blank\">@ammarali32</a> for hard and effective teamwork. We really enjoyed this competition!</p>\n<h2>Key points</h2>\n<ul>\n<li>Custom dataset</li>\n<li>CLIP visual encoder trained on LAION-2B, finetune for 22 epochs</li>\n<li>Train the projection layer using only ArcFaceMarginLayer</li>\n<li>Use a single projection FC layer with the size of 64 (better than using multiple FC)</li>\n<li>TTA – upscale image 224 -&gt; 240 helps to boost score by ~0.003-0.004</li>\n<li>Improve train time by embedding pre-extraction before the actual training starts. We found <a href=\"https://www.kaggle.com/code/motono0223/guie-tensorflow-clip-distancelayer-train-dim64\" target=\"_blank\">this technique</a> lately and did not rely on it so much. </li>\n</ul>\n<h2>Dataset</h2>\n<ul>\n<li>Google landmark recognition 2021 (7k classes, at most 35 images per class). Later we switched to a cleaned version of the GLR dataset, but, unfortunately, due to Out Of Memory exception happening on a regular basis, we were not able to test it completely</li>\n<li>Products10K (9691 classes, 141K images)</li>\n<li><a href=\"https://www.kaggle.com/datasets/maximvlah/edaotkryt\" target=\"_blank\">Open Food Facts dataset</a> (2k classes with at least 40 images per class) </li>\n<li><a href=\"https://www.kaggle.com/datasets/prondeau/the-car-connection-picture-dataset\" target=\"_blank\">60,000+ Images of Cars</a> (322 classes, 12K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/liucong12601/stanford-online-products-dataset\" target=\"_blank\">Stanford Online Products</a> (take only furniture, at least 10 images per class)</li>\n<li><a href=\"https://www.kaggle.com/datasets/andreybeyn/qudata-gembed-landmarks-210\" target=\"_blank\">Landmarks (210)</a> (210 classes, 10K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/kmader/food41\" target=\"_blank\">Food 41</a> (101 classes, 3K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/kerrit/dishes-67\" target=\"_blank\">Dishes 67</a> (67 classes, 670 images)</li>\n<li><a href=\"https://www.kaggle.com/datasets/sainikhileshreddy/food-recognition-2022\" target=\"_blank\">Food Recognition 2022</a> (500 classes, 12K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/kerrit/storefront-146\" target=\"_blank\">Storefront</a> (141 classes, 4.5k images) </li>\n</ul>\n<h2>What did not work</h2>\n<ul>\n<li>Strong augmentations while training</li>\n<li>Unsupervised learning with Contrastive loss</li>\n<li>Use images with zero padding for training</li>\n<li><a href=\"https://www.kaggle.com/datasets/rhtsingh/130k-images-512x512-universal-image-embeddings\" target=\"_blank\">MET</a>, art history datasets, 130K images </li>\n<li>Distance layer, ElasticArcFace</li>\n<li>AdaptiveAveragePooling, GeM pooling, Multi-linear layers (neck)</li>\n<li>Use a bigger number of images per class / bigger number of classes for the GLR dataset</li>\n</ul>",
  "comments": [
    {
      "id": 1986037,
      "author_name": "Man of the year",
      "author_url": "",
      "post_date": "2022-10-13T18:57:36.237000",
      "content": "<p>I don't understand, how one can fit 240x240 image to the ViT Clip, when it uses 224x224?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1986705,
          "author_name": "Igor Lashkov",
          "author_url": "",
          "post_date": "2022-10-14T08:14:41.620000",
          "content": "<p>Upscale to 240 and then apply a center crop</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1983836,
      "author_name": "ammarali32",
      "author_url": "",
      "post_date": "2022-10-12T09:14:57.573000",
      "content": "<p>Special thanks to you <a href=\"https://www.kaggle.com/igorlashkov\" target=\"_blank\">@igorlashkov</a>, You did all the hardwork and congrats for getting the competition master tier 🔥🎉 </p>",
      "votes": 1,
      "replies": [
        {
          "id": 1984647,
          "author_name": "Igor Lashkov",
          "author_url": "",
          "post_date": "2022-10-12T19:16:25.623000",
          "content": "<p>Thanks! 😊 </p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "comment_count": 4,
  "messages": [
    {
      "id": 1983829,
      "postDate": "2022-10-12T09:11:39.817Z",
      "content": "<p>Our team would like to deeply appreciate the Kaggle staff and Google for hosting this exciting competition as well as everyone here who compete. My congratulations to all participants!</p>\n<p>Special thanks to <a href=\"https://www.kaggle.com/ammarali32\" target=\"_blank\">@ammarali32</a> for hard and effective teamwork. We really enjoyed this competition!</p>\n<h2>Key points</h2>\n<ul>\n<li>Custom dataset</li>\n<li>CLIP visual encoder trained on LAION-2B, finetune for 22 epochs</li>\n<li>Train the projection layer using only ArcFaceMarginLayer</li>\n<li>Use a single projection FC layer with the size of 64 (better than using multiple FC)</li>\n<li>TTA – upscale image 224 -&gt; 240 helps to boost score by ~0.003-0.004</li>\n<li>Improve train time by embedding pre-extraction before the actual training starts. We found <a href=\"https://www.kaggle.com/code/motono0223/guie-tensorflow-clip-distancelayer-train-dim64\" target=\"_blank\">this technique</a> lately and did not rely on it so much. </li>\n</ul>\n<h2>Dataset</h2>\n<ul>\n<li>Google landmark recognition 2021 (7k classes, at most 35 images per class). Later we switched to a cleaned version of the GLR dataset, but, unfortunately, due to Out Of Memory exception happening on a regular basis, we were not able to test it completely</li>\n<li>Products10K (9691 classes, 141K images)</li>\n<li><a href=\"https://www.kaggle.com/datasets/maximvlah/edaotkryt\" target=\"_blank\">Open Food Facts dataset</a> (2k classes with at least 40 images per class) </li>\n<li><a href=\"https://www.kaggle.com/datasets/prondeau/the-car-connection-picture-dataset\" target=\"_blank\">60,000+ Images of Cars</a> (322 classes, 12K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/liucong12601/stanford-online-products-dataset\" target=\"_blank\">Stanford Online Products</a> (take only furniture, at least 10 images per class)</li>\n<li><a href=\"https://www.kaggle.com/datasets/andreybeyn/qudata-gembed-landmarks-210\" target=\"_blank\">Landmarks (210)</a> (210 classes, 10K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/kmader/food41\" target=\"_blank\">Food 41</a> (101 classes, 3K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/kerrit/dishes-67\" target=\"_blank\">Dishes 67</a> (67 classes, 670 images)</li>\n<li><a href=\"https://www.kaggle.com/datasets/sainikhileshreddy/food-recognition-2022\" target=\"_blank\">Food Recognition 2022</a> (500 classes, 12K images) </li>\n<li><a href=\"https://www.kaggle.com/datasets/kerrit/storefront-146\" target=\"_blank\">Storefront</a> (141 classes, 4.5k images) </li>\n</ul>\n<h2>What did not work</h2>\n<ul>\n<li>Strong augmentations while training</li>\n<li>Unsupervised learning with Contrastive loss</li>\n<li>Use images with zero padding for training</li>\n<li><a href=\"https://www.kaggle.com/datasets/rhtsingh/130k-images-512x512-universal-image-embeddings\" target=\"_blank\">MET</a>, art history datasets, 130K images </li>\n<li>Distance layer, ElasticArcFace</li>\n<li>AdaptiveAveragePooling, GeM pooling, Multi-linear layers (neck)</li>\n<li>Use a bigger number of images per class / bigger number of classes for the GLR dataset</li>\n</ul>",
      "rawMarkdown": "Our team would like to deeply appreciate the Kaggle staff and Google for hosting this exciting competition as well as everyone here who compete. My congratulations to all participants!\n\nSpecial thanks to @ammarali32 for hard and effective teamwork. We really enjoyed this competition!\n\n## Key points\n- Custom dataset\n- CLIP visual encoder trained on LAION-2B, finetune for 22 epochs\n- Train the projection layer using only ArcFaceMarginLayer\n- Use a single projection FC layer with the size of 64 (better than using multiple FC)\n- TTA – upscale image 224 -> 240 helps to boost score by ~0.003-0.004\n- Improve train time by embedding pre-extraction before the actual training starts. We found [this technique](https://www.kaggle.com/code/motono0223/guie-tensorflow-clip-distancelayer-train-dim64) lately and did not rely on it so much. \n\n## Dataset\n- Google landmark recognition 2021 (7k classes, at most 35 images per class). Later we switched to a cleaned version of the GLR dataset, but, unfortunately, due to Out Of Memory exception happening on a regular basis, we were not able to test it completely\n- Products10K (9691 classes, 141K images)\n- [Open Food Facts dataset](https://www.kaggle.com/datasets/maximvlah/edaotkryt) (2k classes with at least 40 images per class) \n- [60,000+ Images of Cars](https://www.kaggle.com/datasets/prondeau/the-car-connection-picture-dataset) (322 classes, 12K images) \n- [Stanford Online Products](https://www.kaggle.com/datasets/liucong12601/stanford-online-products-dataset) (take only furniture, at least 10 images per class)\n- [Landmarks (210)](https://www.kaggle.com/datasets/andreybeyn/qudata-gembed-landmarks-210) (210 classes, 10K images) \n- [Food 41](https://www.kaggle.com/datasets/kmader/food41) (101 classes, 3K images) \n- [Dishes 67](https://www.kaggle.com/datasets/kerrit/dishes-67) (67 classes, 670 images)\n- [Food Recognition 2022](https://www.kaggle.com/datasets/sainikhileshreddy/food-recognition-2022) (500 classes, 12K images) \n- [Storefront](https://www.kaggle.com/datasets/kerrit/storefront-146) (141 classes, 4.5k images) \n\n## What did not work\n- Strong augmentations while training\n- Unsupervised learning with Contrastive loss\n- Use images with zero padding for training\n- [MET](https://www.kaggle.com/datasets/rhtsingh/130k-images-512x512-universal-image-embeddings), art history datasets, 130K images \n- Distance layer, ElasticArcFace\n- AdaptiveAveragePooling, GeM pooling, Multi-linear layers (neck)\n- Use a bigger number of images per class / bigger number of classes for the GLR dataset\n",
      "votes": 8
    },
    {
      "id": 1986037,
      "postDate": "2022-10-13T18:57:36.237Z",
      "content": "<p>I don't understand, how one can fit 240x240 image to the ViT Clip, when it uses 224x224?</p>",
      "rawMarkdown": "I don't understand, how one can fit 240x240 image to the ViT Clip, when it uses 224x224?",
      "votes": 1,
      "replies": [
        {
          "id": 1986705,
          "postDate": "2022-10-14T08:14:41.620Z",
          "content": "<p>Upscale to 240 and then apply a center crop</p>",
          "rawMarkdown": "Upscale to 240 and then apply a center crop"
        }
      ]
    },
    {
      "id": 1983836,
      "postDate": "2022-10-12T09:14:57.573Z",
      "content": "<p>Special thanks to you <a href=\"https://www.kaggle.com/igorlashkov\" target=\"_blank\">@igorlashkov</a>, You did all the hardwork and congrats for getting the competition master tier 🔥🎉 </p>",
      "rawMarkdown": "Special thanks to you @igorlashkov, You did all the hardwork and congrats for getting the competition master tier 🔥🎉 ",
      "votes": 1,
      "replies": [
        {
          "id": 1984647,
          "postDate": "2022-10-12T19:16:25.623Z",
          "content": "<p>Thanks! 😊 </p>",
          "rawMarkdown": "Thanks! 😊 "
        }
      ]
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-22T08:33:06Z",
  "competition_id": 36414,
  "competition_slug": "google-universal-image-embedding",
  "team_id": 8897478,
  "solution_url": "/competitions/google-universal-image-embedding/writeups/ammar-igor-18th-private-lb-solution-silver"
}