Code Monkey home page Code Monkey logo

crckd's Introduction

CRCKD

This repository is an official PyTorch implementation of the paper "Categorical Relation-Preserving Contrastive Knowledge Distillation for Skin Lesion Classification" paper from MICCAI 2021.

Installation

Dependencies

  • Python 3.6
  • PyTorch >= 1.5.0
  • numpy
  • pandas
  • scipy
  • sklearn
  • tensorboardX
  • torchvision

Usage

Baseline 1: DenseNet 121

python3 train_CRCKD.py --exp sup4_base

Baseline 2: DenseNet 121 + conventional Mean Teacher (MT)

python3 train_CRCKD.py --ema_consistency 1  --exp sup4_pred_MT

CRCKD: baseline + pred_MT + 0.1 * CRD_20pos + CRP

python3 train_CRCKD.py --ema_consistency 1 --CCD_distill 1 --CRD_b4_weight 0.1 --mode multi_pos --nce_p 20 --CRP_distill 1 --exp sup4_pred_MT_0.1CRD_20pos_CRP

Main Scripts

· cv_splits.py: Split all data into five folds for cross validation.

· train_CRCKD.py: Model training.

· validation.py: Evaluation of the model predictions.

· dataloader/dataset.py: Dataset with memory bank and contrastive samples.

· utils/memory.py: Construct memory banks that supply positive and negative samples.

· utils/CRD_CRP_loss.py: Definition of the CCD and CRP modules proposed in our method.

Citation

If you find the codes useful, please cite the following publication:

@article{xing2021categorical,
  title={Categorical Relation-Preserving Contrastive Knowledge Distillation for Medical Image Classification},
  author={Xing, Xiaohan and Hou, Yuenan and Li, Hang and Yuan, Yixuan and Li, Hongsheng and Meng, Max Q-H},
  journal={arXiv preprint arXiv:2107.03225},
  year={2021}
}

Contact

If you have any problems in the codes, please contact [email protected].

crckd's People

Stargazers

 avatar  avatar Debasmit Roy avatar  avatar  avatar hankyul avatar Anna Woodard avatar Siyuan Yan avatar JindiKong avatar XiaoyuKang avatar Chihiro Nakato avatar  avatar  avatar HOU Yuenan avatar IronMan avatar Sui Libin avatar

Watchers

Xiaohan Xing avatar IronMan avatar

crckd's Issues

about the code

May I ask when you can open source your code? I am very interested in your work.

validation.py

Hello, how can I get the image data in the folder path in validation.py?

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.