{
  "id": 492192,
  "title": "What model do you use with raw eeg data?",
  "url": "/competitions/hms-harmful-brain-activity-classification/discussion/492192",
  "author_name": "",
  "post_date": "2024-04-09T00:22:04.428075300Z",
  "votes": 14,
  "comment_count": 11,
  "views": 0,
  "content": "<p>I try wavenet pytorch, too slow to trainining. Next, I try squeeze former, 1dcnn-gru, eegnet, eegconformer. All fail. Finally, I use vit_small_patch14_reg4_dinov2.lvd142m from timm. Vision model for raw eeg data 😱</p>",
  "messages": [
    {
      "id": "2742502",
      "postDate": "04/09/2024 00:22:04",
      "content": "<p>I try wavenet pytorch, too slow to trainining. Next, I try squeeze former, 1dcnn-gru, eegnet, eegconformer. All fail. Finally, I use vit_small_patch14_reg4_dinov2.lvd142m from timm. Vision model for raw eeg data 😱</p>",
      "rawMarkdown": "I try wavenet pytorch, too slow to trainining. Next, I try squeeze former, 1dcnn-gru, eegnet, eegconformer. All fail. Finally, I use vit_small_patch14_reg4_dinov2.lvd142m from timm. Vision model for raw eeg data 😱",
      "votes": null
    },
    {
      "id": "2742509",
      "postDate": "04/09/2024 00:26:54",
      "content": "<p>I could not make raw eeg data work well…, squeezeformer only local cv 0.35.<br>\nBut just add raw eeg data as part of the image for timm backbone improve a lot.<br>\nI want to learn solution of using raw eeg data and 1d model to get 0.26 or better LB..</p>",
      "rawMarkdown": "I could not make raw eeg data work well..., squeezeformer only local cv 0.35.\nBut just add raw eeg data as part of the image for timm backbone improve a lot.\nI want to learn solution of using raw eeg data and 1d model to get 0.26 or better LB..",
      "votes": null
    },
    {
      "id": "2742513",
      "postDate": "04/09/2024 00:27:55",
      "content": "<p>Hi, Congrats on the strong finish <a href=\"https://www.kaggle.com/quan0095\" target=\"_blank\">@quan0095</a> we used combination of several different architectures, 1D Resnet/Inception based, transformer based, CWT + Deep2dcnn , 1D learnable frontend + 2D CNNs, all worked quite well. </p>\n<p>Did you just used <code>vit_small_patch14_reg4_dinov2.lvd142m</code> to your final solution? What input did you feed into the models?</p>",
      "rawMarkdown": "Hi, Congrats on the strong finish @quan0095 we used combination of several different architectures, 1D Resnet/Inception based, transformer based, CWT + Deep2dcnn , 1D learnable frontend + 2D CNNs, all worked quite well. \n\nDid you just used `vit_small_patch14_reg4_dinov2.lvd142m` to your final solution? What input did you feed into the models?",
      "votes": null
    },
    {
      "id": "2742516",
      "postDate": "04/09/2024 00:32:41",
      "content": "<p>Congrats on the strong finish! </p>\n<p>Our best single model was actually a 1D-wavenet which scored 0.25 CV for GKF &gt;= 10 votes.</p>",
      "rawMarkdown": "Congrats on the strong finish! \n\nOur best single model was actually a 1D-wavenet which scored 0.25 CV for GKF >= 10 votes.",
      "votes": null
    },
    {
      "id": "2742521",
      "postDate": "04/09/2024 00:34:38",
      "content": "<p>Just read your post, does your model only 1d-wavenet or use 1d wavenet for image to feed for 2d model?</p>",
      "rawMarkdown": "Just read your post, does your model only 1d-wavenet or use 1d wavenet for image to feed for 2d model?",
      "votes": null
    },
    {
      "id": "2742525",
      "postDate": "04/09/2024 00:36:05",
      "content": "<p>I use dinov2 vit family in my final solution (vit small, vit base, vit large). I use butter with bandbass [0.5, 40]. Here my input: <a href=\"https://ideone.com/DTzo7F\" target=\"_blank\">https://ideone.com/DTzo7F</a>.</p>\n<pre><code>         = np.reshape(eeg, (, , EEG_LENGTH))\n         = np.concatenate((eeg[,:,:], eeg[,:,:], eeg[,:,:], eeg[,:,:]), )\n        .append(eeg)\n\n     = np.concatenate(list_eeg, )\n</code></pre>\n<p>This is the key to make vit work with raw eeg data.</p>",
      "rawMarkdown": "I use dinov2 vit family in my final solution (vit small, vit base, vit large). I use butter with bandbass [0.5, 40]. Here my input: https://ideone.com/DTzo7F.\n```\n        eeg = np.reshape(eeg, (4, 200, EEG_LENGTH))\n        eeg = np.concatenate((eeg[0,:,:], eeg[1,:,:], eeg[2,:,:], eeg[3,:,:]), 1)\n        list_eeg.append(eeg)\n \n    eeg = np.concatenate(list_eeg, 1)\n```\nThis is the key to make vit work with raw eeg data.",
      "votes": null
    },
    {
      "id": "2742526",
      "postDate": "04/09/2024 00:36:09",
      "content": "<p>Good question, the output of the 1d-wavenet is fed into a 2d model.</p>",
      "rawMarkdown": "Good question, the output of the 1d-wavenet is fed into a 2d model.",
      "votes": null
    },
    {
      "id": "2742530",
      "postDate": "04/09/2024 00:38:10",
      "content": "<p>So it is a 2d model, but it is really creative to use wavenet as a feature/image extractor, cool.</p>",
      "rawMarkdown": "So it is a 2d model, but it is really creative to use wavenet as a feature/image extractor, cool.",
      "votes": null
    },
    {
      "id": "2742611",
      "postDate": "04/09/2024 01:45:09",
      "content": "<p>wavenets , chrononet , 1d resnet worked mostly with same performance on features described here <a href=\"https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/492220\" target=\"_blank\">https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/492220</a></p>",
      "rawMarkdown": "wavenets , chrononet , 1d resnet worked mostly with same performance on features described here https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/492220",
      "votes": null
    },
    {
      "id": "2742616",
      "postDate": "04/09/2024 01:50:03",
      "content": "<p>Use vision model is the right way, just view the input as bsx1x16x10000 then transform to bsx1x160x1000，by applying some small tricks. And  that we will get private lb 0.28, public lb 0.23.</p>\n<p>I think this way to reshape the input is better.</p>\n<pre><code>reshaped_tensor = x.view(bs, , , )\nreshaped_and_permuted_tensor = reshaped_tensor.permute(, , , )\nreshaped_and_permuted_tensor = reshaped_and_permuted_tensor.reshape(bs,  * , )\n</code></pre>",
      "rawMarkdown": "Use vision model is the right way, just view the input as bsx1x16x10000 then transform to bsx1x160x1000，by applying some small tricks. And  that we will get private lb 0.28, public lb 0.23.\n\nI think this way to reshape the input is better.\n```python\nreshaped_tensor = x.view(bs, 16, 1000, 10)\nreshaped_and_permuted_tensor = reshaped_tensor.permute(0, 1, 3, 2)\nreshaped_and_permuted_tensor = reshaped_and_permuted_tensor.reshape(bs, 16 * 10, 1000)\n\n```",
      "votes": null
    },
    {
      "id": "2742894",
      "postDate": "04/09/2024 06:11:02",
      "content": "<p>Enn, I found adding raw to image is very usefull, but I still invesigate a lot on using 1d model on raw eeg data… I should have tested using 2d model on raw eeg data only.</p>",
      "rawMarkdown": "Enn, I found adding raw to image is very usefull, but I still invesigate a lot on using 1d model on raw eeg data... I should have tested using 2d model on raw eeg data only.",
      "votes": null
    },
    {
      "id": "2742908",
      "postDate": "04/09/2024 06:17:43",
      "content": "<p>On the contrary, my spectrum model is not that strong. I spend a lot of time to train a spectrum model that with high lb. 3d CNN pretrained model is a little bit weak, while the 3D transformer-based CNN is excessively time-consuming. </p>",
      "rawMarkdown": "On the contrary, my spectrum model is not that strong. I spend a lot of time to train a spectrum model that with high lb. 3d CNN pretrained model is a little bit weak, while the 3D transformer-based CNN is excessively time-consuming.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2742509,
      "author_name": "goldenlock",
      "author_url": "",
      "post_date": "04/09/2024 00:26:54",
      "content": "<p>I could not make raw eeg data work well…, squeezeformer only local cv 0.35.<br>\nBut just add raw eeg data as part of the image for timm backbone improve a lot.<br>\nI want to learn solution of using raw eeg data and 1d model to get 0.26 or better LB..</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2742513,
      "author_name": "nischaydnk",
      "author_url": "",
      "post_date": "04/09/2024 00:27:55",
      "content": "<p>Hi, Congrats on the strong finish <a href=\"https://www.kaggle.com/quan0095\" target=\"_blank\">@quan0095</a> we used combination of several different architectures, 1D Resnet/Inception based, transformer based, CWT + Deep2dcnn , 1D learnable frontend + 2D CNNs, all worked quite well. </p>\n<p>Did you just used <code>vit_small_patch14_reg4_dinov2.lvd142m</code> to your final solution? What input did you feed into the models?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2742525,
          "author_name": "quan0095",
          "author_url": "",
          "post_date": "04/09/2024 00:36:05",
          "content": "<p>I use dinov2 vit family in my final solution (vit small, vit base, vit large). I use butter with bandbass [0.5, 40]. Here my input: <a href=\"https://ideone.com/DTzo7F\" target=\"_blank\">https://ideone.com/DTzo7F</a>.</p>\n<pre><code>         = np.reshape(eeg, (, , EEG_LENGTH))\n         = np.concatenate((eeg[,:,:], eeg[,:,:], eeg[,:,:], eeg[,:,:]), )\n        .append(eeg)\n\n     = np.concatenate(list_eeg, )\n</code></pre>\n<p>This is the key to make vit work with raw eeg data.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2742516,
      "author_name": "brendanartley",
      "author_url": "",
      "post_date": "04/09/2024 00:32:41",
      "content": "<p>Congrats on the strong finish! </p>\n<p>Our best single model was actually a 1D-wavenet which scored 0.25 CV for GKF &gt;= 10 votes.</p>",
      "votes": null,
      "replies": [
        {
          "id": 2742521,
          "author_name": "goldenlock",
          "author_url": "",
          "post_date": "04/09/2024 00:34:38",
          "content": "<p>Just read your post, does your model only 1d-wavenet or use 1d wavenet for image to feed for 2d model?</p>",
          "votes": null,
          "replies": [
            {
              "id": 2742526,
              "author_name": "brendanartley",
              "author_url": "",
              "post_date": "04/09/2024 00:36:09",
              "content": "<p>Good question, the output of the 1d-wavenet is fed into a 2d model.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2742530,
                  "author_name": "goldenlock",
                  "author_url": "",
                  "post_date": "04/09/2024 00:38:10",
                  "content": "<p>So it is a 2d model, but it is really creative to use wavenet as a feature/image extractor, cool.</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": 2742611,
      "author_name": "gauravbrills",
      "author_url": "",
      "post_date": "04/09/2024 01:45:09",
      "content": "<p>wavenets , chrononet , 1d resnet worked mostly with same performance on features described here <a href=\"https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/492220\" target=\"_blank\">https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/492220</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2742616,
      "author_name": "cooolz",
      "author_url": "",
      "post_date": "04/09/2024 01:50:03",
      "content": "<p>Use vision model is the right way, just view the input as bsx1x16x10000 then transform to bsx1x160x1000，by applying some small tricks. And  that we will get private lb 0.28, public lb 0.23.</p>\n<p>I think this way to reshape the input is better.</p>\n<pre><code>reshaped_tensor = x.view(bs, , , )\nreshaped_and_permuted_tensor = reshaped_tensor.permute(, , , )\nreshaped_and_permuted_tensor = reshaped_and_permuted_tensor.reshape(bs,  * , )\n</code></pre>",
      "votes": null,
      "replies": [
        {
          "id": 2742894,
          "author_name": "goldenlock",
          "author_url": "",
          "post_date": "04/09/2024 06:11:02",
          "content": "<p>Enn, I found adding raw to image is very usefull, but I still invesigate a lot on using 1d model on raw eeg data… I should have tested using 2d model on raw eeg data only.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2742908,
              "author_name": "cooolz",
              "author_url": "",
              "post_date": "04/09/2024 06:17:43",
              "content": "<p>On the contrary, my spectrum model is not that strong. I spend a lot of time to train a spectrum model that with high lb. 3d CNN pretrained model is a little bit weak, while the 3D transformer-based CNN is excessively time-consuming. </p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2742502": "I try wavenet pytorch, too slow to trainining. Next, I try squeeze former, 1dcnn-gru, eegnet, eegconformer. All fail. Finally, I use vit_small_patch14_reg4_dinov2.lvd142m from timm. Vision model for raw eeg data 😱",
    "2742509": "I could not make raw eeg data work well..., squeezeformer only local cv 0.35.\nBut just add raw eeg data as part of the image for timm backbone improve a lot.\nI want to learn solution of using raw eeg data and 1d model to get 0.26 or better LB..",
    "2742513": "Hi, Congrats on the strong finish @quan0095 we used combination of several different architectures, 1D Resnet/Inception based, transformer based, CWT + Deep2dcnn , 1D learnable frontend + 2D CNNs, all worked quite well. \n\nDid you just used `vit_small_patch14_reg4_dinov2.lvd142m` to your final solution? What input did you feed into the models?",
    "2742516": "Congrats on the strong finish! \n\nOur best single model was actually a 1D-wavenet which scored 0.25 CV for GKF >= 10 votes.",
    "2742521": "Just read your post, does your model only 1d-wavenet or use 1d wavenet for image to feed for 2d model?",
    "2742525": "I use dinov2 vit family in my final solution (vit small, vit base, vit large). I use butter with bandbass [0.5, 40]. Here my input: https://ideone.com/DTzo7F.\n```\n        eeg = np.reshape(eeg, (4, 200, EEG_LENGTH))\n        eeg = np.concatenate((eeg[0,:,:], eeg[1,:,:], eeg[2,:,:], eeg[3,:,:]), 1)\n        list_eeg.append(eeg)\n \n    eeg = np.concatenate(list_eeg, 1)\n```\nThis is the key to make vit work with raw eeg data.",
    "2742526": "Good question, the output of the 1d-wavenet is fed into a 2d model.",
    "2742530": "So it is a 2d model, but it is really creative to use wavenet as a feature/image extractor, cool.",
    "2742611": "wavenets , chrononet , 1d resnet worked mostly with same performance on features described here https://www.kaggle.com/competitions/hms-harmful-brain-activity-classification/discussion/492220",
    "2742616": "Use vision model is the right way, just view the input as bsx1x16x10000 then transform to bsx1x160x1000，by applying some small tricks. And  that we will get private lb 0.28, public lb 0.23.\n\nI think this way to reshape the input is better.\n```python\nreshaped_tensor = x.view(bs, 16, 1000, 10)\nreshaped_and_permuted_tensor = reshaped_tensor.permute(0, 1, 3, 2)\nreshaped_and_permuted_tensor = reshaped_and_permuted_tensor.reshape(bs, 16 * 10, 1000)\n\n```",
    "2742894": "Enn, I found adding raw to image is very usefull, but I still invesigate a lot on using 1d model on raw eeg data... I should have tested using 2d model on raw eeg data only.",
    "2742908": "On the contrary, my spectrum model is not that strong. I spend a lot of time to train a spectrum model that with high lb. 3d CNN pretrained model is a little bit weak, while the 3D transformer-based CNN is excessively time-consuming."
  },
  "source": "meta"
}