Abstract
Design patterns provide a systematic way to convey solutions to recurring modeling challenges. This paper introduces design patterns for hybrid modeling, an approach that combines modeling based on first principles with data-driven modeling techniques. While both approaches have complementary advantages there are often multiple ways to combine them into a hybrid model, and the appropriate solution will depend on the problem at hand. In this paper, we provide four base patterns that can serve as blueprints for combining data-driven components with domain knowledge into a hybrid approach. In addition, we also present two composition patterns that govern the combination of the base patterns into more complex hybrid models. Each design pattern is illustrated by typical use cases from application areas such as climate modeling, engineering, and physics.
Introduction
In the current landscape of artificial intelligence, a significant shift is occurring at the intersection of classical physics and modern machine learning. While deep learning models excel at identifying patterns in high-dimensional data, they are frequently criticized as "black boxes" that require vast amounts of data and struggle to generalize beyond their training distributions. Conversely, first-principles models—grounded in physics, chemistry, or biology—are highly interpretable and data-efficient but often lack the complexity to capture the nuances of real-world, non-linear systems.
Hybrid modeling emerges as a solution to this dichotomy, seeking to combine the strengths of both approaches. However, the integration of domain knowledge with data-driven components has historically been an ad-hoc, domain-specific endeavor. This paper formalizes this integration by introducing a taxonomy of "Design Patterns" for hybrid modeling, providing a unified language for researchers across diverse scientific and engineering disciplines.
The Need for a Unified Taxonomy
Building a hybrid model often involves "reinventing the wheel." A climate scientist integrating fluid dynamics with a neural network may face the same architectural challenges as an automotive engineer modeling a combustion engine, yet they lack a shared framework to exchange solutions. By abstracting these recurring challenges into design patterns, we can facilitate knowledge transfer and provide blueprints for building models that are more accurate, data-efficient, and physically consistent.
Base Design Patterns
The authors propose a block-diagram notation using $P$ for physics-based components and $D$ for data-driven components. Four fundamental base patterns are identified:
- The Delta Model ($H = P + D$): In this configuration, the physics model $P$ captures the primary, well-understood trend of the system. The machine learning component $D$ is then trained to learn the "residual" or the discrepancy between the physical model's predictions and real-world observations. This is particularly effective for correcting known simplifications in theoretical models.
- Physics-based Preprocessing ($H = D(P)$): Here, domain knowledge is used to transform raw data into a more informative representation before it reaches the machine learning model. A classic example is the conversion of raw audio signals into Mel spectrograms, which leverage acoustic principles to simplify the learning task for a downstream classifier.
- Feature Learning ($H = P(D)$): In this pattern, the machine learning model acts as a "virtual sensor." It estimates unmeasurable or latent variables—such as the internal temperature of a motor or local atmospheric coefficients—which then serve as inputs for a rigorous physics-based simulation.
- Physical Constraints ($H = D_P$): This pattern involves embedding domain knowledge directly into the architecture or optimization process of the machine learning model. This can be achieved through "hard constraints" (e.g., ensuring output sums to one via a Softmax layer) or "soft constraints" (e.g., Physics-Informed Neural Networks (PINNs) that penalize violations of differential equations in the loss function).
Composition Patterns
To address complex, multi-layered systems, the authors introduce composition patterns that govern how base patterns can be combined:
- Recurrent Composition: This involves using hybrid blocks within sequential update rules, such as integrating a Delta model into a Kalman filter or a Recurrent Neural Network (RNN) to model time-evolving systems.
- Hierarchical Composition: This pattern allows for the nesting of hybrid models, where one hybrid component serves as a sub-module within a larger, more complex hybrid architecture.
Empirical Evaluation: The Van der Pol Oscillator
The efficacy of these patterns is demonstrated through the Van der Pol oscillator, a non-linear dynamical system. The study compared three approaches:
- Pure Physics ($P$): Successfully captured long-term trends but failed to account for local, short-term perturbations.
- Pure Machine Learning ($D$): Utilized a Gaussian Process that performed well within the range of the training data but failed catastrophically (reverting to a zero-mean) in regions where data was missing.
- Hybrid Delta Model ($H = P + D$): This approach maintained high accuracy across all regions. It utilized the physics component to "bridge" data gaps (extrapolation) while using the machine learning component to refine the physics where data was available (interpolation).
Discussion and Future Work
While these design patterns provide a robust blueprint for model construction, the validation and verification of hybrid models remain an open challenge. These models combine different sources of uncertainty—modeling errors in the physics and statistical noise in the data—making standard error metrics insufficient for a complete assessment of reliability.
Future research will focus on expanding this library of patterns and developing automated tools for the end-to-end training of multi-component hybrid architectures. By standardizing these approaches, the scientific community can move toward a more disciplined and repeatable methodology for combining the laws of nature with the power of data.
Summary updated