Git Product home page Git Product logo

transgrow's Introduction

TransGrow

Teaser image Picture: Generate realistic inter- and extrapolations for irregular plant time series.

Time dependent Image Generation of Plants from Incomplete Sequences with CNN-Transformer (GCPR 22)

Requirements

A suitable conda environment can be installed from the provided package file environment.yml

conda env create -f environment.yaml
conda activate transgrow

Configurations

This project is structured in such a way that all adjustable variables are stored in two configuration files as dictionary.
For any details to the variables, please have a look into these files.

  • Model training: ./configs/config_main_transgrow.py
  • Model testing: ./configs/config_test_transgrow.py

Data

General

In the following, we always use the term plant images to refer not only to datasets containing images with single plants, but also to field patches or satellite images that show a region of multiple plants per image.

The plant images must be sorted as a multi-temporal time series in folders. This means that for each plant/region a folder exists that contains images of all available time points of this plant/region.

The images should be of quadratic size and the file names must contain at least one date, or even date+time, if modeling unit is to be finer than daily. From this time information, the temporal positions are calculated. The number of images per time series is flexible, i.e. not every time point has to exist for every plant. All plants are divided into train, val, and test set.

./
└── data
  ├── MixedCrop  
  | ├── train
  |   ├── plant_01
  |   | ├── plant_01_2022-09-10.png
  |   | ├── plant_01_2022-09-12.png
  |   | ├── plant_01_2022-09-16.png
  |   | └── ...
  |   ├── plant_02
  |   | ├── plant_02_2022-09-10.png
  |   | ├── plant_02_2022-09-15.png
  |   | └── ...
  | ├── val
  |   ├── plant_03
  |   | ├── plant_03_2022-09-12.png
  |   | ├── plant_03_2022-09-16.png
  |   | └── ...      
  | └── test
  |   ├── plant_04
  |   | ├── plant_04_2022-09-10.png
  |   | ├── plant_04_2022-09-12.png
  |   | └── ...
  ├── Arabidopsis
  └── ...

Use Arabidopsis or MixedCrop data

Please find here a small, multi-temporal sorted subsets of the Arabidopsis 'abd' and the MixedCrop 'mix' dataset.

  • Change in ./configs/config_main_transgrow.py:

      cfg['data_name'] = 'abd' # or 'mix'
    

Training

To train a TransGrow model run

python main_transgrow.py

Thereby the settings from ./configs/config_main_transgrow.py are used. To resume a previous training, please enter the experiment name there and ensure, that architecture parameters are consistent.

Testing

To test a previously trained model run

python test_transgrow.py

You need to specify at least the log dir and the experiment name which you want to evaluate in ./configs/config_test_transgrow.py

About the rest: Per default all parameters used to train the model are also used for testing. But one advantage of TransGrow is that especially the data parameters (e.g. the number of input frames, or the time interval between them) can differ from training. So configuration parameters, which control the shape of the data, can be updated here as desired.

Further Notes

MS-SSIM values in the paper are calculated with the normalized MS-SSIM (stabilizes the training), while the current repo for score calculation in the script test_transgrow.py has been switched to the non-normalized MS-SSIM calculation.

Citation

@InProceedings{drees2022time,
  author    = {Drees, Lukas and Weber, Immanuel and Ru{\ss}wurm, Marc and Roscher, Ribana},
  title     = {Time Dependent Image Generation of Plants from Incomplete Sequences with CNN-Transformer},
  booktitle = {Proc.~of the DAGM German Conference on Pattern Recognition (GCPR)},
  year      = {2022},
  editor    = {Andres, Bj{\"o}rn and Bernard, Florian and Cremers, Daniel and Frintrop, Simone and Goldl{\"u}cke, Bastian and Ihrke, Ivo},
  pages     = {495--510},
  address   = {Cham},
  publisher = {Springer International Publishing},
  doi       = {10.1007/978-3-031-16788-1_30},
}

transgrow's People

Contributors

luked12 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fanxingrong

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.