{
  "id": 582845,
  "title": "A Two-Stage Approach for Prediction using CNN Classification and InversionNet[LB: 133.6]",
  "url": "/competitions/waveform-inversion/discussion/582845",
  "author_name": "",
  "post_date": "2025-06-03T07:09:42.226683100Z",
  "votes": 12,
  "comment_count": 19,
  "views": 0,
  "content": "<p>Hi everyone,<br>\nI'd like to share my approach and would love to get your feedback.</p>\n<p>My Approach (2 Stages)<br>\nStage 1: CNN Classifier<br>\nFirst, I built a simple CNN classifier to categorize the test data into 10 velocity map types based on their waveforms. This model achieved <strong>92.2%</strong> accuracy on the validation dataset.</p>\n<p>Stage 2: InversionNet with Specific Weights<br>\nFollowing this classification, I used InversionNet for the final prediction. Crucially, I applied a specific set of pre-trained weights corresponding to each sample's predicted map type.</p>\n<p>Result<br>\nThis two-stage method achieved a final score of <strong>133.6</strong> on the leaderboard.</p>\n<p>Classify notebook : <a href=\"https://www.kaggle.com/code/nakanishiwataru/fwi-seis-data-classifier\" target=\"_blank\">https://www.kaggle.com/code/nakanishiwataru/fwi-seis-data-classifier</a><br>\nInversionNet notebook : <a href=\"https://www.kaggle.com/code/nakanishiwataru/inversionnet-with-classified-data\" target=\"_blank\">https://www.kaggle.com/code/nakanishiwataru/inversionnet-with-classified-data</a></p>\n<p>Any thoughts or suggestions for improvement would be greatly appreciated. Thanks for reading!</p>",
  "messages": [
    {
      "id": "3216146",
      "postDate": "06/03/2025 07:09:42",
      "content": "<p>Hi everyone,<br>\nI'd like to share my approach and would love to get your feedback.</p>\n<p>My Approach (2 Stages)<br>\nStage 1: CNN Classifier<br>\nFirst, I built a simple CNN classifier to categorize the test data into 10 velocity map types based on their waveforms. This model achieved <strong>92.2%</strong> accuracy on the validation dataset.</p>\n<p>Stage 2: InversionNet with Specific Weights<br>\nFollowing this classification, I used InversionNet for the final prediction. Crucially, I applied a specific set of pre-trained weights corresponding to each sample's predicted map type.</p>\n<p>Result<br>\nThis two-stage method achieved a final score of <strong>133.6</strong> on the leaderboard.</p>\n<p>Classify notebook : <a href=\"https://www.kaggle.com/code/nakanishiwataru/fwi-seis-data-classifier\" target=\"_blank\">https://www.kaggle.com/code/nakanishiwataru/fwi-seis-data-classifier</a><br>\nInversionNet notebook : <a href=\"https://www.kaggle.com/code/nakanishiwataru/inversionnet-with-classified-data\" target=\"_blank\">https://www.kaggle.com/code/nakanishiwataru/inversionnet-with-classified-data</a></p>\n<p>Any thoughts or suggestions for improvement would be greatly appreciated. Thanks for reading!</p>",
      "rawMarkdown": "Hi everyone,\nI'd like to share my approach and would love to get your feedback.\n\nMy Approach (2 Stages)\nStage 1: CNN Classifier\nFirst, I built a simple CNN classifier to categorize the test data into 10 velocity map types based on their waveforms. This model achieved **92.2%** accuracy on the validation dataset.\n\nStage 2: InversionNet with Specific Weights\nFollowing this classification, I used InversionNet for the final prediction. Crucially, I applied a specific set of pre-trained weights corresponding to each sample's predicted map type.\n\nResult\nThis two-stage method achieved a final score of **133.6** on the leaderboard.\n\nClassify notebook : https://www.kaggle.com/code/nakanishiwataru/fwi-seis-data-classifier\nInversionNet notebook : https://www.kaggle.com/code/nakanishiwataru/inversionnet-with-classified-data\n\n\nAny thoughts or suggestions for improvement would be greatly appreciated. Thanks for reading!",
      "votes": null
    },
    {
      "id": "3216222",
      "postDate": "06/03/2025 08:56:31",
      "content": "<p>One model to rule them all is best.</p>",
      "rawMarkdown": "One model to rule them all is best.",
      "votes": null
    },
    {
      "id": "3216267",
      "postDate": "06/03/2025 10:05:43",
      "content": "<p>Thank you for your comment. Could you please explain why a single model is considered better than multiple models? </p>\n<p>As a complete beginner, I tried to think through the reasons, but I couldn’t fully understand them.</p>",
      "rawMarkdown": "Thank you for your comment. Could you please explain why a single model is considered better than multiple models? \n\nAs a complete beginner, I tried to think through the reasons, but I couldn’t fully understand them.",
      "votes": null
    },
    {
      "id": "3216301",
      "postDate": "06/03/2025 11:30:02",
      "content": "<p>I tried inversionnet and it was quite slow to converge. It is not competitive with the models shared by <a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> . You should try these after =your classifier.</p>",
      "rawMarkdown": "I tried inversionnet and it was quite slow to converge. It is not competitive with the models shared by @brendanartley . You should try these after =your classifier.",
      "votes": null
    },
    {
      "id": "3216302",
      "postDate": "06/03/2025 11:32:29",
      "content": "<p>Machine learning is an experimental science. You experiment and see what works best. Then you can try understanding why what works best does work best.</p>\n<p>I didn't do it but I am pretty sure that <a href=\"https://www.kaggle.com/shlomoron\" target=\"_blank\">@shlomoron</a> tried one model per dataset and compared to one model for all. It is why he can say what he said.</p>\n<p>My gut feeling, but I should test it, is that one model is better as it ovefits less to training data given it has to cope with a variety of data.</p>",
      "rawMarkdown": "Machine learning is an experimental science. You experiment and see what works best. Then you can try understanding why what works best does work best.\n\nI didn't do it but I am pretty sure that @shlomoron tried one model per dataset and compared to one model for all. It is why he can say what he said.\n\nMy gut feeling, but I should test it, is that one model is better as it ovefits less to training data given it has to cope with a variety of data.",
      "votes": null
    },
    {
      "id": "3216318",
      "postDate": "06/03/2025 12:11:36",
      "content": "<p>Actually did not try. As you said, 'gut feeling'.  </p>",
      "rawMarkdown": "Actually did not try. As you said, 'gut feeling'.",
      "votes": null
    },
    {
      "id": "3216321",
      "postDate": "06/03/2025 12:15:18",
      "content": "<p>I tried, One model to rule them all</p>\n<p>As for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes</p>",
      "rawMarkdown": "I tried, One model to rule them all\n\nAs for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes",
      "votes": null
    },
    {
      "id": "3216324",
      "postDate": "06/03/2025 12:22:18",
      "content": "<p><a href=\"https://www.kaggle.com/shlomoron\" target=\"_blank\">@shlomoron</a> You should say it is gut feeling then. </p>",
      "rawMarkdown": "shlomoron You should say it is gut feeling then.",
      "votes": null
    },
    {
      "id": "3216332",
      "postDate": "06/03/2025 12:29:08",
      "content": "<blockquote>\n  <p>As for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes  </p>\n</blockquote>\n<p>You actually see it easily, if you train on one dataset and validate on all of them- the model usually learn from one to several (this I tried).  <br>\nAlso, if you train classifier, your model would be as good as the clasifier. So at this point just train one model. Story would be different if we knew at test time what is the dataset of each sample. But we don't.   <br>\nNo good reason to try classifier honestly unless one have very good reason to suspect it would be stronger (I don't have any), and if one does, he should do so as an experiment agains one model baseline, IMO.</p>",
      "rawMarkdown": ">As for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes  \n\nYou actually see it easily, if you train on one dataset and validate on all of them- the model usually learn from one to several (this I tried).  \nAlso, if you train classifier, your model would be as good as the clasifier. So at this point just train one model. Story would be different if we knew at test time what is the dataset of each sample. But we don't.   \nNo good reason to try classifier honestly unless one have very good reason to suspect it would be stronger (I don't have any), and if one does, he should do so as an experiment agains one model baseline, IMO.",
      "votes": null
    },
    {
      "id": "3216360",
      "postDate": "06/03/2025 13:12:49",
      "content": "<p>Thank you very much for your detailed explanation. I now have a much better understanding of the point that a single model can learn more essential information. I sincerely appreciate it.</p>",
      "rawMarkdown": "Thank you very much for your detailed explanation. I now have a much better understanding of the point that a single model can learn more essential information. I sincerely appreciate it.",
      "votes": null
    },
    {
      "id": "3216365",
      "postDate": "06/03/2025 13:21:48",
      "content": "<p>Thank you for your detailed explanation. You're right, if a single model can achieve a similar level of accuracy, there's really no reason to increase the complexity by using multiple models.</p>",
      "rawMarkdown": "Thank you for your detailed explanation. You're right, if a single model can achieve a similar level of accuracy, there's really no reason to increase the complexity by using multiple models.",
      "votes": null
    },
    {
      "id": "3217501",
      "postDate": "06/05/2025 04:35:53",
      "content": "<p>i also try for this.</p>",
      "rawMarkdown": "i also try for this.",
      "votes": null
    },
    {
      "id": "3217523",
      "postDate": "06/05/2025 05:17:54",
      "content": "<p>It would be interesting to know what those remaining 7.8% errors are . I thought each type of wave is very distinct in nature ,but if the classification model is missing them , then there could be some wrong velocity model created for those edge cases by the segmentation model as well . It may be worth looking if they contribute to MAE significantly . </p>\n<p>An idea would be to have a classification auxiliary head with Segmentation model and reduce the loss for that jointly while training segmentation…</p>",
      "rawMarkdown": "It would be interesting to know what those remaining 7.8% errors are . I thought each type of wave is very distinct in nature ,but if the classification model is missing them , then there could be some wrong velocity model created for those edge cases by the segmentation model as well . It may be worth looking if they contribute to MAE significantly . \n\nAn idea would be to have a classification auxiliary head with Segmentation model and reduce the loss for that jointly while training segmentation...",
      "votes": null
    },
    {
      "id": "3217840",
      "postDate": "06/05/2025 12:53:36",
      "content": "<p>Maybe most confusions are between variants A and B of the same type of dataset?</p>",
      "rawMarkdown": "Maybe most confusions are between variants A and B of the same type of dataset?",
      "votes": null
    },
    {
      "id": "3217980",
      "postDate": "06/05/2025 16:08:21",
      "content": "<p>Thanks for your information<br>\ni will try it</p>",
      "rawMarkdown": "Thanks for your information\ni will try it",
      "votes": null
    },
    {
      "id": "3218690",
      "postDate": "06/06/2025 15:15:55",
      "content": "<p>I also came up with the idea of classifying speed maps into 10 categories. <br>\nMy approach was to add an auxiliary classification head to Bartley's ConvNeXt public notebook. As a result, I achieved an accuracy of 99.4% on the validation dataset.</p>",
      "rawMarkdown": "I also came up with the idea of classifying speed maps into 10 categories. \nMy approach was to add an auxiliary classification head to Bartley's ConvNeXt public notebook. As a result, I achieved an accuracy of 99.4% on the validation dataset.",
      "votes": null
    },
    {
      "id": "3218708",
      "postDate": "06/06/2025 15:48:43",
      "content": "<p>Thanks for your comment.<br>\nThat's a good point, maybe I should have just used a backbone like ConvNeXt directly.<br>\nSo in that sense, does that mean these backbones can differentiate between the types almost perfectly?</p>",
      "rawMarkdown": "Thanks for your comment.\nThat's a good point, maybe I should have just used a backbone like ConvNeXt directly.\nSo in that sense, does that mean these backbones can differentiate between the types almost perfectly?",
      "votes": null
    },
    {
      "id": "3218713",
      "postDate": "06/06/2025 15:51:08",
      "content": "<p>Thanks for your comment. Let's both do our best!</p>",
      "rawMarkdown": "Thanks for your comment. Let's both do our best!",
      "votes": null
    },
    {
      "id": "3218716",
      "postDate": "06/06/2025 15:57:30",
      "content": "<p>I agree that the backbone is important.<br>\nIn addition, performing both speed map prediction and classification simultaneously might also be important.</p>",
      "rawMarkdown": "I agree that the backbone is important.\nIn addition, performing both speed map prediction and classification simultaneously might also be important.",
      "votes": null
    },
    {
      "id": "3218729",
      "postDate": "06/06/2025 16:20:30",
      "content": "<p>I see. In that case, it seems like a single model would be the better approach.</p>",
      "rawMarkdown": "I see. In that case, it seems like a single model would be the better approach.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3216222,
      "author_name": "shlomoron",
      "author_url": "",
      "post_date": "06/03/2025 08:56:31",
      "content": "<p>One model to rule them all is best.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3216267,
          "author_name": "nakanishiwataru",
          "author_url": "",
          "post_date": "06/03/2025 10:05:43",
          "content": "<p>Thank you for your comment. Could you please explain why a single model is considered better than multiple models? </p>\n<p>As a complete beginner, I tried to think through the reasons, but I couldn’t fully understand them.</p>",
          "votes": null,
          "replies": [
            {
              "id": 3216302,
              "author_name": "cpmpml",
              "author_url": "",
              "post_date": "06/03/2025 11:32:29",
              "content": "<p>Machine learning is an experimental science. You experiment and see what works best. Then you can try understanding why what works best does work best.</p>\n<p>I didn't do it but I am pretty sure that <a href=\"https://www.kaggle.com/shlomoron\" target=\"_blank\">@shlomoron</a> tried one model per dataset and compared to one model for all. It is why he can say what he said.</p>\n<p>My gut feeling, but I should test it, is that one model is better as it ovefits less to training data given it has to cope with a variety of data.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 3216318,
                  "author_name": "shlomoron",
                  "author_url": "",
                  "post_date": "06/03/2025 12:11:36",
                  "content": "<p>Actually did not try. As you said, 'gut feeling'.  </p>",
                  "votes": null,
                  "replies": [
                    {
                      "id": 3216321,
                      "author_name": "harshitsheoran",
                      "author_url": "",
                      "post_date": "06/03/2025 12:15:18",
                      "content": "<p>I tried, One model to rule them all</p>\n<p>As for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes</p>",
                      "votes": null,
                      "replies": [
                        {
                          "id": 3216332,
                          "author_name": "shlomoron",
                          "author_url": "",
                          "post_date": "06/03/2025 12:29:08",
                          "content": "<blockquote>\n  <p>As for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes  </p>\n</blockquote>\n<p>You actually see it easily, if you train on one dataset and validate on all of them- the model usually learn from one to several (this I tried).  <br>\nAlso, if you train classifier, your model would be as good as the clasifier. So at this point just train one model. Story would be different if we knew at test time what is the dataset of each sample. But we don't.   <br>\nNo good reason to try classifier honestly unless one have very good reason to suspect it would be stronger (I don't have any), and if one does, he should do so as an experiment agains one model baseline, IMO.</p>",
                          "votes": null,
                          "replies": [
                            {
                              "id": 3216365,
                              "author_name": "nakanishiwataru",
                              "author_url": "",
                              "post_date": "06/03/2025 13:21:48",
                              "content": "<p>Thank you for your detailed explanation. You're right, if a single model can achieve a similar level of accuracy, there's really no reason to increase the complexity by using multiple models.</p>",
                              "votes": null,
                              "replies": []
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "id": 3216324,
                      "author_name": "cpmpml",
                      "author_url": "",
                      "post_date": "06/03/2025 12:22:18",
                      "content": "<p><a href=\"https://www.kaggle.com/shlomoron\" target=\"_blank\">@shlomoron</a> You should say it is gut feeling then. </p>",
                      "votes": null,
                      "replies": []
                    }
                  ]
                },
                {
                  "id": 3216360,
                  "author_name": "nakanishiwataru",
                  "author_url": "",
                  "post_date": "06/03/2025 13:12:49",
                  "content": "<p>Thank you very much for your detailed explanation. I now have a much better understanding of the point that a single model can learn more essential information. I sincerely appreciate it.</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 3216301,
      "author_name": "cpmpml",
      "author_url": "",
      "post_date": "06/03/2025 11:30:02",
      "content": "<p>I tried inversionnet and it was quite slow to converge. It is not competitive with the models shared by <a href=\"https://www.kaggle.com/brendanartley\" target=\"_blank\">@brendanartley</a> . You should try these after =your classifier.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3217501,
          "author_name": "zxccvvvv",
          "author_url": "",
          "post_date": "06/05/2025 04:35:53",
          "content": "<p>i also try for this.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3217523,
      "author_name": "phoenix9032",
      "author_url": "",
      "post_date": "06/05/2025 05:17:54",
      "content": "<p>It would be interesting to know what those remaining 7.8% errors are . I thought each type of wave is very distinct in nature ,but if the classification model is missing them , then there could be some wrong velocity model created for those edge cases by the segmentation model as well . It may be worth looking if they contribute to MAE significantly . </p>\n<p>An idea would be to have a classification auxiliary head with Segmentation model and reduce the loss for that jointly while training segmentation…</p>",
      "votes": null,
      "replies": [
        {
          "id": 3217840,
          "author_name": "cpmpml",
          "author_url": "",
          "post_date": "06/05/2025 12:53:36",
          "content": "<p>Maybe most confusions are between variants A and B of the same type of dataset?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3217980,
      "author_name": "ttyn4519",
      "author_url": "",
      "post_date": "06/05/2025 16:08:21",
      "content": "<p>Thanks for your information<br>\ni will try it</p>",
      "votes": null,
      "replies": [
        {
          "id": 3218713,
          "author_name": "nakanishiwataru",
          "author_url": "",
          "post_date": "06/06/2025 15:51:08",
          "content": "<p>Thanks for your comment. Let's both do our best!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3218690,
      "author_name": "welshonionman",
      "author_url": "",
      "post_date": "06/06/2025 15:15:55",
      "content": "<p>I also came up with the idea of classifying speed maps into 10 categories. <br>\nMy approach was to add an auxiliary classification head to Bartley's ConvNeXt public notebook. As a result, I achieved an accuracy of 99.4% on the validation dataset.</p>",
      "votes": null,
      "replies": [
        {
          "id": 3218708,
          "author_name": "nakanishiwataru",
          "author_url": "",
          "post_date": "06/06/2025 15:48:43",
          "content": "<p>Thanks for your comment.<br>\nThat's a good point, maybe I should have just used a backbone like ConvNeXt directly.<br>\nSo in that sense, does that mean these backbones can differentiate between the types almost perfectly?</p>",
          "votes": null,
          "replies": [
            {
              "id": 3218716,
              "author_name": "welshonionman",
              "author_url": "",
              "post_date": "06/06/2025 15:57:30",
              "content": "<p>I agree that the backbone is important.<br>\nIn addition, performing both speed map prediction and classification simultaneously might also be important.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 3218729,
                  "author_name": "nakanishiwataru",
                  "author_url": "",
                  "post_date": "06/06/2025 16:20:30",
                  "content": "<p>I see. In that case, it seems like a single model would be the better approach.</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3216146": "Hi everyone,\nI'd like to share my approach and would love to get your feedback.\n\nMy Approach (2 Stages)\nStage 1: CNN Classifier\nFirst, I built a simple CNN classifier to categorize the test data into 10 velocity map types based on their waveforms. This model achieved **92.2%** accuracy on the validation dataset.\n\nStage 2: InversionNet with Specific Weights\nFollowing this classification, I used InversionNet for the final prediction. Crucially, I applied a specific set of pre-trained weights corresponding to each sample's predicted map type.\n\nResult\nThis two-stage method achieved a final score of **133.6** on the leaderboard.\n\nClassify notebook : https://www.kaggle.com/code/nakanishiwataru/fwi-seis-data-classifier\nInversionNet notebook : https://www.kaggle.com/code/nakanishiwataru/inversionnet-with-classified-data\n\n\nAny thoughts or suggestions for improvement would be greatly appreciated. Thanks for reading!",
    "3216222": "One model to rule them all is best.",
    "3216267": "Thank you for your comment. Could you please explain why a single model is considered better than multiple models? \n\nAs a complete beginner, I tried to think through the reasons, but I couldn’t fully understand them.",
    "3216301": "I tried inversionnet and it was quite slow to converge. It is not competitive with the models shared by @brendanartley . You should try these after =your classifier.",
    "3216302": "Machine learning is an experimental science. You experiment and see what works best. Then you can try understanding why what works best does work best.\n\nI didn't do it but I am pretty sure that @shlomoron tried one model per dataset and compared to one model for all. It is why he can say what he said.\n\nMy gut feeling, but I should test it, is that one model is better as it ovefits less to training data given it has to cope with a variety of data.",
    "3216318": "Actually did not try. As you said, 'gut feeling'.",
    "3216321": "I tried, One model to rule them all\n\nAs for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes",
    "3216324": "shlomoron You should say it is gut feeling then.",
    "3216332": ">As for reason, my 'gut feeling' is similar that when a single model is able to learn more patterns it helps it across different classes  \n\nYou actually see it easily, if you train on one dataset and validate on all of them- the model usually learn from one to several (this I tried).  \nAlso, if you train classifier, your model would be as good as the clasifier. So at this point just train one model. Story would be different if we knew at test time what is the dataset of each sample. But we don't.   \nNo good reason to try classifier honestly unless one have very good reason to suspect it would be stronger (I don't have any), and if one does, he should do so as an experiment agains one model baseline, IMO.",
    "3216360": "Thank you very much for your detailed explanation. I now have a much better understanding of the point that a single model can learn more essential information. I sincerely appreciate it.",
    "3216365": "Thank you for your detailed explanation. You're right, if a single model can achieve a similar level of accuracy, there's really no reason to increase the complexity by using multiple models.",
    "3217501": "i also try for this.",
    "3217523": "It would be interesting to know what those remaining 7.8% errors are . I thought each type of wave is very distinct in nature ,but if the classification model is missing them , then there could be some wrong velocity model created for those edge cases by the segmentation model as well . It may be worth looking if they contribute to MAE significantly . \n\nAn idea would be to have a classification auxiliary head with Segmentation model and reduce the loss for that jointly while training segmentation...",
    "3217840": "Maybe most confusions are between variants A and B of the same type of dataset?",
    "3217980": "Thanks for your information\ni will try it",
    "3218690": "I also came up with the idea of classifying speed maps into 10 categories. \nMy approach was to add an auxiliary classification head to Bartley's ConvNeXt public notebook. As a result, I achieved an accuracy of 99.4% on the validation dataset.",
    "3218708": "Thanks for your comment.\nThat's a good point, maybe I should have just used a backbone like ConvNeXt directly.\nSo in that sense, does that mean these backbones can differentiate between the types almost perfectly?",
    "3218713": "Thanks for your comment. Let's both do our best!",
    "3218716": "I agree that the backbone is important.\nIn addition, performing both speed map prediction and classification simultaneously might also be important.",
    "3218729": "I see. In that case, it seems like a single model would be the better approach."
  },
  "source": "meta"
}