Git Product home page Git Product logo

conus-classification-theano's Introduction

Conus Classification with Lasagne/Theano

Author Ignacio Heredia, Lara Lloret Iglesias

Date August 2018

This repository contains the code used to train a ResNet50 convolutional network on conus classification. Here is the paper describing the work (arxiv version).

Contents

  • ./data Data files
  • ./plan_classification Core code
  • ./webpage Independent folder which contains the essential files/functions to run a simple webpage to host your trained net and make predictions. For example the conus classification app is running at http://deep.ifca.es/.

This has been tested in Ubuntu 14.04 with Python 2.7.12 with the Anaconda 4.2.0 (64-bit) distribution, Theano 0.9.0.dev2 and Lasagne 0.2.dev1.

Resusing this framework

This framework is quite flexible to retrain a ResNet50 with your image dataset (in .jpg format).

1) Providing the dataset files

First you need add to the ./data/data_splits path the files:

Mandatory files

  • synsets.txt
  • train.txt

Optional files

  • val.txt
  • test.txt
  • tags.txt

The train.txt, val.txt and test.txt files associate an image to a label number (that has to start at zero). The synsets.txt file translates those label numbers to label names. Finally the tags.txt enables you to provide a tag to each training image to custom the data augmentation operations you apply to each image (see the docstring of the data_augmentation function in the ./plan_classification/data_utils.py file).

You can find examples of these files at ./data/data_splits/dataset_demo.

2) Downloading the pretrained model

You have to download the Lasagne Model Zoo pretrained weights with ImageNet from here and copy them to ./data/data_splits/pretrained_weights.

3) Launching the training

Then you can launch the training executing ./plan_classification/train_runfile.py once you have updated the parameters of the training inside the script (like the number of epochs, the folder path containing your images, etc). If you want to train with gpu you should create a .theanorc file in your ~ dir with a content similar to the following:

[global]
device=gpu
floatX=float32
[cuda]
root = /usr/local/cuda-8.0
[lib]
cnmem=.75

The weights of the trained net will be stored in ./conus_classification/training_weights (in an .npz file) and the training information in ./plan_classification/training_info (in a .json file).

To learn how to use your freshly trained conus_classification for making predictions or plotting your training information, take a look at ./plan_classification/test_scripts/test_demo.py. If you prefer to have a graphical interface, you can run a simple webpage to query your model. For more info check the webpage docs.

References

conus-classification-theano's People

Contributors

laramaktub avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.