Skip to content
ModelListedExternal
Download

Refractor Cdm

earthlyframes-collaborative-intelligence-license

KindOtherBase modellaion/larger_clap_musicVersionRevision b521330Cgrade

Model source

Kind
Other
File size
1.39 MB
Base model
laion/larger_clap_music
Version
vRevision b521330
Updated
Oct 17, 2026
Downloads
0
Source
Hugging Face

Source description

Refractor CDM

Refractor CDM (Compact Disc Module) is a lightweight MLP calibration head that classifies full-mix audio recordings into one of nine "rainbow colors" — a chromatic taxonomy used in The Rainbow Table, an AI-assisted album series.

The CDM is a companion to the base Refractor ONNX model (a multimodal fusion network trained on short catalog segments). The base model works well for MIDI and short audio clips but predicts poorly on full-mix audio because CLAP embeddings are optimized for short segments. The CDM corrects this by training directly on chunked full-mix audio.

Model Details

PropertyValue
Architecture2-layer MLP (256 → 128 → 9)
Parameters361,993
InputCLAP audio (512-dim) + DeBERTa concept (768-dim) = 1280-dim
OutputSoftmax probabilities over 9 colors (color_probs, shape [batch, 9])
FormatONNX (refractor_cdm.onnx, 1.4 MB)
Training data3,450 chunks from 78 full-mix songs across all 9 colors
LossCrossEntropyLoss with label smoothing (0.1) + inverse-frequency class weights

Color Classes

Index  Color    CHROMATIC_TARGETS (temporal / spatial / ontological)
  0    Red      Past / Thing / Known
  1    Orange   Past / Thing / Imagined
  2    Yellow   Future / Place / Imagined
  3    Green    Future / Place / Forgotten
  4    Blue     Present / Person / Forgotten
  5    Indigo   Uniform / Uniform / Known+Forgotten [0.1, 0.4, 0.4]
  6    Violet   Present / Person / Known
  7    White    Uniform across all axes
  8    Black    Uniform across all axes

Targets are derived at runtime from `app/structures/concepts/chromatic_targets.py`,
which reads directly from the canonical `the_rainbow_table_colors` Pydantic model.
Previous versions had hand-rolled copies that diverged for 7 of 9 colours; this was
corrected in April 2026 (fix-chromatic-targets-canonical-source).

Validation Results

Evaluated on 78 labeled songs from staged_raw_material using 30s/5s-stride chunked scoring with confidence-weighted aggregation.

ColorCorrectTotalAccuracy
Red111291.7%
Orange44100.0%
Yellow1010100.0%
Green6875.0%
Blue1111100.0%
Indigo101190.9%
Violet111291.7%
White91090.0%
Overall727892.3%

Usage

The CDM is used via the Refractor wrapper. It auto-loads when refractor_cdm.onnx is present alongside refractor.onnx.

from training.refractor import Refractor

scorer = Refractor()  # CDM auto-detected

result = scorer.score(
    audio_emb=scorer.prepare_audio(waveform, sr=48000),
    concept_emb=scorer.prepare_concept("A song about forgetting the future"),
)
# result: {"temporal": {...}, "spatial": {...}, "ontological": {...}, "confidence": 0.93}

For full-mix WAV files, use chunk_audio + aggregate_chunk_scores from score_mix.py to score in overlapping windows and pool results.

Training

# Phase 1 — extract CLAP + concept embeddings from staged_raw_material/
python training/extract_cdm_embeddings.py

# Phase 2 — train on Modal (A10G GPU)
modal run training/modal_train_refractor_cdm.py

# Validate
python training/validate_mix_scoring.py

Limitations

  • CLAP embeddings have a maximum internal window of ~10s; chunked scoring is essential for full-length tracks
  • Green classification is the weakest at 75% — two songs are near the Yellow/Violet boundary
  • Training data is drawn from a single artist's catalog — generalization to other music is untested
  • The concept embedding path requires a DeBERTa-v3-base inference pass (~600 MB model)

Citation

Part of The Rainbow Table generative music pipeline. See brotherclone/white and earthlyframes/white-training-data.

Sources

1 source
Hugging FacePrimaryVersion b5213307a50cd10a3a6f594987ccb146809aee61
huggingface.co/earthlyframes/refractor_cdm/tree/b5213307a50cd10a3a6f594987ccb146809aee61

Verified Aug 29

Model artifacts

1 artifact

refractor_cdm.onnx

onnx · 1.39 MB · SHA-256 d81305afb04b…bb58 · Hugging Face

Download

Source excerpts

2 excerpts

--- language: - en license: other license_name: earthlyframes-collaborative-intelligence-license license_link: https://github.com/brotherclone/white/blob/main/COLLABORATIVE_INTELLIGENCE_LICENSE.md pipeline_tag: audio-classification tags: - audio - music - onnx - chromatic - rainbow-table base_model: - laion/larger_clap_music - microsoft/deberta-v3-base --- # Refractor CDM **Refractor CDM** (Compact Disc Module) is a lightweight MLP calibration head that classifies full-mix audio recordings into one of nine "rainbow colors" — a chromatic taxonomy used in *The Rainbow Table*, an AI-assisted album series. The CDM is a companion to the base Refractor ONNX model (a multimodal fusion network trained on short catalog segments). The base model works well for MIDI and short audio clips but predicts poorly on full-mix audio because CLAP embeddings are optimized for short segments. The CDM corrects this by training directly on chunked full-mix audio. ## Model Details | Property | Value | |---|---| | Architecture | 2-layer MLP (256 → 128 → 9) | | Parameters | 361,993 | | Input | CLAP audio (512-dim) + DeBERTa concept (768-dim) = 1280-dim | | Output | Softmax probabilities over 9 colors (`color_probs`, shape `[batch, 9]`) | | Format | ONNX (`refractor_cdm.onnx`, 1.4 MB) | | Training data | 3,450 chunks from 78 full-mix songs across all 9 colors | | Loss | CrossEntropyLoss with label smoothing (0.1) + inverse-frequency class weights | ## Color Classes ``` Index Color CHROMATIC_TARGETS (temporal / spatial / ontological) 0 Red Past / Thing / Known 1 Orange Past / Thing / Imagined 2 Yellow Future / Place / Imagined 3 Green Future / Place / Forgotten 4 Blue Present / Person / Forgotten 5 Indigo Uniform / Uniform / Known+Forgotten [0.1, 0.4, 0.4] 6 Violet Present / Person / Known 7 White Uniform across all axes 8 Black Uniform across all axes Targets are derived at runtime from `app/structures/concepts/chromatic_targets.py`, which reads directly from the canonical `the_rainbow_table_colors` Pydantic model. Previous versions had hand-rolled copies that diverged for 7 of 9 colours; this was corrected in April 2026 (fix-chromatic-targets-canonical-source). ``` ## Validation Results Evaluated on 78 labeled songs from `staged_raw_material` using 30s/5s-stride chunked scoring with confidence-weighted aggregation. | Color | Correct | Total | Accuracy |...

Source context: 0 downloads · 0 likes · Pipeline audio-classification · Repo earthlyframes/refractor_cdm