MAST: Label-Efficient, Robust, and Generalizable Sound Detection for Biodiversity Monitoring via Masked Audio Pretraining and Self-Training

Tianyi Xu, Daniel L. Pimentel-Alarcón, Zuzana Buřivalová, Claudia Solis-LemusNeurIPS 2026

TL;DR

Recording thousands of hours of wild rainforest audio is easy; getting human experts to draw bounding boxes around every chirp, croak, and howl on a spectrogram is nearly impossible. MAST solves this bottleneck by combining self-supervised pretraining on raw, unlabeled soundscapes with an iterative self-training loop, turning a single day of expert annotations into a robust animal-sound detector. Unlike standard vision detectors that collapse when the weather changes or you move the microphone to a new tree, MAST generalizes across unseen days and locations.

What Problem Does This Paper Address?

Imagine strapping an audio recorder to a tree in Borneo. Over a few months, you capture a rich tapestry of biodiversity. To turn this raw audio into ecological data, researchers convert sound into mel-spectrograms (visual heatmaps of frequency over time) and try to spot the animals.

In hyperdiverse places like tropical rainforests, we often don't even know all the species present, so standard species-classifiers fail. Instead, ecologists first want binary time–frequency detection: draw a box around "any animal sound" so we know when and at what pitch creatures are vocalizing.

Treating spectrograms like images and throwing off-the-shelf object detectors (like YOLO or Faster R-CNN) at them works great—until it rains, day turns to night, or you move to a new site. Soundscapes are wildly non-stationary. Because expert bounding-box annotation is exhausting, training sets usually cover just a narrow slice of time and space. Standard detectors overfit to the background hum of that specific Tuesday and collapse under distribution shift.

Figure 2: Motivation of MAST. (a) Rainforest soundscapes exhibit substantial temporal and cross- site distribution shift, making detection under unseen conditions difficult. (b) Standard supervised biodiversity detectors trained on limited labels from a narrow time/site range often generalize poorly when deployed to new days and sites. (c) These challenges motivate a label-efficient and shift-robust framework that can leverage both limited expert labels and abundant unlabeled soundscapes.

Methods

MAST (Masked Audio Pretraining and Self-Training) decouples learning what the environment sounds like from finding the animals, across three stages:

Figure 3: Overview of the MAST pipeline. (A) Masked-audio pretraining learns general acoustic representations from unlabeled rainforest spectrograms via masked reconstruction. (B) Detector training transfers the pretrained encoder to a detection model with an audio-aware adapter and lightweight FPN, together with a box-level contrastive objective for event separation. (C) Staged self- training improves robustness under distribution shift by first generating pseudo-labels on unlabeled audio and then retraining with exploration on pseudo-labeled data followed by refinement on expert- labeled data.
  1. In-Domain Masked Audio Pretraining: Using a standard Vision Transformer (ViT) architecture (AudioMAE), MAST masks out patches of unlabeled spectrograms and trains the network to reconstruct the missing audio. Crucially, it does this on domain-matched wild audio rather than generic YouTube clips.
  2. Audio-Aware Detector Adaptation (What's New): Standard ViTs chop spectrograms into $16 \times 16$ grids. On the frequency axis, this leaves only 8 coarse tokens (~1 kHz each), completely blurring out narrow-band bird or insect calls. The authors introduce an asymmetric learnable adapter that upsamples frequency by $4\times$ and time by $2\times$, paired with anisotropic ($k \times 1$ and $1 \times k$) convolutions tailored to the horizontal/vertical nature of pitch and rhythm. They attach a lightweight FCOS detection head and add a box-level contrastive loss, pulling jittered views of the same animal call together while pushing away hard background noise.
  3. Two-Stage Self-Training Curriculum: The trained detector generates confidence-weighted "pseudo-boxes" on a massive pool of unlabeled audio. Naive pseudo-labeling usually spirals into confirmation bias. Instead, MAST runs a two-step dance per round: Stage 1 (Exploration) trains on pseudo-labels to absorb diverse new weather and site backgrounds; Stage 2 (Refinement) fine-tunes back on the clean, expert-labeled set to re-anchor precision and kill false positives.

Datasets

Models are trained and evaluated separately on two distinct ecological worlds:

  • Tropical Rainforest (East Kalimantan, Indonesia): 24 hours of expert-annotated recordings from a single day at one site (containing 131 distinct sound types, or sonotypes, collapsed into one "animal" class), paired with ~661.7 hours of unlabeled audio across multiple sites and dates.
  • Mediterranean Habitats (BIRDeep & BirdSet XCM): 641 annotated recordings covering 38 bird species across 9 sites and 4 habitat types in Doñana National Park, Spain. Pretraining combines unlabeled BIRDeep audio with ~900K spectrogram chunks from BirdSet XCM.

Both domains test In-Domain splits alongside Temporal OOD (unseen days) and Cross-Site OOD (unseen locations).

Key Insights and Ideas

  • Domain-matched pretraining beats massive generic pretraining: Pretraining on ~660 hours of local rainforest noise transfers far better than AudioMAE pretrained on millions of generic AudioSet clips (mostly human speech and music). Knowing what your forest's wind and insects sound like matters.
  • Exploration needs an anchor: In ablations, training only on pseudo-labels or mixing them naively with expert labels wrecked precision (dropping to 0.157). The two-stage curriculum—wandering out into noisy unlabeled data, then snapping back to expert ground truth—is what makes self-training work (0.544 F1).
  • Zero-shot species retrieval comes for free: Even though MAST only detects binary "animal" boxes, pooling the pretrained encoder features inside each predicted box yields rich acoustic embeddings. Nearest-neighbor lookup on high-confidence boxes matched 131 specific rainforest sonotypes with 96.1% Top-1 accuracy without training a multi-class classifier.
  • A warning for annotators: If you only have budget to label 1,000 audio chunks, don't label sequentially from the start of a recording. Sampling chunks evenly across the day beat sequential labeling by +0.13 F1 because it captures shifting acoustic conditions.

Key Results

Supervised baselines trained from scratch suffer catastrophic collapse under distribution shift—for instance, FCOS plunges $5\times$ on rainforest cross-site F1 (from 0.786 in-domain down to 0.155).

Figure 1: Performance comparison on rainforest domain. MAST achieves the best overall performance, with especially large improvements under temporal and cross-site distribution shift, showing stronger robustness than fully supervised baselines and generic SSL transfer.

MAST + Self-Training (ST) dramatically cushions this fall:

  • Rainforest Cross-Site OOD: Achieves 0.572 F1 and 0.392 mAP, beating the AudioMAE baseline by +0.24 F1 and +0.22 mAP (and outperforming Faster R-CNN's 0.082 F1 by $7\times$). Temporal OOD reaches 0.559 F1 vs. AudioMAE's 0.332.
  • Bird Domain Cross-Site OOD: Reaches 0.643 F1 and 0.441 mAP, outperforming AudioMAE by +0.10 F1 and +0.12 mAP.
  • Adapter Impact: Adding the asymmetric adapter alone boosts pre-self-training rainforest cross-site F1 from 0.348 to 0.441 and achieves the highest localization sharpness (0.682 mean IoU).

Limitations and Future Work

  • Frequency ceiling: Resampling audio to 16 kHz cuts off everything above 8 kHz (Nyquist limit), blinding the system to high-pitched insects, amphibians, and ultrasonic bats.
  • Binary scope & tiny calls: MAST doesn't natively output species labels, and it still struggles with the smallest third of vocalizations in time–frequency area (only 0.169 recall).
  • Uneven site gains & compute cost: Self-training isn't magic everywhere; F1 actually dipped slightly at one marshland bird site (0.444 to 0.417), and gains plateau after two rounds. Furthermore, the pipeline is compute-heavy (~286 GPU-hours on an A100 for pretraining, fine-tuning, and two self-training rounds).
  • Future directions: Scaling to higher sampling rates, multi-class detection, multi-annotator benchmarks, and safeguarding sensitive GPS metadata so automated detectors aren't misused by poachers.

Summary updated

Abstract

Passive acoustic monitoring can measure biodiversity at larger scales, but time--frequency annotation of animal vocalizations is expensive, site-specific, and difficult to sustain at scale. We present a label-efficient framework for binary detection of animal sounds that combines masked audio pretraining with a lightweight detector on mel spectrograms, then further improves robustness through iterative self-training on unlabeled audio. We first pretrain a ViT-based encoder on unlabeled recordings via masked reconstruction and transfer the encoder to a detection backbone. To better separate animal sounds from confounding background, we add a box-level contrastive loss that pulls matched event regions together while pushing noisy negatives apart. We then apply a two-stage pseudo-labeling curriculum to exploit large unlabeled pools without additional annotation. We train and evaluate models separately on two ecologically distinct domains: tropical rainforest soundscapes (Indonesia) and bird vocalizations in Mediterranean habitats (Spain). On both domains, masked audio pretraining and contrastive learning consistently improve time--frequency detection under temporal and cross-site distribution shift, and self-training yields further gains in out-of-distribution performance. On the rainforest domain, MAST with self-training achieves +0.22 mAP and +0.24 F1 over the AudioMAE baseline under cross-site shift. On the bird domain, self-training achieves +0.12 mAP and +0.10 F1 over the AudioMAE baseline under cross-site shift. Overall, our results show that MAST can effectively extend self-supervised audio representations from clip-level tasks to robust box-level localization across diverse bioacoustic settings, providing a practical path for biodiversity monitoring with limited labels. Code is available at https://github.com/tianyi0216/MAST.
BibTeX
@inproceedings{xu2026mast,
  author = {Tianyi Xu and Daniel L. Pimentel-Alarcón and Zuzana Buřivalová and Claudia Solis-Lemus},
  title = {{MAST: Label-Efficient, Robust, and Generalizable Sound Detection for Biodiversity Monitoring via Masked Audio Pretraining and Self-Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=uco9zJhmN7},
}
Figure