How mithunr7/audiocf-align-project works
Purpose and execution surface
AudioCF-Align is an offline research pipeline for cold-start music recommendation. It maps audio embeddings for tracks with no interaction history into a collaborative-filtering preference space, then evaluates ranking quality on time-based cold splits. Primary executable stages are training scripts under src/train/, evaluation under src/eval/, and the experiment orchestrator run_ablation.py.
Audio representation boundary
src/embeddings/extract_audio_embeddings.py produces the raw acoustic inputs consumed by the learned projection. The intended source is Music4All-Onion audio features and associated track metadata; raw datasets and generated caches are external/gitignored rather than represented in this tree. This is the boundary between content-derived vectors and recommendation models.
CF teacher: behavioral preference space
src/models/cf_teacher.py defines the BPR matrix-factorization teacher, trained from warm user–track interactions by src/train/train_cf_teacher.py. Its learned track embeddings are the 128-D target space: they encode observed listener preference rather than acoustic similarity. Teacher training must precede student training because its item embeddings become regression labels.
Student alignment model
src/models/artistbridge.py implements the AudioCF-Align/legacy ArtistBridge student MLP; src/models/projection.py contains the projection-layer logic. src/train/train_artistbridge.py trains this network to transform 100-D audio embeddings toward teacher track embeddings, using combined MSE and cosine-style alignment objectives. The historical artist-anchor hypothesis is represented by this training/model area and is evaluated as an ablation, not the core inference requirement.
Baseline branch
src/models/baselines.py defines comparison recommenders, with training in src/train/train_baselines.py. These establish raw-audio and other non-aligned reference behavior against which the student’s CF-space projection is measured. They are a separate model branch but share the same prepared split/evaluation contract.
Inference and ranking flow
For a cold track, its audio embedding flows through the student to produce a CF-space item vector. Ranking compares that vector with user preference representations learned by the CF teacher; no interactions for the target track are required. The important modality boundary is therefore: audio vector → projected item vector → CF-compatible ranking, rather than direct audio-neighbor retrieval.
Evaluation and experiment analysis
src/eval/evaluate.py is the final ranking-evaluation entry point, relying on src/eval/metrics.py for ranking measures. src/eval/evaluate_baselines.py compares baseline methods, while src/eval/evaluate_ablation_seeds.py and src/eval/analyze_artistbridge.py support multi-seed ablation and diagnostic/significance analysis. Evaluation uses sampled-negative ranking and distinguishes fully-cold from semi-cold conditions.
Runtime and dependencies
The runtime is Python with PyTorch for neural/CF training, Pandas and NumPy for data handling, and SciPy for statistical evaluation, declared in requirements.txt. External services/data dependencies are the Zenodo-hosted Music4All-Onion interactions/audio features and Hugging Face-hosted enriched Music4All track–artist metadata. src/utils/config.py centralizes shared experiment configuration.
Main entry points: train_artistbridge.py Train aligned student · artistbridge.py AudioCF-Align student · cf_teacher.py BPR CF teacher · train_cf_teacher.py Train CF teacher
Components 17
Data & representation
External audio and interaction data become track vectors.
- Music4All-Onion data · Audio features, metadata, and warm interactions.
- Audio embedding extraction · Produces raw acoustic track vectors.
src/embeddings/extract_audio_embeddings.py - 100-D audio embeddings · Input representation for cold tracks.
Preference models
Teacher, aligned student, and comparison branch.
- BPR CF teacher · Defines the 128-D behavioral preference space.
src/models/cf_teacher.py - AudioCF-Align student · Maps audio vectors into teacher item space.
src/models/artistbridge.py - Projection layers
src/models/projection.py - Baseline recommenders · Raw-audio and non-aligned reference methods.
src/models/baselines.py
Training
Scripts build the learned recommendation artifacts.
- Train CF teacher
src/train/train_cf_teacher.py - Train aligned student · Uses MSE and cosine-style alignment to teacher labels.
src/train/train_artistbridge.py - Train baselines
src/train/train_baselines.py - Shared experiment config
src/utils/config.py
Evaluation & experiments
Ranking, ablation, and diagnostic analysis.
- Cold-track CF ranking · Scores projected cold items against teacher user preferences.
- Ranking evaluation · Sampled-negative ranking for fully- and semi-cold splits.
src/eval/evaluate.py - Ranking metrics
src/eval/metrics.py - Baseline evaluation
src/eval/evaluate_baselines.py - Ablation & diagnostics · Multi-seed ablation, diagnostics, and significance analysis.
src/eval/evaluate_ablation_seeds.py - Ablation orchestrator
run_ablation.py
Connections 21
- Music4All-Onion data → Audio embedding extraction: audio features
- Audio embedding extraction → 100-D audio embeddings: extracts
- Music4All-Onion data → Train CF teacher: warm interactions
- Train CF teacher → BPR CF teacher: fits
- 100-D audio embeddings → Train aligned student: training inputs
- BPR CF teacher → Train aligned student: item embedding labels
- Train aligned student → AudioCF-Align student: fits
- Projection layers → AudioCF-Align student: projection logic
- 100-D audio embeddings → AudioCF-Align student: cold-track input
- AudioCF-Align student → Cold-track CF ranking: projected item vector
- BPR CF teacher → Cold-track CF ranking: user preference vectors
- Cold-track CF ranking → Ranking evaluation: ranked candidates
- Ranking metrics → Ranking evaluation: measures
- 100-D audio embeddings → Train baselines: shared inputs
- Train baselines → Baseline recommenders: fits
- Baseline recommenders → Baseline evaluation: compare
- Ranking evaluation → Ablation & diagnostics: ranking results
- Ablation orchestrator → Train aligned student: runs variants
- Ablation orchestrator → Ablation & diagnostics: coordinates seeds
- Shared experiment config → Train CF teacher: shared settings
- Shared experiment config → Train aligned student: shared settings