Git Product home page Git Product logo

1st-place-don-t-stop-until-you-drop's Introduction

1st place solution don't stop until you drop

This repository represents open-source research developed by Seffi Cohen, Niv Goldshlager, Nurit Cohen Inger and Or Katz , for the 1st place solution to the kaggle days championship - Don't stop until you drop!

Train + Inferance

  1. run train_p2_swin_large_patch4_window12_384.ipynb
  2. run train_p2_swin_base_patch4_window12_384.ipynb
  3. run inferance_swin_large_patch4_window12_384-final.ipynb

TL;DR

  1. Swin transform (large and base) image size 384
  2. 5-fold class blanced
  3. Scheduler - 'CosineAnnealingWarmRestarts'
  4. Soft transforms
def get_transforms(*, data):
    
    if data == 'train':
        return Compose([
            Resize(CFG.size, CFG.size),
            albumentations.HorizontalFlip(p=0.5),
            albumentations.RandomBrightness(limit=0.2, p=0.75),
            albumentations.RandomContrast(limit=0.2, p=0.75),
            HorizontalFlip(p=0.5),
            albumentations.HueSaturationValue(hue_shift_limit=40, sat_shift_limit=40, val_shift_limit=0, p=0.75),
            albumentations.ShiftScaleRotate(shift_limit=0.2, scale_limit=0.3, rotate_limit=5, border_mode=0, p=0.75),
            CutoutV2(max_h_size=int(CFG.size * 0.2), max_w_size=int(CFG.size * 0.2), num_holes=1, p=0.75),# VerticalFlip(p=0.5),
            # ShiftScaleRotate(p=0.5),
            Normalize(
                mean=[0.485, 0.456, 0.406],
                std=[0.229, 0.224, 0.225],
            ),
            ToTensorV2(),
        ])

    elif data == 'valid':
        return Compose([
            Resize(CFG.size, CFG.size),
            Normalize(
                mean=[0.485, 0.456, 0.406],
                std=[0.229, 0.224, 0.225],
            ),
            ToTensorV2(),
        ])
  1. Ensemble swin-l and swin-b (4 folds from l and 2 from b)
  2. Config
class CFG:
    debug=False
    apex=False
    print_freq=100
    num_workers=8
    model_name='swin_large_patch4_window12_384'
    size=384
    scheduler='CosineAnnealingWarmRestarts' # ['ReduceLROnPlateau', 'CosineAnnealingLR', 'CosineAnnealingWarmRestarts']
    epochs=8
    #factor=0.2 # ReduceLROnPlateau
    #patience=4 # ReduceLROnPlateau
    #eps=1e-6 # ReduceLROnPlateau
    #T_max=10 # CosineAnnealingLR
    T_0=10 # CosineAnnealingWarmRestarts
    lr=1e-4
    min_lr=1e-6
    batch_size=12
    weight_decay=1e-6
    gradient_accumulation_steps=1
    max_grad_norm=1000
    seed=42
    target_size=6
    target_col='class_6'
    n_fold=5
    trn_fold=[0, 1, 2, 3, 4]
    train=True
    inference=False
  1. Results:
model Private Score Public Score
swin-l-5-folds 0.96699 0.95364
swin-b-5-folds 0.95379 0.94260
ensemble 0.96039 0.95805

References

https://www.kaggle.com/yasufuminakama/cassava-resnext50-32x4d-starter-training

1st-place-don-t-stop-until-you-drop's People

Contributors

orkatz7 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.