Image2PlantArchitecture: DINOv2-Base (448x448, Multi-View RGB) + GPT-2-Medium

Paper DOI arXiv GitHub Dataset

This is the best-performing checkpoint from the paper "A vision language model for generating XML-based organ-level plant architecture representations of cowpea from simulated images" (Frontiers in Artificial Intelligence, 2026).

Model Details

  • Vision Encoder: facebook/dinov2-base (ViT-B, frozen during training)
  • Text Decoder: gpt2-medium (with cross-attention)
  • Input Resolution: 448 x 448 RGB
  • View Configuration: Multi-view (top-down + 3 side views)
  • Training Dataset: heesup/Cowpea-Architecture-XML (train plots 0000–7999, val plots 8000–8999, seed 42)

Evaluation Results (4,000 Test Samples, Plots 9000–9099)

Metric Score
BLEU-4 94.00%
ROUGE-L 0.5182
Leaf Area MAPE 3.2%
Leaf Count MAPE 4.1%

Usage

See the GitHub repository for the custom PlantArchitectureModel class and tokenizer/XML conversion utilities:

import torch
from models.model import PlantArchitectureModel
from src.plant_tokenizer import token2vec, SOS_TOKEN, EOS_TOKEN, PAD_TOKEN
from src.string_to_xml_to_vec import vec2xml
from src.linked_xml_to_recursive_xml import recursive_to_linked, pretty_print_xml

checkpoint_path = "heesup/dinov2-base_448_RGB_Sideview_gpt2-medium"
model = PlantArchitectureModel.from_pretrained(checkpoint_path, torch_dtype=torch.float16).to("cuda")
model.eval()

with torch.no_grad():
    with torch.cuda.amp.autocast():
        result = model.generate(
            pixel_values,
            decoder_start_token_id=SOS_TOKEN,
            decoder_input_ids=plant_info,
            eos_token_id=EOS_TOKEN,
            pad_token_id=PAD_TOKEN,
            max_length=4096 * 2,
            repetition_penalty=1.1,
            use_cache=True,
        )
        result_tokens = result.squeeze().cpu().numpy()[6:]

plant_vec = token2vec(result_tokens)
plant_xml = recursive_to_linked(vec2xml(plant_vec))
plant_xml_str = pretty_print_xml(plant_xml)

Citation

@article{yun2026vision,
  title={A vision language model for generating XML-based organ-level plant architecture representations of cowpea from simulated images},
  author={Yun, Heesup and Uyehara, Isaac Kazuo and Droutsas, Ioannis and Ranario, Earl and Diepenbrock, Christine H. and Bailey, Brian N. and Earles, J. Mason},
  journal={Frontiers in Artificial Intelligence},
  volume={9},
  pages={1844338},
  year={2026},
  doi={10.3389/frai.2026.1844338},
  url={https://www.frontiersin.org/journals/artificial-intelligence/articles/10.3389/frai.2026.1844338/full}
}
Downloads last month
-
Safetensors
Model size
0.5B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train heesup/dinov2-base_448_RGB_Sideview_gpt2-medium

Paper for heesup/dinov2-base_448_RGB_Sideview_gpt2-medium