Giter VIP home page Giter VIP logo

osu-cvl / agriculture Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 28 KB

Code for "Confidence-Driven Hierarchical Classification of Cultivated Plant Stresses"

Home Page: https://openaccess.thecvf.com/content/WACV2021/papers/Frank_Confidence-Driven_Hierarchical_Classification_of_Cultivated_Plant_Stresses_WACV_2021_paper.pdf

Python 100.00%
deep-learning computer-vision confidence-estimation hierarchical-classification agriculture

agriculture's Introduction

Confidence-Driven Hierarchical Classification of Cultivated Plant Stresses

This repo contains a condensed version of the code used in the paper Confidence-Driven Hierarchical Classification of Cultivated Plant Stresses by Logan Frank, Christopher Wiegman, Dr. Jim Davis, and Dr. Scott Shearer.

The contents in this repo are organized as follows:

Code

To use our code begin with installing the necessary requirements, assuming you already have some environment with Python 3.7 and pip: pip install -r requirements.txt

You may adapt and use the code provided for training your own base classifier (run everything from the top-level of this repo):

python base_classifiers/train.py \
    --image_dir <path-to-your-dataset-according-to-pytorch-image-folder-class> \
    --network_dir <wherever-you-want-to-save-your-network-related-data> \
    --results_dir <wherever-you-want-to-save-your-results-from-training> \
    --dataset <name-of-your-dataset> \
    --name <whatever-you-want-to-name-your-experiment> \
    --network <whichever-network-you-want-to-use> \
    --batch_size <some-int> \
    --learning_rate <some-float> \
    --num_epochs <some-int> \
    --balance_dataset <whether-or-not-you-want-to-balance-the-training-dataset>

Currently, our code only supports the ResNet-18 and small CNN networks used in our paper. More can easily be added. If you choose to balance the training dataset (using instance replication), it is strongly recommended you choose a batch size that is a multiple of your number of training classes so there is the same number of examples from each class in every batch.

Once a base classifier has been trained, the approach we applied to our datasets can be ran with:

python davis/pipeline.py \
    --image_dir <path-to-your-dataset-according-to-pytorch-image-folder-class> \
    --network_path <path-to-your-base-classifier-pth-file> \
    --tree_path <path-to-your-hierarchy-txt-file> \
    --results_dir <wherever-you-want-to-save-your-results-from-training> \
    --dataset <name-of-your-dataset> \
    --name <whatever-you-want-to-name-your-experiment> \
    --network <whichever-network-you-want-to-use-as-your-base-classifier> \
    --nbins <number-of-desired-histogram-bins-for-calibration> \
    --priors <what-type-of-priors> \
    --confidence <some-float-for-confidence-threshold>

By default, we run with nbins == 10, priors == 'equal' ('data' or 'manual' can also be used), and confidence == 0.5 (confidence should be [0, 1]).

agriculture's People

Contributors

loganfrank avatar

Stargazers

 avatar

Watchers

 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.