Git Product home page Git Product logo

sahand68 / deformablecnn-planttraits Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plant-ai-biophysics-lab/deformablecnn-planttraits

0.0 0.0 0.0 1.86 MB

A deformable CNN model that accepts multiple sensor inputs and predicts multiple continuous plant trait outputs. SOTA on the 2021 Autonomous Greenhouse Challenge dataset.

License: BSD 3-Clause "New" or "Revised" License

Python 44.28% Jupyter Notebook 55.72%

deformablecnn-planttraits's Introduction

DeformableCNN-PlantTraits

Trait measurement is critical for the plant breeding and agricultural production pipeline. Typically, a suite of plant traits is measured using laborious manual measurements and then used to train and/or validate higher throughput trait estimation techniques. Here, we introduce a relatively simple convolutional neural network (CNN) model that accepts multiple sensor inputs and predicts multiple continuous trait outputs โ€“ i.e. a multi-input, multi-output CNN (MIMO-CNN). Further, we introduce deformable convolutional layers into this network architecture (MIMO-DCNN) to enable the model to adaptively adjust its receptive field, model complex variable geometric transformations in the data, and fine-tune the continuous trait outputs. We examine how the MIMO-CNN and MIMO-DCNN models perform on a multi-input (i.e. RGB + depth images), multi-trait output lettuce dataset from the 2021 Autonomous Greenhouse Challenge. Ablation studies were conducted to examine the effect of using single versus multiple inputs, and single versus multiple outputs. The MIMO-DCNN model resulted in a normalized mean squared error (NMSE) of 0.068; a substantial improvement over the top 2021 leaderboard score of 0.081.

See accepted 2022 AAAI AI for Ag and Food Systems workshop paper here Simultaneously Predicting Multiple Plant Traits from Multiple Sensors via Deformable CNN Regression.

Training

Either use train.py or run the training cells in the example notebook. Change hyperparameters and training options accordingly.

Evaluation

Either use eval.py or run the evaluation cells in the example notebook. Keep in mind that these cells require ground-truth values in order to quntify error. For deployment, load the image, load the model, pass the image through the model, and the model will output continuous plant traits values.

Training a model with custom data

In order to use this implementation with custom data, create a json file with the following format:

{
    "image": {
        "0": "RGB_27.png",
        "1": "RGB_79.png"
    },
    "depth_image": {
        "0": "Depth_27.png",
        "1": "Depth_79.png"
    },
    "outputs": {
        "0": {
            "regression": {
                "FreshWeightShoot": 5.5,
                "DryWeightShoot": 0.42,
                "Height": 9.0,
                "Diameter": 11.0,
                "LeafArea": 153.9
            },
            "classification": "Lugano"
        },
        "1": {
            "regression": {
                "FreshWeightShoot": 30.3,
                "DryWeightShoot": 1.92,
                "Height": 8.8,
                "Diameter": 20.2,
                "LeafArea": 582.3
            },
            "classification": "Lugano"
        }
    }
}

This file for this template is provided in the repo and is called template.json. This example has two datapoints, which each have an rgb and depth image along with 5 regression outputs; FreshWeightShoot, DryWeightShoot, Height, Diameter, LeafArea and one class output, Variety. The classification output is optional and can be left blank. Just change image names (RGB_27.png), variables names (FreshWeightShoot) and variable values (5.5) according to your data. You are free to any number of regression variables/outputs.

After creating the JSON file, change the paths of RGB_Data_Dir, Depth_Data_Dir and JSON_Files_Diraccording to your data.

Acknowledgments

This project was partly funded by the National AI Institute for Food Systems (AIFS).

deformablecnn-planttraits's People

Contributors

hkaman7 avatar masonearles avatar pranav-raja-scale avatar pranavraja99 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.