Lab 7 · PNW-Cnet + Train a Custom Spectrogram CNN

Worth: 20 points  |  Due: end of Day 4 (morning)  |  Files to submit: pnwcnet_detections.csv, custom_cnn.pt, training_curves.png, val_confusion.png, and a 1-page PDF.
Pre-reading: Bioacoustics tutorial, PNW-Cnet and custom CNN sections.

Biological motivation

You are monitoring an old-growth forest where the species of management interest is the barred owl pair duet — a distinctive antiphonal call between a male and a female. PNW-Cnet has a "barred owl" class but it's trained on single-bird calls and treats duets the same as solo calls. You need a classifier that specifically detects the duet to estimate pair occupancy.

Data

Get the data: aiecol_audio.zip (98 MB) — or the full bundle aiecol_data_sample.zip (395 MB). See the downloads page for layout.

You'll use two pieces:

Tasks

Task 1 — PNW-Cnet inference via pycnet-audio (4 pts)

Install pycnet-audio in its own conda env (see the bioacoustics tutorial):

conda create -n pycnet -c conda-forge sox python=3.11 -y
conda activate pycnet
pip install pycnet-audio

Then run the end-to-end pipeline on the soundscape directory using PNW-Cnet v5:

pycnet process /path/to/soundscapes -c v5 -w 4 -a

This generates 12-second non-overlapping spectrograms, scores them, and writes:

Convert the class-scores CSV to long form (one row per above-threshold detection) and save as pnwcnet_detections.csv. Report the top 5 detected classes by frequency and note which (if any) are barred owl variants (e.g., STVA_8Note, STVA_Duet).

Task 2 — train custom 3-class CNN (8 pts)

Use train_spec_cnn.py (from the bioacoustics tutorial) as a starting point, adapting for 3 classes (duet, solo_barred, background). Run for at least 10 epochs. Save:

Task 3 — compare custom CNN to PNW-Cnet on the duet question (4 pts)

For each 5-second window in the soundscape:

Plot a scatter of the two scores. Comment on how well PNW-Cnet's general "barred owl" score serves as a proxy for the more specific "duet" event you actually care about.

Task 4 — interpretation (4 pts)

In 200 words: when does the off-the-shelf model suffice, and when do you need to train your own? What does your custom CNN's failure mode look like (listen to a few false positives) and how would you improve it?

Go-further

Augment the duet class by temporally jittering and pitch-shifting clips (± 1 semitone) and re-train. Did augmentation help?

Rubric

ComponentPoints
PNW-Cnet runs and outputs are summarised4
Custom CNN trains with all required outputs8
Cross-model comparison and scatter4
Interpretation4
Total20