节点文献
基于YOLO与图注意力网络的端到端UML类图模块化方案
End-to-End UML Class Diagram Modularization Solution Based on YOLO and Graph Attention Network
【作者】 徐立;
【导师】 伍赛;
【作者基本信息】 浙江大学 , 计算机技术, 2025, 硕士
【摘要】 统一建模语言(Unified Modeling Language,UML)目前在软件工程领域的应用越来越广泛,已成为开发团队进行系统设计和架构的重要工具。近年来,随着软件系统规模的持续扩张,UML类图模型的复杂性不断增加,这不仅使得开发人员在理解和维护模型时遇到困难,还将导致开发过程中的错误和时间浪费,严重影响项目的进度和质量。在这种背景下,UML类图模型的模块化显得尤为重要。模块化是将一个大型模型划分为多个独立的子模块的过程,能够帮助解决UML类图模型因规模扩大而产生的复杂性问题,使得开发人员更快速、准确地理解模型需求与架构,减少因模型复杂而导致的开发错误与时间浪费,提升工作效率。现有模块化方案在输入模态和信息利用方面存在显著局限性,无法有效应对大型复杂UML类图模型的挑战:一方面,缺乏对图像模态数据的直接处理能力,导致其在处理仅有图像形式的UML类图模型时面临挑战;另一方面,无法充分利用UML类图模型中蕴含的丰富信息,使得模块化结果的质量受到限制。针对上述局限性,本研究旨在通过一种端到端的UML类图模型模块化方案,以期能直接从图像格式的UML类图模型得到优化的模块化结果。本研究首先提出了一种基于YOLO增强的UML类图信息提取方法(YOLO-Enhanced UML class diagram Information Extraction,YOLO-UE),该方法基于YOLO算法构建目标检测模型来识别UML类图图像中的元素,如类矩形、关系类型符号,再通过经典图像处理算法提取图像中的结构信息与关系信息,最终输出对应的UML类图模型信息,克服了传统方法无法直接处理图像输入的局限性。其次,本研究提出了一种基于类相关度的模块化方法(Class-Correlation based Modularization,CCM),该方法提出了类相关度的概念,用于衡量类图中各个类之间功能或语义上的关联强度,同时基于类相关度的概念对图注意力网络(Graph Attention Network,GAT)的注意力机制进行改进,使其能够动态学习类图模型中类与类之间的语义关联,输出富含语义信息的节点嵌入表示,最终通过K-means聚类算法得到可靠的模块化结果,解决了传统方法在UML类图信息利用方面的痛点。本研究基于Lindholmen数据集,与多种先进方法进行对比,并在多个指标上进行了大量实验评估。实验结果表明,在不同场景的UML类图信息提取任务上,YOLO-UE方法相较于基准方法在F1分数、平均精度均值(Mean Average Precision,mAP)和平均推理时间上分别提升了至少34.3%,53.1%和4.78倍,且在高度干扰和复杂程度更高的场景下也有更低的性能衰减,显示出更强的鲁棒性和泛用性;在UML类图模型模块化任务上,相比其他基准方法,CCM方法在多个模块化质量指标上表现相当甚至更优,同时又能保证较强的鲁棒性和高效性。
【Abstract】 The Unified Modeling Language(UML)is now more and more widely used in the field of software engineering and has become an important tool for development teams to carry out system design and architecture.In recent years,with the continuous expansion of the scale of software systems,the complexity of UML class diagram models has continued to increase,which not only makes it difficult for developers to understand and maintain models,but also leads to errors and time waste in the development process,seriously affecting the progress and quality of the project.In this context,the modularization of UML class diagram models is particularly important.Modularization is the process of dividing a large model into multiple independent sub-modules,which can help solve the complexity problem of UML class diagram models caused by the expansion of scale,allowing developers to understand model requirements and architecture more quickly and accurately,reduce development errors and time waste caused by model complexity,and improve work efficiency.The existing modularization scheme has significant limitations in input modality and information utilization,and cannot effectively cope with the challenges of large and complex UML class diagram models:on the one hand,the lack of direct processing capabilities for image modality data leads to challenges in processing UML class diagram models that are only in image form;on the other hand,the inability to fully utilize the rich information contained in the UML class diagram model limits the quality of the modularization results.In view of the above limitations,this study aims to obtain optimized modularization results directly from the UML class diagram model in image format through an end-to-end UML class diagram model modularization solution.This study first proposed a YOLO-Enhanced UML class diagram Information Extraction method(YOLO-UE),which builds a target detection model based on the YOLO algorithm to identify elements in the UML class diagram image,such as class rectangles and relationship type symbols,and then extracts the structural information and relationship information in the image through the classic image processing algorithm,and finally outputs the corresponding UML class diagram model information,overcoming the limitation that traditional methods cannot directly process image input.Secondly,this study proposes a modularization method based on class correlation(Class-Correlation based Modularization,CCM).This method proposes the concept of class correlation,which is used to measure the functional or semantic association strength between classes in the class diagram.At the same time,based on the concept of class correlation,the attention mechanism of the Graph Attention Network(GAT)is improved,so that it can dynamically learn the semantic association between classes in the class diagram model and output node embedding representations rich in semantic information.Finally,a reliable modularization result is obtained through the K-means clustering algorithm,which solves the pain points of traditional methods in the use of UML class diagram information.This study is based on the Lindholmen dataset,compared with a variety of advanced methods,and conducted a large number of experimental evaluations on multiple indicators.Experimental results show that in UML class diagram information extraction tasks in different scenarios,the YOLO-UE method has improved the F1 score,mean average precision(mAP)and average inference time by at least 34.3%,53.1%and 4.78 times respectively compared with the baseline method,and has lower performance degradation in scenarios with high interference and higher complexity,showing stronger robustness and versatility;in the UML class diagram model modularization task,compared with other benchmark methods,the CCM method performs comparable or even better in multiple modularization quality indicators,while ensuring strong robustness and efficiency.
【Key words】 Unified Modeling Language; Software Engineering; Modularity; Target Detection; Graph Attention Network;
- 【网络出版投稿人】 浙江大学 【网络出版年期】2026年 06期
- 【分类号】TP311.5;TP391.41;TP183