GithubHelp home page GithubHelp logo

gyasmeen-ml / spbl_pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xpwu95/spbl_pytorch

0.0 0.0 0.0 114 KB

PyTorch implementation of "Self-Paced Balance Learning for Clinical Skin Disease Recognition"

License: MIT License

MATLAB 1.08% Python 98.92%

spbl_pytorch's Introduction

SPBL_Pytorch

PyTorch implementation of "Self-Paced Balance Learning for Clinical Skin Disease Recognition"

Installation

This project is based on spaco and Open-Reid. And we add imbalanced learning methods in it and modify some code for compatibility.

Requirements

  • Python 3.4+
  • PyTorch 0.4.0

Setup the Environment and Packages

i. Create a new environment

We recommend Anaconda as the package & environment manager. And here is an example:

conda create -n spbl
conda activate spbl

ii. Install PyTorch

Follow the official instructions to install Pytorch. Here is an example using conda:

conda install pytorch=0.4.0 torchvision -c pytorch

iii. Install Cython

conda install cython 
# or "pip install cython"

iv. Install Python Matlab Engine

Follow the official instructions to install python matlab engine. Here is an example using conda:

cd "matlabroot/extern/engines/python"
python setup.py install

Install SPBL

i.Clone the repository

git clone https://github.com/xpwu95/SPBL_Pytorch.git

ii. Compile extensions

cd open-reid
python setup.py install

Prepare Data

The SD-198 and SD-260 datasets can be downloaded from http://xiaopingwu.cn/assets/projects/sd-198/.

It is recommended to symlink the datasets root to spbl/data/dataset_name/raw/images.

ln -s $YOUR_DATA_ROOT data/dataset_name/raw/images

The directories should be arranged like this:

SPBL_Pytorch
├──	spbl
|	├── reid
|	├── examples
|	│   ├── data
|	│   │   ├── sd-198
|	│   │   │   ├── raw
|	│   │   │   │   ├── images
|	│   │   │   │   ├── train.txt
|	│   │   │   │   ├── val.txt
|	│   │   ├── sd-260
|	│   │   ├── mit67
|	│   │   ├── caltech101
|	│   │   ├── minist
|	│   │   ├── mlc

Running

python spbl.py

Configuration

The configuration parameters are mainly in the /examples/cfg.py files. The parameters you most probably change are as follows:

  • input_size: the size of input image
  • lr: learning rate
  • batch_size: batch size
  • workers:
  • iter_step: the pace parameter of the SPBL
  • gamma:
  • train_ratio: the ratio of the initial training set
  • model: model name
  • dataset: dataset name
  • class_num: the class number of the dataset
  • epochs: total training epochs
  • step_size: the step size of the learning rate decay
  • add_ratios: add ratios

Results

Dataset Precision Recall F1 G-mean MAUC Accuracy
SD-198 71.4±1.7 65.7±1.6 66.2±1.6 42.8±4.0 68.5±1.6 67.8±1.8
SD-260 59.9±1.6 48.2±1.1 51.0±0.9 19.6±1.1 64.8±1.2 65.1±0.8
Dataset MIT-67 Caltech-101 MINIST MLC
Accuracy 64.1±0.5 88.6±0.4 99.0±0.1 72.0

License

This project is released under the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.