Skip to content

0YJ/TomatoMAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

TomatoMAP: Tomato Multi-Angle Multi-Pose Dataset for Fine-Grained Phenotyping

A Novel Dataset for Tomato Fine-Grained Phenotyping

Homepage paper GitHub Code Dataset Visitor


TomatoMAP is a novel dataset generated from our multi camera array based on findability, accessibility, interoperability, and reusability (FAIR). The data generation and annotation take two years with multiple domain experts. TomatoMAP includes three subsets, TomatoMAP-Cls, TomatoMAP-Det and TomatoMAP-Seg for 50 BBCH classification, 7 main area detection, and 10 classes instance segmentation for fine-grained phenotyping. The dataset has also unique 3D modeling potential for further research.

If you need any help, submit a ticket via GitHub Issues.

πŸ“œ License

  • TomatoMAP dataset is released under CC BY 4.0. Commercial use requires permission.
  • TomatoMAP code space is released under Apache 2.0.

πŸ“’ Updates

  • 2025-07-15 For KIDA Conference, arXiv was available
  • 2025-07-18 e!DAL dataset DOI is claimed
  • 2025-07-23 Code repo was turned to public
  • 2025-07-24 Submitted to Nature
  • 2026-02-17 Accepted by Nature
  • 2026-02-24 e!DAL dataset DOI is published
  • 2026-02-24 Code space is optimized from private branch

🌠 Coming Soon

  • Update homepage
  • Code for our IoT Datastation
  • TomatoMAP Plus (TomatoMAP+), a fancy follow-up project

🀝Cooperation

If you are interested to contribute to our work, please feel free to contact us.

✨ Getting Started

Our code is tested under the following environment details:

  • OS: Ubuntu 20.04.6 LTS
  • GPU: Tesla V100-PCIE-16GB
  • NVIDIA Driver: 575.57.08
  • CUDA Toolkit: 12.6
  • Python: 3.10.19 (conda)
  • PyTorch: 2.4.0
  • TorchVision: 0.19.0

For Detectron2 compilation with CUDA 12.6, use gcc/g++ 13 in conda env (newer GCC, e.g. 14, may fail with nvcc host compiler checks).

❀Expand details❀

Requirements

We suggest using conda for env management.

git clone https://github.com/0YJ/TomatoMAP.git --recursive
cd TomatoMAP
conda env create --file environment.yml
conda activate TomatoMAP
pip install -e submodules/ultralytics/ --no-build-isolation --no-deps
pip install -e submodules/detectron2/ --no-build-isolation --no-deps

We use notebook as TomatoMAP builder.

jupyter notebook
# Then open the notebook, follow our pipeline (you may need to adjust the path based on your system).

unzip TomatoMAP dataset you downloaded from our e!DAL repo under repository root:

unzip TomatoMAP.zip
mv TomatoMAP_builder.ipynb TomatoMAP

Then follow the guide under TomatoMAP_builder.ipynb to finish the dataset setup. Finally your project folder should look like this:

Project Structure

TomatoMAP/
β”œβ”€β”€ main.py                        # Main entry
β”œβ”€β”€ README.md                      # Project documentation
β”œβ”€β”€ environment.yml                # Environment definition
β”œβ”€β”€ configs/
β”‚   └── det/                       # Detection configs
β”‚       β”œβ”€β”€ TomatoMAP-Det.yaml
β”‚       └── best_hyperparameters.yaml
β”œβ”€β”€ src/                           # Core source functions
β”‚   β”œβ”€β”€ cls_trainer.py
β”‚   β”œβ”€β”€ det_trainer.py
β”‚   β”œβ”€β”€ det_balanced_trainer.py
β”‚   β”œβ”€β”€ seg_trainer.py
β”‚   β”œβ”€β”€ datasets/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ cls/
β”‚   └── avh/
β”œβ”€β”€ submodules/                    # External dependencies
β”‚   β”œβ”€β”€ ultralytics/
β”‚   └── detectron2/
β”œβ”€β”€ TomatoMAP/                     # Dataset root directory
β”‚   β”œβ”€β”€ TomatoMAP_builder.ipynb    # Dataset builder notebook
β”‚   β”œβ”€β”€ metadata                   # meta data for dataset
β”‚   β”œβ”€β”€ img                        # raw TomatoMAP data subdivision
β”‚   β”œβ”€β”€ labels                     # raw ToamtoMAP data label subdivision
β”‚   β”œβ”€β”€ BBCH_classification.xlsx   # ToamtoMAP BBCH classification label
β”‚   β”œβ”€β”€ TomatoMAP-Cls/             # Classification subset
β”‚   β”œβ”€β”€ TomatoMAP-Det/             # Detection subset
β”‚   └── TomatoMAP-Seg/             # Segmentation subset
└── outputs/                       # Training outputs (created automatically)

Usage

Classification Training

Train a classification model on TomatoMAP-Cls dataset:

# default training with MobileNetV3-Large
python main.py cls --data-dir ./TomatoMAP/TomatoMAP-Cls --epochs 100

# options
python main.py cls \
    --data-dir ./TomatoMAP/TomatoMAP-Cls \
    --model mobilenet_v3_large \
    --epochs 100 \
    --batch-size 32 \
    --lr 1e-4 \
    --img-size 640 640 \
    --patience 5 \
    --output-dir outputs/cls/experiment1

Available models:

  • mobilenet_v3_large (default)
  • mobilenet_v3_small
  • mobilenet_v2
  • resnet18

Detection Training

Train a YOLO model on TomatoMAP-Det dataset:

# default training with YOLO11-Large
python main.py det --data-config ./configs/det/TomatoMAP-Det.yaml --epochs 500

# options
python main.py det \
    --data-config ./configs/det/TomatoMAP-Det.yaml \
    --model yolo11l.pt \
    --epochs 500 \
    --img-size 640 \
    --batch-size 4 \
    --patience 10 \
    --device 0 \
    --output-dir outputs/det/experiment1 \
    --hyperparams ./configs/det/best_hyperparameters.yaml

# enable class-balanced weighted sampling
python main.py det \
    --data-config ./configs/det/TomatoMAP-Det.yaml \
    --model yolo11l.pt \
    --balanced-sampling

Segmentation Training

Train a Mask R-CNN FPN based model on TomatoMAP-Seg dataset:

# training
python main.py seg train \
    --data-dir ./TomatoMAP/TomatoMAP-Seg \
    --model COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
    --epochs 100 \
    --lr 0.0001 \
    --batch-size 4 \
    --patience 5

# evaluation
python main.py seg eval \
    --data-dir ./TomatoMAP/TomatoMAP-Seg \
    --model-path model_best.pth \
    --output-dir outputs/seg

# visualization
python main.py seg vis \
    --data-dir ./TomatoMAP/TomatoMAP-Seg \
    --model-path model_best.pth \
    --n 5 \
    --output-dir outputs/seg

# dataset information
python main.py seg info --data-dir ./TomatoMAP/TomatoMAP-Seg

# analyze object size (small, big, middle)
python main.py seg analyze --data-dir ./TomatoMAP/TomatoMAP-Seg

Available models:

  • COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml
  • COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml
  • COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml
  • COCO-InstanceSegmentation/mask_rcnn_X_101_32x8d_FPN_3x.yaml

Dataset Preparation

Classification Dataset Structure

TomatoMAP-Cls/
β”œβ”€β”€ train/
β”‚   β”œβ”€β”€ BBCH class1/
β”‚   β”‚   β”œβ”€β”€ img1.jpg
β”‚   β”‚   └── ...
β”‚   └── BBCH class2/
β”‚       └── ...
β”œβ”€β”€ val/
β”‚   └── ...
└── test/
    └── ...

Detection Dataset Structure

TomatoMAP-Det/
β”œβ”€β”€ images
└── labels

Segmentation Dataset Structure

TomatoMAP-Seg/
β”œβ”€β”€ images/               # All images
β”‚   β”œβ”€β”€ img1.JPG
β”‚   └── ...
β”œβ”€β”€ labels/               # All labels in COCO format
    β”œβ”€β”€ isat.yaml         # Label and class configuration
    └── img1.json

🀝 Acknowledgements

This project is powered by the de.NBI Cloud within the German Network for Bioinformatics Infrastructure (de.NBI) and ELIXIR-DE (Research Center JΓΌlich and W-de.NBI-001, W-de.NBI-004, W-de.NBI-008, W-de.NBI-010, W-de.NBI-013, W-de.NBI-014, W-de.NBI-016, W-de.NBI-022), Ultralytics YOLO, Meta Detectron2, ISAT, and LabelStudio. Thanks to JetBrains for supporting us with licenses for their tools.

JetBrains logo. Β Β Β Β  denbi logo.

🌟 Star History

Like our project? Hit that star button at the top right and be our hero! We’ll serve you more open sauce! 🍲

πŸ–Š Citation

If you use TomatoMAP in your research and think our project is useful, please cite:

@article{Zhang2026,
   title = {Tomato Multi-Angle Multi-Pose Dataset for Fine-Grained Phenotyping},
   author = {Yujie Zhang and Sabine Struckmeyer and Andreas Kolb and Sven Reichardt},
   issn = {2052-4463},
   issue = {1},
   journal = {Sci Data},
   month = {2},
   pages = {309},
   volume = {13},
   year = {2026},
   doi = {https://doi.org/10.1038/s41597-026-06926-9}
}

@dataset{tomatomap,
   title={TomatoMAP: Tomato Multi-Angle Multi-Pose Dataset for Fine-Grained Phenotyping},
   author={Yujie Zhang and Sabine Struckmeyer and Andreas Kolb and Sven Reichardt},
   journal={e!DAL-Plant Genomics and Phenomics Research Data Repository (PGP)},
   year={2025},
   doi={https://doi.org/10.5447/ipk/2025/14}
}

About

TomatoMAP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors