Abstract
A system is presented that segments, clusters and predicts musical audio in an unsupervised manner, adjusting the number of (timbre) clusters instantaneously to the audio input. A sequence learning algorithm adapts its structure to a dynamically changing clustering tree. The flow of the system is as follows: 1) segmentation by onset detection, 2) timbre representation of each segment by Mel frequency cepstrum coefficients, 3) discretization by incremental clustering, yielding a tree of different sound classes (e.g. instruments) that can grow or shrink on the fly driven by the instantaneous sound events, resulting in a discrete symbol sequence, 4) extraction of statistical regularities of the symbol sequence, using hierarchical N-grams and the newly introduced conceptual Boltzmann machine, and 5) prediction of the next sound event in the sequence. The system's robustness is assessed with respect to complexity and noisiness of the signal. Clustering in isolation yields an adjusted Rand index (ARI) of 82.7% / 85.7% for data sets of singing voice and drums. Onset detection jointly with clustering achieve an ARI of 81.3% / 76.3% and the prediction of the entire system yields an ARI of 27.2% / 39.2%.
Introduction
Traditional Music Information Retrieval (MIR) systems often exhibit "brittleness" due to their reliance on supervised learning. These systems are typically trained on large, static, labeled datasets of specific instruments or genres, making them struggle when encountering novel sounds or unfamiliar harmonic structures. In contrast, human listeners possess a remarkable ability to adapt to unfamiliar musical styles, quickly identifying patterns and anticipating rhythmic structures from a very early stage. This research addresses this gap by proposing a system that operates from a tabula rasa (blank slate) state, utilizing unsupervised learning to segment, categorize, and predict musical signals in real-time.
Methodology
The proposed system architecture processes audio incrementally through a five-stage pipeline designed for real-time adaptation.
- Segmentation: Musical events, such as notes or drum hits, are identified using a "complex domain" onset detector.
- Feature Extraction: Each segment is represented by Mel-Frequency Cepstrum Coefficients (MFCCs) to capture timbre. A Discrete Cosine Transform (DCT) is applied over time to capture the immediate temporal evolution of the sound.
- Incremental Clustering (Cobweb): This stage acts as the system's "perception." The Cobweb algorithm constructs a hierarchical tree of sound classes. Unlike static clustering methods, Cobweb can dynamically add new categories or merge existing ones as new audio events arrive, allowing the "alphabet" of the system to evolve.
- Sequence Analysis: The resulting stream of cluster IDs (symbols) is analyzed by a prediction engine. Two models were compared: Hierarchical N-grams (HN), which tracks patterns of varying lengths and adapts to structural changes in the clustering tree, and the Conceptual Boltzmann Machine (CB), a recurrent neural network designed to learn pattern "chunks."
- Prediction: The final output is a prediction of both the identity of the next sound symbol and its Inter-Onset Interval (IOI).
Experimental Evaluation
The system was evaluated across three distinct data types to test its versatility:
- Voice: Low-quality recordings of beatboxing with 2-3 sound categories and varying rhythms.
- ENST Drums: A benchmark dataset of professional drum recordings spanning multiple genres (rock, country, disco) and complexities.
- Synthetic Sequences: Specifically designed to test learning rates and robustness against "noise," such as skipped or swapped notes.
Results and Discussion
A defining feature of this system is its "dynamic alphabet." When the clustering algorithm merges or splits categories, the sequence model must instantaneously update its historical statistics to maintain predictive accuracy.
As illustrated in Figure 5, the Hierarchical N-gram (HN) model significantly outperformed the Conceptual Boltzmann Machine (CB) in the "small data, fast learning" regime. The HN model achieved near-perfect prediction on simple patterns after only two repetitions. Furthermore, the system demonstrated resilience to performance noise; predictive power remained stable until noise levels (e.g., missed onsets) exceeded 40%.
Performance was quantified using the Adjusted Rand Index (ARI). In isolation, the Cobweb clustering achieved an ARI of 82.7% for voice and 85.7% for drums. When integrated with onset detection, the transcription ARI remained high at 81.3% for voice. Full system prediction—predicting both the "what" and "when" of the next event—yielded ARIs of 27.2% (voice) and 39.2% (drums). While these values are lower than isolated clustering, they represent a significant baseline for a zero-knowledge, unsupervised system.
Conclusion
This work demonstrates the feasibility of real-time, unsupervised musical prediction. The system successfully adapts its internal sound categories and sequence models on the fly. Current limitations include a monophonic assumption and a lack of metrical awareness, which makes the system sensitive to missed onsets. Future research will explore the integration of Long Short-Term Memory (LSTM) networks for longer dependencies and the inclusion of pitch detection to enable the learning of melodies and chord progressions.
Summary updated