Reconstructing the pressure field around swimming fish using a physics-informed neural network

ABSTRACT Fish detect predators, flow conditions, environments and each other through pressure signals. Lateral line ablation is often performed to understand the role of pressure sensing. In the present study, we propose a non-invasive method for reconstructing the instantaneous pressure field sensed by a fish's lateral line system from two-dimensional particle image velocimetry (PIV) measurements. The method uses a physics-informed neural network (PINN) to predict an optimized solution for the pressure field near and on the fish's body that satisfies both the Navier–Stokes equations and the constraints put forward by the PIV measurements. The method was validated using a direct numerical simulation of a swimming mackerel, Scomber scombrus, and was applied to experimental data of a turning zebrafish, Danio rerio. The results demonstrate that this method is relatively insensitive to the spatio-temporal resolution of the PIV measurements and accurately reconstructs the pressure on the fish's body.

where, is , , or , is the number of spatio-temporal data points in the dataset, and is the number of spatio-temporal data points used for the normalization. Since far away from the fish's body, the component of the velocity and the are both approximately zero, the normalization of these two quantifies only utilized the values near the fish's body. In this analysis, the weights of the loss function were all set to unity and the network was trained for 1000 epochs, or 155,000 iterations. One epoch is defined as the number of iterations required to make one full pass through the entire data set. As shown in Fig. S1-A, as the network size increases, the relative global RMSE decreases and eventually begins to oscillate around a mean value. Based on these results, a network size of 12 hidden layers and 120 neurons per layer was selected since it produced the smallest error in the least amount of time.
In addition to the size of the network, the duration of training also effects the accuracy of the predicted velocity and pressure field. Thus, one must determine the number of iterations that balances the computational expense with the accuracy. To test the PINN's sensitivity to the training time, it was trained for epochs ranging from 500-1750, which for this dataset corresponds to iterations ranging from 77K -272K. For each training period, the relative global root mean square error (RMSE) in the velocity and pressure fields was computed. As shown in Fig.   S1-B, 1500 epochs produces the smallest error in the pressure field predictions and requires a computational cost of roughly 9 hours. Since every 500 epochs adds approximately 1.5 hours to the computational expense, it was determined that training the PINN for 1500 epochs would efficiently balance the accuracy of the PINN predictions with the computational expense.

Effect of weights and data noise
To test the sensitivity of the accuracy of the PINN predictions to the weighting coefficients utilized in the loss function, a weight analysis was performed where the data and boundary conditions loss terms were weighted over the Navier-Stokes equations. The weights tested included 1, 10, 50, 100, 500, and 1000. Since knowledge of the velocity field and boundary condition is needed by the PINN to find a proper solution to the Navier-Stokes

Supplementary Materials and Methods
equations, the idea was that by providing these terms with a higher weight, the accuracy of the method would improve. As was done in the network size and training duration studies, the relative global RMSE in the velocity and pressure fields were computed for each weight tested. In this study, the PINN was trained for 1500 epochs. As shown in Fig. S2, the error decreases significantly as the weighting coefficients approach 100. As the weighting coefficient approaches 1000, the error in the velocity field continues to decrease, but the errors in the pressure field begin to increase. This suggests that a weight that is too large would result in over fitting to the velocity field.
Therefore, a weight of 100 was applied to the data and boundary condition loss terms for all cases tested in this paper. These weighting coefficients correspond to 1 and 3 in the main text.

Journal of Experimental Biology • Supplementary information
To test the sensitivity of the proposed method to noise, artificial white noise was added to the velocity data obtained on the 2D plane extracted from the DNS data. For this study, the velocity field had a spatial resolution of Δ = 0.02 and a temporal resolution of Δ = 0.02 . Gaussian noise is considered, where the noisy velocity data is of the form: Here, is Gaussian noise with zero mean and unit variance, and is the noise level defined by the ratio of the noise magnitude to the standard deviation of the velocity data. The noise level was varied from 0 to 1 by increments of 0.2. The relative global RMSE of the velocity and pressure was then computed for each noise level tested. The results are shown in Fig. S2E, which demonstrates that the PINN method is readily insensitive to noise. The errors in the pressure field only really begin to rise after a noise level greater than 0.6.