All Projects → kamenbliznashki → Chexpert

kamenbliznashki / Chexpert

Licence: mit
CheXpert competition models -- attention augmented convolutions on DenseNet, ResNet; EfficientNet

Projects that are alternatives of or similar to Chexpert

Machine Learning Data Science Reuse
Gathers machine learning and data science techniques for problem solving.
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Sklearn ensae course
Materials for a course on scikit-learn at ENSAE
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Pacmap
PaCMAP: Large-scale Dimension Reduction Technique Preserving Both Global and Local Structure
Stars: ✭ 28 (+0%)
Mutual labels:  jupyter-notebook
Ucsandiegox Dse200x Python For Data Science
UCSandDiego Micro Masters Program
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Taxi
TAXI: a Taxonomy Induction Method based on Lexico-Syntactic Patterns, Substrings and Focused Crawling
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Textclassifier
tensorflow implementation
Stars: ✭ 944 (+3271.43%)
Mutual labels:  jupyter-notebook
World Models Sonic Pytorch
Attempt at reinforcement learning with curiosity for Sonic the Hedgehog games. Number 149 on OpenAI retro contest leaderboard, but more work needed
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Data driven science python demos
IPython notebooks with demo code intended as a companion to the book "Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control" by J. Nathan Kutz and Steven L. Brunton
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Sgdoptim.jl
A julia package for Gradient Descent and Stochastic Gradient Descent
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Sid
Official implementation for ICCV19 "Shadow Removal via Shadow Image Decomposition"
Stars: ✭ 28 (+0%)
Mutual labels:  jupyter-notebook
Conjugate Gradient
Painless conjugate gradient notebooks
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Odsc east 2016
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Kispython
Курс программирования на языке Python
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Mambo
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Advanced Gradient Obfuscating
Take further steps in the arms race of adversarial examples with only preprocessing.
Stars: ✭ 28 (+0%)
Mutual labels:  jupyter-notebook
Sdtm mapper
AI SDTM mapping (R for ML, Python, TensorFlow for DL)
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook
Anatomyofmatplotlib
Anatomy of Matplotlib -- tutorial developed for the SciPy conference
Stars: ✭ 943 (+3267.86%)
Mutual labels:  jupyter-notebook
Mask Rcnn Tensorflow
Fork of Tensorpack to make breaking performance improvements to the Mask RCNN example. Training is approximately 2x faster than the original implementation on AWS.
Stars: ✭ 28 (+0%)
Mutual labels:  jupyter-notebook
Idb Idb Invest Coronavirus Impact Dashboard
Follow the impact of COVID-19 outbreak in Latin America in real time
Stars: ✭ 28 (+0%)
Mutual labels:  jupyter-notebook
Alfabattle2 1stproblem
Alfabattle 2.0 1st task Top-6 solution: 8-folds lgbm blend
Stars: ✭ 27 (-3.57%)
Mutual labels:  jupyter-notebook

CheXpert

Implementation of classification models on the CheXpert dataset aiming to replicate the results in CheXpert: A Large Chest Radiograph Dataset with Uncertainty Labels and Expert Comparison.

Dependencies

  • python 3.5+
  • pytorch 1.0+
  • torchvision
  • numpy
  • pandas
  • sklearn
  • matplotlib
  • tensorboardX
  • tqdm

Usage

To train a model using default batch size, learning:

python chexpert.py  --train
                    --data_path         # location of dataset
                    --model             # choice of densenet121 or resnet152 or efficientnet-b[0-7]
                    --pretrained        # flag if pretrained model should be downloaded (only for densenet and resnet)
                    --cuda              # number of cuda device to train on

To evaluate a single model:

python chexpert.py  --evaluate_single_model / evaluate_ensemble
                    --model             # architecture of the saved model
                    --data_path         # location of dataset
                    --output_dir        # folder where experiment results and tensorboard tracking are saved
                    --restore           # if evaluate_single_model - file path to the saved model checkpoint,
                                          if evaluate_ensemble - folder path to the directory where checkpoints are saved
                    --plot_roc          # flag whether to also plot ROC and PR curves

To visualize class activation mappings from the validation set. Saves a grid of model probabilities, original image, and grad-cam visualization for 3 examples for each condition singularly present, 2 present conditions, >2 present conditions, and no present conditions; example below. Additionally for the same images, if attention model, saves a visualization of attention probabilities at each attention layer, example below.

python chexpert.py  --visualize
                    --model             # choice of densenet121 or resnet152 of the saved model
                    --data_path         # location of dataset
                    --output_dir        # folder where experiment results are saved
                    --restore           # file path to the saved model checkpoint

Results

Models were trained with the hyperparameters described in the paper (Training Procedure section). The results below are an ensemble of the 10 best checkpoints on the validation set computing the mean of the output scores over the 10 models. pretrained refers to ImageNet pretraining and subsequent fine-tuning of the entire model. densenet121_attn_aug refers to attention augmented DenseNet where in each Transition layer the AvgPool and 1x1 convolution are replaced by a 3x3 attention-augmented convolution with stride 2 (cf implementation and reference paper in models; hyperparameters: 8 attn heads, k=0.2, v=0.1).

AUCROC scores on the validation set using U-Ones uncertainty labels:
Model Atelectasis Cardiomegaly Consolidation Edema Pleural Effusion
densenet121_baseline 0.847 0.845 0.912 0.905 0.938
densenet121_pretrained 0.847 0.859 0.900 0.936 0.940
densenet121_attn_aug 0.853 0.838 0.915 0.869 0.913
efficientnet-b0_data_aug 0.857 0.852 0.903 0.890 0.932
efficientnet-b4_data_aug 0.851 0.844 0.904 0.890 0.928
resnet152_baseline 0.861 0.852 0.908 0.894 0.919
resnet152_pretrained 0.849 0.859 0.916 0.934 0.944
ROC and PR plots on the validation set using DenseNet121_pretrained:

densent121_plot

Examples of findings localization using Gradient-weighted Class Activation Mappings using DenseNet121_pretrained:

In the predictions tables below, Pred. prob refers to model prediction probability (uncalibrated).

Pleural Effusion only

densenet121_gradcam

No findings

densenet121_gradcam

Multiple findings

densenet121_gradcam


Issues

Model is confounded by writing on the radiographs (e.g. L/R in corner). Feature map activations for DenseNet121 below highlight writing in top right corner (see visualize_features); attention maps on the same image but using the attention-augmented DenseNet121 show the model attending to the writing (attention probabilities are averaged over the yellow squares overlaid on image) - specifically attention heads 1, 4, 5, and 6 (rows in image).

Original image examples

densenet_feature_base_img

DenseNet121 features at Transition1 layer

densenet121_features

DenseNet121_attn_aug attention maps at Transition1 layer

densenet121_attn1

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].