# 7th place solution (writeup with code)

First of all, congratulations to all the participants, and thanks a lot to the organizers for this competition! It was great fun!
In short, our approach was based on
[Jan's Sound Event Detection model from BirdCLEF 2018](https://github.com/f0k/birdclef2018)
, replacing the predictor with a pretrained CNN from
[Qiuqiang Kong's PANN repository](https://github.com/qiuqiangkong/audioset_tagging_cnn)
. It was trained on 30-second snippets from the official training set extended with
[Rohan Rao's xeno-canto crawls](https://www.kaggle.com/c/birdsong-recognition/discussion/159970)
, using binary cross-entropy against all labeled foreground and background species. Data was augmented by choosing random weights for downmixing the left and right channel to mono (for stereo files), and by mixing in bird-free background noise from the
[Chernobyl BiVA](https://doi.org/10.5285/be5639e9-75e9-4aa3-afdd-65ba80352591)
and
[BirdVox-full-night](https://zenodo.org/record/1205569)
datasets. Inference followed a two-stage procedure that first established a set of species for the recording, using 20-second windows and a threshold of 0.5, then looked for these species in 5-second windows with a threshold of 0.3. Code is
[available on github](https://github.com/f0k/kagglebirds2020)
.
The following sections will explain things in more detail, spread over additional posts due to Kaggle's post size limit. Choose "Sort by: Oldest" to see them in their original order.
If you prefer a slide deck over text, feel free to click through
[some slides explaining what we did](https://docs.google.com/presentation/d/10m0W13sJozYmfWPcPlaBg1j-MOW7p6w_-Tp3pG5KGE0/edit?usp=sharing)
.