Code Monkey home page Code Monkey logo

datascience-bowl's Introduction

Python start guide for data science bowl

The following set of scripts should be a good way to get started with Convolution Neural Networks. It uses a GraphLab-Create's deep learning which is based on CXXNet.

This attempt is a modified version of https://github.com/srikris/datascience-bowl. https://github.com/srikris/datascience-bowl achieved a Public Leaderboard score of 0.93.

  • Setup time: ~30 mins
  • Train and submit creation time: ~3 hours 40 mins on a GRID K520 GPU
  • Validation score: 0.84 (72%)
  • Public Leaderboard score: 0.85

Solution

Here is a quick summary of the submission:

  • Load images into an SFrame (scalable dataframe).
  • Use Pillow to augment the data with rotations with angle 90, 180, and 270.
  • Setup a simple deep learning architecture (based on antinucleon)
  • Create a "fair" train, validaiton split to make sure the classes are balanced.
  • Train a deep learning model.
  • Evaluate the multi-class log loss score.
  • Save the predictions in Kaggle's format into a submission file called "submission.csv".

Install

CPU instructions

pip install -r requirements.pip

GPU instructions

pip install -r requirements-gpu.pip

Data

Let us assume that you have the data downloaded into two folders called train and test. You can do that as follows: (You will probably need a cookie file, so just download it from the website.)

wget https://www.kaggle.com/c/datasciencebowl/download/train.zip
wget https://www.kaggle.com/c/datasciencebowl/download/test.zip
wget http://www.kaggle.com/c/datasciencebowl/download/sampleSubmission.csv.zip
unzip train.zip
unzip test.zip
unzip sampleSubmission.csv.zip

Morphological dataset

Use the grayscale images in train/ and test/ to produce RGB images that consist of 3 channels, the original grayscale image and two basic morphological operations on the original images, like tophat and bottomhat.

Use gen_train.py and gen_test.py to create a new dataset, change the folder locations to match your train/ and test/ parent directory.

Train dataset creation: 5 minutes

python gen_train.py

Test dataset creation: 25 minutes

python gen_test.py

Make submission

Now run the following script. The script will create a submission file. Change the folder locations in the script to point to your new morphological dataset locations, and to the unzipped sampleSubmission.csv

python make_submission.py

datascience-bowl's People

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.