Table of Contents
Fetching ...

A generalised novel loss function for computational fluid dynamics

Zachary Cooper-Baldock, Paulo E. Santos, Russell S. A. Brinkworth, Karl Sammut

TL;DR

A novel loss function is proposed called Gradient Mean Squared Error (GMSE) which automatically and dynamically identifies the regions of importance on a field-by-field basis, assigning appropriate weights according to the local variance to enable accelerated machine learning within computational fluid dynamics.

Abstract

Computational fluid dynamics (CFD) simulations are crucial in automotive, aerospace, maritime and medical applications, but are limited by the complexity, cost and computational requirements of directly calculating the flow, often taking days of compute time. Machine-learning architectures, such as controlled generative adversarial networks (cGANs) hold significant potential in enhancing or replacing CFD investigations, due to cGANs ability to approximate the underlying data distribution of a dataset. Unlike traditional cGAN applications, where the entire image carries information, CFD data contains small regions of highly variant data, immersed in a large context of low variance that is of minimal importance. This renders most existing deep learning techniques that give equal importance to every portion of the data during training, inefficient. To mitigate this, a novel loss function is proposed called Gradient Mean Squared Error (GMSE) which automatically and dynamically identifies the regions of importance on a field-by-field basis, assigning appropriate weights according to the local variance. To assess the effectiveness of the proposed solution, three identical networks were trained; optimised with Mean Squared Error (MSE) loss, proposed GMSE loss and a dynamic variant of GMSE (DGMSE). The novel loss function resulted in faster loss convergence, correlating to reduced training time, whilst also displaying an 83.6% reduction in structural similarity error between the generated field and ground truth simulations, a 76.6% higher maximum rate of loss and an increased ability to fool a discriminator network. It is hoped that this loss function will enable accelerated machine learning within computational fluid dynamics.

A generalised novel loss function for computational fluid dynamics

TL;DR

A novel loss function is proposed called Gradient Mean Squared Error (GMSE) which automatically and dynamically identifies the regions of importance on a field-by-field basis, assigning appropriate weights according to the local variance to enable accelerated machine learning within computational fluid dynamics.

Abstract

Computational fluid dynamics (CFD) simulations are crucial in automotive, aerospace, maritime and medical applications, but are limited by the complexity, cost and computational requirements of directly calculating the flow, often taking days of compute time. Machine-learning architectures, such as controlled generative adversarial networks (cGANs) hold significant potential in enhancing or replacing CFD investigations, due to cGANs ability to approximate the underlying data distribution of a dataset. Unlike traditional cGAN applications, where the entire image carries information, CFD data contains small regions of highly variant data, immersed in a large context of low variance that is of minimal importance. This renders most existing deep learning techniques that give equal importance to every portion of the data during training, inefficient. To mitigate this, a novel loss function is proposed called Gradient Mean Squared Error (GMSE) which automatically and dynamically identifies the regions of importance on a field-by-field basis, assigning appropriate weights according to the local variance. To assess the effectiveness of the proposed solution, three identical networks were trained; optimised with Mean Squared Error (MSE) loss, proposed GMSE loss and a dynamic variant of GMSE (DGMSE). The novel loss function resulted in faster loss convergence, correlating to reduced training time, whilst also displaying an 83.6% reduction in structural similarity error between the generated field and ground truth simulations, a 76.6% higher maximum rate of loss and an increased ability to fool a discriminator network. It is hoped that this loss function will enable accelerated machine learning within computational fluid dynamics.

Paper Structure

This paper contains 16 sections, 12 equations, 13 figures, 1 table, 1 algorithm.

Figures (13)

  • Figure 1: Ground truth CFD plane, used to determine pixel weights. Central body geometry of a submarine is shown in the centre, as observed from a top down perspective. Higher flow velocity indicated by yellow gradient regions.
  • Figure 2: Schematic diagram of the controlled generative adversarial (CGAN) network.
  • Figure 3: Visual depiction of GMSE loss function operation. The reference ground truth CFD image from the dataset (a) is used to first produce a disparity array (b). The disparity array is then blurred, resulting in the blurred array (c). Finally, a weighting array (d) is produced, used to score the individual pixel loss during training for each new instance the generator provides. The grey appearance of (d) results due to the non-zero lowerbound, used to give weighting to the freestream of the flowfield.
  • Figure 4: Image is a cropped version of the flow field depicted in Fig. \ref{['fig:GroundTruth']}. Detailed is the pixel disparity using a standard difference of Gaussians (DOG) filter (a) and the non-linear disparity determination from this method (b). Absolute disparity magnitude is indicated by the colorbars, as shown. Additional detail is shown regarding the disparity on (b) when compared to (a)
  • Figure 5: Generator validation loss for the baseline MSE loss optimised network (red) and the GMSE loss gamma variant networks. More rapid convergence is observed for the GMSE optimised network, in comparison to the MSE optimised network. The DGMSE optimised network is observed to outperform both approaches.
  • ...and 8 more figures