{
  "id": 469953,
  "title": "How are your experience with Augmentation ?",
  "url": "/competitions/hms-harmful-brain-activity-classification/discussion/469953",
  "author_name": "Nirjhar Roy",
  "post_date": "2024-01-22T15:45:29.872000",
  "votes": 44,
  "comment_count": 40,
  "views": 0,
  "content": "<p>Are augmentations really helping here ? How are your experience with augmentation so far ?</p>\n<p>I tried some flips and usual image augmentation .. results are inconclusive . I dont think image augmentations really mirror the diversity in spectrograms .What do you think?</p>",
  "messages": [
    {
      "id": 2614414,
      "postDate": "2024-01-22T15:45:29.873Z",
      "content": "<p>Are augmentations really helping here ? How are your experience with augmentation so far ?</p>\n<p>I tried some flips and usual image augmentation .. results are inconclusive . I dont think image augmentations really mirror the diversity in spectrograms .What do you think?</p>",
      "rawMarkdown": "Are augmentations really helping here ? How are your experience with augmentation so far ?\n\nI tried some flips and usual image augmentation .. results are inconclusive . I dont think image augmentations really mirror the diversity in spectrograms .What do you think?",
      "votes": 44
    },
    {
      "id": 2622116,
      "postDate": "2024-01-27T08:45:08.910Z",
      "content": "<p>For me <code>MixUp (alpha = 2.0)</code> works very well. The LB improved from <code>0.63</code> -&gt; <code>0.55</code> just simply using mixup.</p>\n<p>You can check this <a href=\"https://www.kaggle.com/code/awsaf49/hms-hbac-kerascv-starter-notebook\" target=\"_blank\">KerasCV Notebook</a> for more details.</p>\n<ul>\n<li>Version 1 -&gt; MixUp</li>\n<li>Version 2 -&gt; No MixUp</li>\n</ul>",
      "rawMarkdown": "For me `MixUp (alpha = 2.0)` works very well. The LB improved from `0.63` -> `0.55` just simply using mixup.\n\nYou can check this [KerasCV Notebook](https://www.kaggle.com/code/awsaf49/hms-hbac-kerascv-starter-notebook) for more details.\n* Version 1 -> MixUp\n* Version 2 -> No MixUp",
      "votes": 15,
      "replies": [
        {
          "id": 2622216,
          "postDate": "2024-01-27T10:44:20.083Z",
          "content": "<p>MixUp didn't work for me. I've sampled lots of values with <code>np.random.beta(2, 2)</code> and mean is between 0.49 and 0.51. I guess it makes sense to mix two images almost equally.</p>",
          "rawMarkdown": "MixUp didn't work for me. I've sampled lots of values with `np.random.beta(2, 2)` and mean is between 0.49 and 0.51. I guess it makes sense to mix two images almost equally.",
          "votes": 7
        },
        {
          "id": 2622297,
          "postDate": "2024-01-27T12:20:37.377Z",
          "content": "<p>I have tried alpha=0.2, 0.4 and 1.0 for Kaggle's spectrograms. For me 1.0 was best from the viewpoint of LB.<br>\nA larger value might be better for them.  I will try 2.0.</p>\n<p>For Chirs's spectrograms generated from eegs, interestingly, 0.5 got better LB than 1.0. <br>\n(It is necessary to be careful that the LB scores are not correlated with the CV scores.)</p>",
          "rawMarkdown": "I have tried alpha=0.2, 0.4 and 1.0 for Kaggle's spectrograms. For me 1.0 was best from the viewpoint of LB.\nA larger value might be better for them.  I will try 2.0.\n\nFor Chirs's spectrograms generated from eegs, interestingly, 0.5 got better LB than 1.0. \n(It is necessary to be careful that the LB scores are not correlated with the CV scores.)",
          "votes": 1,
          "replies": [
            {
              "id": 2622320,
              "postDate": "2024-01-27T12:36:58.080Z",
              "content": "<p>I tried with <code>0.5</code> and <code>2.0</code>. And <code>2.0</code> performs way better.</p>",
              "rawMarkdown": "I tried with `0.5` and `2.0`. And `2.0` performs way better.",
              "votes": 5
            }
          ]
        },
        {
          "id": 2641824,
          "postDate": "2024-02-07T17:28:47.433Z",
          "content": "<p><a href=\"https://www.kaggle.com/awsaf\" target=\"_blank\">@awsaf</a> do we need to modify the loss function when using mixup ? 🤔 or will KLD loss work oob</p>",
          "rawMarkdown": "@awsaf do we need to modify the loss function when using mixup ? 🤔 or will KLD loss work oob"
        }
      ]
    },
    {
      "id": 2627933,
      "postDate": "2024-01-31T01:23:21.827Z",
      "content": "<p>Since many people here are talking about MixUp, which samples its <em>lambda</em> parameter from the Beta distribution, here is what different distributions of the Beta distribution look like when we change <em>alpha</em> (also, assuming alpha = beta):</p>\n<pre><code>alpha =  \nx = [np.random.beta(alpha,alpha)  i  ()]\n_ = plt.hist(x, bins = )\n_ = plt.title()\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3197853%2F2ad2255f8cd2f2373f4d1c855bfff5c1%2FScreenshot%202024-01-30%20at%2022.17.18.png?generation=1706664002899031&amp;alt=media\"></p>\n<p>It looks that for:</p>\n<ul>\n<li><em>alpha</em> = 2 ---&gt; normal</li>\n<li><em>alpha</em> = 1 ---&gt; uniform</li>\n<li><em>alpha</em> = 0.5 ---&gt; U-shape/bimodal</li>\n</ul>",
      "rawMarkdown": "Since many people here are talking about MixUp, which samples its *lambda* parameter from the Beta distribution, here is what different distributions of the Beta distribution look like when we change *alpha* (also, assuming alpha = beta):\n```python\nalpha = 2 # <--- 2 as example, could be 0.5, 1.0 or whatever\nx = [np.random.beta(alpha,alpha) for i in range(1000)]\n_ = plt.hist(x, bins = 25)\n_ = plt.title(f\"Beta distribution for alpha: {alpha}\")\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3197853%2F2ad2255f8cd2f2373f4d1c855bfff5c1%2FScreenshot%202024-01-30%20at%2022.17.18.png?generation=1706664002899031&alt=media)\n\nIt looks that for:\n- *alpha* = 2 ---> normal\n- *alpha* = 1 ---> uniform\n- *alpha* = 0.5 ---> U-shape/bimodal\n",
      "votes": 13,
      "replies": [
        {
          "id": 2628598,
          "postDate": "2024-01-31T11:56:41.303Z",
          "content": "<p>Very nice!</p>\n<p>Despite all the positive comments in this thread, for some reason, alpha &gt; 1 did not work for me at all</p>",
          "rawMarkdown": "Very nice!\n\nDespite all the positive comments in this thread, for some reason, alpha > 1 did not work for me at all",
          "votes": 2
        }
      ]
    },
    {
      "id": 2614988,
      "postDate": "2024-01-22T23:45:04.490Z",
      "content": "<p>Mixup boost lb&amp;cv about0.02<br>\nFor me mixup&gt;cutmix,manifold mixup</p>",
      "rawMarkdown": "Mixup boost lb&cv about0.02\nFor me mixup>cutmix,manifold mixup",
      "votes": 14,
      "replies": [
        {
          "id": 2627856,
          "postDate": "2024-01-30T23:26:33.337Z",
          "content": "<p><a href=\"https://www.kaggle.com/abebe9849\" target=\"_blank\">@abebe9849</a> do you apply mixup to all batches or do you apply mixup with certain probability?</p>",
          "rawMarkdown": "@abebe9849 do you apply mixup to all batches or do you apply mixup with certain probability?",
          "votes": 1,
          "replies": [
            {
              "id": 2627863,
              "postDate": "2024-01-30T23:38:30.043Z",
              "content": "<p>p=0.5     alpla=1 </p>",
              "rawMarkdown": "p=0.5     alpla=1 ",
              "votes": 2
            },
            {
              "id": 2641742,
              "postDate": "2024-02-07T16:35:20.493Z",
              "content": "<p>in torch or keras . in keras so far I see drop when using alpha 1 will check other params .</p>",
              "rawMarkdown": "in torch or keras . in keras so far I see drop when using alpha 1 will check other params ."
            }
          ]
        }
      ]
    },
    {
      "id": 2622753,
      "postDate": "2024-01-27T17:21:54.630Z",
      "content": "<p>For me, horizontal flipping also worked, CV = 0.635-&gt;0.619, LB =0.44-&gt;0.42. I am using Kaggle spectrograms as of now. Adding augmentation is helping me training for more epochs though the difference is only 2-3 epoch but i can see comparatively stable results.</p>",
      "rawMarkdown": "For me, horizontal flipping also worked, CV = 0.635->0.619, LB =0.44->0.42. I am using Kaggle spectrograms as of now. Adding augmentation is helping me training for more epochs though the difference is only 2-3 epoch but i can see comparatively stable results.",
      "votes": 10,
      "replies": [
        {
          "id": 2623115,
          "postDate": "2024-01-28T01:41:57.547Z",
          "content": "<p>Thank you for sharing. Can we have any hypotheses why horizontal flipping works? The spectrogram images have a meaningful horizontal axis (may be \"time\" in this case), which means horizontal flipping works like treating an image and the \"time-inverted\" image as similar. This seems strange to me because this operation appears to cause intrinsic information of spectrogram to be lost, but if many images are nearly symmetrical, it might be reasonable that horizontal flipping work well.</p>",
          "rawMarkdown": "Thank you for sharing. Can we have any hypotheses why horizontal flipping works? The spectrogram images have a meaningful horizontal axis (may be \"time\" in this case), which means horizontal flipping works like treating an image and the \"time-inverted\" image as similar. This seems strange to me because this operation appears to cause intrinsic information of spectrogram to be lost, but if many images are nearly symmetrical, it might be reasonable that horizontal flipping work well.",
          "votes": 2
        }
      ]
    },
    {
      "id": 2617558,
      "postDate": "2024-01-24T09:56:50.117Z",
      "content": "<p>I have 5 custom augmentations and they improved my validation score from 0.8x to 0.6833.</p>",
      "rawMarkdown": "I have 5 custom augmentations and they improved my validation score from 0.8x to 0.6833.",
      "votes": 10,
      "replies": [
        {
          "id": 2618477,
          "postDate": "2024-01-24T18:40:23.313Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/gunesevitan\" target=\"_blank\">@gunesevitan</a>, Have you published your augmentations? I'd love to take a look. Did you try brightness and/or contrast augmentations? </p>",
          "rawMarkdown": "Hi @gunesevitan, Have you published your augmentations? I'd love to take a look. Did you try brightness and/or contrast augmentations? ",
          "replies": [
            {
              "id": 2620613,
              "postDate": "2024-01-26T08:38:17.630Z",
              "content": "<p>I won't share the custom ones but yeah I also use brightness/contrast adjustment.</p>",
              "rawMarkdown": "I won't share the custom ones but yeah I also use brightness/contrast adjustment.",
              "votes": 6
            },
            {
              "id": 2629355,
              "postDate": "2024-01-31T18:31:29.197Z",
              "content": "<p><a href=\"https://www.kaggle.com/gunesevitan\" target=\"_blank\">@gunesevitan</a> So far I've been experimenting with brightness/contrast, mixup, and gaussian blur. I'm combining by best values for all of them, but they aren't doing as well as individually. When you're experimenting, do you find the best value individually and then combine? Or test various augmentation values in combination the entire time? </p>",
              "rawMarkdown": "@gunesevitan So far I've been experimenting with brightness/contrast, mixup, and gaussian blur. I'm combining by best values for all of them, but they aren't doing as well as individually. When you're experimenting, do you find the best value individually and then combine? Or test various augmentation values in combination the entire time? "
            },
            {
              "id": 2629367,
              "postDate": "2024-01-31T18:38:47.483Z",
              "content": "<p>It depends on my folds actually. I add a new augmentation with mid intensity and 0.25 probability. I tune the augmentation intensity based on the fold scores. After finding a good subset of intensity values, I tune the augmentation probability. To answer your question, I add augmentation one at a time.</p>",
              "rawMarkdown": "It depends on my folds actually. I add a new augmentation with mid intensity and 0.25 probability. I tune the augmentation intensity based on the fold scores. After finding a good subset of intensity values, I tune the augmentation probability. To answer your question, I add augmentation one at a time.\n",
              "votes": 4
            }
          ]
        }
      ]
    },
    {
      "id": 2630536,
      "postDate": "2024-02-01T10:41:30.893Z",
      "content": "<p>Standard augmentations don't work that well for spectrograms, you might want to try stuff like time/frequency masking. My CV score improved quite a bit after that.</p>",
      "rawMarkdown": "Standard augmentations don't work that well for spectrograms, you might want to try stuff like time/frequency masking. My CV score improved quite a bit after that.",
      "votes": 7
    },
    {
      "id": 2614446,
      "postDate": "2024-01-22T16:03:45.910Z",
      "content": "<p>Same experience here. So far, I haven't been able to make it work. It always yields better results without augmentation.</p>",
      "rawMarkdown": "Same experience here. So far, I haven't been able to make it work. It always yields better results without augmentation.",
      "votes": 7
    },
    {
      "id": 2632405,
      "postDate": "2024-02-02T10:44:27.063Z",
      "content": "<p>Image augmentation is good strategy to score higher<br>\nAlso, there are good Data Augmentations</p>\n<p>[noise addition, generative adversarial networks, sliding windows, sampling, Fourier transform,<br>\nrecombination of segmentation, and others]</p>\n<p>In this paper: <a href=\"https://www.sciencedirect.com/science/article/abs/pii/S0165027020303083\" target=\"_blank\">https://www.sciencedirect.com/science/article/abs/pii/S0165027020303083</a></p>\n<p><strong>\"Noise Addition and sliding windows provied the highest accuract boost\"</strong></p>\n<p>🛑 Denosing(ex: dmey, db8, db6) &amp; Noise Addition especially in eeg will be improve score</p>",
      "rawMarkdown": "Image augmentation is good strategy to score higher\nAlso, there are good Data Augmentations\n\n[noise addition, generative adversarial networks, sliding windows, sampling, Fourier transform,\nrecombination of segmentation, and others]\n\nIn this paper: https://www.sciencedirect.com/science/article/abs/pii/S0165027020303083\n\n**\"Noise Addition and sliding windows provied the highest accuract boost\"**\n\n🛑 Denosing(ex: dmey, db8, db6) & Noise Addition especially in eeg will be improve score\n\n",
      "votes": 5
    },
    {
      "id": 2617870,
      "postDate": "2024-01-24T13:45:10.140Z",
      "content": "<p>same as others: mixup boost cv/lb by 0.02</p>",
      "rawMarkdown": "same as others: mixup boost cv/lb by 0.02",
      "votes": 3
    },
    {
      "id": 2615217,
      "postDate": "2024-01-23T03:12:50.893Z",
      "content": "<p>I could not get significant improvement, but a little.</p>\n<ul>\n<li>cutmix: did not work.</li>\n<li>mixup: worked a little (LB 0~0.02). depended on the value of parameter alpha. </li>\n</ul>\n<p>As a side note, I tried other preprocessing methods like median filter, which did not work.</p>",
      "rawMarkdown": "I could not get significant improvement, but a little.\n- cutmix: did not work.\n- mixup: worked a little (LB 0~0.02). depended on the value of parameter alpha. \n\nAs a side note, I tried other preprocessing methods like median filter, which did not work.",
      "votes": 3,
      "replies": [
        {
          "id": 2620177,
          "postDate": "2024-01-26T01:07:43.367Z",
          "content": "<p>cutmix did not work for me too, i try to adjust alpha for mixup that gives some different results.</p>",
          "rawMarkdown": "cutmix did not work for me too, i try to adjust alpha for mixup that gives some different results.",
          "votes": 3
        }
      ]
    },
    {
      "id": 2622865,
      "postDate": "2024-01-27T19:04:48.303Z",
      "content": "<p>For me, all augmentations (mixup, flip, and other image augmentations like blur) didn't help a lot. It seems to me they're working like adding noise.</p>",
      "rawMarkdown": "For me, all augmentations (mixup, flip, and other image augmentations like blur) didn't help a lot. It seems to me they're working like adding noise.",
      "votes": 1
    },
    {
      "id": 2621941,
      "postDate": "2024-01-27T06:41:16.680Z",
      "content": "<p>Now the mixup doesn't work for me, after I added the spectrogram created by Chris</p>",
      "rawMarkdown": "Now the mixup doesn't work for me, after I added the spectrogram created by Chris",
      "votes": 1,
      "replies": [
        {
          "id": 2621943,
          "postDate": "2024-01-27T06:42:42.673Z",
          "content": "<p>My current score is not using any enhancements, it only gives me drops in LB</p>",
          "rawMarkdown": "My current score is not using any enhancements, it only gives me drops in LB"
        }
      ]
    },
    {
      "id": 2617545,
      "postDate": "2024-01-24T09:40:08.103Z",
      "content": "<p>mixup is helpful other augment did not work for me, one more thing is that I used pytorch did not as good as tf </p>",
      "rawMarkdown": "mixup is helpful other augment did not work for me, one more thing is that I used pytorch did not as good as tf ",
      "votes": 2,
      "replies": [
        {
          "id": 2622776,
          "postDate": "2024-01-27T17:33:59.440Z",
          "content": "<p>Hey <a href=\"https://www.kaggle.com/leehann\" target=\"_blank\">@leehann</a> what spectrograms are you using? Cause in my case i saw similar results with pytorch as in tf notebook by chris.</p>",
          "rawMarkdown": "Hey @leehann what spectrograms are you using? Cause in my case i saw similar results with pytorch as in tf notebook by chris.",
          "replies": [
            {
              "id": 2623101,
              "postDate": "2024-01-28T01:07:45.430Z",
              "content": "<p><a href=\"https://www.kaggle.com/chaudharypriyanshu\" target=\"_blank\">@chaudharypriyanshu</a> Interesting, I convert Chris's latest code to pytorch due to compatibility issue with tf. LB result is 0.42 and I didn't notice much of difference in CV as well</p>",
              "rawMarkdown": "@chaudharypriyanshu Interesting, I convert Chris's latest code to pytorch due to compatibility issue with tf. LB result is 0.42 and I didn't notice much of difference in CV as well"
            }
          ]
        }
      ]
    },
    {
      "id": 2617331,
      "postDate": "2024-01-24T07:19:11.850Z",
      "content": "<p>For me, CoarseDropout also does not help (CV 0.60 -&gt; 0.62 after adding CoarseDropout, no visible difference in LB)</p>",
      "rawMarkdown": "For me, CoarseDropout also does not help (CV 0.60 -> 0.62 after adding CoarseDropout, no visible difference in LB)",
      "votes": 2
    },
    {
      "id": 2614479,
      "postDate": "2024-01-22T16:34:01.870Z",
      "content": "<p>hi <a href=\"https://www.kaggle.com/phoenix9032\" target=\"_blank\">@phoenix9032</a> ,<br>\nSpectrograms comes under signal processing and techniques like autocorrelation, Fourier and wavelet transformations etc. may get you the desired results.<br>\nThanks! </p>",
      "rawMarkdown": "hi @phoenix9032 ,\nSpectrograms comes under signal processing and techniques like autocorrelation, Fourier and wavelet transformations etc. may get you the desired results.\nThanks! ",
      "votes": 2
    },
    {
      "id": 2672537,
      "postDate": "2024-02-28T06:39:13.240Z",
      "content": "<p>New to this competition, How to mix up 1,512,512eegs and 4 128, 256 spectrums ?😪</p>",
      "rawMarkdown": "New to this competition, How to mix up 1,512,512eegs and 4 128, 256 spectrums ?😪"
    },
    {
      "id": 2630485,
      "postDate": "2024-02-01T10:16:43.950Z",
      "content": "<p>For me, my CV has boost ~0.02 when using mix up, but LB has not changes.</p>",
      "rawMarkdown": "For me, my CV has boost ~0.02 when using mix up, but LB has not changes."
    },
    {
      "id": 2615696,
      "postDate": "2024-01-23T08:59:38.790Z",
      "content": "<p>Still working on it…  Not much improvements so far and probably due to what supplejade and Bjarkason said…</p>",
      "rawMarkdown": "Still working on it...  Not much improvements so far and probably due to what supplejade and Bjarkason said...",
      "replies": [
        {
          "id": 2615730,
          "postDate": "2024-01-23T09:30:39.877Z",
          "content": "<p>according to: </p>\n<p><a href=\"https://dsp.stackexchange.com/questions/59264/augmentation-for-eeg-signal-classification-using-deep-learning\" target=\"_blank\">https://dsp.stackexchange.com/questions/59264/augmentation-for-eeg-signal-classification-using-deep-learning</a></p>\n<p>Spectrogram augmentation may not be so feasible as assumed for vision based neural networks.</p>",
          "rawMarkdown": "according to: \n\nhttps://dsp.stackexchange.com/questions/59264/augmentation-for-eeg-signal-classification-using-deep-learning\n\nSpectrogram augmentation may not be so feasible as assumed for vision based neural networks.\n\n"
        },
        {
          "id": 2615777,
          "postDate": "2024-01-23T10:00:16.107Z",
          "content": "<p>On the other hand, there are papers such as this:</p>\n<p>\"Generative adversarial networks in EEG analysis: an overview\"</p>\n<p><a href=\"https://jneuroengrehab.biomedcentral.com/articles/10.1186/s12984-023-01169-w\" target=\"_blank\">https://jneuroengrehab.biomedcentral.com/articles/10.1186/s12984-023-01169-w</a></p>\n<p>which shows that:</p>\n<p>\"…generating artificial EEG data from the limited recorded data using GANs has seen recent success. \"</p>",
          "rawMarkdown": "On the other hand, there are papers such as this:\n\n\"Generative adversarial networks in EEG analysis: an overview\"\n\nhttps://jneuroengrehab.biomedcentral.com/articles/10.1186/s12984-023-01169-w\n\nwhich shows that:\n\n\"...generating artificial EEG data from the limited recorded data using GANs has seen recent success. \"",
          "votes": 3
        },
        {
          "id": 2615782,
          "postDate": "2024-01-23T10:01:56.560Z",
          "content": "<p>And this online article:</p>\n<p>\"Data Augmentation Techniques for Audio Data in Python\"</p>\n<p><a href=\"https://towardsdatascience.com/data-augmentation-techniques-for-audio-data-in-python-15505483c63c\" target=\"_blank\">https://towardsdatascience.com/data-augmentation-techniques-for-audio-data-in-python-15505483c63c</a></p>",
          "rawMarkdown": "And this online article:\n\n\"Data Augmentation Techniques for Audio Data in Python\"\n\nhttps://towardsdatascience.com/data-augmentation-techniques-for-audio-data-in-python-15505483c63c",
          "votes": 1
        }
      ]
    },
    {
      "id": 2614967,
      "postDate": "2024-01-22T23:24:08.333Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 2614812,
      "postDate": "2024-01-22T20:12:30.460Z",
      "rawMarkdown": "",
      "votes": -7,
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2622116,
      "author_name": "Awsaf",
      "author_url": "",
      "post_date": "2024-01-27T08:45:08.910000",
      "content": "<p>For me <code>MixUp (alpha = 2.0)</code> works very well. The LB improved from <code>0.63</code> -&gt; <code>0.55</code> just simply using mixup.</p>\n<p>You can check this <a href=\"https://www.kaggle.com/code/awsaf49/hms-hbac-kerascv-starter-notebook\" target=\"_blank\">KerasCV Notebook</a> for more details.</p>\n<ul>\n<li>Version 1 -&gt; MixUp</li>\n<li>Version 2 -&gt; No MixUp</li>\n</ul>",
      "votes": 15,
      "replies": [
        {
          "id": 2622216,
          "author_name": "Gunes Evitan",
          "author_url": "",
          "post_date": "2024-01-27T10:44:20.083000",
          "content": "<p>MixUp didn't work for me. I've sampled lots of values with <code>np.random.beta(2, 2)</code> and mean is between 0.49 and 0.51. I guess it makes sense to mix two images almost equally.</p>",
          "votes": 7,
          "replies": []
        },
        {
          "id": 2622297,
          "author_name": "sy",
          "author_url": "",
          "post_date": "2024-01-27T12:20:37.377000",
          "content": "<p>I have tried alpha=0.2, 0.4 and 1.0 for Kaggle's spectrograms. For me 1.0 was best from the viewpoint of LB.<br>\nA larger value might be better for them.  I will try 2.0.</p>\n<p>For Chirs's spectrograms generated from eegs, interestingly, 0.5 got better LB than 1.0. <br>\n(It is necessary to be careful that the LB scores are not correlated with the CV scores.)</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2622320,
              "author_name": "Awsaf",
              "author_url": "",
              "post_date": "2024-01-27T12:36:58.080000",
              "content": "<p>I tried with <code>0.5</code> and <code>2.0</code>. And <code>2.0</code> performs way better.</p>",
              "votes": 5,
              "replies": []
            }
          ]
        },
        {
          "id": 2641824,
          "author_name": "Gaurav Rawat",
          "author_url": "",
          "post_date": "2024-02-07T17:28:47.433000",
          "content": "<p><a href=\"https://www.kaggle.com/awsaf\" target=\"_blank\">@awsaf</a> do we need to modify the loss function when using mixup ? 🤔 or will KLD loss work oob</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2627933,
      "author_name": "moth",
      "author_url": "",
      "post_date": "2024-01-31T01:23:21.827000",
      "content": "<p>Since many people here are talking about MixUp, which samples its <em>lambda</em> parameter from the Beta distribution, here is what different distributions of the Beta distribution look like when we change <em>alpha</em> (also, assuming alpha = beta):</p>\n<pre><code>alpha =  \nx = [np.random.beta(alpha,alpha)  i  ()]\n_ = plt.hist(x, bins = )\n_ = plt.title()\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3197853%2F2ad2255f8cd2f2373f4d1c855bfff5c1%2FScreenshot%202024-01-30%20at%2022.17.18.png?generation=1706664002899031&amp;alt=media\"></p>\n<p>It looks that for:</p>\n<ul>\n<li><em>alpha</em> = 2 ---&gt; normal</li>\n<li><em>alpha</em> = 1 ---&gt; uniform</li>\n<li><em>alpha</em> = 0.5 ---&gt; U-shape/bimodal</li>\n</ul>",
      "votes": 13,
      "replies": [
        {
          "id": 2628598,
          "author_name": "Yan Teixeira",
          "author_url": "",
          "post_date": "2024-01-31T11:56:41.303000",
          "content": "<p>Very nice!</p>\n<p>Despite all the positive comments in this thread, for some reason, alpha &gt; 1 did not work for me at all</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 2614988,
      "author_name": "patriot",
      "author_url": "",
      "post_date": "2024-01-22T23:45:04.490000",
      "content": "<p>Mixup boost lb&amp;cv about0.02<br>\nFor me mixup&gt;cutmix,manifold mixup</p>",
      "votes": 14,
      "replies": [
        {
          "id": 2627856,
          "author_name": "moth",
          "author_url": "",
          "post_date": "2024-01-30T23:26:33.337000",
          "content": "<p><a href=\"https://www.kaggle.com/abebe9849\" target=\"_blank\">@abebe9849</a> do you apply mixup to all batches or do you apply mixup with certain probability?</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2627863,
              "author_name": "patriot",
              "author_url": "",
              "post_date": "2024-01-30T23:38:30.043000",
              "content": "<p>p=0.5     alpla=1 </p>",
              "votes": 2,
              "replies": []
            },
            {
              "id": 2641742,
              "author_name": "Gaurav Rawat",
              "author_url": "",
              "post_date": "2024-02-07T16:35:20.493000",
              "content": "<p>in torch or keras . in keras so far I see drop when using alpha 1 will check other params .</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2622753,
      "author_name": "Priyanshu Chaudhary",
      "author_url": "",
      "post_date": "2024-01-27T17:21:54.630000",
      "content": "<p>For me, horizontal flipping also worked, CV = 0.635-&gt;0.619, LB =0.44-&gt;0.42. I am using Kaggle spectrograms as of now. Adding augmentation is helping me training for more epochs though the difference is only 2-3 epoch but i can see comparatively stable results.</p>",
      "votes": 10,
      "replies": [
        {
          "id": 2623115,
          "author_name": "sy",
          "author_url": "",
          "post_date": "2024-01-28T01:41:57.547000",
          "content": "<p>Thank you for sharing. Can we have any hypotheses why horizontal flipping works? The spectrogram images have a meaningful horizontal axis (may be \"time\" in this case), which means horizontal flipping works like treating an image and the \"time-inverted\" image as similar. This seems strange to me because this operation appears to cause intrinsic information of spectrogram to be lost, but if many images are nearly symmetrical, it might be reasonable that horizontal flipping work well.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 2617558,
      "author_name": "Gunes Evitan",
      "author_url": "",
      "post_date": "2024-01-24T09:56:50.117000",
      "content": "<p>I have 5 custom augmentations and they improved my validation score from 0.8x to 0.6833.</p>",
      "votes": 10,
      "replies": [
        {
          "id": 2618477,
          "author_name": "Shane Simon",
          "author_url": "",
          "post_date": "2024-01-24T18:40:23.313000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/gunesevitan\" target=\"_blank\">@gunesevitan</a>, Have you published your augmentations? I'd love to take a look. Did you try brightness and/or contrast augmentations? </p>",
          "votes": 0,
          "replies": [
            {
              "id": 2620613,
              "author_name": "Gunes Evitan",
              "author_url": "",
              "post_date": "2024-01-26T08:38:17.630000",
              "content": "<p>I won't share the custom ones but yeah I also use brightness/contrast adjustment.</p>",
              "votes": 6,
              "replies": []
            },
            {
              "id": 2629355,
              "author_name": "Shane Simon",
              "author_url": "",
              "post_date": "2024-01-31T18:31:29.197000",
              "content": "<p><a href=\"https://www.kaggle.com/gunesevitan\" target=\"_blank\">@gunesevitan</a> So far I've been experimenting with brightness/contrast, mixup, and gaussian blur. I'm combining by best values for all of them, but they aren't doing as well as individually. When you're experimenting, do you find the best value individually and then combine? Or test various augmentation values in combination the entire time? </p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2629367,
              "author_name": "Gunes Evitan",
              "author_url": "",
              "post_date": "2024-01-31T18:38:47.483000",
              "content": "<p>It depends on my folds actually. I add a new augmentation with mid intensity and 0.25 probability. I tune the augmentation intensity based on the fold scores. After finding a good subset of intensity values, I tune the augmentation probability. To answer your question, I add augmentation one at a time.</p>",
              "votes": 4,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2630536,
      "author_name": "poopoo",
      "author_url": "",
      "post_date": "2024-02-01T10:41:30.893000",
      "content": "<p>Standard augmentations don't work that well for spectrograms, you might want to try stuff like time/frequency masking. My CV score improved quite a bit after that.</p>",
      "votes": 7,
      "replies": []
    },
    {
      "id": 2614446,
      "author_name": "Yan Teixeira",
      "author_url": "",
      "post_date": "2024-01-22T16:03:45.910000",
      "content": "<p>Same experience here. So far, I haven't been able to make it work. It always yields better results without augmentation.</p>",
      "votes": 7,
      "replies": []
    },
    {
      "id": 2632405,
      "author_name": "Peter",
      "author_url": "",
      "post_date": "2024-02-02T10:44:27.063000",
      "content": "<p>Image augmentation is good strategy to score higher<br>\nAlso, there are good Data Augmentations</p>\n<p>[noise addition, generative adversarial networks, sliding windows, sampling, Fourier transform,<br>\nrecombination of segmentation, and others]</p>\n<p>In this paper: <a href=\"https://www.sciencedirect.com/science/article/abs/pii/S0165027020303083\" target=\"_blank\">https://www.sciencedirect.com/science/article/abs/pii/S0165027020303083</a></p>\n<p><strong>\"Noise Addition and sliding windows provied the highest accuract boost\"</strong></p>\n<p>🛑 Denosing(ex: dmey, db8, db6) &amp; Noise Addition especially in eeg will be improve score</p>",
      "votes": 5,
      "replies": []
    },
    {
      "id": 2617870,
      "author_name": "Reacher",
      "author_url": "",
      "post_date": "2024-01-24T13:45:10.140000",
      "content": "<p>same as others: mixup boost cv/lb by 0.02</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 2615217,
      "author_name": "sy",
      "author_url": "",
      "post_date": "2024-01-23T03:12:50.893000",
      "content": "<p>I could not get significant improvement, but a little.</p>\n<ul>\n<li>cutmix: did not work.</li>\n<li>mixup: worked a little (LB 0~0.02). depended on the value of parameter alpha. </li>\n</ul>\n<p>As a side note, I tried other preprocessing methods like median filter, which did not work.</p>",
      "votes": 3,
      "replies": [
        {
          "id": 2620177,
          "author_name": "SEVEN",
          "author_url": "",
          "post_date": "2024-01-26T01:07:43.367000",
          "content": "<p>cutmix did not work for me too, i try to adjust alpha for mixup that gives some different results.</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 2622865,
      "author_name": "Yu Wu",
      "author_url": "",
      "post_date": "2024-01-27T19:04:48.303000",
      "content": "<p>For me, all augmentations (mixup, flip, and other image augmentations like blur) didn't help a lot. It seems to me they're working like adding noise.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2621941,
      "author_name": "Donghui Zhang",
      "author_url": "",
      "post_date": "2024-01-27T06:41:16.680000",
      "content": "<p>Now the mixup doesn't work for me, after I added the spectrogram created by Chris</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2621943,
          "author_name": "Donghui Zhang",
          "author_url": "",
          "post_date": "2024-01-27T06:42:42.673000",
          "content": "<p>My current score is not using any enhancements, it only gives me drops in LB</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 2617545,
      "author_name": "HZM",
      "author_url": "",
      "post_date": "2024-01-24T09:40:08.103000",
      "content": "<p>mixup is helpful other augment did not work for me, one more thing is that I used pytorch did not as good as tf </p>",
      "votes": 2,
      "replies": [
        {
          "id": 2622776,
          "author_name": "Priyanshu Chaudhary",
          "author_url": "",
          "post_date": "2024-01-27T17:33:59.440000",
          "content": "<p>Hey <a href=\"https://www.kaggle.com/leehann\" target=\"_blank\">@leehann</a> what spectrograms are you using? Cause in my case i saw similar results with pytorch as in tf notebook by chris.</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2623101,
              "author_name": "Roy Wei",
              "author_url": "",
              "post_date": "2024-01-28T01:07:45.430000",
              "content": "<p><a href=\"https://www.kaggle.com/chaudharypriyanshu\" target=\"_blank\">@chaudharypriyanshu</a> Interesting, I convert Chris's latest code to pytorch due to compatibility issue with tf. LB result is 0.42 and I didn't notice much of difference in CV as well</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2617331,
      "author_name": "Mikołaj Sacha",
      "author_url": "",
      "post_date": "2024-01-24T07:19:11.850000",
      "content": "<p>For me, CoarseDropout also does not help (CV 0.60 -&gt; 0.62 after adding CoarseDropout, no visible difference in LB)</p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2614479,
      "author_name": "supplejade",
      "author_url": "",
      "post_date": "2024-01-22T16:34:01.870000",
      "content": "<p>hi <a href=\"https://www.kaggle.com/phoenix9032\" target=\"_blank\">@phoenix9032</a> ,<br>\nSpectrograms comes under signal processing and techniques like autocorrelation, Fourier and wavelet transformations etc. may get you the desired results.<br>\nThanks! </p>",
      "votes": 2,
      "replies": []
    },
    {
      "id": 2672537,
      "author_name": "Seeing Times",
      "author_url": "",
      "post_date": "2024-02-28T06:39:13.240000",
      "content": "<p>New to this competition, How to mix up 1,512,512eegs and 4 128, 256 spectrums ?😪</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2630485,
      "author_name": "Haru",
      "author_url": "",
      "post_date": "2024-02-01T10:16:43.950000",
      "content": "<p>For me, my CV has boost ~0.02 when using mix up, but LB has not changes.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2615696,
      "author_name": "AIDLRE001",
      "author_url": "",
      "post_date": "2024-01-23T08:59:38.790000",
      "content": "<p>Still working on it…  Not much improvements so far and probably due to what supplejade and Bjarkason said…</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2615730,
          "author_name": "AIDLRE001",
          "author_url": "",
          "post_date": "2024-01-23T09:30:39.877000",
          "content": "<p>according to: </p>\n<p><a href=\"https://dsp.stackexchange.com/questions/59264/augmentation-for-eeg-signal-classification-using-deep-learning\" target=\"_blank\">https://dsp.stackexchange.com/questions/59264/augmentation-for-eeg-signal-classification-using-deep-learning</a></p>\n<p>Spectrogram augmentation may not be so feasible as assumed for vision based neural networks.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2615777,
          "author_name": "AIDLRE001",
          "author_url": "",
          "post_date": "2024-01-23T10:00:16.107000",
          "content": "<p>On the other hand, there are papers such as this:</p>\n<p>\"Generative adversarial networks in EEG analysis: an overview\"</p>\n<p><a href=\"https://jneuroengrehab.biomedcentral.com/articles/10.1186/s12984-023-01169-w\" target=\"_blank\">https://jneuroengrehab.biomedcentral.com/articles/10.1186/s12984-023-01169-w</a></p>\n<p>which shows that:</p>\n<p>\"…generating artificial EEG data from the limited recorded data using GANs has seen recent success. \"</p>",
          "votes": 3,
          "replies": []
        },
        {
          "id": 2615782,
          "author_name": "AIDLRE001",
          "author_url": "",
          "post_date": "2024-01-23T10:01:56.560000",
          "content": "<p>And this online article:</p>\n<p>\"Data Augmentation Techniques for Audio Data in Python\"</p>\n<p><a href=\"https://towardsdatascience.com/data-augmentation-techniques-for-audio-data-in-python-15505483c63c\" target=\"_blank\">https://towardsdatascience.com/data-augmentation-techniques-for-audio-data-in-python-15505483c63c</a></p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 2614967,
      "author_name": "",
      "author_url": "",
      "post_date": "2024-01-22T23:24:08.333000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2614812,
      "author_name": "",
      "author_url": "",
      "post_date": "2024-01-22T20:12:30.460000",
      "content": "",
      "votes": -7,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2614414": "Are augmentations really helping here ? How are your experience with augmentation so far ?\n\nI tried some flips and usual image augmentation .. results are inconclusive . I dont think image augmentations really mirror the diversity in spectrograms .What do you think?",
    "2622116": "For me `MixUp (alpha = 2.0)` works very well. The LB improved from `0.63` -> `0.55` just simply using mixup.\n\nYou can check this [KerasCV Notebook](https://www.kaggle.com/code/awsaf49/hms-hbac-kerascv-starter-notebook) for more details.\n* Version 1 -> MixUp\n* Version 2 -> No MixUp",
    "2627933": "Since many people here are talking about MixUp, which samples its *lambda* parameter from the Beta distribution, here is what different distributions of the Beta distribution look like when we change *alpha* (also, assuming alpha = beta):\n```python\nalpha = 2 # <--- 2 as example, could be 0.5, 1.0 or whatever\nx = [np.random.beta(alpha,alpha) for i in range(1000)]\n_ = plt.hist(x, bins = 25)\n_ = plt.title(f\"Beta distribution for alpha: {alpha}\")\n```\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F3197853%2F2ad2255f8cd2f2373f4d1c855bfff5c1%2FScreenshot%202024-01-30%20at%2022.17.18.png?generation=1706664002899031&alt=media)\n\nIt looks that for:\n- *alpha* = 2 ---> normal\n- *alpha* = 1 ---> uniform\n- *alpha* = 0.5 ---> U-shape/bimodal\n",
    "2614988": "Mixup boost lb&cv about0.02\nFor me mixup>cutmix,manifold mixup",
    "2622753": "For me, horizontal flipping also worked, CV = 0.635->0.619, LB =0.44->0.42. I am using Kaggle spectrograms as of now. Adding augmentation is helping me training for more epochs though the difference is only 2-3 epoch but i can see comparatively stable results.",
    "2617558": "I have 5 custom augmentations and they improved my validation score from 0.8x to 0.6833.",
    "2630536": "Standard augmentations don't work that well for spectrograms, you might want to try stuff like time/frequency masking. My CV score improved quite a bit after that.",
    "2614446": "Same experience here. So far, I haven't been able to make it work. It always yields better results without augmentation.",
    "2632405": "Image augmentation is good strategy to score higher\nAlso, there are good Data Augmentations\n\n[noise addition, generative adversarial networks, sliding windows, sampling, Fourier transform,\nrecombination of segmentation, and others]\n\nIn this paper: https://www.sciencedirect.com/science/article/abs/pii/S0165027020303083\n\n**\"Noise Addition and sliding windows provied the highest accuract boost\"**\n\n🛑 Denosing(ex: dmey, db8, db6) & Noise Addition especially in eeg will be improve score\n\n",
    "2617870": "same as others: mixup boost cv/lb by 0.02",
    "2615217": "I could not get significant improvement, but a little.\n- cutmix: did not work.\n- mixup: worked a little (LB 0~0.02). depended on the value of parameter alpha. \n\nAs a side note, I tried other preprocessing methods like median filter, which did not work.",
    "2622865": "For me, all augmentations (mixup, flip, and other image augmentations like blur) didn't help a lot. It seems to me they're working like adding noise.",
    "2621941": "Now the mixup doesn't work for me, after I added the spectrogram created by Chris",
    "2617545": "mixup is helpful other augment did not work for me, one more thing is that I used pytorch did not as good as tf ",
    "2617331": "For me, CoarseDropout also does not help (CV 0.60 -> 0.62 after adding CoarseDropout, no visible difference in LB)",
    "2614479": "hi @phoenix9032 ,\nSpectrograms comes under signal processing and techniques like autocorrelation, Fourier and wavelet transformations etc. may get you the desired results.\nThanks! ",
    "2672537": "New to this competition, How to mix up 1,512,512eegs and 4 128, 256 spectrums ?😪",
    "2630485": "For me, my CV has boost ~0.02 when using mix up, but LB has not changes.",
    "2615696": "Still working on it...  Not much improvements so far and probably due to what supplejade and Bjarkason said...",
    "2614967": "",
    "2614812": ""
  }
}