Audio Fine-Tuning Spike
Fine-Tuning and Evaluation Harness for Domain Audio
Overview
A FastAPI and Librosa research harness for fine-tuning audio models on domain-specific data, with automated API tests, stored experiment results and confusion-matrix reporting.
The problem
Off-the-shelf audio models underperform on niche acoustic tasks, and without structured feature extraction, fine-tuning and quantitative error analysis it is impossible to tell whether a change actually helped.
The solution
Built a reproducible spike: audio ingestion and feature extraction with Librosa, classical and neural classifiers trained on extracted features, SQLite-backed experiment records, pytest and httpx API tests, and Matplotlib/Seaborn confusion matrices for error analysis.
Project gallery
Technical architecture
Feature pipeline, training harness and evaluated API surface
Feature Extraction
Librosa pipeline producing MFCCs, spectral features and normalized waveforms with consistent sampling parameters.
Training & Comparison
Scikit-learn classifiers compared against a neural baseline on identical folds for honest deltas.
Experiment Store
SQLite records of parameters, metrics and dataset versions so runs can be compared later.
Evaluation API & Tests
FastAPI endpoints for scoring audio, covered by async pytest and httpx tests.
Methodology
- Fixed sampling rate, window size and hop length so features were comparable across runs
- Established a baseline before any fine-tuning
- Reported per-class precision and recall, not just aggregate accuracy
- Automated API tests so the serving path matched the training path
Results & impact
Key impact
- Turned audio experimentation into a measurable process
- Provided a reusable evaluation harness for later speech projects
- Caught a training and serving feature mismatch before deployment
Challenges & solutions
Small Domain Datasets
Used stratified folds, augmentation and per-class reporting instead of trusting a single accuracy number
Train/Serve Skew
Shared one feature extraction module between training and the FastAPI endpoint, verified by tests