{
  "id": 433732,
  "title": "First Kaggle competition : 10th place public leaderboard; Nth place private leaderboard",
  "url": "/competitions/cafa-5-protein-function-prediction/writeups/synthetic-goose-first-kaggle-competition-10th-plac",
  "author_name": "",
  "post_date": "2024-01-02T20:30:23.847Z",
  "votes": 25,
  "comment_count": 17,
  "views": 0,
  "content": "<h2><strong>Introduction</strong></h2>\n<p>Firstly I want to thank the organizers for a very nice competition - having it based on Kaggle opened up submissions to a wider range of people compared to previous iterations when mainly specialist labs showed results so the wider net of people being exposed to CAFA is really gratifying to see. My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made. Both of us are molecular biologists with only limited bioinformatics and machine learning experience - so this competition was something of a trial by fire and we learned a lot from taking part.</p>\n<h2><strong>Approach</strong></h2>\n<p>We used these datasets in our model: <br>\n1) Prot-T5, ESM2, and Ankh Protein Language Model (PLM) embeddings. We carried out no further modifications or finetuning on the output of PLMs, only conversion to float32 to save memory. <br>\n2) A single binary matrix representing species taxonomy for each protein.<br>\n3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein</p>\n<p>For GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model to classify by taking the top N labels sorted by IA*frequency. </p>\n<p>Datasets were sorted in alphabetical order to ensure identical ordering across datasets as well as removal of single duplicate row in test data. </p>\n<p>We made a simple dense neural network in keras that takes these as separate inputs before concatenating them into a final layer that attempts to predict every label from a single GO ontology/domain. We used binary cross entropy (BCE) as our loss function and Adam optimizer with lr=0.0003 and a simple lr scheduler. We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.</p>\n<p>Our model was trained with KFold = 5 across 5 different random splits of the training data before a simple average of predictions was made for each ontology/domain and the results concatenated. </p>\n<p>One interesting thing we observed is that Ridge regression sometimes performed better on PLM embeddings compared to a neural network for some ontologies, which was unexpected and might indicate underfitting for the neural network. </p>\n<h2><strong>What didn't work</strong></h2>\n<p>ProtBert embeddings performed poorly and were not utilized at all. <br>\nData from STRING did not prove helpful in the final model. <br>\nWe attempted to use a separate transformer layer that takes in label embeddings created with Anc2Vec (<a href=\"https://academic.oup.com/bib/article/23/2/bbac003/6523148\" target=\"_blank\">https://academic.oup.com/bib/article/23/2/bbac003/6523148</a>) but it did not improve model performance.<br>\nWe attempted to use a hierarchy aware loss function (<a href=\"https://papers.nips.cc/paper/2020/file/6dd4e10e3296fa63738371ec0d5df818-Paper.pdf\" target=\"_blank\">https://papers.nips.cc/paper/2020/file/6dd4e10e3296fa63738371ec0d5df818-Paper.pdf</a>) but it did not perform better than BCE.</p>\n<h2><strong>Scores</strong></h2>\n<p>Using merely the PLM embeddings along with taxonomic information we obtained a public leaderboard (PL) score of about 0.55. Including text information increases the PL score to ~0.58.<br>\nEnsembling with a public ensemble notebook (<a href=\"https://www.kaggle.com/code/adaluodao/merge-datasets\" target=\"_blank\">https://www.kaggle.com/code/adaluodao/merge-datasets</a>) increases PL score to ~0.62.</p>\n<h2><strong>EDIT</strong></h2>\n<p>4th place overall! <br>\nCode used to generate our models can be found here:<br>\n<a href=\"https://github.com/zongmingchua/cafa5\" target=\"_blank\">https://github.com/zongmingchua/cafa5</a> <br>\nFinal ensembling is shown here:<br>\n<a href=\"https://www.kaggle.com/code/zmcxjt/merge-datasets\" target=\"_blank\">https://www.kaggle.com/code/zmcxjt/merge-datasets</a></p>",
  "messages": [
    {
      "id": "2403549",
      "postDate": "08/22/2023 18:01:30",
      "content": "<h2><strong>Introduction</strong></h2>\n<p>Firstly I want to thank the organizers for a very nice competition - having it based on Kaggle opened up submissions to a wider range of people compared to previous iterations when mainly specialist labs showed results so the wider net of people being exposed to CAFA is really gratifying to see. My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made. Both of us are molecular biologists with only limited bioinformatics and machine learning experience - so this competition was something of a trial by fire and we learned a lot from taking part.</p>\n<h2><strong>Approach</strong></h2>\n<p>We used these datasets in our model: <br>\n1) Prot-T5, ESM2, and Ankh Protein Language Model (PLM) embeddings. We carried out no further modifications or finetuning on the output of PLMs, only conversion to float32 to save memory. <br>\n2) A single binary matrix representing species taxonomy for each protein.<br>\n3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein</p>\n<p>For GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model to classify by taking the top N labels sorted by IA*frequency. </p>\n<p>Datasets were sorted in alphabetical order to ensure identical ordering across datasets as well as removal of single duplicate row in test data. </p>\n<p>We made a simple dense neural network in keras that takes these as separate inputs before concatenating them into a final layer that attempts to predict every label from a single GO ontology/domain. We used binary cross entropy (BCE) as our loss function and Adam optimizer with lr=0.0003 and a simple lr scheduler. We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.</p>\n<p>Our model was trained with KFold = 5 across 5 different random splits of the training data before a simple average of predictions was made for each ontology/domain and the results concatenated. </p>\n<p>One interesting thing we observed is that Ridge regression sometimes performed better on PLM embeddings compared to a neural network for some ontologies, which was unexpected and might indicate underfitting for the neural network. </p>\n<h2><strong>What didn't work</strong></h2>\n<p>ProtBert embeddings performed poorly and were not utilized at all. <br>\nData from STRING did not prove helpful in the final model. <br>\nWe attempted to use a separate transformer layer that takes in label embeddings created with Anc2Vec (<a href=\"https://academic.oup.com/bib/article/23/2/bbac003/6523148\" target=\"_blank\">https://academic.oup.com/bib/article/23/2/bbac003/6523148</a>) but it did not improve model performance.<br>\nWe attempted to use a hierarchy aware loss function (<a href=\"https://papers.nips.cc/paper/2020/file/6dd4e10e3296fa63738371ec0d5df818-Paper.pdf\" target=\"_blank\">https://papers.nips.cc/paper/2020/file/6dd4e10e3296fa63738371ec0d5df818-Paper.pdf</a>) but it did not perform better than BCE.</p>\n<h2><strong>Scores</strong></h2>\n<p>Using merely the PLM embeddings along with taxonomic information we obtained a public leaderboard (PL) score of about 0.55. Including text information increases the PL score to ~0.58.<br>\nEnsembling with a public ensemble notebook (<a href=\"https://www.kaggle.com/code/adaluodao/merge-datasets\" target=\"_blank\">https://www.kaggle.com/code/adaluodao/merge-datasets</a>) increases PL score to ~0.62.</p>\n<h2><strong>EDIT</strong></h2>\n<p>4th place overall! <br>\nCode used to generate our models can be found here:<br>\n<a href=\"https://github.com/zongmingchua/cafa5\" target=\"_blank\">https://github.com/zongmingchua/cafa5</a> <br>\nFinal ensembling is shown here:<br>\n<a href=\"https://www.kaggle.com/code/zmcxjt/merge-datasets\" target=\"_blank\">https://www.kaggle.com/code/zmcxjt/merge-datasets</a></p>",
      "rawMarkdown": "## **Introduction**\nFirstly I want to thank the organizers for a very nice competition - having it based on Kaggle opened up submissions to a wider range of people compared to previous iterations when mainly specialist labs showed results so the wider net of people being exposed to CAFA is really gratifying to see. My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made. Both of us are molecular biologists with only limited bioinformatics and machine learning experience - so this competition was something of a trial by fire and we learned a lot from taking part.\n\n##**Approach**\nWe used these datasets in our model: \n1) Prot-T5, ESM2, and Ankh Protein Language Model (PLM) embeddings. We carried out no further modifications or finetuning on the output of PLMs, only conversion to float32 to save memory. \n2) A single binary matrix representing species taxonomy for each protein.\n3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein\n\nFor GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model to classify by taking the top N labels sorted by IA*frequency. \n\nDatasets were sorted in alphabetical order to ensure identical ordering across datasets as well as removal of single duplicate row in test data. \n\nWe made a simple dense neural network in keras that takes these as separate inputs before concatenating them into a final layer that attempts to predict every label from a single GO ontology/domain. We used binary cross entropy (BCE) as our loss function and Adam optimizer with lr=0.0003 and a simple lr scheduler. We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.\n\nOur model was trained with KFold = 5 across 5 different random splits of the training data before a simple average of predictions was made for each ontology/domain and the results concatenated. \n\nOne interesting thing we observed is that Ridge regression sometimes performed better on PLM embeddings compared to a neural network for some ontologies, which was unexpected and might indicate underfitting for the neural network. \n\n##**What didn't work**\nProtBert embeddings performed poorly and were not utilized at all. \nData from STRING did not prove helpful in the final model. \nWe attempted to use a separate transformer layer that takes in label embeddings created with Anc2Vec (https://academic.oup.com/bib/article/23/2/bbac003/6523148) but it did not improve model performance.\nWe attempted to use a hierarchy aware loss function (https://papers.nips.cc/paper/2020/file/6dd4e10e3296fa63738371ec0d5df818-Paper.pdf) but it did not perform better than BCE.\n\n##**Scores**\nUsing merely the PLM embeddings along with taxonomic information we obtained a public leaderboard (PL) score of about 0.55. Including text information increases the PL score to ~0.58.\nEnsembling with a public ensemble notebook (https://www.kaggle.com/code/adaluodao/merge-datasets) increases PL score to ~0.62.\n\n\n##**EDIT**\n4th place overall! \nCode used to generate our models can be found here:\nhttps://github.com/zongmingchua/cafa5 \nFinal ensembling is shown here:\nhttps://www.kaggle.com/code/zmcxjt/merge-datasets",
      "votes": null
    },
    {
      "id": "2403600",
      "postDate": "08/22/2023 18:26:36",
      "content": "<blockquote>\n  <p>My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made.</p>\n</blockquote>\n<p>Given your background, I would hardly consider that you fell short.</p>\n<p>There are many nice ideas in your solution. I haven't thought about adding text-based information, though it makes sense in retrospect. I don't think that would necessarily work as a general solution because many proteins are not correctly annotated. Still, for relatively well studied organisms that are targeted in this competition it should work.</p>",
      "rawMarkdown": "> My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made.\n\nGiven your background, I would hardly consider that you fell short.\n\nThere are many nice ideas in your solution. I haven't thought about adding text-based information, though it makes sense in retrospect. I don't think that would necessarily work as a general solution because many proteins are not correctly annotated. Still, for relatively well studied organisms that are targeted in this competition it should work.",
      "votes": null
    },
    {
      "id": "2403619",
      "postDate": "08/22/2023 18:40:57",
      "content": "<p>Thank you for the kind words. Using text based information from paper abstracts is a method we borrowed directly from that of Zhu lab's NetGO model but it really only helps you with proteins that are adequately described in the literature!</p>",
      "rawMarkdown": "Thank you for the kind words. Using text based information from paper abstracts is a method we borrowed directly from that of Zhu lab's NetGO model but it really only helps you with proteins that are adequately described in the literature!",
      "votes": null
    },
    {
      "id": "2403662",
      "postDate": "08/22/2023 19:23:10",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/zmcxjt\" target=\"_blank\">@zmcxjt</a>, thank you for sharing details on your approach. I'm new to these kind of competitions and don't have possess any domain knowledge, so may I ask a few questions:</p>\n<blockquote>\n  <p>For GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model </p>\n</blockquote>\n<p>Were you submitting  all 1500+800+800  for each protein or did further pre-selection?</p>\n<p>I was banging my head a lot about how to do the final selection for submission due to this  <a href=\"https://www.kaggle.com/competitions/cafa-5-protein-function-prediction/overview/evaluation\" target=\"_blank\">line</a>, which I probably misunderstood</p>\n<blockquote>\n  <p>Finally, to limit prediction file sizes, one target cannot be associated with more than 1500 terms for MF, BP, and CC subontologies combined. </p>\n</blockquote>\n<p>I read it as: for each protein, the evaluation code will take up to 500 labels from each ontology, so  there is no point to provide more than 1,500 per protein and one needs to come up with a ranking scheme.</p>\n<blockquote>\n  <p>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.</p>\n</blockquote>\n<p>Did you experiment with other schemes to weigh positive labels? (maybe  <code>IA*frequency</code> that you mentioned above)? In my not-so-ideal validation scheme, I was comparing the inverse frequency scheme with <code>IA*frequency</code>for an MLP  but my validation scheme is not ideal, and I forgot to test the simpler IA weights.</p>\n<blockquote>\n  <p>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well</p>\n</blockquote>\n<p>I've seen people  <a href=\"http://karpathy.github.io/2019/04/25/recipe/\" target=\"_blank\">arguing</a> against combining batch norm and dropout citing this <a href=\"https://arxiv.org/abs/1801.05134\" target=\"_blank\">paper</a> but your stellar results suggest that potential drop in performance is limited after all!</p>",
      "rawMarkdown": "Hi @zmcxjt, thank you for sharing details on your approach. I'm new to these kind of competitions and don't have possess any domain knowledge, so may I ask a few questions:\n\n>For GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model \n\nWere you submitting  all 1500+800+800  for each protein or did further pre-selection?\n\nI was banging my head a lot about how to do the final selection for submission due to this  [line](https://www.kaggle.com/competitions/cafa-5-protein-function-prediction/overview/evaluation), which I probably misunderstood\n\n>Finally, to limit prediction file sizes, one target cannot be associated with more than 1500 terms for MF, BP, and CC subontologies combined. \n\nI read it as: for each protein, the evaluation code will take up to 500 labels from each ontology, so  there is no point to provide more than 1,500 per protein and one needs to come up with a ranking scheme.\n\n>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.\n\nDid you experiment with other schemes to weigh positive labels? (maybe  `IA*frequency` that you mentioned above)? In my not-so-ideal validation scheme, I was comparing the inverse frequency scheme with ` IA*frequency `for an MLP  but my validation scheme is not ideal, and I forgot to test the simpler IA weights.\n\n\n>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well\n\nI've seen people  [arguing](http://karpathy.github.io/2019/04/25/recipe/) against combining batch norm and dropout citing this [paper](https://arxiv.org/abs/1801.05134) but your stellar results suggest that potential drop in performance is limited after all!",
      "votes": null
    },
    {
      "id": "2403713",
      "postDate": "08/22/2023 19:57:23",
      "content": "<blockquote>\n  <p>Were you submitting all 1500+800+800 for each protein or did further pre-selection?</p>\n</blockquote>\n<p>In order to minimize our submission size, we actually only selected the top 5% of predictions based on probability assigned by our model. The final submission file ends up in the range of 500mb in size. </p>\n<p>Due to the rarity and low IA weight of many GO terms, most proteins will have drastically lower than 1500 GO terms predicted for them.</p>\n<blockquote>\n  <p>Did you experiment with other schemes to weigh positive labels? (maybe IA*frequency that you mentioned above)?</p>\n</blockquote>\n<p>Unfortunately we did not! But I think the effects would be subtle. </p>\n<blockquote>\n  <p>I've seen people arguing against combining batch norm and dropout citing this paper but your stellar results suggest that potential drop in performance is limited after all!</p>\n</blockquote>\n<p>Due to the large number of input data being simultaneously fed in, the model quite rapidly begins to overfit which was not something we ever managed to completely overcome. We attempted many ways to regularize but were not too successful in doing so.</p>",
      "rawMarkdown": ">Were you submitting all 1500+800+800 for each protein or did further pre-selection?\n\nIn order to minimize our submission size, we actually only selected the top 5% of predictions based on probability assigned by our model. The final submission file ends up in the range of 500mb in size. \n\nDue to the rarity and low IA weight of many GO terms, most proteins will have drastically lower than 1500 GO terms predicted for them.\n\n>Did you experiment with other schemes to weigh positive labels? (maybe IA*frequency that you mentioned above)?\n\nUnfortunately we did not! But I think the effects would be subtle. \n\n>I've seen people arguing against combining batch norm and dropout citing this paper but your stellar results suggest that potential drop in performance is limited after all!\n\nDue to the large number of input data being simultaneously fed in, the model quite rapidly begins to overfit which was not something we ever managed to completely overcome. We attempted many ways to regularize but were not too successful in doing so.",
      "votes": null
    },
    {
      "id": "2403720",
      "postDate": "08/22/2023 20:03:51",
      "content": "<p>Understood, thank you for the prompt reply!</p>",
      "rawMarkdown": "Understood, thank you for the prompt reply!",
      "votes": null
    },
    {
      "id": "2403791",
      "postDate": "08/22/2023 21:17:49",
      "content": "<p>Congratulations and thanks for a detailed write up! STRING and Anc2Vec didn't work for us either, glad to see your experience is consistent here.</p>",
      "rawMarkdown": "Congratulations and thanks for a detailed write up! STRING and Anc2Vec didn't work for us either, glad to see your experience is consistent here.",
      "votes": null
    },
    {
      "id": "2404307",
      "postDate": "08/23/2023 07:13:09",
      "content": "<p>Congratulations, <a href=\"https://www.kaggle.com/zmcxjt\" target=\"_blank\">@zmcxjt</a> ! Although this is your first time participating, you have achieved such a good ranking! Your plan is very helpful, especially using \"2) A single binary matrix representing species taxonomy for each protein\" and \"3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein\".</p>",
      "rawMarkdown": "Congratulations, @zmcxjt ! Although this is your first time participating, you have achieved such a good ranking! Your plan is very helpful, especially using \"2) A single binary matrix representing species taxonomy for each protein\" and \"3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein\".",
      "votes": null
    },
    {
      "id": "2404438",
      "postDate": "08/23/2023 08:59:35",
      "content": "<p>Congratulations on achieving a high ranking in your first participation! Thank you for always contributing to the discussions with valuable insights.</p>\n<blockquote>\n  <p>\"3) Information about the academic abstracts related to each protein, obtained through tf-idf processing of the text.\"</p>\n</blockquote>\n<p>This idea is absolutely brilliant! I never thought of that.</p>\n<blockquote>\n  <p>\"ProtBert embedding performance was low, and it was not used at all.\"</p>\n</blockquote>\n<p>In my experiments as well, concatenating ProtBERT rather led to a decline in score. I suspect this might be due to a lower information density compared to others like T5. However, when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.</p>",
      "rawMarkdown": "Congratulations on achieving a high ranking in your first participation! Thank you for always contributing to the discussions with valuable insights.\n\n\n> \"3) Information about the academic abstracts related to each protein, obtained through tf-idf processing of the text.\"\n\nThis idea is absolutely brilliant! I never thought of that.\n\n\n> \"ProtBert embedding performance was low, and it was not used at all.\"\n\nIn my experiments as well, concatenating ProtBERT rather led to a decline in score. I suspect this might be due to a lower information density compared to others like T5. However, when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.",
      "votes": null
    },
    {
      "id": "2404844",
      "postDate": "08/23/2023 14:38:38",
      "content": "<p>Congratulations on your impressive 10th place finish on the public leaderboard!!!</p>",
      "rawMarkdown": "Congratulations on your impressive 10th place finish on the public leaderboard!!!",
      "votes": null
    },
    {
      "id": "2404938",
      "postDate": "08/23/2023 15:38:04",
      "content": "<blockquote>\n  <p>when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.</p>\n</blockquote>\n<p>That's a very nice approach, something I should definitely have experimented more with!</p>",
      "rawMarkdown": ">when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.\n\nThat's a very nice approach, something I should definitely have experimented more with!",
      "votes": null
    },
    {
      "id": "2405529",
      "postDate": "08/24/2023 00:44:15",
      "content": "<p>Congratulations on your achievement!</p>",
      "rawMarkdown": "Congratulations on your achievement!",
      "votes": null
    },
    {
      "id": "2412704",
      "postDate": "08/28/2023 12:55:24",
      "content": "<p>Nice and simple with literature aug!</p>",
      "rawMarkdown": "Nice and simple with literature aug!",
      "votes": null
    },
    {
      "id": "2568669",
      "postDate": "12/20/2023 18:34:33",
      "content": "<p>Congratulations to your team!</p>",
      "rawMarkdown": "Congratulations to your team!",
      "votes": null
    },
    {
      "id": "2591933",
      "postDate": "01/08/2024 09:40:04",
      "content": "<p>Re \"ProtBERT to 3dims using UMAP/tSNE\" - Dang, there goes my standing argument that PCA/compression of embeddings <em>never</em> improved a representation 😭</p>\n<p>Nice work! Sounds like a really nice, surprisingly simple rep! How much did the free text/tf-idf contrib? Did you try processing that further (e.g. embeddings from BioBERT models)?</p>",
      "rawMarkdown": "Re \"ProtBERT to 3dims using UMAP/tSNE\" - Dang, there goes my standing argument that PCA/compression of embeddings *never* improved a representation 😭\n\nNice work! Sounds like a really nice, surprisingly simple rep! How much did the free text/tf-idf contrib? Did you try processing that further (e.g. embeddings from BioBERT models)?",
      "votes": null
    },
    {
      "id": "2591936",
      "postDate": "01/08/2024 09:41:52",
      "content": "<p>Didja try <a href=\"https://doi.org/10.1093/bioinformatics/btac020\" target=\"_blank\">ProteinBert</a> (not ProtBert!) embeddings? (e.g. Global layer rep)?<br>\n<a href=\"https://github.com/nadavbra/protein_bert\" target=\"_blank\">https://github.com/nadavbra/protein_bert</a></p>",
      "rawMarkdown": "Didja try [ProteinBert](https://doi.org/10.1093/bioinformatics/btac020) (not ProtBert!) embeddings? (e.g. Global layer rep)?\nhttps://github.com/nadavbra/protein_bert",
      "votes": null
    },
    {
      "id": "3311480",
      "postDate": "11/05/2025 05:21:59",
      "content": "<p>Hello， sir， did you have the esemble notebook offline, because the link could not be used now</p>",
      "rawMarkdown": "Hello， sir， did you have the esemble notebook offline, because the link could not be used now",
      "votes": null
    },
    {
      "id": "3312014",
      "postDate": "11/06/2025 07:57:36",
      "content": "<p>hello, sir, I am wondering if the 3 specialists is better than a generalist model, did you do annealing experiment in this side. Then I also have a question, how you choose the topk label for 3 specialist, if it is IA * frequency?Then the loss should also be multiply with the weight of IA, simply multiply with IA?Im I correct, because I tried this in CAFA6 and found it did not work in my experiment </p>",
      "rawMarkdown": "hello, sir, I am wondering if the 3 specialists is better than a generalist model, did you do annealing experiment in this side. Then I also have a question, how you choose the topk label for 3 specialist, if it is IA * frequency?Then the loss should also be multiply with the weight of IA, simply multiply with IA?Im I correct, because I tried this in CAFA6 and found it did not work in my experiment",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2403600,
      "author_name": "tilii7",
      "author_url": "",
      "post_date": "08/22/2023 18:26:36",
      "content": "<blockquote>\n  <p>My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made.</p>\n</blockquote>\n<p>Given your background, I would hardly consider that you fell short.</p>\n<p>There are many nice ideas in your solution. I haven't thought about adding text-based information, though it makes sense in retrospect. I don't think that would necessarily work as a general solution because many proteins are not correctly annotated. Still, for relatively well studied organisms that are targeted in this competition it should work.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2403619,
          "author_name": "zmcxjt",
          "author_url": "",
          "post_date": "08/22/2023 18:40:57",
          "content": "<p>Thank you for the kind words. Using text based information from paper abstracts is a method we borrowed directly from that of Zhu lab's NetGO model but it really only helps you with proteins that are adequately described in the literature!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2403662,
      "author_name": "dustinthewind",
      "author_url": "",
      "post_date": "08/22/2023 19:23:10",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/zmcxjt\" target=\"_blank\">@zmcxjt</a>, thank you for sharing details on your approach. I'm new to these kind of competitions and don't have possess any domain knowledge, so may I ask a few questions:</p>\n<blockquote>\n  <p>For GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model </p>\n</blockquote>\n<p>Were you submitting  all 1500+800+800  for each protein or did further pre-selection?</p>\n<p>I was banging my head a lot about how to do the final selection for submission due to this  <a href=\"https://www.kaggle.com/competitions/cafa-5-protein-function-prediction/overview/evaluation\" target=\"_blank\">line</a>, which I probably misunderstood</p>\n<blockquote>\n  <p>Finally, to limit prediction file sizes, one target cannot be associated with more than 1500 terms for MF, BP, and CC subontologies combined. </p>\n</blockquote>\n<p>I read it as: for each protein, the evaluation code will take up to 500 labels from each ontology, so  there is no point to provide more than 1,500 per protein and one needs to come up with a ranking scheme.</p>\n<blockquote>\n  <p>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.</p>\n</blockquote>\n<p>Did you experiment with other schemes to weigh positive labels? (maybe  <code>IA*frequency</code> that you mentioned above)? In my not-so-ideal validation scheme, I was comparing the inverse frequency scheme with <code>IA*frequency</code>for an MLP  but my validation scheme is not ideal, and I forgot to test the simpler IA weights.</p>\n<blockquote>\n  <p>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well</p>\n</blockquote>\n<p>I've seen people  <a href=\"http://karpathy.github.io/2019/04/25/recipe/\" target=\"_blank\">arguing</a> against combining batch norm and dropout citing this <a href=\"https://arxiv.org/abs/1801.05134\" target=\"_blank\">paper</a> but your stellar results suggest that potential drop in performance is limited after all!</p>",
      "votes": null,
      "replies": [
        {
          "id": 2403713,
          "author_name": "zmcxjt",
          "author_url": "",
          "post_date": "08/22/2023 19:57:23",
          "content": "<blockquote>\n  <p>Were you submitting all 1500+800+800 for each protein or did further pre-selection?</p>\n</blockquote>\n<p>In order to minimize our submission size, we actually only selected the top 5% of predictions based on probability assigned by our model. The final submission file ends up in the range of 500mb in size. </p>\n<p>Due to the rarity and low IA weight of many GO terms, most proteins will have drastically lower than 1500 GO terms predicted for them.</p>\n<blockquote>\n  <p>Did you experiment with other schemes to weigh positive labels? (maybe IA*frequency that you mentioned above)?</p>\n</blockquote>\n<p>Unfortunately we did not! But I think the effects would be subtle. </p>\n<blockquote>\n  <p>I've seen people arguing against combining batch norm and dropout citing this paper but your stellar results suggest that potential drop in performance is limited after all!</p>\n</blockquote>\n<p>Due to the large number of input data being simultaneously fed in, the model quite rapidly begins to overfit which was not something we ever managed to completely overcome. We attempted many ways to regularize but were not too successful in doing so.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2403720,
              "author_name": "dustinthewind",
              "author_url": "",
              "post_date": "08/22/2023 20:03:51",
              "content": "<p>Understood, thank you for the prompt reply!</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2403791,
      "author_name": "thedrcat",
      "author_url": "",
      "post_date": "08/22/2023 21:17:49",
      "content": "<p>Congratulations and thanks for a detailed write up! STRING and Anc2Vec didn't work for us either, glad to see your experience is consistent here.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2404307,
      "author_name": "songqizhou",
      "author_url": "",
      "post_date": "08/23/2023 07:13:09",
      "content": "<p>Congratulations, <a href=\"https://www.kaggle.com/zmcxjt\" target=\"_blank\">@zmcxjt</a> ! Although this is your first time participating, you have achieved such a good ranking! Your plan is very helpful, especially using \"2) A single binary matrix representing species taxonomy for each protein\" and \"3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein\".</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2404438,
      "author_name": "isakatsuyoshi",
      "author_url": "",
      "post_date": "08/23/2023 08:59:35",
      "content": "<p>Congratulations on achieving a high ranking in your first participation! Thank you for always contributing to the discussions with valuable insights.</p>\n<blockquote>\n  <p>\"3) Information about the academic abstracts related to each protein, obtained through tf-idf processing of the text.\"</p>\n</blockquote>\n<p>This idea is absolutely brilliant! I never thought of that.</p>\n<blockquote>\n  <p>\"ProtBert embedding performance was low, and it was not used at all.\"</p>\n</blockquote>\n<p>In my experiments as well, concatenating ProtBERT rather led to a decline in score. I suspect this might be due to a lower information density compared to others like T5. However, when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2404938,
          "author_name": "zmcxjt",
          "author_url": "",
          "post_date": "08/23/2023 15:38:04",
          "content": "<blockquote>\n  <p>when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.</p>\n</blockquote>\n<p>That's a very nice approach, something I should definitely have experimented more with!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 2591933,
          "author_name": "danofer",
          "author_url": "",
          "post_date": "01/08/2024 09:40:04",
          "content": "<p>Re \"ProtBERT to 3dims using UMAP/tSNE\" - Dang, there goes my standing argument that PCA/compression of embeddings <em>never</em> improved a representation 😭</p>\n<p>Nice work! Sounds like a really nice, surprisingly simple rep! How much did the free text/tf-idf contrib? Did you try processing that further (e.g. embeddings from BioBERT models)?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2404844,
      "author_name": "kummarivasanthi",
      "author_url": "",
      "post_date": "08/23/2023 14:38:38",
      "content": "<p>Congratulations on your impressive 10th place finish on the public leaderboard!!!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2405529,
      "author_name": "yashsachan4yrbtech",
      "author_url": "",
      "post_date": "08/24/2023 00:44:15",
      "content": "<p>Congratulations on your achievement!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2412704,
      "author_name": "danofer",
      "author_url": "",
      "post_date": "08/28/2023 12:55:24",
      "content": "<p>Nice and simple with literature aug!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2568669,
      "author_name": "tilii7",
      "author_url": "",
      "post_date": "12/20/2023 18:34:33",
      "content": "<p>Congratulations to your team!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2591936,
      "author_name": "danofer",
      "author_url": "",
      "post_date": "01/08/2024 09:41:52",
      "content": "<p>Didja try <a href=\"https://doi.org/10.1093/bioinformatics/btac020\" target=\"_blank\">ProteinBert</a> (not ProtBert!) embeddings? (e.g. Global layer rep)?<br>\n<a href=\"https://github.com/nadavbra/protein_bert\" target=\"_blank\">https://github.com/nadavbra/protein_bert</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 3311480,
      "author_name": "aizealotwu",
      "author_url": "",
      "post_date": "11/05/2025 05:21:59",
      "content": "<p>Hello， sir， did you have the esemble notebook offline, because the link could not be used now</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 3312014,
      "author_name": "aizealotwu",
      "author_url": "",
      "post_date": "11/06/2025 07:57:36",
      "content": "<p>hello, sir, I am wondering if the 3 specialists is better than a generalist model, did you do annealing experiment in this side. Then I also have a question, how you choose the topk label for 3 specialist, if it is IA * frequency?Then the loss should also be multiply with the weight of IA, simply multiply with IA?Im I correct, because I tried this in CAFA6 and found it did not work in my experiment </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2403549": "## **Introduction**\nFirstly I want to thank the organizers for a very nice competition - having it based on Kaggle opened up submissions to a wider range of people compared to previous iterations when mainly specialist labs showed results so the wider net of people being exposed to CAFA is really gratifying to see. My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made. Both of us are molecular biologists with only limited bioinformatics and machine learning experience - so this competition was something of a trial by fire and we learned a lot from taking part.\n\n##**Approach**\nWe used these datasets in our model: \n1) Prot-T5, ESM2, and Ankh Protein Language Model (PLM) embeddings. We carried out no further modifications or finetuning on the output of PLMs, only conversion to float32 to save memory. \n2) A single binary matrix representing species taxonomy for each protein.\n3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein\n\nFor GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model to classify by taking the top N labels sorted by IA*frequency. \n\nDatasets were sorted in alphabetical order to ensure identical ordering across datasets as well as removal of single duplicate row in test data. \n\nWe made a simple dense neural network in keras that takes these as separate inputs before concatenating them into a final layer that attempts to predict every label from a single GO ontology/domain. We used binary cross entropy (BCE) as our loss function and Adam optimizer with lr=0.0003 and a simple lr scheduler. We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.\n\nOur model was trained with KFold = 5 across 5 different random splits of the training data before a simple average of predictions was made for each ontology/domain and the results concatenated. \n\nOne interesting thing we observed is that Ridge regression sometimes performed better on PLM embeddings compared to a neural network for some ontologies, which was unexpected and might indicate underfitting for the neural network. \n\n##**What didn't work**\nProtBert embeddings performed poorly and were not utilized at all. \nData from STRING did not prove helpful in the final model. \nWe attempted to use a separate transformer layer that takes in label embeddings created with Anc2Vec (https://academic.oup.com/bib/article/23/2/bbac003/6523148) but it did not improve model performance.\nWe attempted to use a hierarchy aware loss function (https://papers.nips.cc/paper/2020/file/6dd4e10e3296fa63738371ec0d5df818-Paper.pdf) but it did not perform better than BCE.\n\n##**Scores**\nUsing merely the PLM embeddings along with taxonomic information we obtained a public leaderboard (PL) score of about 0.55. Including text information increases the PL score to ~0.58.\nEnsembling with a public ensemble notebook (https://www.kaggle.com/code/adaluodao/merge-datasets) increases PL score to ~0.62.\n\n\n##**EDIT**\n4th place overall! \nCode used to generate our models can be found here:\nhttps://github.com/zongmingchua/cafa5 \nFinal ensembling is shown here:\nhttps://www.kaggle.com/code/zmcxjt/merge-datasets",
    "2403600": "> My team worked hard on this problem and although we fell short in the rankings it is humbling to look back at the progress we made.\n\nGiven your background, I would hardly consider that you fell short.\n\nThere are many nice ideas in your solution. I haven't thought about adding text-based information, though it makes sense in retrospect. I don't think that would necessarily work as a general solution because many proteins are not correctly annotated. Still, for relatively well studied organisms that are targeted in this competition it should work.",
    "2403619": "Thank you for the kind words. Using text based information from paper abstracts is a method we borrowed directly from that of Zhu lab's NetGO model but it really only helps you with proteins that are adequately described in the literature!",
    "2403662": "Hi @zmcxjt, thank you for sharing details on your approach. I'm new to these kind of competitions and don't have possess any domain knowledge, so may I ask a few questions:\n\n>For GO labels, we separately identified 1500 BPO, 800 CCO, and 800 MFO terms from each ontology for each model \n\nWere you submitting  all 1500+800+800  for each protein or did further pre-selection?\n\nI was banging my head a lot about how to do the final selection for submission due to this  [line](https://www.kaggle.com/competitions/cafa-5-protein-function-prediction/overview/evaluation), which I probably misunderstood\n\n>Finally, to limit prediction file sizes, one target cannot be associated with more than 1500 terms for MF, BP, and CC subontologies combined. \n\nI read it as: for each protein, the evaluation code will take up to 500 labels from each ontology, so  there is no point to provide more than 1,500 per protein and one needs to come up with a ranking scheme.\n\n>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well.\n\nDid you experiment with other schemes to weigh positive labels? (maybe  `IA*frequency` that you mentioned above)? In my not-so-ideal validation scheme, I was comparing the inverse frequency scheme with ` IA*frequency `for an MLP  but my validation scheme is not ideal, and I forgot to test the simpler IA weights.\n\n\n>We further used the IA weights as class_weight when calling model.fit(). We added dropout and batch normalization layers to our model as well\n\nI've seen people  [arguing](http://karpathy.github.io/2019/04/25/recipe/) against combining batch norm and dropout citing this [paper](https://arxiv.org/abs/1801.05134) but your stellar results suggest that potential drop in performance is limited after all!",
    "2403713": ">Were you submitting all 1500+800+800 for each protein or did further pre-selection?\n\nIn order to minimize our submission size, we actually only selected the top 5% of predictions based on probability assigned by our model. The final submission file ends up in the range of 500mb in size. \n\nDue to the rarity and low IA weight of many GO terms, most proteins will have drastically lower than 1500 GO terms predicted for them.\n\n>Did you experiment with other schemes to weigh positive labels? (maybe IA*frequency that you mentioned above)?\n\nUnfortunately we did not! But I think the effects would be subtle. \n\n>I've seen people arguing against combining batch norm and dropout citing this paper but your stellar results suggest that potential drop in performance is limited after all!\n\nDue to the large number of input data being simultaneously fed in, the model quite rapidly begins to overfit which was not something we ever managed to completely overcome. We attempted many ways to regularize but were not too successful in doing so.",
    "2403720": "Understood, thank you for the prompt reply!",
    "2403791": "Congratulations and thanks for a detailed write up! STRING and Anc2Vec didn't work for us either, glad to see your experience is consistent here.",
    "2404307": "Congratulations, @zmcxjt ! Although this is your first time participating, you have achieved such a good ranking! Your plan is very helpful, especially using \"2) A single binary matrix representing species taxonomy for each protein\" and \"3) Text information obtained by tf-idf of abstract information from academic papers associated with each protein\".",
    "2404438": "Congratulations on achieving a high ranking in your first participation! Thank you for always contributing to the discussions with valuable insights.\n\n\n> \"3) Information about the academic abstracts related to each protein, obtained through tf-idf processing of the text.\"\n\nThis idea is absolutely brilliant! I never thought of that.\n\n\n> \"ProtBert embedding performance was low, and it was not used at all.\"\n\nIn my experiments as well, concatenating ProtBERT rather led to a decline in score. I suspect this might be due to a lower information density compared to others like T5. However, when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.",
    "2404844": "Congratulations on your impressive 10th place finish on the public leaderboard!!!",
    "2404938": ">when I reduced the dimensions of ProtBERT to 3dims using UMAP/tSNE and added it, the score improved. I think this was because the information was compressed.\n\nThat's a very nice approach, something I should definitely have experimented more with!",
    "2405529": "Congratulations on your achievement!",
    "2412704": "Nice and simple with literature aug!",
    "2568669": "Congratulations to your team!",
    "2591933": "Re \"ProtBERT to 3dims using UMAP/tSNE\" - Dang, there goes my standing argument that PCA/compression of embeddings *never* improved a representation 😭\n\nNice work! Sounds like a really nice, surprisingly simple rep! How much did the free text/tf-idf contrib? Did you try processing that further (e.g. embeddings from BioBERT models)?",
    "2591936": "Didja try [ProteinBert](https://doi.org/10.1093/bioinformatics/btac020) (not ProtBert!) embeddings? (e.g. Global layer rep)?\nhttps://github.com/nadavbra/protein_bert",
    "3311480": "Hello， sir， did you have the esemble notebook offline, because the link could not be used now",
    "3312014": "hello, sir, I am wondering if the 3 specialists is better than a generalist model, did you do annealing experiment in this side. Then I also have a question, how you choose the topk label for 3 specialist, if it is IA * frequency?Then the loss should also be multiply with the weight of IA, simply multiply with IA?Im I correct, because I tried this in CAFA6 and found it did not work in my experiment"
  },
  "source": "meta"
}