Algorithms

MSAF comes with two types of algorithms: boundary detection and label clustering algorithms. Below, the included algorithms are discussed and classified based on these two categories. Note that some algorithms can actually approach both subproblems.

Additionally, two other algorithms published under a GPL license can be obtained from the msaf-gpl repo.

Boundary Algorithms

Checkerboard Kernel

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the boundaries of a given track using the Foote

Convex Non-Negative Matrix Factorization

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the structure of a given track using a modified version

Ordinal Linear Discriminant Analysis

Segmenter(file_struct[, in_bound_idxs, ...]) This class implements the algorithm described here:

Laplacian Segmentation

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the boundaries of a given track using the Spectral

Structural Features

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the boundaries of a given track using the Serrà

Variable Markov Oracle

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the structure of a given track using the Variable

Label Algorithms

2D-Fourier Magnitude Coefficients

Segmenter(file_struct[, in_bound_idxs, ...]) This method labels segments using the 2D-FMC method described here:

Convex Non-Negative Matrix Factorization

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the structure of a given track using a modified version

Laplacian Segmentation

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the boundaries of a given track using the Spectral

Variable Markov Oracle

Segmenter(file_struct[, in_bound_idxs, ...]) This script identifies the structure of a given track using the Variable

Adding A New Algorithm to MSAF

To include a new algorithm in MSAF, the following steps should be performed:

  1. Create new directory in the algorithms directory with the desired algorithm name.

  2. Create 3 new files in this new directory: __init__.py, config.py, and segmenter.py.

  3. The __init__.py file should import everything from the new config.py and segmenter.py files.

  4. The config.py should contain the following variables:

    • config: variable with the parameters of the algorithm.
    • algo_id: string with the algorithm identifier.
    • is_boundary_type: boolean that determines whether the algorithm allows boundary detection.
    • is_label_type: boolean that determines whether the algorithm allows labeling.
  5. The segmenter.py should contain a class Segmenter that inherits from SegmenterInterface and implements the method processFlatt. This is where the main algorithm is implemented.

In the folder algorithms/example an example of a new algorithm is included. The easiest way to add a new algorithm to MSAF is to copy and paste the example directory to use it as the base code of the new algorithm.