Home

Awesome

SwinOCSR

Install

Please see INSTALL.md

Datasets

Image

The our datasets are available in SMILES format to generate images

Download form "dataset"

User cdk/src/main/java/GenerateBatchimage to generate the images
User Binary_images to generate binary images

Saving binary images to "Data/500wan/500wanBinarizationPNG/"

Label

download form https://www.kaggle.com/gogogogo11/datasetlabel

The directory Data should look like:

Data
├── 500wan
│   ├── 500wanBinarizationPNG
│   ├── 500wan_shuffle_DeepSMILES_test_category_0.pkl
│   ├── 500wan_shuffle_DeepSMILES_test_category_1.pkl
│   ├── 500wan_shuffle_DeepSMILES_test_category_2.pkl
│   ├── 500wan_shuffle_DeepSMILES_test_category_3.pkl
│   ├── 500wan_shuffle_DeepSMILES_test_length_0.pkl
│   ├── 500wan_shuffle_DeepSMILES_test_length_1.pkl
│   ├── 500wan_shuffle_DeepSMILES_test_length_2.pkl
│   ├── 500wan_shuffle_DeepSMILES_test_length_3.pkl
│   ├── 500wan_shuffle_DeepSMILES_test.pkl
│   ├── 500wan_shuffle_DeepSMILES_train.pkl
│   ├── 500wan_shuffle_DeepSMILES_val.pkl
│   ├── 500wan_shuffle_DeepSMILES_word_map

Trained models

NameAccuracyTanimotoModel
Swin Transformer(ce loss)0.97360.9965https://www.kaggle.com/gogogogo11/moedel
ResNet-500.89170.9879https://www.kaggle.com/gogogogo11/moedel
EfficientNet-B30.86700.9846https://www.kaggle.com/gogogogo11/moedel
Swin Transformer(focal loss)0.98580.9977https://www.kaggle.com/gogogogo11/moedel

Train model

this is a example for Swin-transformer-celoss
cd model/Swin-transformer-celoss
CUDA_VISIBLE_DEVICES="0,1,2,3" python -m torch.distributed.launch --nproc_per_node 4 --master_port 29500 main.py   --resume <checkpoint-file> 


Eval model

this is a example for Swin-transformer-celoss
cd model/Swin-transformer-celoss
CUDA_VISIBLE_DEVICES="0" python -m torch.distributed.launch --nproc_per_node 1 --master_port 29500 main.py --eval  --resume <checkpoint-file> --test_dir <label-file>


How to run the Swin Transformer (focal loss) model on images