Giter Site home page Giter Site logo

kaggle_protein_classification's Introduction

This project is code of Human Protein Atlas Image Classification competition

Getting Started

  • dataset.py is self customed data loader solution independent of Deep learning frameworks.When applied in ensemble model,the last model's memory can't be released completely,thus causing increasing memeory usage.So I finally replace it with pytorch's data loader in pytorch_dataset.py.
  • resnet.py trains model.
  • transforms.py. image augmentation.
  • utils.py handles csv file,calculates class weight and splits train and validation data.
  • predict.py predicts test data

Some appcoaches taken

learning rate schedule is warm restarts,which is described in SGDR: Stochastic Gradient Descent with Warm Restarts.
bce loss combined with log-dampned weight works better.

Attention

  • If your hardware can't deal with large batch,you can try accumulating gradient tech.
for iteration,(images,labels) in enumerate(train_loader):
   images = images.cuda()
   labels = labels.cuda()
   inputs = Variable(images)
   targets = Variable(labels)
   outputs=model(inputs)
   loss=criterion(outputs,targets)
   # loss regularization
   loss = loss/accumulation_steps   
   loss.backward()
   if(iteration%accumulation_steps)==0:
       optimizer.step()        # update parameters of net
       optimizer.zero_grad()   # reset gradient
  • we trained our model only in train data,no external data nor leaked data. External data can boost about 0.1 in lb.However,someone in competition's discussion claimed that he could achieve 0.6 without external data,so we didn't take external data into consideration.
  • our final result ends with public lb 0.474,private lb 0.443,wihch is obvious not good.Because this is our first competition,we do not konw lots of techniques useful in such competition.We still have a long way to go.

kaggle_protein_classification's People

Contributors

xuzhengxiao avatar

Watchers

 avatar paper2code - bot avatar

Forkers

shaxinlei

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.