Vlm Cadfeaturerecognition
Vlm Cadfeaturerecognition
This repository provides code and resources for automating manufacturing feature recognition in CAD designs using vision-language models.
Overview
VLM-CADFeatureRecognition
This repository contains the code and resources accompanying the paper "Leveraging Vision-Language Models for Manufacturing Feature Recognition in CAD Designs". The study explores the application of vision-language models (VLMs) to automate the recognition of various manufacturing features in CAD designs without extensive training datasets or predefined rules.
Dataset Used: The dataset used in this study is available in the Dataset folder.
Authors: Muhammad Tayyab Khan, Chen Lequn
Overview
Automatic Feature Recognition (AFR) is crucial for converting design knowledge into actionable manufacturing information. Traditional AFR methods often rely on predefined geometric rules and large datasets, which can be time-consuming and may lack generalizability across different manufacturing features. This project investigates the use of VLMs, employing prompt engineering techniques such as multi-view query images, few-shot learning, sequential reasoning, and chain-of-thought, to recognize a wide range of manufacturing features in CAD designs.
Figure 1: Overview of VLM-based AFR approach
MFCAD-VLM Dataset
The study utilizes the MFCAD-VLM dataset, a comprehensive collection designed to advance research in CAD and AFR. The dataset includes:
- STEP Files: CAD models in STEP format, representing various parts with distinct manufacturing features, categorized by complexity levels (easy, medium, and hard).
- Ground Truth JSON Files: Expert-annotated JSON files corresponding to each STEP file, detailing manufacturing feature types, quantities, and specifics essential for accurate AFR assessment.
- Multi-View Isometric Images: Three isometric-view snapshots per CAD model, generated via Python, capturing different viewing angles to aid feature recognition tasks.
Installation
Requirements
- Python >= 3.9
- PyTorch >= 1.8.0
- CUDA-compatible GPU (recommended) with appropriate CUDA drivers installed
To set up the environment, follow these steps:
-
Clone the repository:
git clone https://github.com/Davidlequnchen/VLM-CADFeatureRecognition.git cd VLM-CADFeatureRecognition -
Create and activate a conda environment:
conda create -n vlm_afr python=3.9 conda activate vlm_afr -
Install pyocc using conda:
conda install -c conda-forge pythonocc-core=7.8.1 -
Install PyTorch:
To check your CUDA version:
nvidia-smiIMPORTANT: PyTorch installation depends on your CUDA version. Choose the appropriate command:
For CUDA 12.1:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121For CUDA 11.8:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118For CPU only:
pip install torch torchvision torchaudio -
Install other requirements:
pip install -r requirements.txt
Usage
-
Download the MFCAD-VLM Dataset:
The dataset used can be found at
"Dataset"directory. -
Configure the Dataset Path:
Set the path to the directory where the MFCAD-VLM dataset is located.
-
Run Experiments:
Execute the provided scripts to perform feature recognition tasks as described in the paper.
📄 Citation
If you find this repository or the MFCAD-VLM dataset useful in your research, please cite our officially published paper:
Leveraging Vision-Language Models for Manufacturing Feature Recognition in Computer-Aided Designs
Journal of Computing and Information Science in Engineering (JCISE), ASME, 2025.
DOI: https://doi.org/10.1115/1.4069266
@article{khan2025leveraging,
title={Leveraging Vision-Language Models for Manufacturing Feature Recognition in Computer-Aided Designs},
author={Khan, Muhammad Tayyab and Chen, Lequn and Ng, Ye Han and Feng, Wenhe and Tan, Nicholas Yew Jin and Moon, Seung Ki},
journal={Journal of Computing and Information Science in Engineering},
volume={25},
number={},
pages={104501},
year={2025},
publisher={American Society of Mechanical Engineers},
doi={10.1115/1.4069266},
url={https://doi.org/10.1115/1.4069266}
}
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgements
We acknowledge the support from the Singapore Institute of Manufacturing Technology (SIMTech), the Advanced Remanufacturing and Technology Centre (ARTC), and Nanyang Technological University (NTU).
Files in this package
- CAD source: easy_33.STEP, easy_8.STEP, hard_13.STEP, hard_15.STEP, hard_23.STEP, hard_29.STEP, hard_31.STEP, hard_32.STEP, hard_5.stp, hard_7.stp, medium_3.STEP, medium_32.STEP (+88 more)
- Images: easy_10_view_2.png, easy_15_view_2.png, easy_20_view_1.png, easy_20_view_2.png, easy_20_view_3.png, easy_32_view_2.png, easy_32_view_3.png, medium_11_view_1.png, medium_31_view_1.png, medium_31_view_2.png, medium_31_view_3.png, medium_7_view_2.png
Source & license
- Original author: Davidlequnchen
- Source repository: https://github.com/Davidlequnchen/VLM-CADFeatureRecognition
- License: MIT
Imported into the CommunityCAD Archive with attribution preserved. All rights remain with the original author under the stated license.
More models
Vision UiCommunityCAD Archive· OBJ
TosketchCommunityCAD Archive· OBJ
NopscadlibCommunityCAD Archive· STL
LaserscadCommunityCAD Archive· STL
Cadquery ModelsCommunityCAD Archive· FCSTD · STL
SseCommunityCAD Archive· STEP · FCSTD +2
Bad Thing Of The Edge KeyboardCommunityCAD Archive· STEP · STL
3D Printable Bearing GeneratorCommunityCAD Archive· STL