Skip to content

koso019003/Adversarial-Rivalry-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adversarial Rivalry Learning for Music Classification

Model architecture

Proposed genreMERT (with ARL) architecture.

Introduction

This repo is official PyTorch implementation of Adversarial Rivalry Learning for Music Classification (ICASSP 2026).

we introduced adversarial rivalry learning (ARL), a novel learning paradigm that overcomes LCA’s limitations by reducing hyperparameter tuning burden and providing a clear learning criterion. Through structured branch rivalry, ARL achieves superior performance across benchmarks with no additional inference cost, offering a practical solution for music classification.

Pleaser refer to our paper for further details.

Getting started

Installation & Clone the repo [Environment on Linux (Ubuntu 22.04 with python >= 3.8)]

# Clone the repo:
$ git clone ...
$ cd $PWD/Adversarial-Rivalry-Learning

# Install the requirements using `conda` and `pip`: 
$ conda create -y -n genreMERT python=3.8
$ conda activate genreMERT
$ conda install -y pytorch=2.2.1 torchaudio=2.2.1 pytorch-cuda=11.8 -c pytorch -c nvidia
$ conda install -y lightning=2.2.0.post0 -c conda-forge

$ pip install -r requirements.txt

Download weights

Download the pre-trained genreMERT (w/ ARL) weights from here.

You need to unzip the contents, and the data directory structure should follow the hierarchy below.

${ROOT}  
|-- weights  
|   |-- genreMERT_ARL.ckpt

Evaluation

Run the commands below under the folder src/ to evaluate a pretrained model on GTZAN test set.

You should be able to obtain the output below, which is identical to the result in Table 4 (see our paper):

$ cd src

# genreMERT (w/ ARL)
$ CUDA_VISIBLE_DEVICES=0 python main.py
Seed set to 0
Loading dataset...
Setting sample rate from 22050 to 24000
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
Predicting test_dataset result
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
Predicting DataLoader 0: 100%|████████████████████████████████████| 6/6 [00:07<00:00,  4.30it/s]

Number of parameters: 94.40 (M)
Test accuracy of y:
Frame level: 0.90       Song level: 0.93

You should also be able to obtain the results under the ROOT/result.

Results

Models Frame Level Acc. Song Level Acc. #Para. (M)
genreMERT (w/ LCA) 0.89 0.92 94.40
genreMERT (w/ ARL) 0.90 0.93 94.40

Confusion matrix

genreMERT (w/ LCA) genreMERT (w/ ARL)

Citation

@INPROCEEDINGS{11463306,
  author={Lin, Yi-Xing and Wei, Wen-Li and Lin, Jen-Chun},
  booktitle={ICASSP 2026 - 2026 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)}, 
  title={Adversarial Rivalry Learning for Music Classification}, 
  year={2026},
  volume={},
  number={},
  pages={16107-16111},
  keywords={Filtering;Filters;MIMICs;Millimeter wave integrated circuits;Monolithic integrated circuits;Feedback loop;Life cycle assessment;Product lifecycle management;LoRa;Protocols;Attention learning;music classification},
  doi={10.1109/ICASSP55912.2026.11463306}}

License

This project is licensed under the terms of the MIT license.

References

This code is based on koso019003/Learnable-Counterfactual-Attention and partly based on huggingface/transformers.

The pre-trained weights of MERT used in genreMERT (w/ ARL) are from here.

About

Official implementation of accepted IEEE ICASSP paper "Adversarial Rivalry Learning for Music Classification".

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages