A curved surface representation method for convolutional neural network of wake field prediction

The goal of this study is to develop a prediction method to recognize the wake field behind a ship using a convolutional neural network (CNN) model. First, a new representation method for a 3D curved surface is proposed suitable for the CNN, called an image-based hull form representation (IHR). The advantages of the proposed method are the high fidelity of its hull form representation using more than 20,000 input data points and its fast prediction speed, which requires less than 0.01 s for a task that traditionally took more than an hour to estimate by physics-based simulation. The IHR regards that a two-dimensional grid formed on the 3D curved hull surface, which is used for structured-grid-based CFD, as a data set with the same data structure as the image data. Because CNNs recognize image data at accuracy rates higher than humans, a CNN is also be expected to recognize 3D surface characteristics with higher accuracy than humans. The image data are represented by three primary colors (cyan, magenta, yellow) in vertical and horizontal (i × j) pixels. The hull-form-structured grid can also be expressed as an i × j structure data with (x, y, z) coordinates that have the same data structure as the three primary colors in the image data. A CFD calculation data set of 2730 ship types with different stern shapes was constructed to verify the proposed method. The validation results proves that the root mean squared error of the proposed model is 0.005 to predict axial wake velocity on a propeller plane, and the coefficient of determination R2 achieves 0.986. In addition, the estimation speed for each hull-form prediction is 100,000 times faster than are physics-based simulations. The results lead to the conclusion that the representation method of a curved surface and the proposed prediction method of the stern wake field is a promising tool in the initial hull form design.


Introduction
Recently, environmental regulations such as EEDI and labor shortages have produced a strong demand to shorten ship design times.Simulation-based design (SBD) has been a prevalent technique in hydrodynamic hull-form design, and many hull-form optimization methods based on computational fluid dynamics (CFD) have been utilized in hull-form design.However, physically based simulations are still slow; large-scale calculations of hull-form optimization can take up to several weeks.
In contrast, artificial neural network (ANN) technologies have advanced rapidly.Kim et al. [1] proposed a generative neural network for parameterized Eulerian fluid simulations intended to create animations rapidly; this model performed up to 700 times faster than techniques to simulate data with a CFD solver.Thus, this approach can be applied to hydrodynamic ship design, especially during the preliminary design stage, because the model error caused by not using the physical model is relatively tolerable and the fast prediction speed is required.
The application of ANNs to the hydrodynamics of ships has been discussed starting from the second AI boom, in early 2000, Matumura and Ura [2] applied ANN technique to predict wave marking resistance from the input parameters of ship length, width, Froude number.Following this, Kanai [3], Mesbahi and Bertram [4], Bertram and Mesbahi [5] and Mason et al. [6] presented some models to predict calm sea propulsive performances using ANNs.These ANNs handle only up to ten input parameters of principal dimensions that cannot represent complex three-dimensional hull forms.Radojcic and Kalajdzic [7] proposed an ANN model to estimate resistance and trim based on the systematic generated hull form database, called the Naples Hard Chine Systematic Series, and Margari et al. [8] also modeled another series tank-test results, called MARAD systematic series.The MARAD comprises 16 full hull forms, specifically designed for use as bulk carriers and tankers.Although the ANN technique has been advanced in the last 20 years, input parameters of these models are still dimensional information of ship, such as length beam ratio, slenderness ratio, longitudinal center of gravity (LCG).Kazemi et al. [9] designed a stepped planning craft using ANN trained by CFD database, which can estimate resistance from loading weight, LCG position, step type and step position.In this model, some local shape parameters began to be applied that is easy to parameterize in the hull form.Cepowski [10] applied an ANN to estimate added resistance by means of ship's principal dimensions, block coefficient and Froude number.Another approach to apply an ANN technique to ship design is presented by Eric et al. [11], they develop a neural network-based response surface method for reducing the cost of time-consuming CFD optimizations in ship design.
Looking at other ANN adaptations in the field of ships other than hull form design, Bal Beşikçi et al. [12] estimated ship fuel consumption for various operational conditions from inputs of ship speed, revolutions per minute, mean draft, trim, cargo quantity on board, wind, and sea conditions.Nowruzi et al. [13] investigated the lift to drag ratio of conventional 2D and 3D NACA hydrofoils by environmental and geometrical conditions, such as Reynold's Number, angle of attack, aspect ratio and taper ratio of hydrofoil.Shora et al. [14] proposed an ANN model which predicts the performance and cavitation volume of the propeller, by inputs of pitch ratio, rake angle, and skew angle, advance velocity ratio and cavitation number.Najafi et al. [15] designed hydrofoil-supported catamarans based on an ANN model which predicts resistance and trim sinkage by Froude number, hydrofoil type.
These applications are useful for the decision-making of ship design and operation, but there are still limitations of application of complex three-dimensional hull form surface design, that cannot capture 10-100 parameters.The cause of this limitation of ANN is the problem of overfitting in the training when the inputs of the model increased.Especially in the design of the local shape of a hull form with a complex three-dimensional shape, this limit becomes a constraint of the design.While the shape of the propeller can be easily defined by parameters, such as pitch distribution, there is no method for parametrizing the hull form in detail with a small number of parameters, and hull form information was lost in the parametrization of the past studies.
In the field of hull-form expression and parametrization in design, many methods have been developed and discussed.Khan et al. [16] introduced a method to represent yacht hull surfaces by parametrized feature curves on conns patches defined for each section.Nam and Si Bang [17] proposed hull variation method that modifies the boundary shape with geometric constraints of area and centroid.Hong et al. [18] developed a method of transforming the surface of ship hull using self-bending method, and Zong et al. [19] applied the self-blending method to CFD-based optimization of a trimaran.However, these methods have been developed with consideration for hull form optimization using CFD and optimization theory and are not optimal for ANN adaptation.
Trying to solve the limitation problem of the ANN inputs, Habu and Egami [20] applied the deep learning method to estimate wave-making resistance.This model can treat offset data, which has 1950 data points.Takagi et al. [21] proposed a prediction model using image data obtained by projecting the hull shape from various angles as input.These studies show good approximation results for predicting scalar value, but the question has remained unanswered how to express the detailed hull forms suitable for ANNs.
In such situations, a hull form surface design methodology using data science technology has been developed.This design methodology directly handles and analyzes hull-surface grid information which is over 20,000 data points and captures all the detail and local information of the hull surface.This method utilizes CFD simulation data accumulated at the design location; however, these data are not currently being used as effectively as possible during project design.Ichinose and Tahara [22] introduced a wake field design method that applied the CFD result database and a hull-form blending (morphing) method that solves the inverse problem of the Navier-Stokes equation; namely, this method can generate a hull form that yields the desired wake field behind the ship.The advantage of combining hull form manipulations with data analysis is that this approach does not constrain the hull representation.
In this study, a hull representation method suitable for a convolutional neural network (CNN) is proposed.The proposed method can capture the local and detailed hull-form surface information using over 20,000 points of input data, and CNN technique enables us to overwhelm the problem of the limitation of the input dimension.CNNs are widely used in image data recognition and have recorded higher recognition accuracy than humans; thus, CNNs have the potential to recognize features of more than 20,475 (65 × 105 × 3) input data on hull form surfaces.Initial validation results using a data set of 2730 hull form and flow field CFD data demonstrate the proposed method's ability to make precise wake predictions.

Hull form data representation
Before introducing image-based hull form representation (IHR), this section briefly reviews basic CNN characteristics.Figure 1 shows an overview of the convolution operation in a CNN.The convolution operation is performed on a filter of size k at intervals of stride s which compresses the region data at some scale data to enlarge the data characteristics in the focused region.In Fig. 1, ch indicates the channel size of the input data which has two dimensions (h, w), and Floor denotes an operation to obtain the closest integer value.
The operation emphasizes the relationship of pixels to adjacent data rather than the absolute value of each pixel.A CNN performs these operations over multiple layers and then corrects the weights with the learning data so that a model emerges that automatically emphasizes the relationships between adjacent pixel values.Thus, the convolution operation can automatically handle object positional differences.
In the case of hull-form surfaces, the relationship with adjacent offset data is important for representing the hull surface; for example, in a theoretical analysis of wave-making resistance, the first-order differential value and curvature of a hull form are the basis of a solution.Hence, a CNN that can consider this relationship will be effective for shiphydrodynamic analysis.
Based on this idea, an IHR for ANNs that can directly process 3D hull surfaces was devised in this study.
Figure 2 shows an overview of the IHR.The main point of the representation is the two-dimensional grid format of the hull surface.A structured grid-based CFD format has the same structure as the image data.The image data are represented by three primary colors (cyan, magenta and yellow) on the vertical (i) and horizontal (j) pixels.The hull-form structured grid is also expressed as i × j structure data with (x, y, z) coordinates, which have the same data structure as the three primary colors in the image data.
For ANNs, this representation has two advantages over the conventional parametric hull-form representation method.
First, this representation has a higher degree of freedom in hull-form expression than do conventional hull-form representations based on hull parameters.The proposed Second, data augmentation can be achieved by placing different grids on the same hull form.In general, the number of CFD results is often limited, but machine learning needs large amounts of training data.Given that the number of grids of the database is sufficient and the CFD calculation result converges to the correct value even if the grid arrangement is changed, the proposed method can use data augmented by creating multiple grids with different hull surface grids from a single CFD calculation result.

CNN architecture and prediction method
As our present method predicts image-liked wake flow data from image-based hull form data, the generative adversarial networks (GAN) model proposed by Radford et al. [23] has the same dimensional data set structure of input and output data.Therefore, the present CNN architecture was designed by the reference of the GAN architecture.
Figure 3 illustrates the input and output data for the proposed CNN.Imaged hull-form data, which include 2730 ships represented by a 3 × 65 × 105 data structure, are used as the input to the CNN, and the output is a CFD-calculated wake field value represented by 3 × 19 × 9 data structure in the output layer.Note that because the wake field in the resistance condition can assumed to be symmetric to the centerline for symmetric hull forms, only the port-side half of the hull form and wake data are used in this study.The details of this data set are provided in the next section.
The architecture of the proposed CNN is shown in Fig. 4. In this model, some original adjustments for the convolution layer and filter size are applied to the basic GAN model.In Fig. 4, the rectified linear unit activation function (ReLU) is a commonly used activation function in CNNs, and batch normalization (BN) is a technique for standardizing data to accelerate neural network training.In this architecture, the imaged hull-form data of the input data is on the left-side of the figure, and the model generates the value of the stern wake flow on the right-side.The first three processes in this model imply convolution operations to extract the high-level feature of each hull form, and the dense processes indicate fully connected layers to learn non-linear combination of the high-level features as represented by the output of the convolutional layers.It noted that the proposed CNN was coded using Keras [24].
In the training of this CNN model, mean square errors (MSE) of each of the flow velocity is applied to the loss function; MSE is defined by the following equation: where y i are the ground truth values, ŷi are predicted values of each point, and n is the number of data available for the training.As the solver of optimization to reduce the loss function in the training, Adam method (2015) [25] is applied in the present research.The learning rate is 2 × 10 -4 in the referenced paper [23], but because the number of images available for learning is limited, the learning rate of the present paper is set to 1 × 10 -6 through trial and error observing the loss function of training and validation data.
Finally, from a design tool decision-making process viewpoint, the advantages of this method are described in Fig. 5.In a physical model, the flow field is estimated directly from the hull-form data, and the hull surface pressure distribution is integrated to calculate the propulsive performance.Thus, the conventional proposed an ANN estimation method has a critical problem for use in hull design applications: because the propulsive performance is calculated from the intentionally determined hull-form parameters, designers cannot easily  understand why a particular hull form improves the propulsive performance.In contrast, the present method further estimates the propulsive performance from the result of the estimated flow field; consequently, the designer can easily understand why a particular hull form achieves high performance.

Training data set
The data set of the present study is a CFD flow filed database, which is solved by the three-dimensional incompressible Reynolds averaged Navier Stokes (RaNS) equation.In this research an artificial compressibility approach is used for the velocity-pressure coupling as Eq. ( 2): (2) , where (u, v, w) are the velocities in the Cartesian coordinate (x, y, z), respectively.The temporal step is expressed by t, and the pressure is p. is the parameter of the artificial compressibility approach.ij is defined as follows: where R n is Reynolds number and −u , i u , j is the Reynolds stress component.This component is evaluated by one equation turbulent model, modified Spalart-Allmaras (MSA) [26] in this work.
Equation ( 2) is discretized by the finite volume method and Gauss integral theorem and solved by an in-house structured CFD solver, NAGISA [27].
This solver and turbulence model are normally used for hull form design at NMRI to estimate model-scale flow filed.The calculation grids of basic hull forms without any appendages at full loads and even keels were generated with HO topology, 0.9 million cells in half side (i × j × k = 174 × 64 × 80) at model scale as shown in Fig. 6.On the center plane of the hull, a symmetry condition is assigned, and the result is mirrored after the calculation.The minimum spacing normal to wall is set to be y + < 1.0 for constant R n = 1.0 × 10 7 .The effect of free surface is con- sidered to be small and ignored in all cases.An investigation on gird uncertainty for this calculative configuration was carried out in in the previous study [28], and we judged that the present grids have the same acceptable uncertainty level as in this research.
The training data set used to evaluate the proposed wake prediction method is the domestic-749-gross-tonnage DB2    6 Example of CFD grid [28] data set [28], which contains 2730 hull forms and wake field data calculated by CFD.The goal of this study is to perform an initial evaluation of the proposed method; thus, this data set, which was compiled for another research project [28], is applied to gain a complete evaluation picture of the present method.The main dimensions of this data set are presented in Table 1; only the aft part (from S.S. 3.0 to the aft end) is deformed, as shown in Fig. 7.
Figure 8 shows examples of wake fields at the propeller plane from the data set.These images demonstrate that the data set contains a varied wake flow field that is practically used in terms of the wake peak and strength of the vortex, which is comprise of a hook shape.

Results and discussion
The training set is used for training of the present CNN model, and it takes 13 min for 8000 epochs using a computer equipped as follows: CPU: AMD EPYC 7302P (16 Core, 3 GHz) × 1; GPU: NVIDIA RTX3090 24 GB Memory GPU × 2.
In the training, the training set ( 2184) is divided further as 90% (1966) training data and 10% (218) validation data, randomly.This validation data is used to predict the response of the fitted model which is trained by the training data.
Figure 9 shows a convergence graph for the loss function of the proposed CNN.The abscissa represents epochs, which is the number of times all the training vectors are used once to update the weights, the ordinate represents the loss function value, and train and val denote historical training and validation data, respectively.The convergence history shows that overfitting did not occur with the proposed CNN on this training data.
To evaluate an unbiased performance of the present model using the test set, root mean squared error (RMSE) and coefficient of determination R 2 is introduced.Each of them is defined by Eqs. ( 4) and ( 5), respectively: where y is the averaged value of the ground truth (CFD evaluated) values.
The root mean squared error (RMSE) of the first trained model for the test set is 0.011, and the coefficient of determination R 2 is 0.909.The R 2 is a statistical measurement of how well the model predicts the real data and takes the range from − 1.0 to 1.0.The result of the present model, 0.909 indicates that the model can predict the real data very well.
To determine the robustness of the present model, k-fold cross-validation is applied.The training set is split 10 folds.The model is trained using 9 folds as training data, and the resulting model is validated on the remaining part of the data, 10 times.
In the history in k-fold cross-validation of 10 times training, the coefficient of determination R 2 evaluated by test set ranges from 0.838 to 0.954.Observing the history of prediction results in k-fold cross-validation in Fig. 10, the  The value of R 2 : 0.986 is slightly higher than that of the general CNN models, but since the constraints of the data of the hull form are stronger than the general image data, it is appropriate to consider that the value of the present model is acceptable in modeling for ship designs.In addition, it is relatively easy to predict that the data set of the entire design space of the hull form are more correlated to the object of predictions than the data set used in the general objective recognition.It is also important to note that as this study focuses on the ability of the model to capture the local shape of the hull using the CNN method, the present data set is constrained in the main dimension.
To reveal the distribution of the variance of the prediction results of the present model, the distribution of the prediction results of the present model for all test set; all data points (9 × 19), all ship (564), is shown in Fig. 11.The graph indicates that the difference between the prediction results and test set is almost entirely within the range of ±5%.
Figure 12 presents the histogram of the difference between test data and a predicted value for all the test set.The distribution is observed close to a normal distribution, and the standard deviation of it is 0.005.As an ideal standard deviation of wake measurement in a towing tank is 0.0021 which is on the ITTC recommended procedures and guidelines of uncertainty analysis [29], and there is a paper reported that uncertainty of wake measurement of tank test achieves 0.04 [30], present prediction model's performance is practically sufficient.It noted that there are some rooms to improve the fidelity of the CFD data set, such as using more detail grid and turbulent model.
The average estimation speed for each hull form prediction is approximately 0.0015 s, which is more than 100,000 times faster than are physics-based simulations, which require approximately an hour for each prediction.
Next, the distribution of the predict values at each position of the propeller plane is evaluated.Figure 13 shows the evaluation points of the predicted axial velocity of the wake field on the propeller plane.Each point reflects a prediction point of the proposed method; the abscissa presents the breadth directional position; and the ordinate shows the water-depth directional position.First, prediction in the radius direction of the propeller plane at the centerline (y = 1.0) is crucial for propeller design with regard to vibration.
Figure 14, which shows a comparison between the test set and the predicted data at the centerline, demonstrates that the proposed method precisely predicts the wake peak on the top of the propeller plane, which is valuable for propeller design.
Figure 15 shows the evaluation results in the rotational direction of the propeller plane at a 70% propeller radius (r/R = 0.7).These results also indicate that the proposed prediction method is consistent with the validation data.
Finally, the worst-case prediction results, which defined as the data with the maximum RSME, are shown in Fig. 16.The prediction results show some fluctuations  between adjacent data.This is because the loss function used in this study is composed of only the difference of each point.When the loss function is defined as considering the relationship between adjacent points, these fluctuations will be able to be minimized.The maximum axial wake velocity differential is limited to approximately 0.05, which is acceptable for initial hull form design and prediction.Hence, these validation results demonstrate that the proposed prediction method can predict the stern wake field remarkably faster than CFD calculation with practical accuracy in the initial hull form and propeller design processes.

Concluding remarks
In this study, a prediction method for the wake field behind a ship using a CNN was developed, in which a proposed a curved surface representation method for ANN is used to directly process 3D hull surfaces.The main advantages of the proposed method are the high fidelity of its hull form representation using more than 20,000 input data points and its fast prediction speed, which requires less than 0.01 s for a task that has traditionally taken more than an hour to estimate using physics-based simulation methods.
The IHR regards the two-dimensional grid formed on the 3D curved hull surface, which is used for structured-gridbased CFD, as a data set with the same data structure as the image data.Because CNNs can recognize image data at accuracy rates higher than those of humans, a CNN can be expected to recognize 3D surface characteristics better than humans.The image data are represented by three primary colors (cyan, magenta, yellow) on two-dimensional pixels.The hull-form-structured grid can also be expressed as a two-dimensional structure data with (x, y, z) coordinates that have the same data structure as the three primary colors in the image data.
A CFD calculation data set of 2730 ship types with different stern shapes was adopted to verify the proposed method.A verification using the k-hold cross-validation method confirmed the robustness of the present.The validation results also showed that the root mean squared error of the prediction axial wake velocity u on the propeller plane for the test data set of the proposed model is 0.005, and the coefficient of determination R 2 achieves 0.986.The value of R 2 is slightly higher than that of the general CNN models, but since the constraints of the data of the hull form are stronger than the general image data, the value of the present model is acceptable in modeling for ship designs.Thus, the results of this study reveal that the representation method of a curved surface and the proposed prediction method can predict the stern wake field remarkably faster than CFD calculation with practical accuracy during the initial hull form and propeller design processes.

Fig. 3
Fig. 3 Input and output data set of the proposed CNN Fig. 4 CNN architecture of present prediction

Fig. 5
Fig. 5 Comparison between a conventional neural network for ship hydrodynamic prediction and the proposed network

Fig.
Fig.6Example of CFD grid[28] The 2730 CFD data set mentioned here is randomly divide by two components: training set, and test set.The 20% of all 2730 data set (564) is held out as test set which is used to provide an unbiased evaluation on a final model.The other 80% (2184) data is used for training of the present CNN model to determine the parameters, this set is called training set.

Fig. 7
Fig. 7 Examples of frame lines at S.S. 1.0 and aft profiles of hull forms in the data set

Fig. 8 Fig. 9 Fig. 10
Fig. 8 Examples of wake fields at the propeller plane estimated by CFD from the data set

Fig. 11
Fig. 11 Distribution of the prediction results for all test data sets

Fig. 12
Fig. 12 Histogram of difference between test and predict value in all test data set

Fig. 14 Fig. 15
Fig. 14 Comparison between the validation and predicted data at the hull centerline

Table 1
Main dimensions of the 749 G/T general cargo data set 749 G/T general cargo