用大模型统一生成各类可控的CAD设计,用户一句话就能改图。
FlexCAD: Unified and Versatile Controllable CAD Generation with Fine-tuned Large Language Models
- 把CAD各层级转成文本序列,让大模型理解设计意图。
- 通过分层掩码训练,实现对草图、拉伸等操作的灵活控制。
- 支持多种修改需求,适合工业设计与快速原型开发人员。
近年来,基于用户意图生成计算机辅助设计(CAD)模型的可控生成成为研究热点。现有方法控制能力有限,且需为不同控制类型分别建模,效率低下。为实现对草图-拉伸、拉伸、草图、面、环和曲线等所有CAD构建层次的统一可控生成,我们提出FlexCAD,一种通过微调大语言模型(LLM)构建的统一模型。首先,为提升LLM的理解能力,我们将CAD模型抽象为结构化文本,将每一层次表示为一系列文本标记。其次,为在统一模型中处理多种可控生成任务,我们引入分层感知掩码策略:训练时,用掩码标记遮蔽CAD文本中的特定层次字段(由一系列标记组成),该字段可灵活设定代表不同层次;随后让LLM预测被遮蔽部分。推理时,用户意图转化为带有掩码标记的CAD文本,替换用户希望修改的部分,输入FlexCAD后生成新模型。在公开数据集上的综合实验表明,FlexCAD在生成质量与可控性方面均具有效性。代码将开源于https://github.com/microsoft/FlexCAD。
原文摘要 · Abstract (English)
Recently, there is a growing interest in creating computer-aided design (CAD) models based on user intent, known as controllable CAD generation. Existing work offers limited controllability and needs separate models for different types of control, reducing efficiency and practicality. To achieve controllable generation across all CAD construction hierarchies, such as sketch-extrusion, extrusion, sketch, face, loop and curve, we propose FlexCAD, a unified model by fine-tuning large language models (LLMs). First, to enhance comprehension by LLMs, we represent a CAD model as a structured text by abstracting each hierarchy as a sequence of text tokens. Second, to address various controllable generation tasks in a unified model, we introduce a hierarchy-aware masking strategy. Specifically, during training, we mask a hierarchy-aware field in the CAD text with a mask token. This field, composed of a sequence of tokens, can be set flexibly to represent various hierarchies. Subsequently, we ask LLMs to predict this masked field. During inference, the user intent is converted into a CAD text with a mask token replacing the part the user wants to modify, which is then fed into FlexCAD to generate new CAD models. Comprehensive experiments on public dataset demonstrate the effectiveness of FlexCAD in both generation quality and controllability. Code will be available at https://github.com/microsoft/FlexCAD.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。