Git Product home page Git Product logo

ecl's Introduction

ECL: Class-Enhancement Contrastive Learning for Long-tailed Skin Lesion Classification

GitHub stars MIT Licence

Share us a โญ if this repo does help

This repository is the official implementation of ECL (Accepted by MICCAI 2023). If you encounter any question, please feel free to contact us. You can create an issue or just send an email to me at [email protected]. Also welcome for any idea exchange and discussion.

video-record.mp4

Updates

[07/09/2023] Code is public.

Table of Contents

Abstract

Our Network Structure Skin image datasets often suffer from imbalanced data distribution, exacerbating the difficulty of computer-aided skin disease diagnosis. Some recent works exploit supervised contrastive learning (SCL) for this long-tailed challenge. Despite achieving significant performance, these SCL-based methods focus more on head classes, yet ignore the utilization of information in tail classes. In this paper, we propose class-Enhancement Contrastive Learning (ECL), which enriches the information of minority classes and treats different classes equally. For information enhancement, we design a hybrid-proxy model to generate class-dependent proxies and propose a cycle update strategy for parameter optimization. A balanced-hybrid-proxy loss is designed to exploit relations between samples and proxies with different classes treated equally. Taking both "imbalanced data" and "imbalanced diagnosis difficulty" into account, we further present a balanced-weighted cross-entropy loss following the curriculum learning schedule.

Requirements

  • Windows/Linux both support
  • python 3.8
  • PyTorch 1.9.0
  • torchvision 0.10.0

Datasets

We conduct experiments on two public skin lesion datasets (download from ISIC Challenge): ISIC 2018 and ISIC 2019. The ISIC 2018 dataset contains 2594 images of 7 classes, and the ISIC 2019 dataset contains 25331 images of 8 classes. You can run the following code to get the splied datasets:

python ./utils/dataset/split_data.py  --datapath ./data/ISIC2018/ --dataset ISIC2018

Training

To train the model(s) in the paper, run this command:

python train.py --dataset ISIC2018 --data_path ./data/ISIC2018/ --batch_size 64 --lr 0.002 --epochs 100 --gpu 0 --model_path ./results/ISIC2018/

Testing

We upload the model weights for two datasets, run this command:

python test.py --dataset ISIC2018 --data_path ./data/ISIC2018/  --model_path ./data/ISIC2018/ --log_path <your log path>

Citation & Acknowledgments

If you find this repo useful for your research, please consider citing the paper

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.