{
  "id": 245393,
  "title": "An experiment !!!!",
  "url": "/competitions/birdclef-2021/discussion/245393",
  "author_name": "Sayantan Kirtaniya",
  "post_date": "2021-06-10T19:26:45.135000",
  "votes": 9,
  "comment_count": 0,
  "views": 0,
  "content": "<p><img src=\"https://user-images.githubusercontent.com/50532530/121430316-90b4a500-c995-11eb-9065-f6ee81fec7d2.jpg\" alt=\"birdsong\"></p>\n<h1>BirdCLEF 2021 - Birdcall Identification</h1>\n<p><strong>Hello everyone as the competition is already completed we have experimented something, here it is:</strong></p>\n<ul>\n<li>As the birds are from many places we first clustered the places based on the location and make CSV of cluster point added with the train_meta_data.csv. there are several notebook for EDA to understand but notebook by <a href=\"https://www.kaggle.com/maximvlah\" target=\"_blank\">@maximvlah</a>   (<a href=\"https://www.kaggle.com/maximvlah/migration-patterns-morning-vs-night-birds\" target=\"_blank\">notebook link</a> ) and notebook by   <a href=\"https://www.kaggle.com/aramacus\" target=\"_blank\">@aramacus</a> (<a href=\"https://www.kaggle.com/aramacus/at-the-right-place-in-the-right-time\" target=\"_blank\">notebook link</a>) is helped us lot. Thanks for the notebooks.</li>\n<li>Now our target is to use the background noise as a very big factor and this is why we extracted the noise from the files and save into directories, and it is pubic.</li>\n<li>Then we made a approach,, where he was taking 4 random noises and added to the main signals, here we have done the same, but based on clusters, so from the clusters column we have got the cluster number each noise and take 4 random noise  from  each cluster and added to the .ogg files of that particular cluster.</li>\n<li>We thought that the background noise can be big help and then we took the concept of  <a href=\"https://www.kaggle.com/hanson0910\" target=\"_blank\">@hanson0910</a> from this <a href=\"https://www.kaggle.com/c/birdclef-2021/discussion/240823\" target=\"_blank\">discussion</a> and made this function to use,   </li>\n</ul>\n<pre><code>def Addition(audio):#added function\n   SAMPLE_RATE = 32000\n   augment = Compose([\n   AddGaussianNoise(min_amplitude=0.008, max_amplitude=0.015, p=1),\n   FrequencyMask(min_frequency_band=0.0, max_frequency_band=0.5, p=1.0),\n   TimeMask(min_band_part=0.0, max_band_part=0.5, fade=False, p=1.0),\n   ClippingDistortion(min_percentile_threshold=20, max_percentile_threshold=40, p=1.0),\n   ])\n   augmented_samples = augment(samples=torch.from_numpy(audio), sample_rate=SAMPLE_RATE)\n   output=(augmented_samples)\n   return output\n</code></pre>\n<ul>\n<li>Here is our notebook where we have clustered the data and make the data frame: <a href=\"https://www.kaggle.com/aditimaurya/clustering\" target=\"_blank\">Here is the link</a></li>\n<li>Here is our function for the noise and signal split:</li>\n</ul>\n<pre><code>def signal_noise_split(audio):\n   S, _ = spectrum._spectrogram(y=audio, power=1.0, n_fft=2048, hop_length=512, win_length=2048)\n   col_median = np.median(S, axis=0, keepdims=True)\n   row_median = np.median(S, axis=1, keepdims=True)\n   S[S &lt; row_median * 3] = 0.0\n   S[S &lt; col_median * 3] = 0.0\n   S[S &gt; 0] = 1\n   S = binary_erosion(S, structure=np.ones((4, 4)))\n   S = binary_dilation(S, structure=np.ones((4, 4)))\n   indicator = S.any(axis=0)\n   indicator = binary_dilation(indicator, structure=np.ones(4), iterations=2)\n   mask = np.repeat(indicator, 512)\n   mask = binary_dilation(mask, structure=np.ones(2048 - 512), origin=-(2048 -512)//2)\n   mask = mask[:len(audio)]\n   signal = audio[mask]\n   noise = audio[~mask]\n   return signal,noise\n</code></pre>\n<ul>\n<li>Here is the notebook where we have added the noise with the .ogg files and made the .npy mel specs, we have taken help from the notebook of <a href=\"https://www.kaggle.com/kneroma\" target=\"_blank\">@kneroma</a> : <a href=\"https://www.kaggle.com/chinmayjain767/npy-file-creation\" target=\"_blank\">Here is the link</a></li>\n<li>At the end we have added the noise files to the test files also wrt to their country and state, along with the cluster code of noise, tested on that, we not make another notebook public, because there are pretty good notebooks what you can use for submitting. </li>\n</ul>\n<h3>Here is our full process diagram:</h3>\n<p><img src=\"https://user-images.githubusercontent.com/50532530/121582735-fc0d7e00-ca4c-11eb-81fe-45233580dd19.PNG\" alt=\"lll\"><br>\nwe just making this public for future support may be this files and want know from other kagglers about our concept , that is it somewhat fine or totally bad🙂.</p>",
  "messages": [
    {
      "id": 1344295,
      "postDate": "2021-06-10T19:26:45.137Z",
      "content": "<p><img src=\"https://user-images.githubusercontent.com/50532530/121430316-90b4a500-c995-11eb-9065-f6ee81fec7d2.jpg\" alt=\"birdsong\"></p>\n<h1>BirdCLEF 2021 - Birdcall Identification</h1>\n<p><strong>Hello everyone as the competition is already completed we have experimented something, here it is:</strong></p>\n<ul>\n<li>As the birds are from many places we first clustered the places based on the location and make CSV of cluster point added with the train_meta_data.csv. there are several notebook for EDA to understand but notebook by <a href=\"https://www.kaggle.com/maximvlah\" target=\"_blank\">@maximvlah</a>   (<a href=\"https://www.kaggle.com/maximvlah/migration-patterns-morning-vs-night-birds\" target=\"_blank\">notebook link</a> ) and notebook by   <a href=\"https://www.kaggle.com/aramacus\" target=\"_blank\">@aramacus</a> (<a href=\"https://www.kaggle.com/aramacus/at-the-right-place-in-the-right-time\" target=\"_blank\">notebook link</a>) is helped us lot. Thanks for the notebooks.</li>\n<li>Now our target is to use the background noise as a very big factor and this is why we extracted the noise from the files and save into directories, and it is pubic.</li>\n<li>Then we made a approach,, where he was taking 4 random noises and added to the main signals, here we have done the same, but based on clusters, so from the clusters column we have got the cluster number each noise and take 4 random noise  from  each cluster and added to the .ogg files of that particular cluster.</li>\n<li>We thought that the background noise can be big help and then we took the concept of  <a href=\"https://www.kaggle.com/hanson0910\" target=\"_blank\">@hanson0910</a> from this <a href=\"https://www.kaggle.com/c/birdclef-2021/discussion/240823\" target=\"_blank\">discussion</a> and made this function to use,   </li>\n</ul>\n<pre><code>def Addition(audio):#added function\n   SAMPLE_RATE = 32000\n   augment = Compose([\n   AddGaussianNoise(min_amplitude=0.008, max_amplitude=0.015, p=1),\n   FrequencyMask(min_frequency_band=0.0, max_frequency_band=0.5, p=1.0),\n   TimeMask(min_band_part=0.0, max_band_part=0.5, fade=False, p=1.0),\n   ClippingDistortion(min_percentile_threshold=20, max_percentile_threshold=40, p=1.0),\n   ])\n   augmented_samples = augment(samples=torch.from_numpy(audio), sample_rate=SAMPLE_RATE)\n   output=(augmented_samples)\n   return output\n</code></pre>\n<ul>\n<li>Here is our notebook where we have clustered the data and make the data frame: <a href=\"https://www.kaggle.com/aditimaurya/clustering\" target=\"_blank\">Here is the link</a></li>\n<li>Here is our function for the noise and signal split:</li>\n</ul>\n<pre><code>def signal_noise_split(audio):\n   S, _ = spectrum._spectrogram(y=audio, power=1.0, n_fft=2048, hop_length=512, win_length=2048)\n   col_median = np.median(S, axis=0, keepdims=True)\n   row_median = np.median(S, axis=1, keepdims=True)\n   S[S &lt; row_median * 3] = 0.0\n   S[S &lt; col_median * 3] = 0.0\n   S[S &gt; 0] = 1\n   S = binary_erosion(S, structure=np.ones((4, 4)))\n   S = binary_dilation(S, structure=np.ones((4, 4)))\n   indicator = S.any(axis=0)\n   indicator = binary_dilation(indicator, structure=np.ones(4), iterations=2)\n   mask = np.repeat(indicator, 512)\n   mask = binary_dilation(mask, structure=np.ones(2048 - 512), origin=-(2048 -512)//2)\n   mask = mask[:len(audio)]\n   signal = audio[mask]\n   noise = audio[~mask]\n   return signal,noise\n</code></pre>\n<ul>\n<li>Here is the notebook where we have added the noise with the .ogg files and made the .npy mel specs, we have taken help from the notebook of <a href=\"https://www.kaggle.com/kneroma\" target=\"_blank\">@kneroma</a> : <a href=\"https://www.kaggle.com/chinmayjain767/npy-file-creation\" target=\"_blank\">Here is the link</a></li>\n<li>At the end we have added the noise files to the test files also wrt to their country and state, along with the cluster code of noise, tested on that, we not make another notebook public, because there are pretty good notebooks what you can use for submitting. </li>\n</ul>\n<h3>Here is our full process diagram:</h3>\n<p><img src=\"https://user-images.githubusercontent.com/50532530/121582735-fc0d7e00-ca4c-11eb-81fe-45233580dd19.PNG\" alt=\"lll\"><br>\nwe just making this public for future support may be this files and want know from other kagglers about our concept , that is it somewhat fine or totally bad🙂.</p>",
      "rawMarkdown": "\n![birdsong](https://user-images.githubusercontent.com/50532530/121430316-90b4a500-c995-11eb-9065-f6ee81fec7d2.jpg)\n\n\n# BirdCLEF 2021 - Birdcall Identification\n**Hello everyone as the competition is already completed we have experimented something, here it is:**\n\n- As the birds are from many places we first clustered the places based on the location and make CSV of cluster point added with the train_meta_data.csv. there are several notebook for EDA to understand but notebook by @maximvlah   ([notebook link](https://www.kaggle.com/maximvlah/migration-patterns-morning-vs-night-birds) ) and notebook by   @aramacus ([notebook link](https://www.kaggle.com/aramacus/at-the-right-place-in-the-right-time)) is helped us lot. Thanks for the notebooks.\n- Now our target is to use the background noise as a very big factor and this is why we extracted the noise from the files and save into directories, and it is pubic.\n- Then we made a approach,, where he was taking 4 random noises and added to the main signals, here we have done the same, but based on clusters, so from the clusters column we have got the cluster number each noise and take 4 random noise  from  each cluster and added to the .ogg files of that particular cluster.\n- We thought that the background noise can be big help and then we took the concept of  @hanson0910 from this [discussion](https://www.kaggle.com/c/birdclef-2021/discussion/240823) and made this function to use,   \n```\ndef Addition(audio):#added function\n    SAMPLE_RATE = 32000\n    augment = Compose([\n    AddGaussianNoise(min_amplitude=0.008, max_amplitude=0.015, p=1),\n    FrequencyMask(min_frequency_band=0.0, max_frequency_band=0.5, p=1.0),\n    TimeMask(min_band_part=0.0, max_band_part=0.5, fade=False, p=1.0),\n    ClippingDistortion(min_percentile_threshold=20, max_percentile_threshold=40, p=1.0),\n    ])\n    augmented_samples = augment(samples=torch.from_numpy(audio), sample_rate=SAMPLE_RATE)\n    output=(augmented_samples)\n    return output\n```\n- Here is our notebook where we have clustered the data and make the data frame: [Here is the link](https://www.kaggle.com/aditimaurya/clustering)\n- Here is our function for the noise and signal split:\n```\ndef signal_noise_split(audio):\n    S, _ = spectrum._spectrogram(y=audio, power=1.0, n_fft=2048, hop_length=512, win_length=2048)\n\n    col_median = np.median(S, axis=0, keepdims=True)\n    row_median = np.median(S, axis=1, keepdims=True)\n    S[S < row_median * 3] = 0.0\n    S[S < col_median * 3] = 0.0\n    S[S > 0] = 1\n\n    S = binary_erosion(S, structure=np.ones((4, 4)))\n    S = binary_dilation(S, structure=np.ones((4, 4)))\n\n    indicator = S.any(axis=0)\n    indicator = binary_dilation(indicator, structure=np.ones(4), iterations=2)\n\n    mask = np.repeat(indicator, 512)\n    mask = binary_dilation(mask, structure=np.ones(2048 - 512), origin=-(2048 -512)//2)\n    mask = mask[:len(audio)]\n    signal = audio[mask]\n    noise = audio[~mask]\n    return signal,noise\n```\n- Here is the notebook where we have added the noise with the .ogg files and made the .npy mel specs, we have taken help from the notebook of @kneroma : [Here is the link](https://www.kaggle.com/chinmayjain767/npy-file-creation)\n\n- At the end we have added the noise files to the test files also wrt to their country and state, along with the cluster code of noise, tested on that, we not make another notebook public, because there are pretty good notebooks what you can use for submitting. \n\n### Here is our full process diagram:\n![lll](https://user-images.githubusercontent.com/50532530/121582735-fc0d7e00-ca4c-11eb-81fe-45233580dd19.PNG)\n\nwe just making this public for future support may be this files and want know from other kagglers about our concept , that is it somewhat fine or totally bad🙂.",
      "votes": 9
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1344295": "\n![birdsong](https://user-images.githubusercontent.com/50532530/121430316-90b4a500-c995-11eb-9065-f6ee81fec7d2.jpg)\n\n\n# BirdCLEF 2021 - Birdcall Identification\n**Hello everyone as the competition is already completed we have experimented something, here it is:**\n\n- As the birds are from many places we first clustered the places based on the location and make CSV of cluster point added with the train_meta_data.csv. there are several notebook for EDA to understand but notebook by @maximvlah   ([notebook link](https://www.kaggle.com/maximvlah/migration-patterns-morning-vs-night-birds) ) and notebook by   @aramacus ([notebook link](https://www.kaggle.com/aramacus/at-the-right-place-in-the-right-time)) is helped us lot. Thanks for the notebooks.\n- Now our target is to use the background noise as a very big factor and this is why we extracted the noise from the files and save into directories, and it is pubic.\n- Then we made a approach,, where he was taking 4 random noises and added to the main signals, here we have done the same, but based on clusters, so from the clusters column we have got the cluster number each noise and take 4 random noise  from  each cluster and added to the .ogg files of that particular cluster.\n- We thought that the background noise can be big help and then we took the concept of  @hanson0910 from this [discussion](https://www.kaggle.com/c/birdclef-2021/discussion/240823) and made this function to use,   \n```\ndef Addition(audio):#added function\n    SAMPLE_RATE = 32000\n    augment = Compose([\n    AddGaussianNoise(min_amplitude=0.008, max_amplitude=0.015, p=1),\n    FrequencyMask(min_frequency_band=0.0, max_frequency_band=0.5, p=1.0),\n    TimeMask(min_band_part=0.0, max_band_part=0.5, fade=False, p=1.0),\n    ClippingDistortion(min_percentile_threshold=20, max_percentile_threshold=40, p=1.0),\n    ])\n    augmented_samples = augment(samples=torch.from_numpy(audio), sample_rate=SAMPLE_RATE)\n    output=(augmented_samples)\n    return output\n```\n- Here is our notebook where we have clustered the data and make the data frame: [Here is the link](https://www.kaggle.com/aditimaurya/clustering)\n- Here is our function for the noise and signal split:\n```\ndef signal_noise_split(audio):\n    S, _ = spectrum._spectrogram(y=audio, power=1.0, n_fft=2048, hop_length=512, win_length=2048)\n\n    col_median = np.median(S, axis=0, keepdims=True)\n    row_median = np.median(S, axis=1, keepdims=True)\n    S[S < row_median * 3] = 0.0\n    S[S < col_median * 3] = 0.0\n    S[S > 0] = 1\n\n    S = binary_erosion(S, structure=np.ones((4, 4)))\n    S = binary_dilation(S, structure=np.ones((4, 4)))\n\n    indicator = S.any(axis=0)\n    indicator = binary_dilation(indicator, structure=np.ones(4), iterations=2)\n\n    mask = np.repeat(indicator, 512)\n    mask = binary_dilation(mask, structure=np.ones(2048 - 512), origin=-(2048 -512)//2)\n    mask = mask[:len(audio)]\n    signal = audio[mask]\n    noise = audio[~mask]\n    return signal,noise\n```\n- Here is the notebook where we have added the noise with the .ogg files and made the .npy mel specs, we have taken help from the notebook of @kneroma : [Here is the link](https://www.kaggle.com/chinmayjain767/npy-file-creation)\n\n- At the end we have added the noise files to the test files also wrt to their country and state, along with the cluster code of noise, tested on that, we not make another notebook public, because there are pretty good notebooks what you can use for submitting. \n\n### Here is our full process diagram:\n![lll](https://user-images.githubusercontent.com/50532530/121582735-fc0d7e00-ca4c-11eb-81fe-45233580dd19.PNG)\n\nwe just making this public for future support may be this files and want know from other kagglers about our concept , that is it somewhat fine or totally bad🙂."
  }
}