{'fraction_non_alphanumeric': 0.026592208482914506, 'fraction_numerical': 0.011833532774896955, 'mean_word_length': 5.218685407193055, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Data recovery in computational fluid dynamics through deep image priors

One of the challenges encountered by computational simulations at exascale is the reliability of simulations in the face of hardware and software faults. These faults, expected to increase with the complexity of the computational systems, will lead to the loss of simulation data and simulation failure and are currently addressed through a checkpoint-restart paradigm. Focusing specifically on computational fluid dynamics simulations, this work proposes a method that uses a deep convolutional neural network to recover simulation data. This data recovery method (i) is agnostic to the flow configuration and geometry, (ii) does not require extensive training data, and (iii) is accurate for very different physical flows. Results indicate that the use of deep image priors for data recovery is more accurate than standard recovery techniques, such as the Gaussian process regression, also known as Kriging. Data recovery is performed for two canonical fluid flows: laminar flow around a cylinder and homogeneous isotropic turbulence. For data recovery of the laminar flow around a cylinder, results indicate similar performance between the proposed method and Gaussian process regression across a wide range of mask sizes. For homogeneous isotropic turbulence, data recovery through the deep convolutional neural network exhibits an error in relevant turbulent quantities approximately three times smaller than that for the Gaussian process regression,. Forward simulations using recovered data illustrate that the enstrophy decay is captured within 10% using the deep convolutional neural network approach. Although demonstrated specifically for data recovery of fluid flows, this technique can be used in a wide range of applications, including particle image velocimetry, visualization, and computational simulations of physical processes beyond the Navier-Stokes equations.


Introduction
As modern computational efforts reach exascale, hardware and software faults will increasingly cause difficulty in completing simulations [1]. Current research in hardware systems and software frameworks [2,3,4,5,6,7] continues to develop techniques to detect and anticipate system failures; however, assuming that a fault has been detected and signaled, the data loss from these failures will require data recovery processes [8]. This work addresses this challenge. Current computational codes rely on a checkpoint and restart paradigm to recover from faults, requiring either significant memory consumption for frequent checkpoints or large resimulation efforts. The ability to recover the missing data without resorting to data checkpoints has the potential to increase simulation resilience.
In the context of computational fluid dynamics (CFD), data recovery has been explored using a variety of machine learning approaches. Gappy proper orthogonal decomposition (POD) has shown particular success in reconstructing missing data [9,10,11]. This approach relies on combining POD with leastsquares estimates [12,13] and data from direct numerical simulations snapshots. Venturi and Karniadakis [11] expanded on the methods proposed by Everson and Sirovich [9] and used this technique to reconstruct missing data of unsteady flow past a cylinder. Other approaches rely on Gaussian process regression (GPR), often referred to as Kriging in geophysics, which is a a reconstruction technique that uses the mean and covariance of the Gaussian processes prior. 2 The prior's covariance is determined by a kernel whose hyperparameters are optimized using training data. Gunes et al. [14] compare POD-based and GPRbased solution reconstruction and show that GPR interpolations are particularly effective for unsteady flows (including instability regions), whereas POD-based methods are advantageous when the temporal resolution is high. In addition to these methods, Lee et al. [8] proposed a "resimulation" method in which the missing data region is resimulated using appropriate initial and boundary conditions. This new method is evaluated for lid-driven cavity flows and flows past a cylinder at low Reynolds numbers. Lee et al. [15] combined the gaptooth algorithm, previously developed for dynamic systems [16], multiresolution information fusion, and auxiliary data to construct a general framework for fault-tolerant CFD. The method is demonstrated to work well for simulations of the heat equation and lid-driven cavity flow.
Recently, the deep learning community has been proposing methods for data recovery in the field of inverse image reconstruction problems, which include denoising, inpainting, and super-resolution, [17,18,19,20,21,22,23]. Deep convolutional neural networks, particularly generative adversarial networks, have been very successful at solving this class of problems [17]. Inpainting is of particular relevance to our objective of reconstructing flow solutions. The objective of inpainting is to fill in missing portions of a damaged image such that the result is indistinguishable from the original image. Various generative adversarial neural networks have been proposed for image inpainting with notable success [24,25,26,27,28]. Generally speaking, these approaches have relied on training deep neural networks with an extensive and large data set of images such that the network learns image priors that it can use in other configurations.
The deep learning methodology used in this work was first developed by Ulyanov et al. [29] for various inverse image reconstruction problems, including inpainting. In contrast with previous image reconstruction solution with deep neural networks, Ulyanov et al. [29] showed that "contrary to the belief that learning is necessary for building good image priors, a great deal of image statistics are captured by the structure of a convolutional image generator independent of learning." Instead of training the neural networks with a large database of images, the authors use untrained neural networks to fit single degraded images, using the network weights as parameters for solving the image reconstruction problem.
In this work, we use deep convolutional neural networks, such as those proposed by Ulyanov et al. [29], for spatial reconstruction of the flow solution for simulations wherein some type of fault led to loss of data, e.g., processor failure.
In contrast to gappy POD [11], we assume that the current gappy data are the only available data for the reconstruction procedure. This assumption is relevant to large simulations where it is computationally expensive to reload data residing on the file system and the reconstruction process is restricted to data already in memory. One advantage of using deep convolutional neural networks is that this approach avoids eigenmode decompositions for solution reconstruction, which could restrict the applicability or translation of the method to new configurations. As illustrated in this work, the method proposed here is not specific to the flow configuration and does not require multiple training data samples.
This paper is organized as follows. In Section 2, we present the problem formulation and define the objective function for the data recovery problem. In Section 3, we detail the architecture of the deep convolutional neural network used to perform the data recovery process for fluid flows. In Section 4, we present our results by evaluating the neural network's ability to perform data recovery for two canonical flows: laminar flow past a cylinder, Section 4.1, and homogeneous isotropic turbulence, Section 4.2. These results are compared with data recovery performed through GPR. Finally, conclusions and future work are presented in Section 5.

Problem formulation
In this work, we evaluate the performance of deep convolutional neural networks for data recovery in CFD. Deep convolutional neural networks have shown particular success for solving the image reconstruction problem [17]. Image reconstruction is analogous to data recovery because they share a similar objective to provide synthetic data that closely match the missing data. The image reconstruction problem can be cast as an optimization problem: where x is the original image that needs to be recovered, x 0 is the corrupted image, E(x; x 0 ) is the task-dependent data term, and R(x) is the image prior.
In the case of inpainting, the task-dependent data term is: where • is the Hadamart product, m ∈ {0, 1} h×w represents the binary mask, and h and w are the image height and width. The image prior is usually captured through the training of convolutional neural networks using a large image database. In the approach proposed by Ulyanov et al. [29], R(x) is replaced by a parameterization such that the optimization problem becomes: where f represents the convolutional neural network with parameters θ that is initialized randomly, and z is a fixed input. The fixed input for the neural network can take many forms but is usually chosen to be random uniform noise or smoothly varying data. Note that the neural network input is fixed. Given a deteriorated image, the neural network effectively learns, by backpropagation and network parameter tuning, the encoding necessary to map the fixed input to an output, i.e., the recovered image, which minimizes the loss function, Equation 3.
We emphasize that physical constraints are not explicitly included in the data recovery process. This has the advantage of enabling a reconstruction technique that does not depend on the physical nature of the problem. Higher fidelity can be achieved, however, by incorporating physical constraints, as suggested in [30,31]. The work presented here focuses on two-dimensional reconstruction, though there is no inherent methodological limitation to reconstructing three-dimensional data directly.

Neural network architecture
The network chosen for this work is a convolutional neural network that exhibits an encoder-decoder architecture with approximately 2 million tunable parameters and no skip connections, Figure 1a. This architecture enables the network to encode the input in the latent space and then decode the latent space representation into the reconstructed image. The nonlinear activation function used in the network is LeakyReLU [32]. Downsampling was performed through simple striding in the convolution procedure, Figure 1b, and upsampling was done through nearest-neighbor upsampling, Figure 1c. The number of filters in the downsampling and upsampling layers, n f , was kept fixed at 128, and the kernel size, k, was fixed at 3. Experiments showed that using a fixed smoothly varying input z for the neural network imposes a smoothness prior, which is beneficial for data recovery for fluid flows. The optimization process was performed using Adam [33]. The implementation was done in PyTorch [34], and the learning process was computed on a Tesla V100 graphics processing unit.
The number of iterations for all the experiments was 2000, thereby reducing the loss function by three orders of magnitude.

Results
To demonstrate the efficacy of using deep neural networks for data recovery,    unsurprising that GPR performs well at moderate mask sizes, given previously published results [14].
Initial two-dimensional data slices are generated by slicing in each direction a numerical simulation of homogeneous isotropic turbulence at a resolution of 64 cells in each direction, leading to 192 unique slices. The velocities in each direction are assigned an input channel for the neural network. Masks simulating data loss because of processor failure are generated independently, following typical domain decomposition. We explore two different parameters associated with the mask generation process. The first is the total percentage of missing data, f , ranging from 6.25% to 25%. The second is the length scale associated with each block of missing data, L m , ranging from 3.125% to 50% of the domain length, or 0.74λ to 11.87λ. For each pair of parameters f and L m , we randomly generate ten different masks, resulting in 130 unique masks. These are randomly applied to 100 initial slices, resulting in 1300 slices requiring reconstruction. For each of these deteriorated slices, the neural network parameters are tuned to optimize the reconstruction loss function, Equation (3). The data from the resulting recovered slice are then used for comparison with the original slice.
The data recovery process is illustrated for one slice in Figure 4.   Figure 5a.
The average error from the GPR reconstruction increases at high wavenumbers, indicating that it not able to accurately capture the smallest scales of turbulence, Figure 5b. This behavior is not exhibited with the deep neural network reconstruction, and the error increases slightly as a function of wavenumber.
Velocities in slices of the original and recovered data are used as initial con-   Figure 6 illustrates the decay of normalized enstrophy, ω = λ 2 u 2 V V (∇ × u) 2 dV , for simulations where f = 25% and L m ∈ [0.74λ, 11.87λ], or 3.125% to 50% of the domain length. GPR reconstruction exhibits a significantly different enstrophy decay from the original data, Figure 6b. For the deep convolutional neural network, the enstrophy decay is well captured at all mask sizes, with slightly less accuracy for large L m , Figure 6a. Across the range of mask sizes, the normalized error at t = 1τ in kinetic energy and enstrophy is less than 10% for the deep convolutional neural network and around 20% for the GPR reconstruction. These differences in reconstruction procedures are attributed to the deep convolutional neural network's ability to preserve the energy spectra and accurately represent all the length scales.

Conclusion
This We emphasize that the work presented here is not necessarily beholden to the specific inpainting technique used. The deep learning community has developed many different methods for image inpainting that can be used for data recovery, and it is expected that state-of-the-art methodologies would perform comparably well. Rather, the use of deep image priors as first proposed by Ulyanov et al. [29] and investigated here provides a convenient framework to perform data recovery of fluid flows because it does not require pretraining the neural network to construct image priors for different flows. It is therefore agnostic to the specific flow configuration, and the same framework can be used for very different flows. This technique, however, does necessitate the solution of an optimization problem for each data recovery task. Future work will investigate alleviating this through partial pretraining, transfer learning, and perceptual loss functions.
This work -including data sets, demonstration notebooks, analysis scripts, and figures -can be publicly accessed at the project's GitHub page. 4 Traditional machine learning algorithms were implemented through scikit-learn [35] and the deep learning algorithms through PyTorch [34].