Giter Club home page Giter Club logo

nabirds's Introduction

Falco

Deep Learning on Cornell's NABirds Dataset

This repository contains code to accompany the article This Model is For the Birds

The article deals with experiments performed using classification models build with Cornell's NABirds dataset.

The code consists of three parts:

  • Creating the tfrecord files

  • Training the model.

  • Model evaluation.

In the article, three sizes of EfficientNet and the corresponding image resolutions are considered. Any one of the eight EfficientNet sizes can be trained from this respository, and each size model can be trained with any of the eight image resolutions.

I recommend running code in a clean environment. My own experiments were done in Google Colab; if you don't require a TPU a virtual environment with TensorFlow should be sufficient. I would not recommend trying to train or test without at least a GPU.

Samples of how to run the three components are below.

Making records.

This code converts the images in NABIRDS_DIR to tfrecord shards containing up to FILE_SIZE records each, writing progress to the console every 1000 records.

python make_tfrecord.py -l --dir ${NABIRDS_DIR} \
                        --size ${FILE_SIZE} \                    

Training the Model

This code trains an EfficientNetB0 model using the default image size for EfficientNetB3 (higher resoluton improves accuracy.) This uses the default learning rate of 1e-3, decayed 0.94 every 4 epochs, the default Adam optimizer, and the default pretrained ImageNet weights.

python train_model.py --dir ${NABIRDS_DIR}\
                      --enet 0 \
                      --res 3 \
                      --epoch 300

Model Evaluation

This code evaluates the model trained above. There are four possible ways to choose testing data, here I choose to use the bounding box crop to evaluate, but rescaled to match the training input size.

python test_model.py --dir ${NABIRDS_DIR}\
                      --enet 0 \
                      --res 3 \
                      --crop

nabirds's People

Contributors

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