1st Place Winning Solution - BirdCLEF 2021 - Birdcall Identification

Below is our solution for the BirdCLEF 2021 - Birdcall Identification.

If you want to reproduce our results, please check share_solution/working directory.

Overview

To overview our solution, please check here.

To put it simply, our solution is composed of the three stage training.

1st stage

Building melspectrogram classifier (0:nocall, 1:somebird singing) from freefield1010 data. (hereinafter referred to as "nocall detector")

freefield1010

2nd stage

Building melspectrogram multilabel(397dims) classifier to identify which birds are singing in a clip(7sec). Before building it, we make 2nd stage input labels weighted with call probablility.

  • training: train_short_audio data
  • validation: train_soundscapes data

3rd stage

Candidate extraction from 2nd stage output (five birds extracted per clip(7sec)). The train_metadata & forward/backward frame information are added as features and then classification for each of candidates (0:unlikely 1:likely) is performed by lightgbm.

  • training: train_short_audio data
  • validation: train_soundscapes data

To reproduce the result, please follow the steps below.

Make sure you put datasets shown below in the right directory. All of the ipynb files have been confirmed to work in the Kaggle notebook environment. (You can just imitate the same directory structure as Kaggle, like input, working.)

1. BUILD NOCALL DETECTOR

We use the nocall detector for the following two purposes.

  • A. To modify 2nd stage input data labels.
  • B. To attach labels to 3rd stage input data. At this time, threshold is 0.5 (hard labeling).

Check the code below.

2. TRAIN CALL PROBABILITIES

In this stage, we train call probabilities for each birds with no call probability on th e 1st stage.

Check the code below.

3. EXTRACT CANDIDATES & ADD FEATURES & TRAIN LIGHTGBM & FIND A BEST THRESHOLD & MAKE SUBMISSION

Check the code below.

(Appendix 1) TRAIN_SHORT_AUDIO → MELSPECTROGRAM IMAGES

Here is a useful code by kneroma@Kaggle (maybe known as kkiller) to perform that.

(https://www.kaggle.com/kneroma/birdclef-mels-computer-public)

(Appendix 2) TRAIN_SHORT_AUDIO (images) → NOCALL PROBABILITIES

nocall detector models (Ⅰ)

  • /output
    • inference results for train_short_audio are outputted.

(Appendix 3) TRAIN_SHORT_AUDIO (images) → 397dims birdcall probabilities

Check the code below.


The hardware we used:

  • kaggle notebook

  • Google Colab Pro

  • Personally-owned PC

    • OS : Ubuntu 18.04.3 LTS
    • CPU : Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    • Graphics : GeForce RTX 2080 Ti
    • Memory : 64GB

Environment we used:

Check the Dockerfile below. This is the same as kaggle notebook environment on 2021/6/13.

gpu.Dockerfile