Applying physics-based loss functions to neural networks for improved generalizability in mechanics problems

Samuel J. Raymond,David B. Camarillo
DOI: https://doi.org/10.48550/arXiv.2105.00075
2021-05-25
Abstract:Physics-Informed Machine Learning (PIML) has gained momentum in the last 5 years with scientists and researchers aiming to utilize the benefits afforded by advances in machine learning, particularly in deep learning. With large scientific data sets with rich spatio-temporal data and high-performance computing providing large amounts of data to be inferred and interpreted, the task of PIML is to ensure that these predictions, categorizations, and inferences are enforced by, and conform to the limits imposed by physical laws. In this work a new approach to utilizing PIML is discussed that deals with the use of physics-based loss functions. While typical usage of physical equations in the loss function requires complex layers of derivatives and other functions to ensure that the known governing equation is satisfied, here we show that a similar level of enforcement can be found by implementing more simpler loss functions on specific kinds of output data. The generalizability that this approach affords is shown using examples of simple mechanical models that can be thought of as sufficiently simplified surrogate models for a wide class of problems.
Computational Physics,Computational Engineering, Finance, and Science,Machine Learning,Numerical Analysis
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is to improve the generalization ability of neural networks in mechanical problems. Specifically, the author proposes a new method to improve the prediction performance of traditional neural networks when dealing with different energy systems by introducing constraints based on physical laws into the loss function. This method aims to overcome the problem that traditional loss functions only rely on the error between predicted values and true values, especially when using data with different energy states for training, traditional loss functions are often unable to accurately predict the evolution process of different systems. ### Background of the Paper Physics - Informed Machine Learning (PIML) is an emerging field that combines the advantages of scientific computing and machine learning. The goal of PIML is to ensure that the prediction, classification, and inference of machine - learning models conform to the constraints of physical laws. In recent years, PIML has made significant progress in fields such as computational mechanics and materials science. ### Research Motivation When dealing with physical problems, traditional neural networks often have problems of inaccurate prediction or mode collapse due to the lack of explicit constraints on physical laws. For example, when training a neural network with a traditional loss function, the network may be biased towards predicting low - energy states, resulting in the failure of high - energy - state prediction. ### Solution This paper proposes a new method, that is, adding simple physical laws, such as the law of conservation of energy, into the loss function to force the predictions of the neural network to conform to physical laws. This method not only improves the generalization ability of the model but is also more computationally efficient, avoiding the complex partial differential equation (PDE) calculations in traditional Physics - Informed Neural Networks (PINNs). ### Experimental Verification The author carried out experimental verification through a simple pendulum system. The experimental results show that the neural network trained with a loss function containing an energy - conservation term can better predict the motion of the pendulum system and maintain energy conservation over multiple periods, while the traditional loss function will cause the prediction results to rapidly decay to the lowest energy state. ### Conclusion The method proposed in this paper significantly improves the prediction performance of neural networks when dealing with mechanical problems of different energy systems by introducing simple physical laws into the loss function. This method is not only more computationally efficient but also has wide applicability and can be applied to a variety of physical systems. Future research can further explore how to embed other physical laws (such as conservation of momentum, conservation of angular momentum, etc.) into the loss function to improve the generalization ability and prediction accuracy of the model.