Skip to content

FanChiMao/Competition-2022-Pytorch-Orchid_Classification

Repository files navigation

[AICUP 2022] Competition-2022-Pytorch-Classification

report download Visitors Open In Colab Hugging Face Spaces

Installation

The model is built in PyTorch 1.8.0 and tested on Windows10 environment
(Python: 3.8, CUDA: 10.2, cudnn: 7.6).

For installing, follow these intructions

conda create -n pytorch python=3.8  
conda activate pytorch  
conda install pytorch=1.8 torchvision cudatoolkit=10.2 -c pytorch  
conda install -c conda-forge tensorboardx
pip install git+https://github.com/rwightman/pytorch-image-models.git
pip install -r requirements.txt

Dataset

You can refer the README.md to prepare the dataset.

Train each classifier

Set hyperparameters and revelent training path in train.yaml and simply run train.py.

Predict via each trained classifier

You can download our pretrained model from pretrained.
To predict the orchid images by single classifier, see predict.py and run:

python predict.py --model model_name --input_dir images_folder_path --result_dir save_csv_here --weights path_to_models

Ensemble strategy

We support the code of three different ensemble methods as following:

Ensemble figures...

Average ensemble

Traditional ensemble

Resnet ensemble

However, due to the time limitation, we only use Average ensemble method to improve our performance. Traditional ensemble and Resnet ensemble cost about 8 hours to test on 81710 images by our GTX GPU 1080Ti.😱

  • Average ensemble
    Before predicting the results via average ensemble, please first check the parameters in predict_ensemble.yaml are all correctly set. And directly run:

    python predict_ensemble.py
    
  • Traditional ensemble
    Train the ensemble mlp via running train_ensemble_mlp.py.

  • Resnet ensemble
    Train the res-ensemble net via running faster_res_ensemble_train.py and predict the output label using faster_res_ensemble_test.py.

Final result

  • Score (accuracy)

    • Public dataset: 90.00%

    • Private dataset: 78.03%

    • General final score1: 81.63%

    • Specific orchids: 96.15%

      Public set Private set General final score
      Best accuracy 0.900077 0.780395 0.816300277
  • Official final leaderboard

    • Leaderboard: leaderboard pdf
    • Registration teams: 743
    • Participating teams: 275
    • Our (TEAM_482) final rank: 18-th2

Reference

Contact us

Footnotes

  1. General final score = 0.3xPublic + 0.7xPrivate

  2. Winners depend on the baseline score where general final score > 0.79