{
  "id": 359351,
  "title": "9th place solution: finetune CLIP ViT-H/14",
  "content": "<p>First of all, I thank the organizers for this great competition!</p>\n<p>My solution is heavily based on <a href=\"https://www.kaggle.com/motono0223\" target=\"_blank\">@motono0223</a>'s work. Thank you very much!<br>\n<a href=\"https://www.kaggle.com/code/motono0223/guie-clip-tensorflow-train-example\" target=\"_blank\">https://www.kaggle.com/code/motono0223/guie-clip-tensorflow-train-example</a></p>\n<p><a href=\"https://www.kaggle.com/code/akihirok/9th-place-guie-fintune-tf-clip-trainable/notebook\" target=\"_blank\">* My code is now public *</a></p>\n<h2>Key improvements over the original work</h2>\n<ul>\n<li>Input 64D vectors to ArcFace (instead of 256D ones) (~ 0.01 gain)</li>\n<li><a href=\"https://laion.ai/blog/large-openclip/\" target=\"_blank\">Open CLIP ViT-H/14 on LAION-2B</a> (~ 0.08 gain)</li>\n<li>Reduce LR linearly (~ 0.01 gain)</li>\n<li>Finetune backbone CLIP model for 1 epoch w/ low LR w/o DA (~ 0.02 gain)<ul>\n<li>1 epoch = 10 epochs in the <a href=\"https://www.kaggle.com/motono0223\" target=\"_blank\">@motono0223</a>'s work</li></ul></li>\n</ul>\n<h2>Dataset</h2>\n<p>I indeed thought that finding nice datasets was the most important thing to win the competition.<br>\nHowever, I eventually used the same datasets as the original work.<br>\nI couldn't find any other dataset which works well. 😭</p>\n<p>Products-10K &gt; Landmark Retrieval 2021 &gt; ImageNet-1K &gt; Deep Fashion = Food Recognition &gt; others (in my best knowledge)</p>\n<h2>Note</h2>\n<ul>\n<li>I suffered from random OOM errors in submission (with CLIP H/14). I gave up more complex architecture because of this. (why you can do an ensemble or TTA? 🤔)</li>\n</ul>\n<p>Thank you for reading!</p>",
  "comments": [
    {
      "id": 1983846,
      "author_name": "RocketScience",
      "author_url": "",
      "post_date": "2022-10-12T09:25:57.683000",
      "content": "<p>What I found is that ensembling multiple CLIP backbones togther via tensorflow may throw exactly same error as more complicated CLIP structures, while top ensemble-based solutions provided in PyTorch can be smoothly evaluated and now I wonder what is actually happening.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1983849,
          "author_name": "Akihiro Katsura",
          "author_url": "",
          "post_date": "2022-10-12T09:34:52.300000",
          "content": "<p>PyTorch was all I needed 😂</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1983030,
      "author_name": "Nanashi",
      "author_url": "",
      "post_date": "2022-10-11T18:38:20.300000",
      "content": "<p><a href=\"https://www.kaggle.com/akihirok\" target=\"_blank\">@akihirok</a>  congrats! we have a similar setup with more tricks :) Interesting that all your code is apparently tensorflow-based</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1983501,
      "author_name": "Wenxuan Ye",
      "author_url": "",
      "post_date": "2022-10-12T05:09:07.590000",
      "content": "<p>How do you solve the problem:\"ResourceExhaustedError: received trailing metadata size exceeds limit\"</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1983825,
          "author_name": "Akihiro Katsura",
          "author_url": "",
          "post_date": "2022-10-12T09:04:14.860000",
          "content": "<p>I didn't experience that actually.<br>\nTry the notebook I shared 😃</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "comment_count": 5,
  "messages": [
    {
      "id": 1982968,
      "postDate": "2022-10-11T18:03:44.800Z",
      "content": "<p>First of all, I thank the organizers for this great competition!</p>\n<p>My solution is heavily based on <a href=\"https://www.kaggle.com/motono0223\" target=\"_blank\">@motono0223</a>'s work. Thank you very much!<br>\n<a href=\"https://www.kaggle.com/code/motono0223/guie-clip-tensorflow-train-example\" target=\"_blank\">https://www.kaggle.com/code/motono0223/guie-clip-tensorflow-train-example</a></p>\n<p><a href=\"https://www.kaggle.com/code/akihirok/9th-place-guie-fintune-tf-clip-trainable/notebook\" target=\"_blank\">* My code is now public *</a></p>\n<h2>Key improvements over the original work</h2>\n<ul>\n<li>Input 64D vectors to ArcFace (instead of 256D ones) (~ 0.01 gain)</li>\n<li><a href=\"https://laion.ai/blog/large-openclip/\" target=\"_blank\">Open CLIP ViT-H/14 on LAION-2B</a> (~ 0.08 gain)</li>\n<li>Reduce LR linearly (~ 0.01 gain)</li>\n<li>Finetune backbone CLIP model for 1 epoch w/ low LR w/o DA (~ 0.02 gain)<ul>\n<li>1 epoch = 10 epochs in the <a href=\"https://www.kaggle.com/motono0223\" target=\"_blank\">@motono0223</a>'s work</li></ul></li>\n</ul>\n<h2>Dataset</h2>\n<p>I indeed thought that finding nice datasets was the most important thing to win the competition.<br>\nHowever, I eventually used the same datasets as the original work.<br>\nI couldn't find any other dataset which works well. 😭</p>\n<p>Products-10K &gt; Landmark Retrieval 2021 &gt; ImageNet-1K &gt; Deep Fashion = Food Recognition &gt; others (in my best knowledge)</p>\n<h2>Note</h2>\n<ul>\n<li>I suffered from random OOM errors in submission (with CLIP H/14). I gave up more complex architecture because of this. (why you can do an ensemble or TTA? 🤔)</li>\n</ul>\n<p>Thank you for reading!</p>",
      "rawMarkdown": "First of all, I thank the organizers for this great competition!\n\nMy solution is heavily based on @motono0223's work. Thank you very much!\nhttps://www.kaggle.com/code/motono0223/guie-clip-tensorflow-train-example\n\n[* My code is now public *](https://www.kaggle.com/code/akihirok/9th-place-guie-fintune-tf-clip-trainable/notebook)\n\n## Key improvements over the original work\n\n- Input 64D vectors to ArcFace (instead of 256D ones) (~ 0.01 gain)\n- [Open CLIP ViT-H/14 on LAION-2B](https://laion.ai/blog/large-openclip/) (~ 0.08 gain)\n- Reduce LR linearly (~ 0.01 gain)\n- Finetune backbone CLIP model for 1 epoch w/ low LR w/o DA (~ 0.02 gain)\n    - 1 epoch = 10 epochs in the @motono0223's work\n\n## Dataset\n\nI indeed thought that finding nice datasets was the most important thing to win the competition.\nHowever, I eventually used the same datasets as the original work.\nI couldn't find any other dataset which works well. 😭\n\nProducts-10K > Landmark Retrieval 2021 > ImageNet-1K > Deep Fashion = Food Recognition > others (in my best knowledge)\n\n## Note\n\n- I suffered from random OOM errors in submission (with CLIP H/14). I gave up more complex architecture because of this. (why you can do an ensemble or TTA? 🤔)\n\nThank you for reading!",
      "votes": 20
    },
    {
      "id": 1983846,
      "postDate": "2022-10-12T09:25:57.683Z",
      "content": "<p>What I found is that ensembling multiple CLIP backbones togther via tensorflow may throw exactly same error as more complicated CLIP structures, while top ensemble-based solutions provided in PyTorch can be smoothly evaluated and now I wonder what is actually happening.</p>",
      "rawMarkdown": "What I found is that ensembling multiple CLIP backbones togther via tensorflow may throw exactly same error as more complicated CLIP structures, while top ensemble-based solutions provided in PyTorch can be smoothly evaluated and now I wonder what is actually happening.",
      "votes": 1,
      "replies": [
        {
          "id": 1983849,
          "postDate": "2022-10-12T09:34:52.300Z",
          "content": "<p>PyTorch was all I needed 😂</p>",
          "rawMarkdown": "PyTorch was all I needed 😂",
          "votes": 1
        }
      ]
    },
    {
      "id": 1983030,
      "postDate": "2022-10-11T18:38:20.300Z",
      "content": "<p><a href=\"https://www.kaggle.com/akihirok\" target=\"_blank\">@akihirok</a>  congrats! we have a similar setup with more tricks :) Interesting that all your code is apparently tensorflow-based</p>",
      "rawMarkdown": "@akihirok  congrats! we have a similar setup with more tricks :) Interesting that all your code is apparently tensorflow-based",
      "votes": 1
    },
    {
      "id": 1983501,
      "postDate": "2022-10-12T05:09:07.590Z",
      "content": "<p>How do you solve the problem:\"ResourceExhaustedError: received trailing metadata size exceeds limit\"</p>",
      "rawMarkdown": "How do you solve the problem:\"ResourceExhaustedError: received trailing metadata size exceeds limit\"",
      "replies": [
        {
          "id": 1983825,
          "postDate": "2022-10-12T09:04:14.860Z",
          "content": "<p>I didn't experience that actually.<br>\nTry the notebook I shared 😃</p>",
          "rawMarkdown": "I didn't experience that actually.\nTry the notebook I shared 😃"
        }
      ]
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-22T08:35:11Z",
  "competition_id": 36414,
  "competition_slug": "google-universal-image-embedding",
  "team_id": 9061641,
  "solution_url": "/competitions/google-universal-image-embedding/writeups/akihiro-katsura-9th-place-solution-finetune-clip-v"
}