Safetensors
ShizhaoSun commited on
Commit
fc0604b
·
verified ·
1 Parent(s): ff9255e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +157 -3
README.md CHANGED
@@ -1,3 +1,157 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+
5
+ ## Model Details
6
+
7
+
8
+
9
+ ### Model Description
10
+
11
+ This model aims to achieve controllable Computer-Aided Design (CAD) generation across all CAD construction hierarchies, such as sketch-extrusion, extrusion, sketch, face, loop and curve. It takes an original CAD model along with the part the user intends to modify as input and generates multiple new CAD models with only the chosen part changed, where CAD models are represented as structured texts.
12
+
13
+ - **Developed by:** Zhanwei Zhang, Shizhao Sun, Wenxiao Wang, Deng Cai and Jiang Bian
14
+ - **Model type:** Large Language Models
15
+ - **Language(s):** Python
16
+ - **License:** MIT
17
+ - **Finetuned from model:** Llama-3.1-8B
18
+
19
+ ### Model Sources
20
+
21
+ - **Repository:** https://github.com/microsoft/FlexCAD
22
+ - **Paper:** https://arxiv.org/pdf/2411.05823
23
+
24
+ ## Uses
25
+
26
+
27
+ ### Direct Intended Uses
28
+
29
+ Take an original CAD model along with the part the user intends to modify as input and generate multiple new CAD models with only the chosen part changed, where CAD models are represented as structured texts.
30
+
31
+ FlexCAD is being shared with the research community to facilitate reproduction of our results and foster further research in CAD generation.
32
+
33
+ FlexCAD is intended to be used by domain experts who are independently capable of evaluating the quality of outputs before acting on them.
34
+
35
+ ### Out-of-Scope Use
36
+
37
+ We do not recommend using FlexCAD in commercial or real-world applications without further testing and development. It is being released for research purposes.
38
+
39
+ Use in any manner that violates applicable laws and regulations,
40
+
41
+ ## Risks and Limitations
42
+
43
+ FlexCAD inherits any biases, errors or omissions produced by its base model. Develops are advised to choose an appropriate base LLM carefully, depending on the intended use case.
44
+
45
+ FlexCAD uses the Llama model. See https://huggingface.co/meta-llama/Llama-3.1-8B to understand the capabilities and limitations of this model.
46
+
47
+ As the model is fine-tuned on very specific data about CAD models, it is unlikely to generate information other than CAD models.
48
+
49
+ CAD models generated by FlexCAD may not be technically accurate in all cases. Users are responsible for assessing the quality of generated content for each intended use case.
50
+
51
+ FlexCAD was developed for research and experimental purposes. Further testing and validation are needed before considering its application in commercial and real-world scenarios.
52
+
53
+ ### Recommendations
54
+
55
+ Please only provide a CAD model that you want to modify to the model.
56
+
57
+ Users are responsible for sourcing their content legally and ethically. This could include securing appropriate copyrights and the anonymization of data prior to use in research.
58
+
59
+ ## How to Get Started with the Model
60
+
61
+ ```
62
+ python sample.py --model_path <model_path> --num_samples <num_samples> --data_path <data_path> --mask_type <mask_type>
63
+ ```
64
+
65
+ Here, mask_type can be one of ```unconditional```, ```cad```, sketch-extrusion(```es```), ```extrusion```, ```sketch```, ```face```, ```loop```, ```curve```.
66
+
67
+ For more information, please visit our GitHug repo: https://github.com/microsoft/FlexCAD.
68
+
69
+ ## Training Details
70
+
71
+ ### Training Data
72
+
73
+ The training data is from an open-source dataset, DeepCAD: https://github.com/ChrisWu1997/DeepCAD?tab=readme-ov-file. We use its pre-processed version: https://github.com/samxuxiang/SkexGen.
74
+
75
+ ### Training Procedure
76
+
77
+
78
+ #### Preprocessing
79
+
80
+ CAD models are converted to structured text, where all the categorical and numerical information are represented as textual tokens.
81
+
82
+ See A.1 in our paper (https://arxiv.org/pdf/2411.05823) for a detailed definition for the sequence format.
83
+
84
+
85
+ #### Training Hyperparameters
86
+
87
+ LoRA rank and alpha: 8, 32
88
+
89
+ Optimizer: AdamW
90
+
91
+ Batch size: 32
92
+
93
+ Learning rate: 5e-4
94
+
95
+ Epochs: 30
96
+
97
+ #### Speeds, Sizes, Times
98
+
99
+ Llama-3.1-8B: 8B parameters
100
+
101
+ ## Evaluation
102
+
103
+
104
+ ### Testing Data, Factors & Metrics
105
+
106
+ #### Testing Data
107
+
108
+ The testing data is from an open-source dataset, DeepCAD: https://github.com/ChrisWu1997/DeepCAD?tab=readme-ov-file. We use its pre-processed version: https://github.com/samxuxiang/SkexGen.
109
+
110
+
111
+ #### Metrics
112
+
113
+ 1. Generation diversity and quality on the generated CAD models in comparison to the test set, including Coverage (COV), Minimum Matching Distance (MMD) and Jensen-Shannon Divergence (JSD) [1][2].
114
+
115
+ 2. The percentage of predicted CAD sequences that can be successfully rendered into 3D models, denoted as Prediction Validity (PV).
116
+
117
+ 3. The percentage of the generated CAD models that are labeled as realistic ones by human evaluators, denoted as Realism.
118
+
119
+ [1] https://arxiv.org/abs/2207.04632
120
+
121
+ [2] https://arxiv.org/abs/2307.00149
122
+
123
+ ### Results
124
+
125
+ #### Summary
126
+ We use prior work, including Skexgen [1], Hnc-cad [2], and prompting GPT-4o [3], as baselines. FlexCAD demonstrates superior performance compared to these baselines across most metrics. Notably, it achieves significant improvements in PV, with the PV values for GPT-4o, Skexgen, Hnc-cad, and FlexCAD being 62.3%, 68.7%, 72.6%, and 93.4% respectively, in the context of sketch-level controllable generation. See Table 1 for the complete evaluation in our paper (https://arxiv.org/pdf/2411.05823).
127
+
128
+ [1] https://arxiv.org/abs/2207.04632
129
+
130
+ [2] https://arxiv.org/abs/2307.00149
131
+
132
+ [3] https://platform.openai.com/docs/models#gpt-4o
133
+
134
+
135
+ ## Environmental Impact
136
+
137
+ Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
138
+
139
+
140
+ ## Citation
141
+
142
+ **BibTeX:**
143
+
144
+ ```
145
+ @InProceedings{zhang2024flexcad,
146
+ title={FlexCAD: Unified and Versatile Controllable CAD Generation with Fine-tuned Large Language Models},
147
+ author={Zhang, Zhanwei and Sun, Shizhao and Wang, Wenxiao and Cai, Deng and Bian, Jiang},
148
+ booktitle={ICLR},
149
+ year={2025}
150
+ }
151
+ ```
152
+
153
+ ## Model Card Contact
154
+
155
+ We welcome feedback and collaboration from our audience. If you have suggestions, questions, or observe unexpected/offensive behavior in our technology, please contact us at Shizhao Sun, shizsu@microsoft.com.
156
+
157
+ If the team receives reports of undesired behavior or identifies issues independently, we will update this repository with appropriate mitigations.