Home

Awesome

Kaggle-2019-Blindness-Detection

10th-place solution code for https://www.kaggle.com/c/aptos2019-blindness-detection/overview. This repository contains my solution code and provided as is.

This repository is not maintained

Dependencies

pip install --quiet -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" git+https://github.com/NVIDIA/apex
pip install git+https://github.com/mapillary/inplace_abn.git@v1.0.3

Results

Experiment nameCV scoreLB scoreEncoderExtra dataNoteArgs
Baseline classification0.9077 ± 0.00450.625Resnet18No4 folds-
Baseline regression0.9093 ± 0.00330.646Resnet18No4 folds-
--------------------------------------------------------------------------------------------------------
Baseline classification0.9213 ± 0.00330.772SEResnext50No4 folds-
Baseline regression0.9225 ± 0.00220.787SEResnext50No2 folds-
Baseline regression0.9176 ± 0.00800.763SEResnext101No4 folds, Multi-pooling-
Baseline classification0.8055 ± 0.00650.714 (?1)cls_resnext50_gapYes4 folds-
Baseline regression0.9234 ± 0.00350.791reg_resnext50_rmsNo4 folds-
Baseline regression0.9129 ± 0.00990.804reg_resnext50_rmsYes4 folds-
Baseline regression0.9200 ± 0.00440.803reg_resnext50_rmsYes4 folds (768)-
--------------------------------------------------------------------------------------------------------
Baseline regression0.9128 ± 0.00660.799reg_seresnext50_rmsYes4 folds-
Baseline regression0.8992 ± 0.0041reg_seresnext101_rmsYes4 folds-
Baseline regression0.9018 ± 0.00790.774reg_densenet201_rmsYes4 folds-
Baseline regression0.9053 ± 0.00530.761reg_inceptionv4_rmsYes4 folds-
--------------------------------------------------------------------------------------------------------
Regression with aux loss0.9170 ± 0.00490.787reg_seresnext50_rmsYes4 folds-m reg_seresnext50_rms -a medium -f 0 -f 1 -f 2 -f 3 -b 60 -l clipped_mse --fp16 -o Adam -d 0.5 -s multistep -lr 1e-4 -wd 1e-4 -e 100 -v --use-idrid --use-messidor --use-aptos2019 --warmup 10
--------------------------------------------------------------------------------------------------------
Regression with aux loss0.9244 ± 0.00600.752reg_seresnext50_rmsAptos20154 foldstrain_regression_baseline.py -m reg_seresnext50_rms -a medium -f 0 -f 1 -f 2 -f 3 -b 60 --fp16 -o Adam -d 0.5 -s multistep -lr 1e-4 -e 100 -es 20 -v --use-aptos2019 --warmup 10
Regression with aux loss0.8737 ± 0.02140.668reg_seresnext50_rmsIDRID4 foldstrain_regression_baseline.py -m reg_seresnext50_rms -a medium -f 0 -f 1 -f 2 -f 3 -b 60 --fp16 -o Adam -d 0.5 -s multistep -lr 1e-4 -e 100 -es 20 -v --use-idrid --warmup 10
Regression with aux loss0.9006 ± 0.01410.554reg_seresnext50_rmsMessidor4 foldstrain_regression_baseline.py -m reg_seresnext50_rms -a medium -f 0 -f 1 -f 2 -f 3 -b 60 --fp16 -o Adam -d 0.5 -s multistep -lr 1e-4 -e 100 -es 20 -v --use-messidor --warmup 10
Regression with aux loss0.9134 ± 0.00440.779reg_seresnext50_rmsA15, ID, MD4 foldstrain_regression_baseline.py -m reg_seresnext50_rms -a medium -f 0 -f 1 -f 2 -f 3 -b 60 --fp16 -o Adam -d 0.5 -s multistep -lr 1e-4 -e 100 -es 20 -v --use-messidor --warmup 10
--------------------------------------------------------------------------------------------------------
Regression with aux loss0.9231 ± 0.00430.813seresnextd50_gwapA15, ID, MD4 foldstrain_regression_baseline.py -m seresnext50d_gwap -a medium -f 0 -f 1 -f 2 -f 3 -b 60 --size 512 --fp16 -o AdamW -wd 1e-4 -s multistep -lr 3e-4 -e 50 --use-idrid --use-messidor --use-aptos2019 -v --criterion-cls focal_kappa -l1 2e-4
Regression with aux loss0.9216 ± 0.00350.809seresnextd50_gapA15, ID, MD4 foldstrain_regression_baseline.py -m seresnext50d_gap -a medium -f 0 -f 1 -f 2 -f 3 -b 60 --size 512 --fp16 -o AdamW -wd 1e-4 -s multistep -lr 3e-4 -e 50 --use-idrid --use-messidor --use-aptos2019 -v --criterion-cls focal_kappa -l1 2e-4
--------------------------------------------------------------------------------------------------------
Finetuned 806_8130.9680 ± 0.00370.803
zen_golick0.9142 ± 0.00490.770
zen_golick_T0.9419 ± 0.00660.784
--------------------------------------------------------------------------------------------------------

|--------------------------------|-----------------|------------|-----------------------|----------------|---------|-| | happy_shirley | 0.8148 ± 0.0020 | 0.758 | eager_wright | | 0.771 | goofy_heyrovsky | | 0.785 |--------------------------------|-----------------|------------|-----------------------|----------------|---------|-|

|--------------------------------------------------|------------|-----------------------|----------------|---------|-| | ablation_study_seresnext50d_max_hard | 0.782 |
| ablation_study_seresnext50d_max_medium | 0.787 |
| ablation_study_seresnext50d_max_light | 0.765 |
|--------------------------------------------------|------------|-----------------------|----------------|---------|-| | ablation_study_seresnext50d_gwap_hard | 0.778 | | ablation_study_seresnext50d_gwap_medium | 0.794 |
| ablation_study_seresnext50d_gwap_light | 0.795 | |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | ablation_study_seresnext50d_gap_hard | 0.797 | | ablation_study_seresnext50d_gap_medium | 0.802 | | ablation_study_seresnext50d_gap_light | 0.801 | |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | ablation_study_seresnext50d_gwap_uda_medium| 0.787 | | ablation_study_seresnext50d_rank_medium | 0.765 | |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | youthful_mccarthy | 0.791 | 0.9045 ± 0.0042 | |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | heuristic_sinoussi (seresnext50) | 0.823 | 0.9162 ± 0.0055 | | heuristic_sinoussi_finetune | 0.822 | 0.9170 ± 0.0055 | |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | modest_williams | 0.828 | 0.9198 ± 0.0032 | | modest_williams (finetune) | 0.828 | 0.9204 ± 0.0032 | | modest_williams + heuristic_sinoussi | 0.832 | | |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | modest_williams + heuristic_sinoussi | 0.834 | | optimized thresholds on OOF [0.52704163, 1.47657166, 2.42753601, 3.3937439] | modest_williams + heuristic_sinoussi | 0.836 | | optimized thresholds on Aptos15? [0.52704163, 1.47657166, 2.42753601, 3.3937439 ] | modest_williams + heuristic_sinoussi | 0.836 | | optimized thresholds on Aptos15? [0.52704163, 1.47657166, 2.42753601, 3.3937439 ] |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | inceptionv4_gap_happy_wright | 0.827 | 0.9154 ± 0.0044 | inceptionv4_gwap_cranky_torvalds | 0.824 | 0.9066 ± 0.0053 | seresnext50_rnn_clever_roentgen | 0.831 | 0.9118 ± 0.0057 |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | modest_williams+heuristic_sinoussi+happy_wright | 0.843 | | modest_williams+heuristic_sinoussi+happy_wright | 0.844 | FlipLR | modest_williams+heuristic_sinoussi+happy_wright | 0.844 | Flip4, mean | | modest_williams+heuristic_sinoussi+happy_wright | 0.844 | FlipLR, median | | modest_williams+heuristic_sinoussi+happy_wright | 0.842 | Truncated mean |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | heuristic_sinoussi+modest_williams++happy_wright+clever_roentgen | | | heuristic_sinoussi+modest_williams++happy_wright+clever_roentgen | 0.802 | logistic_regression | seresnet152-sad-ardinghelli | 0.816 | | happy_wright | 0.802 | | seresnext101_fpn_512_practical_wright | 806 | 0.9142 0.0064 | warmup FPN from | resnet34_gap_jovial_turing | 809 | 0.9088 0.0043 |--------------------------------------------------|------------|-----------------------|----------------|---------|-| |inceptionv4_gap_512_medium_aptos2019_messidor_idrid_pl1_fold0_wizardly_mestorf_main.pth | 823 |inceptionv4_gap_512_medium_aptos2019_messidor_idrid_pl1_fold0_wizardly_mestorf_warmup.pth |841 |seresnext50_gap_512_medium_fold0_vibrant_johnson.pth | 825 | |seresnext50_gap_512_medium_fold0_vibrant_johnson.pth | 822 | Non-optimal thresholds |--------------------------------------------------|------------|-----------------------|----------------|---------|-| | inceptionv4_gap_512_medium_pl1_epic_shaw | 843 | 0.9747 ± 0.0002 | warmup | inceptionv4_gap_512_medium_pl1_epic_shaw | 830 | ??? | main (fold 1,2,3) | seresnext101_gap_pl1_sad_neumann | 829 | 0.9747 ± 0.0002 | modest_williams+heuristic_sinoussi+happy_wright+shaw | | | inceptionv4_gap_512_medium_pl1_epic_shaw | | | warmup, normal + clahe

Extra data

  1. http://www.it.lut.fi/project/imageret/diaretdb1_v2_1/

References

  1. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5961805/
  2. https://www.slideshare.net/EducacionMolina/diabetic-retinopathy-71884270
  3. http://defauw.ai/diabetic-retinopathy-detection/
  4. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4944099/
  5. http://eyesteve.com/diabetic-retinopathy-grading/
  6. http://eyesteve.com/diabetic-retinopathy-grading/
  7. https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0139148
  8. https://mlwave.com/kaggle-ensembling-guide/
  9. https://www.kaggle.com/amrmahmoud123/1-guide-to-ensembling-methods
  10. http://blog.kaggle.com/2016/12/27/a-kagglers-guide-to-model-stacking-in-practice/
  11. https://github.com/MLWave/Kaggle-Ensemble-Guide/blob/master/src/correlations.py
  12. https://jamanetwork.com/journals/jamaophthalmology/fullarticle/2734990

Other

Train on Aptos 2019

Validation on IDRID + MESSIDOR: 0.6325 / 0.6291 messidor TTA None Mean 0.5497315432994327 std 0.020016714451918216 MeanAvg 0.5370538498582897 idrid TTA None Mean 0.7221154799857236 std 0.02454628058174581 MeanAvg 0.7603479511540748 aptos2019 TTA None Mean 0.9720265955567333 std 0.0024721825621897855 MeanAvg 0.9873314014864271 aptos2015 TTA None Mean 0.471382231210149 std 0.02805589901308936 MeanAvg 0.4984512005316677