Feature Extraction from Flow Fields: Physics-Based Clustering and Morphing with Applications

Riccardo Margheritti, Onofrio Semeraro, Maurizio Quadrio, Giacomo BoracchiApplied Sciences 2025

TL;DR

This paper tackles the challenge of applying machine learning to complex fluid dynamics data by introducing two novel methods for automatically extracting meaningful features. These methods, physics-based clustering and mesh morphing, enable scalable and robust analysis of diverse flow fields, paving the way for more automated and generalizable ML applications in fields like aerospace and medicine.

What Problem Does This Paper Address?

Computational Fluid Dynamics (CFD) simulations generate massive, high-dimensional datasets that are difficult for traditional machine learning (ML) models to process directly. This is especially true when dealing with datasets that have significant geometric variability (e.g., different airfoil shapes or patient anatomies) and limited training examples. Current ML approaches often rely on "handcrafted" features, where domain experts manually define specific regions within the flow field and extract relevant quantities. While this leverages expert knowledge, it's a laborious and time-consuming process that doesn't scale well to new geometries or large datasets, requiring experts to redefine regions for each new case. This paper aims to overcome this scalability and manual intervention bottleneck by developing automated, yet physically informed, feature extraction techniques for CFD data.

Methods

The authors propose two complementary methods for feature extraction:

  • Physics-Based Clustering: This method automatically identifies meaningful flow regions by clustering cells based on the local balance of terms from the governing Navier-Stokes equations (RANS or LES). Instead of relying on predefined geometric regions, this approach uses the underlying physics to segment the flow field into coherent zones. A Bayesian Gaussian Mixture Model (BGMM) is used for clustering. To handle the variable number and ordering of clusters across different simulations, two strategies are employed:
  • C-FREE: Clusters are identified independently for each simulation, and a permutation-invariant set-learning model (Point Transformer) is used for inference.
  • C-PROP: Clusters from a reference simulation are propagated to all other simulations, ensuring consistent region definitions and allowing the use of standard ML models like MLPs.
  • Morphing-Based Method: This approach reintroduces expert knowledge by defining regions on a single reference geometry. Each CFD flow field and its mesh are then "morphed" onto this reference geometry using Radial Basis Functions (RBFs) for mesh deformation and finite element projection for data transfer. This ensures that expert-defined regions are consistently applied across all simulations, regardless of their original geometry. This method is particularly useful when anatomical or geometric landmarks are crucial for interpretation.

Datasets

The authors validate their methods on three distinct datasets:

  • AirNACA: A large dataset of 2D CFD simulations for NACA four-digit airfoils, used for predicting airfoil shape (regression). This dataset includes a publicly available portion and an extended version generated by the authors.
  • AirDEF: An extension of the AirNACA dataset, introducing controlled geometric deformations (bumps, cavities, cut trailing edges) to mimic manufacturing defects. This dataset is also 2D and used for defect detection (regression). The authors state this dataset will be publicly released.
  • NosePAT & NoseREAL: 3D CFD simulations of airflow in human upper airways derived from CT scans. NosePAT consists of synthetic pathological geometries generated from healthy scans, while NoseREAL includes real patient data. This dataset is used for classifying nasal pathologies (binary classification).

Key Insights and Ideas

  • Physics-Driven Segmentation: Using the governing equations to define regions for clustering offers a more physically grounded and adaptive segmentation than purely geometric approaches.
  • Bridging Data-Driven and Expert Knowledge: The two methods offer complementary strengths: clustering provides adaptability, while morphing provides consistency and interpretability rooted in expert knowledge.
  • Scalability is Key: The core motivation is to move beyond manual feature engineering, which is a significant bottleneck in applying ML to diverse CFD problems.
  • Consistency Matters for ML: Whether through propagated clusters (C-PROP) or morphed geometries, ensuring consistent feature representations across samples is crucial for effective ML model training.
  • Morphing for Interpretability: In applications like medical diagnostics, where anatomical landmarks are vital, morphing allows for the consistent application of expert-defined regions, maintaining interpretability.

Key Results

  • Aerodynamic Applications (AirNACA & AirDEF):
    • Physics-based clustering (PROP-CR+FC) achieved the highest accuracy (86.5% for AirNACA, 88.7% for AirDEF), outperforming the handcrafted baseline (HC) and the free clustering approach (FREE-CR+FC).
  • The clustering-based methods were significantly better at detecting surface defects than the handcrafted baseline, which failed to capture localized flow perturbations.
  • Morphing-based methods (MORPH+HC, MORPH+FC) performed similarly to the handcrafted baseline, as the chosen regions were far from the airfoil and thus less affected by morphing.
  • Biomedical Application (NosePAT & NoseREAL):
    • For NosePAT (synthetic data), MORPH+FC achieved the highest accuracy (88.5%), closely followed by the handcrafted baseline (HC) at 88.8%. PROP-CR+FC also performed well at 86.8%.
  • For NoseREAL (real patient data), MORPH+FC and PROP-CR+FC achieved the best modal score of 8/10, demonstrating robustness and generalization to unseen real cases.
  • The results suggest that combining richer, clustering-derived features with the spatial consistency of morphing (MORPH+FC) can be highly effective.

Limitations and Future Work

  • Limitations:
    • The C-PROP clustering strategy, while ensuring consistency, might restrict flexibility by relying on a reference case.
  • The handcrafted baseline (HC) in the medical application benefited from strong inductive bias from medical expertise, which is not directly available to clustering.
  • The morphing procedure can be computationally intensive, especially for complex 3D geometries.
  • The NosePAT/NoseREAL datasets are not publicly available due to sensitivity reasons.
  • Future Work:
    • Integrate clustering and morphing components into end-to-end Physics-Informed Neural Networks (PINNs) for direct equation constraint.
  • Extend methods to unsteady and fully 3D CFD scenarios.
  • Develop inference models capable of handling sparse or incomplete CFD data.
  • Explore uncertainty quantification and domain adaptation across geometries.
  • Foster stronger collaborations with domain experts for validation and application.

Summary updated

BibTeX
@inproceedings{margheritti2025feature,
  author = {Riccardo Margheritti and Onofrio Semeraro and Maurizio Quadrio and Giacomo Boracchi},
  title = {{Feature Extraction from Flow Fields: Physics-Based Clustering and Morphing with Applications}},
  booktitle = {Applied Sciences},
  year = {2025},
  doi = {10.3390/app152312421},
}
Figure