[Paper Review] From Image to UML: First Results of Image Based UML Diagram Generation Using LLMs
This paper evaluates the capability of visual Large Language Models (LLMs) to convert hand-drawn or image-based UML class diagrams into formal, machine-readable PlantUML code. Using GPT-4V and other multimodal LLMs, the study finds that while results are promising and usable in model-driven engineering pipelines, performance varies significantly by model and requires human-in-the-loop validation due to limitations in accuracy and consistency.
In software engineering processes, systems are first specified using a modeling language such as UML. These initial designs are often collaboratively created, many times in meetings where different domain experts use whiteboards, paper or other types of quick supports to create drawings and blueprints that then will need to be formalized. These proper, machine-readable, models are key to ensure models can be part of automated processes (e.g. input of a low-code generation pipeline, a model-based testing system, ...). But going from hand-drawn diagrams to actual models is a time-consuming process that sometimes ends up with such drawings just added as informal images to the software documentation, reducing their value a lot. To avoid this tedious task, we explore the usage of Large Language Models (LLM) to generate the formal representation of (UML) models from a given drawing. More specifically, we have evaluated the capabilities of different LLMs to convert images of UML class diagrams into the actual models represented in the images. While the results are good enough to use such an approach as part of a model-driven engineering pipeline we also highlight some of their current limitations and the need to keep the human in the loop to overcome those limitations.
Motivation & Objective
- To investigate whether visual LLMs can accurately convert images of UML class diagrams into formal, machine-readable models.
- To address the challenge of transforming informal, hand-drawn software design sketches into structured, reusable models for low-code and model-driven engineering pipelines.
- To assess the feasibility and limitations of using LLMs as intermediaries in the transition from informal sketches to formal software models.
Proposed method
- The study uses a set of 10 hand-drawn UML class diagrams as input images for evaluation.
- Multiple visual LLMs—including GPT-4V, Gemini Pro, and CogVLM—were prompted to generate PlantUML code from the same images.
- The generated PlantUML code was evaluated for correctness and completeness based on semantic fidelity to the original diagrams.
- A prompt engineering strategy was applied to improve output consistency and reduce syntax errors.
- Results were analyzed through qualitative interpretation due to the black-box nature of LLMs.
- A prototype tool, BESSER, was implemented to support image-to-UML conversion using GPT-4V via the OpenAI API.

Experimental results
Research questions
- RQ1Can visual LLMs accurately and completely reconstruct UML class diagrams from image inputs?
- RQ2How do different visual LLMs compare in terms of correctness and completeness when generating PlantUML code from UML diagram images?
- RQ3What role does prompt engineering play in improving the reliability of LLM-based UML generation?
- RQ4To what extent can the generated models be used in downstream software engineering processes like code generation or model validation?
- RQ5How essential is human-in-the-loop validation for ensuring model quality in this pipeline?
Key findings
- GPT-4V produced the most accurate and complete PlantUML code among the evaluated LLMs, demonstrating superior performance in image-to-UML conversion.
- Other models like Gemini Pro and CogVLM showed lower consistency and higher error rates, particularly in handling complex diagram elements.
- Despite good overall results, the LLMs exhibited nondeterministic behavior, with output variation even for the same input image and prompt.
- Syntax errors were common across models, though they were relatively stable per model across repeated trials.
- The study confirms that while LLMs can serve as effective converters in a model-driven engineering pipeline, human validation remains critical for ensuring correctness.
- The BESSER platform successfully integrates image-to-UML functionality using GPT-4V, enabling end-to-end transformation from image to executable model.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.