Skip to main content
abel deloo

Insect Sound Classification for Naturalis

A classifier that listens to raw field recordings and identifies which insect is singing, so Naturalis can monitor biodiversity at a scale that manual listening never could.

The project

Client: Naturalis Biodiversity Center. Leiden University, team of six, 2025.

Naturalis records huge amounts of field audio, and their existing baseline model left room for improvement. Our team built a classifier for 459 species of grasshoppers, crickets and cicadas that outputs timestamped, confidence-scored predictions in JSON, ready to plug straight into Naturalis's ARISE platform.

How we built it

We built and compared two architectures on a learnable audio frontend (LEAF), which adapts to insect frequency ranges instead of relying on standard mel spectrograms: an EfficientNet CNN and a PaSST spectrogram transformer. They performed almost identically, which meant the CNN could match the transformer at a fraction of the compute cost.

Because the dataset was heavily imbalanced (some species had more than 500 recordings, others fewer than 25), we evaluated on macro-averaged F1 instead of accuracy. Classifying at genus level (196 classes) instead of species level turned out to be far more reliable.

My role

I was the developer responsible for documentation and for keeping the project running smoothly. I kept the README, setup guide and usage instructions up to date after every pipeline change, wrote the architecture sections for both models in the final report, documented why we dropped an alternative model (animal2vec), and added docstrings across the preprocessing, data loading and inference code.

On the code side I built the configuration file for our model hyperparameters and fixed a memory leak in the PyTorch training loop. We worked in Scrum with two-week sprints.

The code is Naturalis's intellectual property, so it is not public.

Stack

  • Python
  • PyTorch
  • Audio classification
  • Scrum
  • Documentation