README.md

March 13, 2024 · View on GitHub

Xian Wang, "Enhancing Vocal Melody Extraction with Multilevel Contexts," under review.

This is the accompanying code for the above paper.

Hardware Requirements:

  • one GPU with 11 GB VRAM
  • 64 GB RAM

Main Python Packages Used

  • tensorflow 2.x
  • librosa
  • soundfile
  • mir_eval
  • medleydb

Code Structure

  • [demo.ipynb] Jupyter notebook demonstrating how to load the model for inference.
  • [main.py] all-in-one file for training and inference
  • [pitch_local.py] implementation of the proposed model
    • [lstm_sub.py] implementation of the LSTM layer used in the model
  • [nsgt.py] implementation of a tf function for calculating the VQT spectrogram
  • [self_defined] some custom utilities
  • [ckpts] stores the best checkpoint of the model
  • [predicted_melody] stores an example melody extracted by other models

Datasets

  • for training: MedleyDB
  • for testing: MedleyDB, ADC04, MIREX05, MIR-1K, RWC

Use the Code for Inference

For your convenience, I have uploaded a checkpoint of the trained model, which is in the folder ckpts. The script main.py has been properly configured to run in inference mode using the above checkpoint, so you do not need to train the model yourself from scratch.

If you would like to train the model yourself, please follow the training process given in the paper, step by step in an incremental manner.

Detailed Performance Measures

In the paper when comparing the performance of different models, due to space limit we only gave the overall accuracy (OA). Below we present more detailed performance measures:

  • voicing recall (VR)
  • voicing false alarm (VFA)
  • raw pitch accuracy (RPA)
  • raw chroma accuracy (RCA)

Measures are in percentage.

Models compared:

  • [kknet] K. Shao, K. Chen, T. Berg-Kirkpatrick, and S. Dubnov, “Towards improving harmonic sensitivity and prediction stability for singing melody extraction,” in Proc. Int. Soc. Music Inf. Retriev. Conf., 2023, pp. 1–7.
  • [mtanet] Y. Gao, Y. Hu, L. Wang, H. Huang, and L. He, “MTANet: Multi-band time-frequency attention network for singing melody extraction from polyphonic music,” in Proc. INTERSPEECH, 2023, pp. 5396–5400.
  • [rmvpe] H. Wei, X. Cao, T. Dan, and Y. Chen, “RMVPE: A robust model for vocal pitch estimation in polyphonic music,” in Proc. INTERSPEECH, 2023, pp. 5421–5425.

ADC04

VRVFARPARCAOA
kknet86.3319.6981.8383.7280.96
mtanet85.67  6.0082.1483.5083.26
rmvpe76.5611.1089.8291.2076.48
proposed81.7817.2788.8990.9277.99

MIREX05

VRVFARPARCAOA
kknet82.7011.2379.4181.5883.12
mtanet82.79  4.8879.4479.5485.40
rmvpe85.73  5.3691.8191.9587.13
proposed84.85  4.5588.8489.2686.55

MDB

VRVFARPARCAOA
kknet70.4614.3862.2866.1776.76
mtanet77.2311.2869.9370.9282.65
rmvpe72.57  9.3685.1087.0283.25
proposed76.0610.5285.7987.0683.85

MIR-1K

VRVFARPARCAOA
kknet70.8722.6061.6366.9166.41
mtanet73.6613.9767.5669.0072.80
rmvpe63.98  4.4287.7791.0972.21
proposed74.3712.4584.3086.9074.78

RWC

VRVFARPARCAOA
kknet76.198.4061.9965.1776.97
mtanet79.4710.6462.7963.2076.49
rmvpe75.84  8.7075.9076.6377.54
proposed77.5310.3675.4276.0877.47