Audio ML / Personal project / In progress

Songsored

Teaching a model to listen closely.

  • Dec 2025 — Present
  • Python · PyTorch · Audio

Project overview

0:22 · Silent
An illustrated look at the clip-level experiments, model comparison and error analysis. Reliable full-song censoring remains a goal.

The idea

I’m building Songsored to find selected words in Moroccan rap audio, with the longer-term idea of using those detections to mute specific portions of a song. The current work focuses on detecting words in short vocal clips.

What I’m working on

The pipeline brings together audio curation, word alignment, mel-spectrogram features and a PyTorch CNN. I’ve also compared the CNN with a speech-encoder approach.

A large part of the work is reviewing false positives and checking whether a model recognises the target word or relies on something else in the recording.

Headline results

Across five training runs, frozen XLS-R features with a trained linear head reached 75.1% mean validation accuracy, compared with 62.9% for the log-mel CNN (BCE 0.554 versus 0.620).

Both used 1,297 one-second training clips from 449 recordings and 41 validation clips from 8 other recordings. Each run used 24,600 Adam updates; the lowest validation-loss checkpoint was selected. Recording-separated validation is small and repeatedly reused, not an independent test. Equal updates do not mean equal compute.

CNN and frozen XLS-R comparison across five training runs: mean validation accuracy rises from 62.9% to 75.1%; BCE falls from 0.620 to 0.554.
Each line connects the same training run; black diamonds show means. These are development-validation results, not full-song detection performance. Protocol and dataset counts ↗

A useful failure case

In a later ordered-pooling experiment, moving the crop to place the target 200 ms earlier lowered recall from 85.6% to 22.4%. Shifted-crop training raised recall at that position to 52.8%, while original-position recall fell to 75.2%.

This diagnostic reuses the same 25 eligible positive clips from 21 recordings, with approximate word boundaries. It changes surrounding audio as well as word position and does not measure false alarms. The later experiment uses expanded training data, so it is distinct from the comparison above.

Recall versus target position: ordered pooling loses recall at earlier positions; shifted training recovers some recall with a tradeoff at the original position.
Five training runs on a positive-only position diagnostic. The plot exposes sensitivity to where the word falls inside a one-second window. Experiment and limitations ↗

Where it stands

This is an ongoing personal project. Clip-level experiments and error analysis are distinct from a reliable full-song detector; the latter remains work in progress.

A model’s errors can tell you more about the problem than its headline score.