BoLiu-USTC / HGPTrans
git clone https://github.com/BoLiu-USTC/HGPTrans.git
Official PyTorch implementation of HGPTrans: hierarchical graph-pooling Transolver for vehicle aerodynamic drag prediction (Cd regression) from STL meshes.
+0
stars, 24h · #30,315
+~0
stars, 7 days · #30,790
+103
stars, 30 days · #4,797
88
★ total
2
forks · 0 open issues
Star history (as recorded here)
LanguagePython
LicenseMIT
Created2026-09-22 (1mo ago)
Last push15d ago
Watchers2
OwnerUser
GitHub topics
Links
README excerpt
# HGPTrans: Hierarchical Graph-Pooling Transolver for Vehicle Drag Prediction > Official PyTorch implementation of HGPTrans: hierarchical graph-pooling Transolver for vehicle aerodynamic drag prediction (Cd regression) from STL meshes. Predict the aerodynamic drag coefficient (Cd) of a vehicle directly from its surface mesh. The model builds a graph from the triangle mesh (vertices + normals as node features, mesh edges as the graph edge set), runs GIN message passing, applies Transolver-style physics attention over learned slice tokens (suited to irregular meshes), and performs hierarchical TopK graph pooling with a multi-scale pooled readout. ## Repository structure [code] ## Installation Requires Python 3.9+ and CUDA (for training on GPU). [code] `torch` and `torch_geometric` are listed but their CUDA-matched wheels depend on your local CUDA version, so install them first following the official guides if the pinned wheels do not match your driver: - PyTorch: https://pytorch.org/get-started/locally/ - PyG: https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html ## Data layout Point `--data_dir` at a dataset directory with this layout (DrivAerNet / DrivAerNet++ style): [code] The DrivAerNet++ 8k+ variant (`train.txt` / `val.txt` / `test.txt` splits and `DrivAerNetPlusPlus_Cd_8k_Updated.xlsx`) is auto-detected as well. ## Training [code] Key options: `--accumulation_steps` (default 16, i.e. effective batch = batch_size × accumulation_steps = 16 × 1). Vertex features are standardized per sample (zero mean / unit variance over each mesh). ## Evaluation [code] Per-design predictions are written to `predLog/preds.txt` next to the checkpoint; metrics (MSE / MAE / R² / rel-L2 / Pearson / Spearman) are printed and an error-scatter plot is saved to `predLog/error.png`. ## Notes - Keep `--batch_size 1`: model forwards use dense reshapes that assume a single graph per batch. Use `--accumulation_steps` for larger effective batches. - All meshes above `--simplify_size` vertices (default 417,114) are decimated with quadric edge collapse before graph construction. - Training latency printed during validation is forward-only; the end-to-end per-car inference time (mesh loading + QEM decimation + forward) reported in the paper is measured over the full pipeline. ## Citation The accompanying paper is available on arXiv:2609.31765. If you use this code or method, please cite: [code] ## License Released under the MIT License.