Paper · 2021-04-01 · cs.LG, cs.CV
BRepNet: A topological message passing system for solid models
BRepNet runs convolutions on a CAD solid's B-rep topology. Each kernel gathers the faces, edges and coedges reached by walks such as next, mate and face, then max-pools coedge features onto faces and edges. Inputs are coordinate-free. Author-reported on the Fusion 360 Gallery segmentation set: 92.52% per-face accuracy and 77.10% IoU, above graph and mesh or point-cloud baselines.
Graph neural networkSemantic segmentationcadb-repsegmentationtopological-walksgraph-convolution
arXivPDFCodeMarkdown13 min read
AI-compiled by claude-haiku-5-5 on 2026-11-13, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
A CAD model is stored as a boundary representation: a list of faces, the edges where they meet, and directed edge uses (coedges) that tie the two together. The comparison methods in the paper turn the model into a mesh or a point cloud, which the authors argue loses useful detail. BRepNet works on the CAD structure itself.
For each directed edge use, it looks at a small, fixed set of neighbours. It finds them by following the stored links in a set order, and it applies learned weights to their features, much like a filter in an image network. The inputs are plain facts about each face and edge, such as its surface or curve type, whether it is convex or concave, and its size. The network labels every face with the kind of modelling step that created it. The authors also release the labelled dataset.
TL;DR
BRepNet is a message-passing network for B-rep solids. Its kernels are defined by topological walks from each coedge, and it pools coedge features onto faces and edges. It is trained with cross-entropy to label each face with the CAD operation that created it. On the authors' Fusion 360 Gallery segmentation data, it reports 92.52% per-face accuracy and 77.10% part IoU for the winged-edge kernel tab. 1. The official code's defaults differ from the paper in several places, so reproduce results with the settings in the reproduce script, not the defaults (see Paper vs code).
Problem
- B-reps are the standard CAD format. They hold faces, edges, loops, coedges and vertices, with their adjacencies §3.1. Converting them to meshes or point clouds loses information. The authors report that meshing failed for 13% of the models §5.6, and that point sampling can miss small faces such as holes and grooves §5.6.
- Many faces are planar, so the modelling step that created one can only be told apart from its neighbourhood. This makes the rare classes hard app. A.1.
- A common B-rep feature pipeline samples point grids on each face and encodes them with a CNN §3.3. The paper asks whether segmentation works with no coordinates at all, using only a few concise topological and type features §3.3.
- A generic graph network on the face adjacency graph does not use the manifold structure of a B-rep. The authors use an edge-conditioned graph network with the same inputs as a baseline to show the gain from doing so §5.5.
Method
B-rep structure. A coedge is a directed edge use. Each one points to its neighbours in the loop, to its mate (the other coedge on the same edge), and to its parent face and parent edge. The method assumes closed, manifold B-reps in which every coedge has exactly one mate §3.1.
Topological walks. A walk starts at a coedge and applies instructions in order: next, previous, mate, and optionally a final hop to the parent face or edge. Each walk is a product of the matrices N (next), P (previous), M (mate), F (coedge to face) and E (coedge to edge) §3.2 eq. 1. The coedge-to-entity incidence (F, E) turns a coedge-level walk into a face or edge reference §3.2.
Input features §3.3:
- Face (7 values): one-hot surface type over plane, cylinder, cone, sphere and torus; a flag for rational NURBS (all zero for non-rational B-splines); the face area.
- Edge (10 values in the paper's description): one-hot curve type, one-hot convexity over concave, convex and smooth, a closed-loop flag, and the edge length. The released code's curve-type list differs (see Paper vs code).
- Coedge (1 value): whether the coedge direction matches the direction of the edge's parametric curve.
- Every feature is standardised with the mean and standard deviation of the training set, and the same scaling is applied to validation and test data §3.3 app. A.1.2 eq. 4.
Convolution unit §3.4 eq. 2 eq. 3.
- For each coedge i and each kernel walk, read the feature vector of the entity the walk reaches. Concatenate all of them, faces first, then edges, then coedges, into row i of a matrix Ψ eq. 2.
- Pass every row of Ψ through an MLP with ReLU non-linearities. The first layer takes the width of Ψ. Each later layer is 3s wide, where s is the hidden width per entity §3.4.
- Split the MLP output Z into three blocks of s columns: a coedge block, a face block and an edge block eq. 3.
- The coedge block is the next coedge state and needs no further processing.
- Max-pool the edge block over the two coedges of each edge. Max-pool the face block over all coedges of each face. These give the next edge and face states §3.4.
Pooling onto faces and edges is what lets information pass between the loops of a face with holes. The authors found the network performs poorly without it §3.4.
Classification §3.5. The last unit's MLP ends with |u| outputs, one per class. These are max-pooled onto faces to give per-face scores, which are trained with cross-entropy §3.5. The official code adds a linear head after this step (see Paper vs code).
# BRepNet forward pass for face labels [§3.4] [§3.5]
# Input: X_f (F, p) faces, X_e (E, q) edges, X_c (C, r) coedges
# kernel walks K_f, K_e, K_c; T convolution units
# Output: face scores (F, u)
def brepnet_forward(X_f, X_e, X_c, K_f, K_e, K_c, T):
# Initial hidden states are the input features [§3.4]
H_f = X_f
H_e = X_e
H_c = X_c
# Hidden convolution units, each keeping s values per entity [§3.4]
for unit in range(T):
# Row i gathers the entities reached from coedge i, faces first,
# then edges, then coedges, in kernel order [eq. 2]
Psi = gather_and_concat(H_f, H_e, H_c, K_f, K_e, K_c)
# Shared MLP with ReLU; output is three blocks of s columns [§3.4]
Z = mlp_unit(Psi) # (C, 3s)
# Split Z into coedge, face and edge blocks [eq. 3]
Z_c, Z_f, Z_e = split_columns(Z, s) # each (C, s)
# The coedge block is the next coedge state [§3.4]
H_c = Z_c
# Max over the two coedges of each edge [§3.4]
H_e = max_pool(Z_e, groups=coedges_of_edge) # (E, s)
# Max over all coedges of each face [§3.4]
H_f = max_pool(Z_f, groups=coedges_of_face) # (F, s)
# Last unit: one output per class, then pool onto faces [§3.5]
Psi = gather_and_concat(H_f, H_e, H_c, K_f, K_e, K_c)
Z_out = mlp_output(Psi) # (C, u)
return max_pool(Z_out, groups=coedges_of_face) # (F, u)Winged-edge kernel §5.2 tab. 2 app. A.2. The configuration used for the headline result has these walks, written as the paper's instructions (f face, e edge, m mate, n next, p previous, I the coedge itself):
- faces: F, MF
- edges: E, NE, PE, MNE, MPE
- coedges: I, M, N, P, MN, MP
The official kernel file lists the same walks as strings [code: kernels/winged_edge.json#L1-L5]. The walks in the official code are written in the same order as the paper.
Training app. A.3.1 §5. Adam, learning rate 0.001, default betas; a mini-batch of about 1000 faces; 50 epochs; the saved model is the one with the smallest validation loss, and that model is evaluated on test data. Each setting is run with 10 seeds and reported as mean ± standard deviation §5.
Hyperparameters
| Name | Value | Where | Notes |
|---|---|---|---|
| Hidden width s (winged edge) | 84 | fig. 5 brepnet.py | Chosen so the total stays near 360k parameters §5.2. Other kernels get their own s. |
| Convolution units in the kernel study | 2, each with a 2-layer MLP | §5.2 | The official code's num_layers counts the output unit too. |
| MLP depth | 2 layers | §5.2 brepnet.py | |
| Hidden MLP width | 3s | §3.4 brepnet.py | |
| Output MLP width | number of classes (u) | §3.5 | Official code uses s, then a linear head (see Paper vs code). |
| Optimiser | Adam, lr 0.001, betas 0.9 and 0.999 | app. A.3.1 brepnet.py | Official default lr is also 0.001. |
| Mini-batch | about 1000 faces | app. A.3.1 | Official default is 200 B-reps (see Paper vs code). |
| Epochs | 50 | §5 reproduce_paper_results.sh | |
| Epoch time | about 45 s on NVIDIA Tesla V100 | app. A.3.1 | Minimum loss near epoch 15, under 12 minutes from random seed app. A.3.1. |
| Dropout | not stated | app. A.3.1 | Official default 0.3; reproduce script sets 0.0 (see Paper vs code). |
| Loss | cross-entropy (mean) | §3.5 brepnet.py | |
| Metric | part IoU over all test faces | §5.1 | Not averaged per model. |
| Split | 70/15/15 | §5 | Published split: 5,399 test bodies; 30,459 bodies for training and validation app. A.1. |
| Dataset size | 35,858 B-rep bodies | §4 app. A.1 | Eight face labels §4. |
| Body scaling | centred; largest bounding-box side 2 units | app. A.1.1 | |
| De-duplication | same face and edge counts; area and volume within 1% | app. A.1.1 | |
| Standardisation | mean and SD over training set | app. A.1.2 eq. 4 | |
| Meshes and point clouds | about 3000 triangles per mesh; 2048 sampled points | §5.6 | Used by the geometry baselines only. |
| PointNet++ | batch 32, lr 0.001, momentum 0.9 | app. A.3.1 | Official TensorFlow implementation. |
| MeshCNN | batch 12, lr 0.0002, momentum 0.9; max 3500 input edges; pooling to 2500, 1750, 1000 | app. A.3.1 | Official PyTorch implementation. |
| ECC baseline | Adam, lr 0.001, default betas | app. A.3.1 | PyTorch Geometric NNConv; ECC code is not in this repository. |
Results
Author-reported. Setup: Fusion 360 Gallery segmentation set; 8 face classes; per-face test metrics, mean ± SD over 10 seeds §5 tab. 1.
| Method | Per-face acc. (%) | Per-face IoU (%) | Per-entity acc. (%) | Per-entity IoU (%) | Parameters |
|---|---|---|---|---|---|
| BRepNet (winged edge) | 92.52 ± 0.15 | 77.10 ± 0.54 | – | – | 359,100 |
| ECC (graph network) | 90.36 ± 0.23 | 72.08 ± 0.50 | – | – | 359,558 |
| ASM (rule-based CAD kernel) | 64.57 | 49.53 | – | – | – |
| PointNet++ (points) | 74.00 ± 0.84 | 34.78 ± 2.23 | 82.78 ± 0.30 (per point) | 36.49 ± 1.67 (per point) | 1,403,784 |
| MeshCNN (mesh edges) | 62.99 ± 0.37 | 20.59 ± 0.41 | 73.81 ± 0.51 (per edge) | 24.07 ± 0.42 (per edge) | 2,279,720 |
Source: tab. 1. The BRepNet row is the winged-edge kernel §5.2. ASM cannot detect RevolveEnd, so its IoU leaves that class out, and it labels 13% of faces as unidentified, which the authors count as wrong §5.4.
Kernel study (per-face test; mean ± SD over 10 seeds) fig. 5:
| Kernel | s | Parameters | Accuracy (%) | IoU (%) |
|---|---|---|---|---|
| Simple edge | 120 | 359k | 91.02 ± 0.20 | 74.03 ± 0.55 |
| Asymmetric | 120 | 359k | 91.66 ± 0.17 | 75.01 ± 0.54 |
| Asymmetric+ | 113 | 358k | 91.82 ± 0.13 | 75.06 ± 0.71 |
| Asymmetric++ | 107 | 359k | 92.05 ± 0.07 | 75.69 ± 0.38 |
| Winged edge | 84 | 359k | 92.52 ± 0.15 | 77.10 ± 0.54 |
| Winged edge+ | 75 | 357k | 92.50 ± 0.15 | 76.86 ± 0.47 |
| Winged edge++ | 63 | 358k | 92.50 ± 0.12 | 77.14 ± 0.44 |
| ECC | 153 | 360k | 90.36 ± 0.23 | 72.08 ± 0.50 |
The authors report that moving from simple edge to asymmetric adds 0.98 IoU points, with a Welch t-test p-value of 0.0012 §5.2. The winged-edge kernel is over 5 standard deviations above simple edge in IoU §5.2.
Input-feature ablation (winged edge+ kernel; IoU drop when a group is removed) §5.3 fig. 6:
- surface type: −3.7 points
- curve type: −3.9 points
- edge convexity: −4.6 points
- edge length: −0.7 points
- face area: −0.4 points
Per class (per-face IoU, from the appendix) app. A.3.2 fig. 11:
- RevolveEnd (0.08% of faces): BRepNet 49%; PointNet++ and MeshCNN find none.
- Fillet: BRepNet 97.57%; ECC 97.32%.
- Chamfer: BRepNet 81.80%; ECC 71.16%.
Label balance app. A.1 fig. 8: ExtrudeSide and ExtrudeEnd are the common classes, at about 50.60% and 15.72% of faces app. A.3.2. CutEnd is 2.35% and Chamfer 2.94% app. A.1. RevolveEnd is 0.08% app. A.1.
Comparison with geometry baselines §5.6: the paper says BRepNet and ECC outperform PointNet++ and MeshCNN by more than 16% in accuracy and 37% in IoU, with under a quarter of the parameters.
Paper vs code
Compiled from arXiv v2 (the CVPR 2021 version). Official code: AutodeskAILab/BRepNet at 2f41a9f63b0ba9669cdb0302d7c667ead747246a, licensed CC BY-NC-SA 4.0. It sits in the same GitHub organisation as the dataset repository that the paper links app. A.1; the authors are listed with Autodesk Research affiliations on the title page.
- Output head. Paper: the last layer of the last unit has |u| outputs, max-pooled to faces §3.5. Code: the output unit's MLP ends at width s with no bias and no ReLU on its last linear layer brepnet.py. The face features are then max-pooled brepnet.py, and a separate linear layer with bias maps s values to classes brepnet.py.
- Output MLP inner width. Paper: other MLP layers are 3s wide §3.4. Code: the output unit's hidden layer is s wide brepnet.py.
- Dropout. Paper: not stated. Code default: 0.3 brepnet.py. The reproduce script sets 0.0 reproduce_paper_results.sh.
- Mini-batch. Paper: about 1000 faces app. A.3.1. Code default: 200 B-reps per batch brepnet.py. A face-capped sampler exists but is off by default brepnet.py. The reproduce script sets neither reproduce_paper_results.sh.
- Input mode. Paper: coordinate-free; the main setting uses only the features listed above §3.3. Code default: UV-Net-style face and coedge point grids on, and the handcrafted features off brepnet.py. The reproduce script turns grids off and the handcrafted features on reproduce_paper_results.sh.
- Edge curve types. Paper: line, circle, ellipse, helix, intersection curve §3.3. Code: straight, circular, elliptical, non-rational B-spline and rational B-spline; no helix or intersection curve all.json. The face list matches the paper all.json.
- Depth. Code
num_layerscounts the output unit, so 2 means one hidden unit plus the output unit brepnet.py brepnet.py. This matches the two units of the kernel study §5.2. The default is 5 brepnet.py. The depth behind Table 1 is not stated. - Parameter count. By hand from the code, the reproduce script's configuration (s = 84, winged edge, 2 units, handcrafted features only, 7 face, 10 edge and 1 coedge input features) gives about 181,196 parameters. Table 1 reports 359,100 tab. 1. We did not find the configuration behind that number.
- Concatenation order. Paper: Z = [H_c, Z^f, Z^e] eq. 3. Code: coedge, edge, face brepnet.py. Harmless if used consistently.
- Equation reference. Code comments cite "equation (4)" for max pooling brepnet.py. In the paper, eq. 4 is the standardisation formula; max pooling is in prose §3.4.
- Matches. Adam with lr 0.001 brepnet.py brepnet.py; 50 epochs reproduce_paper_results.sh; checkpoint with lowest validation loss, then test on it train.py train.py; standardisation from the training split, with a standard-deviation check build_dataset_file.py brepnet_dataset.py; part IoU summed over all faces brepnet.py.
- Not in the repository. The reproduce script trains one seed; the 10-seed averages are not produced by it §5. The ECC, PointNet++ and MeshCNN baselines are not in this repository app. A.3.1.
Pitfalls
- Default config is not the paper config. Running
train/train.pywith defaults uses grids, 200-B-rep batches and dropout 0.3. The reproduce script is the closer match reproduce_paper_results.sh. - Zero padding in face max-pooling. Faces with at most 30 coedges are indexed through a padding row of zeros, which joins the max brepnet.py brepnet_dataset.py. Hidden units end in ReLU, so their values are non-negative and the zeros do not change the max there. The output unit has no ReLU, so a class channel whose coedge values are all negative would pool to 0 for a small face. We found this by reading the code and did not run it.
- Class with no faces. The official metric sets a class's IoU to 1.0 when neither prediction nor label contains it brepnet.py. The paper does not say this. It only matters for subsets or a dataset missing a class.
- Mesh failures and comparison sets. The text says the 13% of B-reps whose mesh failed were removed from the dataset §5.6. It is not stated whether all Table 1 rows use the same models.
- Area and scaling. Bodies are centred and scaled so the largest bounding-box side is 2 units app. A.1.1, and face area is an input §3.3. The paper does not say whether features are computed before or after this scaling. Check the official pipeline's behaviour differences_in_open_cascade_pipeline.md; we did not read that document in full.
- Rare classes dominate the variance. RevolveEnd is 0.08% of faces and IoU on it is 49% app. A.1 app. A.3.2. Per-class numbers are noisy; read the per-class figure, not only the mean.
- Validation split. Section 5 gives 70/15/15, but the exact validation split is in the published dataset file, not in the paper §5 app. A.1.
- Dataset preprocessing. Modelling operations other than extrude, revolve, fillet and chamfer were suppressed, which the authors say changes the shapes of some models app. A.1.1. Results apply only to this preprocessed set.
- Licence. The official code is CC BY-NC-SA 4.0: no commercial use of the code itself. This card describes the method in our own words and quotes no code. The dataset is distributed separately and its terms were not checked here.
Lineage
- Builds on: the winged-edge kernel is similar to the half-flaps of Liu et al. §5.2. Coedge-relative kernels use directed edges to avoid symmetric aggregation §3.4. Convolution as a matrix product over gathered neighbours is the approach of prior work the paper cites §1.
- Compared against: an edge-conditioned convolution graph network with the same inputs and similar parameter count §5.5; PointNet++ and MeshCNN on points and meshes §5.6; a rule-based CAD feature recogniser §5.4.
- Feature inputs in the official code can include UV-Net-style grids, which this paper's main setting does not use brepnet.py.
- Superseded by: none known from content in this wiki.
Source and license
Adapted from “BRepNet: A topological message passing system for solid models” by Joseph G. Lambourne, Karl D. D. Willis, Pradeep Kumar Jayaraman, Aditya Sanghi, Peter Meltzer, Hooman Shayani (arXiv:2104.00706), used under CC BY-SA 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. This page is licensed under CC BY-SA 4.0. Code citations refer to https://github.com/AutodeskAILab/BRepNet at commit 2f41a9f63b0b (CC-BY-NC-SA-4.0 (non-commercial)). Any quoted code is shown under that license.