FROM AGPEDIA — AGENCY THROUGH KNOWLEDGE

Non-negative matrix factorisation

Non-negative matrix factorisation (NMF) approximates a matrix of non-negative values, V, as the product of two smaller non-negative matrices, W and H.[1:1] The columns of W act as templates and the rows of H as activations saying where each template occurs. Because nothing can be subtracted, the factors tend to describe the data as a sum of parts, which often makes them easier to interpret than other factorisations.[1:1][2:1] In music, NMF is applied to magnitude spectrograms, where the templates can stand for the spectra of notes or instruments and the activations for when they sound. It has been used for transcription and source separation.[1:2][3:1][4:1]

A large matrix V shown as approximately equal to the product of a tall narrow matrix W and a short wide matrix H.
NMF approximates V by the product of two smaller non-negative matrices, W and H. Qwertyus · CC BY-SA 3.0

The factorisation

W and H are usually required to have much lower rank than V. Each column of V, a data vector, is then represented as a weighted sum of a small number of template vectors.[1:1] Daniel Lee and Sebastian Seung contrasted this with principal components analysis, whose representation is distributed and relies on cancellations between components; non-negativity, they had shown, makes a factorisation learn a representation of the data by parts.[2:1]

The problem usually has no exact solution, so W and H are found by optimisation.[1:1] Lee and Seung's 2001 paper analysed two algorithms with multiplicative update rules, one minimising the least-squares error and the other the generalised Kullback–Leibler divergence, and proved that both converge monotonically. They found these rules a good compromise between speed and ease of implementation.[2:2] Because the cost functions are convex in W alone or in H alone but not in both together, no algorithm can be expected to find the global minimum; methods find local minima instead.[2:1]

In music

Spectrogram factorisation

Applied to a magnitude spectrogram, W ideally holds the spectral pattern of each pitch in a piece and H the times at which each is active.[1:2] Paris Smaragdis and Judith Brown (2003) used this for polyphonic transcription of notes with a fixed harmonic spectrum, such as piano notes. Their system learned each note's spectrum and timing from the recording itself rather than from built-in knowledge, and was demonstrated on Keith Jarrett's recording of a Bach fugue. Its shortcoming, they wrote, was that it requires instruments whose notes have a static harmonic profile.[3:1]

The number of templates, the rank, is a trade-off. A higher rank approximates the spectrogram better, including the vertical structures of note onsets, but the musical meaning of W and H may be lost.[1:2] Even at a sensible rank, a factorisation started from random values may approximate the spectrogram well and still mean little: in Müller's piano example, most learned templates were mixtures of notes, and the activations hardly resembled a piano roll.[5:1]

Informed factorisation

Multiplicative updates leave any zero entry at zero, so musical knowledge can be imposed through the starting values. Templates can be allowed energy only near the harmonics of the pitch assigned to them, and activations only where a score, aligned to the recording, says each note sounds.[5:2]

Source separation

For separation, the components must be grouped into sources. Tuomas Virtanen's method (2007) models each source as one or more components, each with a fixed spectrum and a time-varying gain, and adds cost terms that favour gains which change slowly and are sparse. On mixtures of pitched instrument samples and drums it separated better than independent subspace analysis and basic NMF; the temporal-continuity term helped detect pitched sounds, while the sparseness term did not help significantly.[4:1] Virtanen noted that there is no universal way to choose the number of components, that complex signals use many components that must then be grouped into sources, and that automatic grouping had proved difficult; supervised grouping works better but needs the sources known and modelled in advance.[4:2]

In reviews of separation methods, NMF belongs to the low-rank family, which models the accompaniment as a few template spectra switched on and off over time.[6:1] The first publicly available separation software, openBlissart (2011), was built on NMF.[7:1] Since the mid-2010s, systems trained on multitrack recordings, mostly deep neural networks, have overtaken such methods.[8:1][7:2]

Implementations

The librosa library's decompose function factors a spectrogram into components and activations, by default with the NMF implementation of scikit-learn.[9:1]

  1. ^a ^b ^c ^d ↗ fb-basic ^a ^b ^c ↗ fb-music Müller, Meinard. Nonnegative Matrix Factorization (NMF). FMP Notebooks (companion to Fundamentals of Music Processing), International Audio Laboratories Erlangen. https://www.audiolabs-erlangen.de/resources/MIR/FMP/C8/C8S3_NMFbasic.html.
  2. ^a ^b ^c ↗ ls-parts ^ ↗ ls-algorithms Lee, Daniel D.; Seung, H. Sebastian (2001). Algorithms for Non-negative Matrix Factorization. Advances in Neural Information Processing Systems 13 (NIPS 2000). MIT Press. https://proceedings.neurips.cc/paper/2000/hash/f9d1152547c0bde01830b7e8bd60024c-Abstract.html.
  3. ^a ^b ↗ sm-transcription Smaragdis, Paris; Brown, Judith C. (2003-10). Non-Negative Matrix Factorization for Polyphonic Music Transcription. 2003 IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (WASPAA). https://doi.org/10.1109/ASPAA.2003.1285860 https://www.merl.com/publications/TR2003-139.
  4. ^a ^b ↗ vi-method ^ ↗ vi-clustering Virtanen, Tuomas (2007-03). Monaural Sound Source Separation by Nonnegative Matrix Factorization With Temporal Continuity and Sparseness Criteria. IEEE Transactions on Audio, Speech, and Language Processing. https://doi.org/10.1109/TASL.2006.885253 https://homepages.tuni.fi/tuomas.virtanen/papers/virtanen_taslp2007.pdf.
  5. ^ ↗ fs-random ^ ↗ fs-constraints Müller, Meinard. NMF-Based Spectrogram Factorization. FMP Notebooks (companion to Fundamentals of Music Processing), International Audio Laboratories Erlangen. https://www.audiolabs-erlangen.de/resources/MIR/FMP/C8/C8S3_NMFSpecFac.html.
  6. ^ ↗ nmf Rafii, Zafar; Liutkus, Antoine; Stöter, Fabian-Robert; Mimilakis, Stylianos Ioannis; et al. (2018-08). An Overview of Lead and Accompaniment Separation in Music. IEEE/ACM Transactions on Audio, Speech, and Language Processing. https://doi.org/10.1109/TASLP.2018.2825440 https://arxiv.org/abs/1804.08300.
  7. ^ ↗ openblissart ^ ↗ ml-outperformed Stöter, Fabian-Robert; Uhlich, Stefan; Liutkus, Antoine; Mitsufuji, Yuki (2019-09-08). Open-Unmix - A Reference Implementation for Music Source Separation. Journal of Open Source Software. https://doi.org/10.21105/joss.01667 https://joss.theoj.org/papers/10.21105/joss.01667.
  8. ^ ↗ sisec2015 Mitsufuji, Yuki; Fabbro, Giorgio; Uhlich, Stefan; Stöter, Fabian-Robert; et al. (2022). Music Demixing Challenge 2021. Frontiers in Signal Processing. https://doi.org/10.3389/frsip.2021.808395 https://arxiv.org/abs/2108.13559.
  9. ^ ↗ ld-decompose librosa development team. librosa.decompose.decompose. librosa 0.11.0 documentation. https://librosa.org/doc/0.11.0/generated/librosa.decompose.decompose.html.

Wikidata: Q10843505

Available in