{
  "id": 661551,
  "title": "#1: It all depends on a good embedding",
  "url": "/competitions/biotrove-clustering/discussion/661551",
  "author_name": "AmbrosM",
  "post_date": "2025-12-12T18:58:56.588000",
  "votes": 3,
  "comment_count": 0,
  "views": 0,
  "content": "<p>My solution has two key elements: Starting with a good baseline and choosing a suitable embedding. For the baseline, see my <a href=\"https://www.kaggle.com/code/ambrosm/cbtd-baseline-submission\" target=\"_blank\">baseline notebook</a>. For the embedding, I computed five embeddings for all images (ResNet-50, EfficientNetV2-B0, ViT, BioCLIP and BioTrove-CLIP) and compared them using three methods:</p>\n<ol>\n<li>Which embedding shows the nicest clusters when reduced to two dimensions with t-SNE?</li>\n<li>Which embedding gives the highest accuracy when used with KNeighborsClassifier to classify the images into families (supervised learning)?</li>\n<li>Which embedding has the highest Calinski–Harabasz score when applied to the families?</li>\n</ol>\n<p>BioCLIP wins in all three comparisons:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2Fba9bc2ffb3d50007b13e5eee678262f4%2Ft-sne.png?generation=1765565688387725&amp;alt=media\" alt=\"t-SNE\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F41f711ee1543739481aceb0fbd6e75e4%2Fknn.png?generation=1765565643545096&amp;alt=media\" alt=\"KNN\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F7ed9e90106e7bbfd8c3a5ee814d4bb97%2Fchi.png?generation=1765565656643142&amp;alt=media\" alt=\"Calinski and Harabasz score\"></p>\n<p>With the right choice of embedding, clustering is easy:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/code/ambrosm/cbtd-bioclip-embeddings\" target=\"_blank\">BioCLIP embedding notebook</a></li>\n<li><a href=\"https://www.kaggle.com/code/ambrosm/cbtd-1-winning-model\" target=\"_blank\">Clustering notebook</a></li>\n</ul>\n<p>I thank the organizers for preparing this interesting challenge!</p>",
  "messages": [
    {
      "id": 3374718,
      "postDate": "2025-12-12T18:58:56.590Z",
      "content": "<p>My solution has two key elements: Starting with a good baseline and choosing a suitable embedding. For the baseline, see my <a href=\"https://www.kaggle.com/code/ambrosm/cbtd-baseline-submission\" target=\"_blank\">baseline notebook</a>. For the embedding, I computed five embeddings for all images (ResNet-50, EfficientNetV2-B0, ViT, BioCLIP and BioTrove-CLIP) and compared them using three methods:</p>\n<ol>\n<li>Which embedding shows the nicest clusters when reduced to two dimensions with t-SNE?</li>\n<li>Which embedding gives the highest accuracy when used with KNeighborsClassifier to classify the images into families (supervised learning)?</li>\n<li>Which embedding has the highest Calinski–Harabasz score when applied to the families?</li>\n</ol>\n<p>BioCLIP wins in all three comparisons:</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2Fba9bc2ffb3d50007b13e5eee678262f4%2Ft-sne.png?generation=1765565688387725&amp;alt=media\" alt=\"t-SNE\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F41f711ee1543739481aceb0fbd6e75e4%2Fknn.png?generation=1765565643545096&amp;alt=media\" alt=\"KNN\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F7ed9e90106e7bbfd8c3a5ee814d4bb97%2Fchi.png?generation=1765565656643142&amp;alt=media\" alt=\"Calinski and Harabasz score\"></p>\n<p>With the right choice of embedding, clustering is easy:</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/code/ambrosm/cbtd-bioclip-embeddings\" target=\"_blank\">BioCLIP embedding notebook</a></li>\n<li><a href=\"https://www.kaggle.com/code/ambrosm/cbtd-1-winning-model\" target=\"_blank\">Clustering notebook</a></li>\n</ul>\n<p>I thank the organizers for preparing this interesting challenge!</p>",
      "rawMarkdown": "My solution has two key elements: Starting with a good baseline and choosing a suitable embedding. For the baseline, see my [baseline notebook](https://www.kaggle.com/code/ambrosm/cbtd-baseline-submission). For the embedding, I computed five embeddings for all images (ResNet-50, EfficientNetV2-B0, ViT, BioCLIP and BioTrove-CLIP) and compared them using three methods:\n1. Which embedding shows the nicest clusters when reduced to two dimensions with t-SNE?\n1. Which embedding gives the highest accuracy when used with KNeighborsClassifier to classify the images into families (supervised learning)?\n1. Which embedding has the highest Calinski–Harabasz score when applied to the families?\n\nBioCLIP wins in all three comparisons:\n\n![t-SNE](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2Fba9bc2ffb3d50007b13e5eee678262f4%2Ft-sne.png?generation=1765565688387725&alt=media)\n\n![KNN](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F41f711ee1543739481aceb0fbd6e75e4%2Fknn.png?generation=1765565643545096&alt=media)\n\n![Calinski and Harabasz score](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F7ed9e90106e7bbfd8c3a5ee814d4bb97%2Fchi.png?generation=1765565656643142&alt=media)\n\nWith the right choice of embedding, clustering is easy:\n- [BioCLIP embedding notebook](https://www.kaggle.com/code/ambrosm/cbtd-bioclip-embeddings)\n- [Clustering notebook](https://www.kaggle.com/code/ambrosm/cbtd-1-winning-model)\n\nI thank the organizers for preparing this interesting challenge!\n",
      "votes": 3
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "3374718": "My solution has two key elements: Starting with a good baseline and choosing a suitable embedding. For the baseline, see my [baseline notebook](https://www.kaggle.com/code/ambrosm/cbtd-baseline-submission). For the embedding, I computed five embeddings for all images (ResNet-50, EfficientNetV2-B0, ViT, BioCLIP and BioTrove-CLIP) and compared them using three methods:\n1. Which embedding shows the nicest clusters when reduced to two dimensions with t-SNE?\n1. Which embedding gives the highest accuracy when used with KNeighborsClassifier to classify the images into families (supervised learning)?\n1. Which embedding has the highest Calinski–Harabasz score when applied to the families?\n\nBioCLIP wins in all three comparisons:\n\n![t-SNE](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2Fba9bc2ffb3d50007b13e5eee678262f4%2Ft-sne.png?generation=1765565688387725&alt=media)\n\n![KNN](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F41f711ee1543739481aceb0fbd6e75e4%2Fknn.png?generation=1765565643545096&alt=media)\n\n![Calinski and Harabasz score](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F7917824%2F7ed9e90106e7bbfd8c3a5ee814d4bb97%2Fchi.png?generation=1765565656643142&alt=media)\n\nWith the right choice of embedding, clustering is easy:\n- [BioCLIP embedding notebook](https://www.kaggle.com/code/ambrosm/cbtd-bioclip-embeddings)\n- [Clustering notebook](https://www.kaggle.com/code/ambrosm/cbtd-1-winning-model)\n\nI thank the organizers for preparing this interesting challenge!\n"
  }
}