ayrna / deep-ordinal-clm

Ordinal classification with Deep Learning using the CLM
14 stars 2 forks source link

Cumulative link models for deep ordinal classification

Algorithms included

This repo contains the code to run experiments with Deep Learning using the Cumulative Link Models and the Quadratic Weighted Kappa loss for the Diabetic Retinopathy, Adience and FGNet datasets. The CLM implementation includes three different link functions used in this work and listed below:

Installation

Dependencies

This repo basically requires:

Compilation

To install the requirements, use:

Install for CPU pip install -r requirements.txt

Install for GPU pip install -r requirements_gpu.txt

Development

Contributions are welcome. Pull requests are encouraged to be formatted according to PEP8, e.g., using yapf.

Usage

You can run all the experiments by running:

python main_experiment.py experiment -f ../exp/all_experiments.json

Note that the Retinopathy dataset must be stored under ../datasets/retinopathy/data128 and the Adience dataset under ../datasets/adience/data256. This path can be changed by settings the enviroment variable DATASETS_DIR in the execution line:

DATASETS_DIR=whatever python main_experiment.py experiment -f ../exp/all_experiments.json

The .json files contain all the details about the experiments settings.

After running the experiments, you can use tools.py to watch the results:

python tools.py

Citation

The paper titled "Cumulative link models for deep ordinal classification" has been published in Neurocomputing. If you use this code, please cite the following paper:

@article{vargas2020cumulative,
  title={Cumulative link models for deep ordinal classification},
  author={Vargas, V{\'\i}ctor Manuel and Guti{\'e}rrez, Pedro Antonio and Herv{\'a}s-Mart{\'\i}nez, C{\'e}sar},
  journal={Neurocomputing},
  year={2020},
  publisher={Elsevier},
  doi={10.1016/j.neucom.2020.03.034}
}

Contributors

Cumulative link models for deep ordinal classification