BRepFormer: Transformer-Based B-rep Geometric Feature Recognition

Yongkang Dai, Xiaoshui Huang, Yunpeng Bai, Hao Guo, Hongping Gan, Ling Yang, Yilei Shi

Abstract

BRepFormer is a novel transformer-based architecture designed to recognize geometric features directly from CAD Boundary Representation (B-rep) data. By treating B-rep faces as tokens and integrating topological relationships as attention biases, the model overcomes the limitations of traditional lossy conversions and Graph Neural Networks. BRepFormer achieves state-of-the-art accuracy on standard benchmarks and a newly introduced Complex B-rep Feature (CBF) dataset, demonstrating robustness in handling intricate industrial geometries.

1. Introduction

In Intelligent Manufacturing, Geometric Feature Recognition (GFR) is essential for translating 3D CAD models into actionable Computer-Aided Manufacturing (CAM) instructions. Identifying features such as holes, slots, and pockets requires understanding both local geometry and global topology. Historically, GFR methods relied on converting B-rep models into voxels or point clouds, which often results in the loss of precise mathematical definitions. While Graph Neural Networks (GNNs) have emerged as a direct-processing alternative, they frequently struggle with long-range dependencies and the complex intersections typical of industrial parts. BRepFormer bridges this gap by applying the Transformer architecture to raw B-rep data, leveraging attention mechanisms to capture complex spatial relationships.

2. Methodology

BRepFormer conceptualizes the faces of a CAD model as tokens in a sequence, analogous to words in a sentence. The pipeline is divided into four distinct stages: Feature Extraction, Feature Encoder, Transformer Block, and Recognition Head.

The BRepFormer architecture pipeline, showing the flow from B-rep data through feature extraction and encoding to the final recognition head.

2.1 Feature Extraction and Encoding

The model extracts geometric data through UV sampling (mapping 3D surfaces to 2D grids) and records semantic attributes like surface type and area. Simultaneously, it calculates topological features, including shortest path distances between faces and dihedral angles.

The "secret sauce" of BRepFormer lies in its Feature Encoder. To counteract the permutation invariance of standard Transformers, the model encodes edge attributes (convexity, length, curve type) and topological distances into an Attention Bias. This bias forces the attention mechanism to prioritize faces that are physically or topologically connected, effectively "teaching" the model the 3D structure of the object.

2.2 Transformer and Recognition

The architecture utilizes eight layers of Transformer modules with Grouped Query Attention (GQA) for computational efficiency. A "Virtual Face" token is introduced to act as a global aggregator, capturing the overall geometric context. Finally, the Recognition Head fuses these global features with local face features to classify each face into a specific geometric category.

3. Datasets and Results

The authors evaluated BRepFormer on three major datasets: MFInstSeg, MFTRCAD, and a newly developed Complex B-rep Feature (CBF) Dataset.

The generation process for the CBF dataset, illustrating how base plates are combined with overlapping complex features to simulate industrial reality.

The CBF dataset, containing 20,000 models with intersecting features, was designed to test the model's robustness against real-world complexity. BRepFormer set new performance benchmarks across all datasets:

  • MFInstSeg: 99.62% accuracy.
  • MFTRCAD: 93.16% accuracy, a 3.28% improvement over previous state-of-the-art models.
  • CBF Dataset: 94.66% accuracy, proving its superiority in handling intersecting geometries where GNNs often fail.

4. Key Insights and Discussion

A significant finding from ablation studies is that semantic attributes (e.g., "this is a cylinder") are more critical for accuracy than high-resolution UV sampling grids. This suggests that the Transformer benefits more from high-level semantic identity than raw point-cloud-like coordinates. Furthermore, the explicit encoding of edges as boundaries proved essential for distinguishing between adjacent features.

Despite its high accuracy, the model showed a slight dip in mean Intersection over Union (mIoU) on the CBF dataset. This is attributed to the high penalty of misclassifying even a single face in features with low face counts. Future work will focus on refining feature interaction handling and expanding the model's application to even more diverse industrial datasets.

Summary updated

BibTeX
@inproceedings{dai2025brepformer,
  author = {Yongkang Dai and Xiaoshui Huang and Yunpeng Bai and Hao Guo and Hongping Gan and Ling Yang and Yilei Shi},
  title = {{BRepFormer: Transformer-Based B-rep Geometric Feature Recognition}},
  booktitle = {ICMR},
  year = {2025},
  doi = {10.1145/3731715.3733283},
}
Figure