/kaggle-HPA

Kaggle Human Protein Atlas Image Classification 73th solution

Primary LanguagePython

Human Protein Atlas Image Classification

73th solution for kaggle Human Protein Atlas Image Classification by pytorch 1.0

requirements:

unzip data.zip under tools/kaggle, download and put train/test pictures in tools/kaggle/train and tools/kaggle/test

Dataset Preprocessing

See tools/preprocessing.py.

  1. combine_dataset for combining train with external data
  2. train_test_split to split train and valid dataset while keeping class distribution using Multilabel Stratification
  3. create_class_weight to assign weights for each class for weighted BCE loss
  4. create_sample_weight to assign each sample to balancing occurences of each class (linearly)
  5. calc_statistics: calculate std and mean for datasets

Train

using config-based system. to train model

python3 train_net.py --config-file config/res18_cv0.yaml

model will be dumped into dump/res18_cv0 folder

Test

python3 test_net.py --config-file config/res18_cv0.yaml

Evaluation & summission

python3 evaluation.py --config-file config/res18_cv0.yaml

Other Useful tools

  1. TTA: edit build_tta_transforms to insert wanted tta and set TTA to 'on'
  2. macro f1 loss