{
  "id": 493131,
  "title": "Some Useful Augmentations",
  "url": "/competitions/birdclef-2024/discussion/493131",
  "author_name": "Koolo",
  "post_date": "2024-04-12T08:33:18.661000",
  "votes": 27,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Hi all… As BirdCLEF has been held for many years, the previous solutions are worth considering. I summarize the data augmentations in the top 5 solutions of BirdCLEF 2023. </p>\n<p>Hope these augmentations are also helpful for BirdCLEF 2024.</p>\n<hr>\n<h2>BirdCLEF 2023</h2>\n<h3>1st</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412808\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/vladimirsydor\" target=\"_blank\">@Volodymyr</a></p>\n<ul>\n<li>Mixup : Simply OR Mixup with Prob = 0.5</li>\n<li>BackgroundNoise with Zenodo nocall</li>\n<li>RandomFiltering - a custom augmentation: in simple terms, it's a simplified random Equalizer</li>\n<li>Spec Aug:<ul>\n<li>Freq:<ul>\n<li>Max length: 10</li>\n<li>Max lines: 3</li>\n<li>Probability: 0.3</li></ul></li>\n<li>Time:<ul>\n<li>Max length: 20</li>\n<li>Max lines: 3</li>\n<li>Probability: 0.3</li></ul></li></ul></li>\n</ul>\n<h3>2nd</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412707\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/honglihang\" target=\"_blank\">@rihanpiggy</a></p>\n<ul>\n<li>GaussianNoise</li>\n<li>PinkNoise</li>\n<li>Gain</li>\n<li>NoiseInjection</li>\n<li>Background Noise(nocall in 2020, 2021 comp + rainforest + environment sound + nocall in freefield1010, warblrb, birdvox)</li>\n<li>PitchShift</li>\n<li>TimeShift</li>\n<li>FrequencyMasking</li>\n<li>TimeMasking</li>\n<li>OR Mixup on waveforms</li>\n<li>Mixup on spectrograms.</li>\n<li><a href=\"https://www.kaggle.com/competitions/birdsong-recognition/discussion/183269\" target=\"_blank\">With a probability of 0.5 lowered the upper frequencies</a></li>\n<li>self mixup for records with 2023 species only in background.(60sec waveform -&gt; split to 6 * 10sec -&gt; np.sum(audios,axis=0) to get a 10sec clip)</li>\n</ul>\n<h3>3rd</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/414102\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/mariotsaberlin\" target=\"_blank\">@let's see</a></p>\n<ul>\n<li>Select 5s audio chunk at random position within file:<ul>\n<li>Without any weighting</li>\n<li>Weighted by signal energy (RMS)</li>\n<li>Weighted by primary class probability (using info from pseudo labeling)</li></ul></li>\n<li>Add hard/soft pseudo labels of up to 8 bird species ranked by probability in selected chunk</li>\n<li>Random cyclic shift</li>\n<li>Filter with random transfer function</li>\n<li>Mixup in time domain via adding chunks of same species, random species and nocall/noise</li>\n<li>Random gain of signal amplitude of chunks before mix</li>\n<li>Random gain of mix</li>\n<li>Pitch shift and time stretch (local &amp; global in time and frequency domain)</li>\n<li>Gaussian/pink/brown noise</li>\n<li>Short noise bursts</li>\n<li>Reverb (see below)</li>\n<li>Different interpolation filters for spectrogram resizing</li>\n<li>Color jitter (brightness, contrast, saturation, hue)</li>\n</ul>\n<h3>4th</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412753\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/atsunorifujita\" target=\"_blank\">@atfujita</a></p>\n<ul>\n<li>OneOf ([Gain, GainTransition])</li>\n<li>OneOf ([AddGaussianNoise, AddGaussianSNR]</li>\n<li>AddShortNoises esc50 (rain, frog)</li>\n<li>AddBackgroundNoise from Zenodo. The 60 minutes with the fewest bird calls were extracted from each dataset and divided into 30 sec (training only).</li>\n<li>AddBackgroundNoise from aicrowd2020_noise_30sec and ff1010bird_nocall (pretraining only).</li>\n<li>LowPassFilter</li>\n<li>PitchShift</li>\n</ul>\n<h3>5th</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412903\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/evgeniimaslov2\" target=\"_blank\">@Yevhenii Maslov</a></p>\n<ul>\n<li>stage: pretrain<ul>\n<li>white noise (p=0.5)</li></ul></li>\n<li>stage: fine-tune<ul>\n<li>For waveform - Mixup (p=1) and OneOf([White noise, pink noise, brown noise, noise injection, esc50 noise, no-call noise]) (p=0.5)</li>\n<li>For spectrogram - Two time masks (p=0.5 each) and one freq mask (p=0.5)</li></ul></li>\n</ul>",
  "messages": [
    {
      "id": 2748079,
      "postDate": "2024-04-12T08:33:18.660Z",
      "content": "<p>Hi all… As BirdCLEF has been held for many years, the previous solutions are worth considering. I summarize the data augmentations in the top 5 solutions of BirdCLEF 2023. </p>\n<p>Hope these augmentations are also helpful for BirdCLEF 2024.</p>\n<hr>\n<h2>BirdCLEF 2023</h2>\n<h3>1st</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412808\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/vladimirsydor\" target=\"_blank\">@Volodymyr</a></p>\n<ul>\n<li>Mixup : Simply OR Mixup with Prob = 0.5</li>\n<li>BackgroundNoise with Zenodo nocall</li>\n<li>RandomFiltering - a custom augmentation: in simple terms, it's a simplified random Equalizer</li>\n<li>Spec Aug:<ul>\n<li>Freq:<ul>\n<li>Max length: 10</li>\n<li>Max lines: 3</li>\n<li>Probability: 0.3</li></ul></li>\n<li>Time:<ul>\n<li>Max length: 20</li>\n<li>Max lines: 3</li>\n<li>Probability: 0.3</li></ul></li></ul></li>\n</ul>\n<h3>2nd</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412707\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/honglihang\" target=\"_blank\">@rihanpiggy</a></p>\n<ul>\n<li>GaussianNoise</li>\n<li>PinkNoise</li>\n<li>Gain</li>\n<li>NoiseInjection</li>\n<li>Background Noise(nocall in 2020, 2021 comp + rainforest + environment sound + nocall in freefield1010, warblrb, birdvox)</li>\n<li>PitchShift</li>\n<li>TimeShift</li>\n<li>FrequencyMasking</li>\n<li>TimeMasking</li>\n<li>OR Mixup on waveforms</li>\n<li>Mixup on spectrograms.</li>\n<li><a href=\"https://www.kaggle.com/competitions/birdsong-recognition/discussion/183269\" target=\"_blank\">With a probability of 0.5 lowered the upper frequencies</a></li>\n<li>self mixup for records with 2023 species only in background.(60sec waveform -&gt; split to 6 * 10sec -&gt; np.sum(audios,axis=0) to get a 10sec clip)</li>\n</ul>\n<h3>3rd</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/414102\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/mariotsaberlin\" target=\"_blank\">@let's see</a></p>\n<ul>\n<li>Select 5s audio chunk at random position within file:<ul>\n<li>Without any weighting</li>\n<li>Weighted by signal energy (RMS)</li>\n<li>Weighted by primary class probability (using info from pseudo labeling)</li></ul></li>\n<li>Add hard/soft pseudo labels of up to 8 bird species ranked by probability in selected chunk</li>\n<li>Random cyclic shift</li>\n<li>Filter with random transfer function</li>\n<li>Mixup in time domain via adding chunks of same species, random species and nocall/noise</li>\n<li>Random gain of signal amplitude of chunks before mix</li>\n<li>Random gain of mix</li>\n<li>Pitch shift and time stretch (local &amp; global in time and frequency domain)</li>\n<li>Gaussian/pink/brown noise</li>\n<li>Short noise bursts</li>\n<li>Reverb (see below)</li>\n<li>Different interpolation filters for spectrogram resizing</li>\n<li>Color jitter (brightness, contrast, saturation, hue)</li>\n</ul>\n<h3>4th</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412753\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/atsunorifujita\" target=\"_blank\">@atfujita</a></p>\n<ul>\n<li>OneOf ([Gain, GainTransition])</li>\n<li>OneOf ([AddGaussianNoise, AddGaussianSNR]</li>\n<li>AddShortNoises esc50 (rain, frog)</li>\n<li>AddBackgroundNoise from Zenodo. The 60 minutes with the fewest bird calls were extracted from each dataset and divided into 30 sec (training only).</li>\n<li>AddBackgroundNoise from aicrowd2020_noise_30sec and ff1010bird_nocall (pretraining only).</li>\n<li>LowPassFilter</li>\n<li>PitchShift</li>\n</ul>\n<h3>5th</h3>\n<p><a href=\"https://www.kaggle.com/competitions/birdclef-2023/discussion/412903\" target=\"_blank\">notebook</a> by <a href=\"https://www.kaggle.com/evgeniimaslov2\" target=\"_blank\">@Yevhenii Maslov</a></p>\n<ul>\n<li>stage: pretrain<ul>\n<li>white noise (p=0.5)</li></ul></li>\n<li>stage: fine-tune<ul>\n<li>For waveform - Mixup (p=1) and OneOf([White noise, pink noise, brown noise, noise injection, esc50 noise, no-call noise]) (p=0.5)</li>\n<li>For spectrogram - Two time masks (p=0.5 each) and one freq mask (p=0.5)</li></ul></li>\n</ul>",
      "rawMarkdown": "Hi all... As BirdCLEF has been held for many years, the previous solutions are worth considering. I summarize the data augmentations in the top 5 solutions of BirdCLEF 2023. \n\nHope these augmentations are also helpful for BirdCLEF 2024.\n\n---\n## BirdCLEF 2023\n\n### 1st \n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412808) by [@Volodymyr](https://www.kaggle.com/vladimirsydor)\n\n* Mixup : Simply OR Mixup with Prob = 0.5\n* BackgroundNoise with Zenodo nocall\n* RandomFiltering - a custom augmentation: in simple terms, it's a simplified random Equalizer\n* Spec Aug:\n    * Freq:\n        * Max length: 10\n        * Max lines: 3\n        * Probability: 0.3\n    * Time:\n        * Max length: 20\n        * Max lines: 3\n        * Probability: 0.3\n\n### 2nd\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412707) by [@rihanpiggy](https://www.kaggle.com/honglihang)\n\n* GaussianNoise\n* PinkNoise\n* Gain\n* NoiseInjection\n* Background Noise(nocall in 2020, 2021 comp + rainforest + environment sound + nocall in freefield1010, warblrb, birdvox)\n* PitchShift\n* TimeShift\n* FrequencyMasking\n* TimeMasking\n* OR Mixup on waveforms\n* Mixup on spectrograms.\n* [With a probability of 0.5 lowered the upper frequencies](https://www.kaggle.com/competitions/birdsong-recognition/discussion/183269)\n* self mixup for records with 2023 species only in background.(60sec waveform -> split to 6 * 10sec -> np.sum(audios,axis=0) to get a 10sec clip)\n\n### 3rd\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/414102) by [@let's see](https://www.kaggle.com/mariotsaberlin)\n\n* Select 5s audio chunk at random position within file:\n    * Without any weighting\n    * Weighted by signal energy (RMS)\n    * Weighted by primary class probability (using info from pseudo labeling)\n* Add hard/soft pseudo labels of up to 8 bird species ranked by probability in selected chunk\n* Random cyclic shift\n* Filter with random transfer function\n* Mixup in time domain via adding chunks of same species, random species and nocall/noise\n* Random gain of signal amplitude of chunks before mix\n* Random gain of mix\n* Pitch shift and time stretch (local & global in time and frequency domain)\n* Gaussian/pink/brown noise\n* Short noise bursts\n* Reverb (see below)\n* Different interpolation filters for spectrogram resizing\n* Color jitter (brightness, contrast, saturation, hue)\n\n### 4th\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412753) by [@atfujita](https://www.kaggle.com/atsunorifujita)\n\n* OneOf ([Gain, GainTransition])\n* OneOf ([AddGaussianNoise, AddGaussianSNR]\n* AddShortNoises esc50 (rain, frog)\n* AddBackgroundNoise from Zenodo. The 60 minutes with the fewest bird calls were extracted from each dataset and divided into 30 sec (training only).\n* AddBackgroundNoise from aicrowd2020_noise_30sec and ff1010bird_nocall (pretraining only).\n* LowPassFilter\n* PitchShift\n\n### 5th\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412903) by [@Yevhenii Maslov](https://www.kaggle.com/evgeniimaslov2)\n\n* stage: pretrain\n    * white noise (p=0.5)\n* stage: fine-tune\n    *  For waveform - Mixup (p=1) and OneOf([White noise, pink noise, brown noise, noise injection, esc50 noise, no-call noise]) (p=0.5)\n    *  For spectrogram - Two time masks (p=0.5 each) and one freq mask (p=0.5)",
      "votes": 26
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "2748079": "Hi all... As BirdCLEF has been held for many years, the previous solutions are worth considering. I summarize the data augmentations in the top 5 solutions of BirdCLEF 2023. \n\nHope these augmentations are also helpful for BirdCLEF 2024.\n\n---\n## BirdCLEF 2023\n\n### 1st \n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412808) by [@Volodymyr](https://www.kaggle.com/vladimirsydor)\n\n* Mixup : Simply OR Mixup with Prob = 0.5\n* BackgroundNoise with Zenodo nocall\n* RandomFiltering - a custom augmentation: in simple terms, it's a simplified random Equalizer\n* Spec Aug:\n    * Freq:\n        * Max length: 10\n        * Max lines: 3\n        * Probability: 0.3\n    * Time:\n        * Max length: 20\n        * Max lines: 3\n        * Probability: 0.3\n\n### 2nd\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412707) by [@rihanpiggy](https://www.kaggle.com/honglihang)\n\n* GaussianNoise\n* PinkNoise\n* Gain\n* NoiseInjection\n* Background Noise(nocall in 2020, 2021 comp + rainforest + environment sound + nocall in freefield1010, warblrb, birdvox)\n* PitchShift\n* TimeShift\n* FrequencyMasking\n* TimeMasking\n* OR Mixup on waveforms\n* Mixup on spectrograms.\n* [With a probability of 0.5 lowered the upper frequencies](https://www.kaggle.com/competitions/birdsong-recognition/discussion/183269)\n* self mixup for records with 2023 species only in background.(60sec waveform -> split to 6 * 10sec -> np.sum(audios,axis=0) to get a 10sec clip)\n\n### 3rd\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/414102) by [@let's see](https://www.kaggle.com/mariotsaberlin)\n\n* Select 5s audio chunk at random position within file:\n    * Without any weighting\n    * Weighted by signal energy (RMS)\n    * Weighted by primary class probability (using info from pseudo labeling)\n* Add hard/soft pseudo labels of up to 8 bird species ranked by probability in selected chunk\n* Random cyclic shift\n* Filter with random transfer function\n* Mixup in time domain via adding chunks of same species, random species and nocall/noise\n* Random gain of signal amplitude of chunks before mix\n* Random gain of mix\n* Pitch shift and time stretch (local & global in time and frequency domain)\n* Gaussian/pink/brown noise\n* Short noise bursts\n* Reverb (see below)\n* Different interpolation filters for spectrogram resizing\n* Color jitter (brightness, contrast, saturation, hue)\n\n### 4th\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412753) by [@atfujita](https://www.kaggle.com/atsunorifujita)\n\n* OneOf ([Gain, GainTransition])\n* OneOf ([AddGaussianNoise, AddGaussianSNR]\n* AddShortNoises esc50 (rain, frog)\n* AddBackgroundNoise from Zenodo. The 60 minutes with the fewest bird calls were extracted from each dataset and divided into 30 sec (training only).\n* AddBackgroundNoise from aicrowd2020_noise_30sec and ff1010bird_nocall (pretraining only).\n* LowPassFilter\n* PitchShift\n\n### 5th\n\n[notebook](https://www.kaggle.com/competitions/birdclef-2023/discussion/412903) by [@Yevhenii Maslov](https://www.kaggle.com/evgeniimaslov2)\n\n* stage: pretrain\n    * white noise (p=0.5)\n* stage: fine-tune\n    *  For waveform - Mixup (p=1) and OneOf([White noise, pink noise, brown noise, noise injection, esc50 noise, no-call noise]) (p=0.5)\n    *  For spectrogram - Two time masks (p=0.5 each) and one freq mask (p=0.5)"
  }
}