--- license: mit library_name: transformers datasets: - heesup/Cowpea-Architecture-XML tags: - plant-architecture - vision-encoder-decoder - dinov2 - gpt2 - cowpea - 3d-reconstruction - helios --- # Image2PlantArchitecture: DINOv2-Base (448x448, Multi-View RGB) + GPT-2-Medium [![Paper](https://img.shields.io/badge/Paper-Frontiers%20in%20AI-blue)](https://www.frontiersin.org/journals/artificial-intelligence/articles/10.3389/frai.2026.1844338/full) [![DOI](https://img.shields.io/badge/DOI-10.3389%2Ffrai.2026.1844338-green)](https://doi.org/10.3389/frai.2026.1844338) [![arXiv](https://img.shields.io/badge/arXiv-2603.22622-b31b1b)](https://arxiv.org/abs/2603.22622) [![GitHub](https://img.shields.io/badge/Code-GitHub-black)](https://github.com/GEMINI-Breeding/Image2PlantArchitecture) [![Dataset](https://img.shields.io/badge/Dataset-Hugging%20Face-yellow)](https://huggingface.co/datasets/heesup/Cowpea-Architecture-XML) 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](https://huggingface.co/datasets/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](https://github.com/GEMINI-Breeding/Image2PlantArchitecture) for the custom `PlantArchitectureModel` class and tokenizer/XML conversion utilities: ```python 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 ```bibtex @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} } ```