A deep learning-based rapid prediction method for ship hydrodynamic performance
Patent Information
- Application Number
- CN202611277620.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-13
AI Technical Summary
计算流体力学方法需要对船舶几何模型进行网格划分和迭代求解,计算过程耗时较长且对计算资源要求高
1、本发明通过构建端到端的深度神经网络映射模型,实现船舶几何特征参数到水动力性能的直接映射,预报过程无需进行网格划分和迭代求解,完全摆脱CFD迭代求解的计算瓶颈,预报时间从传统方法的数小时缩短至毫秒级,可满足船舶快速设计阶段秒级甚至毫秒级的性能预报需求,船舶方案比选阶段可在极短时间内获得多个候选方案的性能评估结果,大幅提升船舶设计效率。
Smart Images

Figure CN122904798A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence, specifically relating to a method for rapid prediction of ship hydrodynamic performance based on deep learning. Background Technology
[0002] Hydrodynamic performance is a key indicator in ship design, directly impacting navigation efficiency, energy consumption, and navigation safety. Traditional hydrodynamic performance prediction primarily relies on computational fluid dynamics (CFD) and model testing. CFD methods require mesh generation and iterative solving of the ship's geometric model, a time-consuming process with high computational resource requirements. Model testing methods necessitate the fabrication of scaled-down ship models for testing in water tanks, resulting in lengthy testing cycles and high costs. These methods are insufficient to meet the demands of efficient performance evaluation of numerous candidate ship types during the rapid ship design phase.
[0003] Existing technologies have attempted to use data-driven methods for ship performance forecasting, but they generally suffer from the following shortcomings: limited ability to handle the complex nonlinear mapping relationship between ship geometry and hydrodynamic performance, making it difficult to guarantee forecast accuracy; lack of effective characterization of the quantitative relationship between geometric parameters and performance, resulting in insufficient interpretability of forecast results and failing to provide designers with an intuitive understanding of the parameter influence mechanism.
[0004] Therefore, how to significantly improve computational efficiency and enhance the interpretability of results while ensuring forecast accuracy is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0005] The purpose of this invention is to provide a method for rapid prediction of ship hydrodynamic performance based on deep learning, which can effectively solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for rapid prediction of ship hydrodynamic performance based on deep learning includes the following specific steps: Collect multiple core geometric parameters of the target vessel; The multiple core geometric parameters are standardized and encoded, and each geometric parameter is mapped to a normalized interval of 0 to 1 to obtain a standardized parameter vector. Based on the standardized parameter vector, the product between each pair of basic features is calculated as a feature cross term, and the basic features and the feature cross term are concatenated to form a multidimensional geometric feature vector. The multidimensional geometric feature vector is input into a trained deep neural network mapping model, which includes an input layer, multiple hidden layers, a batch normalization layer, a multi-head self-attention mechanism module, and an output layer. The multi-head self-attention mechanism module is embedded between the first and second hidden layers to adaptively recalibrate the features and generate an attention weight matrix. A batch normalization layer is configured after each hidden layer. The activation function of the hidden layers uses a modified linear unit, and the activation function of the output layer uses a linear activation function. The forward inference calculation of the deep neural network mapping model outputs dimensionless coefficients of hydrodynamic performance parameters, including drag coefficient, lift coefficient and pitch moment coefficient. The dimensionless coefficients are denormalized to obtain the hydrodynamic performance prediction results of the target ship.
[0007] Furthermore, the multiple core geometric parameters include ship length, ship width, draft, rhombus coefficient, longitudinal position of the center of buoyancy, and vertical position of the center of buoyancy.
[0008] Furthermore, the standardization coding specifically includes: for geometric parameters that are uniformly distributed, linear extremum standardization is used; for geometric parameters that are skewed to one side, nonlinear standardization based on the cumulative distribution function is used, and the parameter value of the geometric parameter is substituted into the cumulative distribution function to obtain the cumulative probability value as the standardization result, so that the skewed distribution parameter is transformed into an approximately uniform distribution in the range of 0 to 1.
[0009] Furthermore, the feature cross term specifically includes the following items: the product of ship length and ship width, the product of ship length and draft, the product of rhombus coefficient and longitudinal position of the center of buoyancy, the product of ship width and draft, and the normalized ratio of the square of ship length to the rhombus coefficient.
[0010] Furthermore, the multi-head self-attention mechanism module adopts a multi-head self-attention structure with 4 or 8 attention heads. Each attention head multiplies the input feature vector with the weights of the trainable query vector matrix, the key vector matrix, and the value vector matrix, respectively, to generate the query vector matrix, the key vector matrix, and the value vector matrix. The output feature of the attention head is obtained by scaling dot product attention calculation. The attention weight distribution of each attention head is averaged to obtain the average attention weight. The average attention weight is then transformed into a matrix of size M×N through a trainable linear mapping layer, where M is the number of geometric parameters and N is the number of hydrodynamic performance indicators. After softmax normalization, the attention weight matrix is formed.
[0011] Furthermore, the deep neural network mapping model has 4 to 8 hidden layers, with 64 to 512 neurons per layer.
[0012] Furthermore, the training process of the deep neural network mapping model includes constructing a multi-ship type training sample library; the multi-ship type training sample library covers bulk carriers, container ships, oil tankers, and passenger ships, with 500 to 2000 sets of samples collected for each type of ship. Each set of samples contains the core geometric parameters and corresponding hydrodynamic performance labels; the hydrodynamic performance labels are obtained through computational fluid dynamics simulation or model experiments, and the collected original samples undergo a double validity screening. The first screening removes abnormal samples whose drag coefficient, lift coefficient, and pitch moment coefficient exceed a preset reasonable range. The second screening removes samples whose geometric parameters are within 5% of their respective value range boundaries. After screening, a random perturbation following a normal distribution is applied to each core geometric parameter of each sample, with the perturbation amplitude being 0.1 to 0.3 times the standard deviation of the corresponding parameter. Each set of original samples is expanded into 5 to 10 enhanced samples to form a training set.
[0013] Furthermore, the forward inference computation of the deep neural network mapping model adopts a static computation graph and memory pre-allocation strategy: before the prediction task starts, the construction of the entire computation graph is completed at once based on the deep learning inference engine, and the computation graph is organized in the form of a directed acyclic graph; according to the shape and precision of each tensor in the computation graph, a fixed-size memory buffer is allocated for all intermediate variables at once.
[0014] Furthermore, after the deep neural network mapping model is trained and before forward inference computation is performed, the deep neural network mapping model is subjected to model quantization compression: a symmetric quantization scheme is adopted, and the quantization scaling factor is determined by the maximum absolute value of the parameter tensor, so as to linearly map the model parameters represented by 32-bit floating-point numbers to the 8-bit integer range, thereby reducing the model storage space.
[0015] Furthermore, the forward inference computation of the deep neural network mapping model supports both graphics processor (GPU) computing mode and CPU computing mode. When the GPU is detected to be unavailable or the video memory is insufficient, it automatically switches to CPU computing mode, and performs inference through multi-threaded parallel computation and vectorized instructions.
[0016] In summary, this application includes at least one of the following beneficial technical effects: 1. This invention achieves direct mapping from ship geometric feature parameters to hydrodynamic performance by constructing an end-to-end deep neural network mapping model. The prediction process does not require grid division and iterative solution, completely eliminating the computational bottleneck of CFD iterative solution. The prediction time is shortened from several hours in traditional methods to milliseconds, which can meet the performance prediction requirements of seconds or even milliseconds in the rapid design stage of ships. In the ship scheme comparison stage, the performance evaluation results of multiple candidate schemes can be obtained in a very short time, which greatly improves the efficiency of ship design.
[0017] 2. This invention constructs a deep neural network model with strong generalization ability by collecting differentiated training samples covering various ship types such as bulk carriers, container ships, oil tankers, and passenger ships. The attention mechanism can accurately learn the influence weights of different geometric parameters on various hydrodynamic performance indicators, ensuring that the prediction results have high prediction accuracy and can meet the accuracy requirements of engineering applications. The prediction accuracy of hydrodynamic parameters such as resistance performance, lift performance, and pitch moment for various ship types has reached a high level.
[0018] 3. This invention establishes a multi-ship type training sample library and adopts a sample collection strategy that combines CFD simulation data and experimental data to cover the geometric features and hydrodynamic characteristics of different ship types. By filtering out abnormal and boundary samples through sample validity screening, the robustness of the model is further enhanced, enabling the trained network to accurately predict ship type schemes outside the coverage of the training set. This effectively solves the technical problem of poor model generalization ability caused by training with single ship type data.
[0019] 4. This invention generates an attention weight matrix by embedding an attention mechanism-driven parameter influence weight learning module into a neural network. This clearly quantifies the influence of different geometric parameters on various hydrodynamic performance indicators, providing designers with an intuitive basis for understanding the intrinsic relationship between geometric parameters and performance. It effectively makes up for the lack of clear explanation of the quantitative relationship between geometric parameters and performance in existing technologies, and improves the interpretability of forecast results. Attached Figure Description
[0020] Figure 1 This is an overall schematic diagram of a deep learning-based method for rapid prediction of ship hydrodynamic performance. Figure 2 A schematic diagram illustrating the core principle of an end-to-end deep neural network mapping model; Figure 3 This is a schematic diagram illustrating the principle of the weight learning module in a multi-head attention mechanism. Figure 4 A flowchart for the parameterized representation of ship geometric features and the construction of multidimensional feature vectors. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the following description is provided in conjunction with the appendix. Figure 1 To be continued Figure 4 The present invention will be further described in detail below with reference to specific embodiments.
[0022] This invention provides a rapid prediction method for ship hydrodynamic performance based on deep learning, encompassing five core components: parameterized representation of ship geometric features, construction of an end-to-end deep neural network mapping model, embedding of an attention mechanism weight learning module, establishment of a multi-ship type training sample library, and construction of a millisecond-level real-time prediction inference framework. The specific implementation methods for each component are described in detail below.
[0023] The first step, S1, involves the parametric representation of ship geometric features and the foundation for model training. This will be carried out according to the following steps: Step S101: Collect core geometric parameters, selecting six parameters—ship length, beam, draft, rhombus coefficient, longitudinal position of the center of buoyancy, and vertical position of the center of buoyancy—as the basic feature set describing the ship's geometry. This set of parameters can comprehensively characterize the macroscopic geometric shape of the underwater part of the ship from dimensions such as principal dimensions, leanness / breadth, and spatial distribution of the center of buoyancy.
[0024] The typical value ranges for each parameter are determined based on the statistical patterns of mainstream ship types in engineering. The ship length ranges from 50 meters to 500 meters, with less than 50 meters mainly corresponding to high-speed boats and small workboats, and more than 500 meters covering very large oil tankers and ore carriers; the ship width ranges from 8 meters to 80 meters, with the corresponding ship width to length ratio covering 1:10 to 1:5.
[0025] The draft ranges from 3 meters to 25 meters, and the ratio of draft to beam covers the common range of 0.25 to 0.55; the rhombus coefficient ranges from 0.50 to 0.88, and the rhombus coefficient is directly related to the relative ratio of wave-making resistance to frictional resistance; the longitudinal position of the center of buoyancy is expressed as a percentage of the ship's length, ranging from -5% to +8%, with a positive value indicating that the center of buoyancy is located aft of the midships and a negative value indicating that the center of buoyancy is located forward of the midships; the vertical position of the center of buoyancy is expressed as a percentage of the draft, ranging from 45% to 65%.
[0026] Step S102, parameter standardization encoding: To eliminate the impact of different dimensions and value ranges of various geometric parameters on subsequent model training, they need to be mapped to a normalized interval of 0 to 1. For parameters such as ship length, which are roughly uniformly distributed, linear extremum standardization is directly used, calculated as follows:
[0027] In the formula, This represents a value of a primitive geometric parameter; This is the minimum value of this geometric parameter across all training samples; This corresponds to the maximum value; The value that falls between 0 and 1 after standardization.
[0028] For parameters with a distribution that is clearly biased to one side, such as the rhombus coefficient, direct linear standardization will cause most samples to be concentrated in a very narrow interval, which is not conducive to the balanced learning of parameter sensitivity in deep neural network training. In this case, a nonlinear standardization strategy based on the cumulative distribution function is used instead: first, the cumulative distribution function of these parameters is estimated using the training sample set, and then the parameter value of each sample is substituted into the cumulative distribution function to obtain the corresponding cumulative probability value, which is directly used as the standardization result.
[0029] After this processing, the originally skewed distribution of parameters is transformed into an approximately uniform distribution within the range of 0 to 1, which can improve the model's sensitivity in different parameter ranges.
[0030] Step S103 involves constructing a multidimensional geometric feature vector. After obtaining six standardized basic features, feature interaction terms are further introduced to capture the nonlinear coupling relationship between geometric parameters. The feature interaction terms are constructed by multiplying the parameters pairwise, specifically generating the following five terms: The product of the ship's length and its beam is used to characterize the side projection area of the ship. The product of length and draft is used to characterize the surface area of a ship on the waterline. The product of the rhombus coefficient and the longitudinal position of the center of buoyancy is used to characterize the coupling effect between the underwater volume distribution of the ship and the longitudinal position of the center of buoyancy. The product of the ship's beam and its draft is used to characterize the cross-sectional area of the ship. The normalized ratio of the square of the ship's length to the block coefficient is used to comprehensively characterize the interaction effect between the ship's length-to-beam ratio and the block coefficient.
[0031] The six standardized basic features are concatenated with these five feature interaction terms to form an 11-dimensional multidimensional geometric feature vector. Higher-dimensional feature representations can more fully characterize the complex properties of ship geometry. Depending on the accuracy requirements of the forecasting mission, third-order feature interaction terms or higher-order polynomial feature terms can be further added, expanding the feature vector dimension to 20 to 50 dimensions.
[0032] In summary, the geometric feature vector constructed in step S103 will be used as the input to the deep neural network mapping model.
[0033] Step S104 involves the collection and organization of training samples. To enable the deep neural network to have predictive capabilities, a multi-ship type training sample library needs to be established. The samples cover at least four mainstream ship types, including bulk carriers, container ships, oil tankers, and passenger ships. 500 to 2000 samples are collected for each ship type, for a total sample size of over 4000 samples. Each sample contains two parts of data: one part is the aforementioned six core geometric parameters, and the other part is the corresponding hydrodynamic performance label.
[0034] Hydrodynamic performance labels can be obtained through computational fluid dynamics simulations or model tests. When using computational fluid dynamics simulations, a two-equation turbulence model or a shear stress transport turbulence model that solves the Reynolds-averaged Navier-Stokes equations is used. The computational domain includes the flow field around the hull and the wave-making region of the free surface, and the total number of grid cells is controlled between 5 million and 20 million.
[0035] When using model testing, it is conducted in a towing tank or circulating water tank, with a model scale between 1:20 and 1:100. The test conditions cover different combinations of speed and wave height and direction. The test data are converted to scale to obtain the hydrodynamic performance at the full ship scale. Regardless of the method used, the drag coefficient, lift coefficient, and pitch moment coefficient corresponding to each set of geometric parameters must be obtained as training labels.
[0036] The collected raw samples need to undergo validity screening. The first screening removes abnormal samples whose drag coefficient, lift coefficient, and pitch moment coefficient significantly exceed the physically reasonable range. The second screening removes samples whose geometric parameters are within 5% of the value range boundary to avoid boundary extrapolation problems. After double screening, the number of valid samples retained generally accounts for 80% to 90% of the original samples.
[0037] Step S105, Data Augmentation and Training Set Construction: Based on the selected valid samples, apply random perturbations that follow a normal distribution to the six core geometric parameters of each sample, with the perturbation amplitude being 0.1 to 0.3 times the standard deviation.
[0038] Through this perturbation, each set of original samples is expanded into 5 to 10 augmented samples. The hydrodynamic labels of the augmented samples are obtained through computational fluid dynamics interpolation or recalculation with slight perturbations. The resulting training set has a denser distribution in the parameter space, which helps improve the model's generalization ability.
[0039] Step S106: Deep Neural Network Training Setup. The deep neural network mapping model is trained using supervised learning. During training, the multidimensional geometric feature vector constructed in step S103 is used as input, and the drag coefficient, lift coefficient, and pitch moment coefficient of the corresponding ship type are used as labels.
[0040] The loss function used for training is the mean squared error, which has the following mathematical form:
[0041] In the formula, This indicates the number of samples in a training batch. For sample index; The index is used to output performance indicators. 1 corresponds to the drag coefficient, 2 corresponds to the lift coefficient, and 3 corresponds to the pitch moment coefficient. For the first The first sample The actual labeled values of each hydrodynamic performance parameter; This represents the corresponding predicted value output by the deep neural network mapping model. The goal of training is to minimize this loss function value through iterative optimization, i.e., to minimize the difference between the predicted value and the label value.
[0042] The optimizer uses the Adam algorithm, with an initial learning rate of 0.001, a weight decay coefficient of 0.0001, and a batch size of 32 or 64. During training, a learning rate decay strategy is employed: when the validation set loss no longer decreases for several consecutive training epochs, the learning rate is reduced to 0.5 times its current value, until the learning rate drops to the minimum threshold of 0.00001.
[0043] Step S107, the role of the attention mechanism: Within the deep neural network mapping model, a multi-head self-attention mechanism is also embedded. The attention mechanism module is located between the first two hidden layers, and adaptively recalibrates the features by calculating the influence weights of different geometric parameters on various hydrodynamic performance indicators.
[0044] After training and convergence, the deep neural network mapping model can not only quickly provide prediction results, but also clearly quantify the correlation between each geometric parameter and performance index through the attention weight matrix, thereby improving the interpretability of the prediction results. The specific calculation method of the attention mechanism and the generation process of the weight matrix will be further elaborated in the subsequent detailed explanation of the deep neural network mapping model architecture.
[0045] The feature representation and training foundation established in step S1 enable the subsequent end-to-end deep neural network mapping model to stably and efficiently achieve millisecond-level rapid prediction from geometric parameters to hydrodynamic performance.
[0046] The next step, S2, involves constructing a deep neural network mapping model, which is carried out according to the following steps: Step S201: Determine the input and output dimensions of the network. The deep neural network mapping model adopts a multi-layer structure consisting of an input layer, multiple hidden layers, and an output layer. The number of neurons in the input layer is set according to the dimension of the multi-dimensional geometric feature vector. When an 11-dimensional feature vector is used, the input layer has 11 neurons. After receiving the standardized encoded ship geometric feature vector, the input layer performs a linear transformation and passes the result to the first hidden layer.
[0047] The output layer contains three neurons, corresponding to the dimensionless outputs of three hydrodynamic performance parameters: drag coefficient, lift coefficient, and pitch moment coefficient. Depending on forecasting requirements, the output layer can be expanded to five or more neurons to simultaneously provide additional hydrodynamic performance parameters such as heave moment and roll moment.
[0048] Step S202: Design the hidden layer topology. All hidden layers adopt a fully connected approach, with each neuron in each layer connected to all neurons in the layer above. The number of hidden layers is selected between 4 and 8, and the number of neurons in each layer is set between 64 and 512. The specific configuration is adjusted according to the scale of the training data and the prediction accuracy requirements.
[0049] A preferred configuration is a 4-layer hidden layer structure, with the number of neurons in each layer being 256, 128, 64, and 32 respectively. This progressively decreasing topology helps the network learn a compressed mapping relationship from the high-dimensional feature space to the low-dimensional output space. Another preferred configuration is a 6-layer hidden layer structure, with all hidden layers having 128 neurons. This equal-width topology enhances the network's expressive power. The two configurations can be chosen based on actual training results.
[0050] Step S203: Add a batch normalization layer. A batch normalization layer is configured after each hidden layer. The batch normalization layer performs mean normalization and variance scaling on the output of the previous hidden layer. The specific calculation process is as follows:
[0051] In the formula, This represents the individual components of the input vector received by the batch normalization layer; In the current training batch The mean; This represents the variance of the current training batch; and The scaling and offset parameters are learnable by the batch normalization layer itself; It is a constant term with a very small value, used to ensure numerical stability. The introduction of batch normalization layers can alleviate the internal covariate shift problem during training, accelerate network convergence, and improve training stability.
[0052] Step S204: Select the activation function. The activation function for the hidden layer is the modified linear unit, mathematically expressed as follows: ,in This represents the input value of the activation function. This activation function maintains linear propagation properties when the input is positive and outputs zero when the input is negative, exhibiting characteristics of simple computation and high gradient propagation efficiency. The output layer uses a linear activation function, meaning it does not perform nonlinear transformations and directly outputs the dimensionless coefficients of the hydrodynamic performance parameters to avoid limiting the numerical range of the predicted values.
[0053] Step S205: Associate the training configuration. During training, the deep neural network mapping model constructed in this step directly uses the mean squared error loss function and Adam optimizer defined in step S106, and updates the parameters according to the corresponding learning rate decay strategy. The specific form of the loss function, the optimizer parameter settings, and the learning rate adjustment rules are fully explained in step S106 and will not be repeated here.
[0054] Through step S2, the deep neural network mapping model applicable to the mapping of ship geometry features to hydrodynamic performance is completed. This model has flexible network depth, standardized batch normalization processing, and suitable activation functions, providing a basic network framework for subsequent embedding of attention mechanism weight learning modules and realizing end-to-end rapid forecasting.
[0055] Next, for step S3, the embedding of the attention mechanism weight learning module, the specific implementation steps are as follows: Step S301: Determine the embedding location and multi-head structure of the attention mechanism module. The attention mechanism module is embedded between the hidden layers of the deep neural network mapping model, specifically between the first and second hidden layers. In this way, the input features are first initially abstracted by the first hidden layer, and then the attention mechanism module reweights the features. Subsequent hidden layers continue calculations based on the weighted features.
[0056] The attention mechanism module employs a multi-head self-attention structure, with either four or eight attention heads. Each attention head independently learns the correlation between different combinations of geometric parameters and hydrodynamic performance. The outputs of multiple attention heads are ultimately fused to capture complex parameter influence relationships. When using four attention heads, the output dimension of each attention head is set to one-quarter of the input feature dimension. After concatenating the outputs of the four attention heads, the overall dimension is restored to be the same as the input feature dimension. When using eight attention heads, the output dimension of each attention head is set to one-eighth of the input feature dimension, and the concatenation also restores it to the input dimension.
[0057] Step S302: Construct the scaled dot product attention calculation for a single attention head. The calculation process for each attention head includes three stages: linear transformation, attention weight calculation, and weighted summation.
[0058] First, the input feature vector of the attention mechanism module is multiplied by the three trainable weight matrices to generate the query vector matrix. Key vector matrix Sum value vector matrix Query vector matrix and key vector matrix All dimensions are ,in The length of the input feature. The dimension of the key vector; the value vector matrix. The dimension is , is the dimension of the value vector.
[0059] Next, the attention weights are calculated using scaled dot product attention. First, the query vector matrix is calculated. With key vector matrix The dot product of the transposes of the product, then divided by the scaling factor. Divided by The purpose is to prevent the dot product value from becoming too large, thus avoiding the gradient vanishing effect caused by the subsequent softmax function entering the saturation region. Finally, the attention weight distribution is obtained by normalizing each row using the softmax function. The calculation formula is:
[0060] In the formula, Represents the query vector matrix; Represents the key vector matrix; Represents a value vector matrix; Indicates the dimension of the key vector; This indicates a softmax normalization operation performed row by row; the final output is a weighted sum of the value vector matrix.
[0061] This weighted summation result is the output of the attention head after re-integrating the input features, highlighting the combination of geometric parameters that have a significant impact on specific hydrodynamic performance.
[0062] Step S303 generates an interpretable attention weight matrix. After parallel computation by multiple attention heads, their respective output features are obtained. This method does not simply concatenate these features as the final output, but further extracts the influence weights of geometric parameters on various hydrodynamic performance indicators.
[0063] The specific approach is as follows: Within each attention head, an attention weight distribution is retained, which is the matrix obtained by softmax calculation, and its shape is... The attention weights of each attention head are averaged to obtain the average attention weight. Since each dimension of the input features corresponds to a specific geometric parameter or feature interaction term, the rows in the average attention weight that are related to these geometric parameters can be transformed into a matrix of size [size missing] through a trainable linear mapping layer. The matrix. The number of geometric parameters depends on whether feature intersection terms are included, and the value ranges from 6 to 11. The number of hydrodynamic performance indicators is set to 3, corresponding to the drag coefficient, lift coefficient, and pitch moment coefficient, respectively. The transformed matrix is then normalized using softmax so that the sum of the elements in each column is 1, ultimately forming the attention weight matrix.
[0064] In the attention weight matrix, the first Line number The values of the elements in the column fall between 0 and 1. The larger the value, the higher the number of elements. The geometric parameter for the _th ... The greater the influence of each hydrodynamic performance index, the more designers can directly view or visualize the attention weight matrix to intuitively understand the contribution of different geometric parameters to each hydrodynamic performance. For example, in the attention weight matrix, if the element value at the intersection of the row corresponding to the rhombus coefficient and the resistance column is significantly higher than that in other columns, it indicates that the rhombus coefficient has a dominant influence on ship resistance, which provides a quantitative reference for ship hull form optimization.
[0065] Step S304, end-to-end training method of attention mechanism module, all trainable parameters in attention mechanism module, including weight matrix for generating query vector matrix, key vector matrix, value vector matrix, and linear mapping layer parameters that map average attention weight to attention weight matrix, are all trained as part of deep neural network mapping model.
[0066] During training, the entire deep neural network mapping model, along with the embedded attention mechanism module, undergoes end-to-end supervised learning using the mean squared error loss function and Adam optimizer defined in step S106. The training data, the specific form of the loss function, and the learning rate decay strategy are detailed in steps S104 to S106. As training converges, the attention mechanism module automatically learns internal weights that reflect the importance of geometric parameters, enabling the attention weight matrix to accurately quantify the impact of different geometric parameters on various hydrodynamic performance parameters.
[0067] In step S3, the attention mechanism weight learning module is fully embedded into the deep neural network mapping model. During the forecasting phase, the model can not only quickly provide drag coefficients, lift coefficients, and pitch moment coefficients, but also simultaneously output an attention weight matrix, presenting the quantitative relationship between geometric parameters and hydrodynamic performance in weighted form, thus addressing the problem of insufficient interpretability of existing forecasting results. This interpretable output, combined with the generalized forecasting capability supported by a multi-ship type training sample library, constitutes a complete technical closed loop from rapid forecasting of ship hydrodynamic performance to design guidance.
[0068] For step S4, a multi-ship type training sample library is established, specifically through the following steps: Step S401: Determine the ship type coverage and total sample size. The construction of the training sample library begins with clarifying the ship type coverage. Sample collection covers four mainstream ship types: bulk carriers, container ships, oil tankers, and passenger ships, and can be expanded to eight types if necessary. Bulk carrier samples cover typical size series such as Capesize, Panamax, and Handysize; container ship samples cover series such as 8000TEU, 5000TEU, and 2000TEU; oil tanker samples cover series such as Very Large Crude Carriers (VLCCs), Suezmax tankers, and Aframax tankers; passenger ship samples cover series such as large cruise ships, Ro-Ro passenger ships, and high-speed passenger ships.
[0069] Collect 500 to 2000 samples for each ship type, with the total sample size controlled between 4000 and 10000. This scale ensures that the training dataset has sufficient representativeness and statistical sufficiency in both ship type and parameter range dimensions.
[0070] Step S402: Determine the content of each sample group and the method for obtaining hydrodynamic performance labels. Each sample group includes two parts: ship geometric parameters and hydrodynamic performance parameters. The ship geometric parameters include six core parameters: ship length, ship beam, draft, prismatic coefficient, longitudinal position of the center of buoyancy, and vertical position of the center of buoyancy, as well as geometric feature cross-term parameters generated according to the method described in step S103.
[0071] Hydrodynamic performance labels are obtained through computational fluid dynamics simulations or model tests. When using computational fluid dynamics simulations, a two-equation turbulence model or a shear stress transport turbulence model is selected to solve the Reynolds-averaged Navier-Stokes equations. The computational domain includes the flow field around the hull and the wave-making region at the free surface. A hybrid meshing strategy is adopted, using a boundary layer-refined mesh in the near-wall region and a sparse mesh in the far-field region. The total number of mesh cells is controlled between 5 million and 20 million to balance computational accuracy and time consumption.
[0072] When using model testing, it is conducted in a towing tank or circulating water tank. The model scale is set from 1:20 to 1:100 according to the ship's dimensions. The test conditions cover different speeds and combinations of wave heights and directions. The test data are converted to scale to obtain hydrodynamic performance parameters at the full ship scale. Regardless of the method used, the drag coefficient, lift coefficient, and pitch moment coefficient corresponding to each set of geometric parameters are ultimately required as training labels.
[0073] Step S403, Sample Validity Screening: The collected raw samples must undergo dual validity screening. The first screening is based on the reasonableness criteria of performance parameters, eliminating abnormal samples whose drag coefficient, lift coefficient, and pitch moment coefficient exceed the preset reasonable range. Specifically, the reasonable range for drag coefficient is set to 0.001 to 0.05, the reasonable range for lift coefficient is set to -0.1 to 0.2, and the reasonable range for pitch moment coefficient is set to -0.05 to 0.05.
[0074] The second screening is based on geometric parameter boundary criteria, eliminating samples whose geometric parameters fall within 5% of their respective value range boundaries. This avoids boundary effects that could cause a decrease in model accuracy when extrapolating from boundary regions. After this double screening, the number of valid samples typically accounts for 80% to 90% of the original sample size.
[0075] Step S404, Data Augmentation and Final Training Set Construction: For the selected valid samples, a random perturbation following a normal distribution is added to each core geometric parameter. The perturbation amplitude is set to 0.1 to 0.3 times the standard deviation of that parameter in the sample set. Each group of original samples is expanded into 5 to 10 augmented samples. The hydrodynamic performance labels of the augmented samples are obtained by computational hydrodynamic interpolation or by recalculating on a small scale after perturbation.
[0076] After data augmentation, the distribution of the training sample library in the parameter space becomes denser, which can improve the generalization ability of the deep neural network mapping model in various regions of the parameter space.
[0077] The sample library in step S4 above is directly used for supervised training of the deep neural network mapping model defined in step S106. Its ship type diversity, sample quantity and data quality directly affect the accuracy and applicability of the final prediction model.
[0078] Step S5 involves constructing a millisecond-level real-time forecast inference framework. Step S501 employs a static computation graph and memory pre-allocation, with model inference using the static computation graph model. Before the forecast task begins, the entire computation graph is constructed in one go based on the deep learning inference engine. The computation graph is organized as a directed acyclic graph, where each computation node corresponds to a layer or a set of computational operations in the deep neural network, and the edges between nodes represent the flow of tensor data.
[0079] Memory allocation employs a pre-allocation strategy. Before inference begins, a fixed-size memory buffer is allocated to all intermediate variables at once, based on the shape and precision of each tensor in the computation graph. This approach eliminates the overhead of dynamic memory allocation at runtime, ensuring stable low-latency characteristics during the inference process.
[0080] Step S502: Apply model quantization compression. The trained deep neural network mapping model is compressed using model quantization technology. The model parameters are converted from 32-bit floating-point numbers to 8-bit integer representations. The quantization process uses a symmetric quantization scheme: the quantization scaling factor is determined by the maximum absolute value of the parameter tensor, linearly mapping the floating-point parameters to the integer range of -128 to 127.
[0081] After quantization, the model storage space is reduced to about a quarter of its original size, and the prediction accuracy loss is controlled within 2%. In scenarios with higher accuracy requirements, a hybrid precision quantization strategy can be adopted, maintaining high precision for key layers such as the attention mechanism module, while using low precision quantization for other layers, thus achieving a balance between storage compression and prediction accuracy.
[0082] Step S503 supports both single-sample and batch inference. The inference computation supports both single-sample immediate response and multi-sample batch processing modes. When the geometric parameters of a single vessel are received, forward inference computation is directly triggered, outputting the corresponding hydrodynamic performance prediction result for that vessel. When the geometric parameters of multiple vessels are received simultaneously or within a short period, the multiple inputs are merged into a single batch for parallel computation, fully utilizing the parallel computing capabilities of the graphics processor to improve inference throughput.
[0083] Step S504: Execute the standard four-stage reasoning process. Each reasoning step is executed in the following four steps in sequence.
[0084] The first step is geometric parameter standardization encoding. After receiving the geometric parameters of the target ship, the same standardization method as in the training phase is used to perform extreme value standardization on each geometric parameter, mapping the original geometric parameters to the interval between 0 and 1, and generating a standardized parameter vector.
[0085] The second step is the generation of multidimensional geometric feature vectors. Based on the standardized parameter vectors, feature interaction terms are calculated according to the rules in step S103 to construct a multidimensional geometric feature vector containing basic features and feature interaction terms. The dimension of the feature vector remains consistent with that of the training phase.
[0086] The third step is the forward inference computation of the neural network. The multidimensional geometric feature vector is input into the trained deep neural network mapping model, and it is processed sequentially through the input layer, each hidden layer, the attention mechanism module, the batch normalization layer, and the output layer to obtain the dimensionless coefficients of the hydrodynamic performance parameters.
[0087] The fourth step is to denormalize the performance parameters. The dimensionless coefficients output by the network are multiplied by the corresponding scaling factor and an offset is added to restore the drag, lift, and pitch moment values to actual physical units.
[0088] The entire forecasting process is executed within 10 milliseconds on a single graphics processor, meeting the requirements for millisecond-level real-time forecasting.
[0089] Step S505 provides dual-mode support for both CPU and GPU. The inference framework supports both CPU and GPU computing modes simultaneously. When GPU unavailability or insufficient video memory is detected, it automatically switches to CPU mode. In CPU mode, through multi-threaded parallel computing and vectorized instruction optimization, the prediction time is controlled within 100 milliseconds, meeting the basic requirements of typical real-time applications.
[0090] The millisecond-level real-time forecasting inference framework constructed in step S5, in conjunction with the deep neural network mapping model fully trained in steps S106 and S4, can efficiently and with low latency evaluate the hydrodynamic performance of a large number of candidate ship types during the rapid ship design phase, achieving an end-to-end rapid closed loop from geometric parameter input to the output of drag, lift and pitch moment forecast results.
[0091] For ease of understanding, an example of a specific application scenario is as follows: The ship to be predicted is a Panamax bulk carrier with a deadweight tonnage of 80,000 tons, a length of 228 meters, a beam of 32.26 meters, a draft of 14 meters, a rhombus coefficient of 0.82, a center of buoyancy longitudinal position of 2.3% of the ship's length, a center of buoyancy vertical position of 55% of the draft, a speed of 14 knots, and a Froude number corresponding to the Shingbo Reynolds number of 0.17.
[0092] In the first step, the aforementioned geometric parameters are substituted into the extremum standardization method to calculate the standardized parameter vector. The standardized value for ship length of 0.356 indicates that the ship's length is at the 35.6 percentile of the sample ship length range, and the standardized value for ship width of 0.304 indicates that the ship's width is at the 30.4 percentile of the sample ship width range.
[0093] In the second step, feature cross terms are calculated based on the standardized parameter vector, resulting in the product of ship length and beam (0.108), ship length and draft (0.170), prism coefficient and longitudinal position of buoyancy (0.531), and ship beam and draft (0.145), etc., which are then spliced together to form an 11-dimensional multidimensional geometric feature vector.
[0094] In the third stage, the 11-dimensional feature vector is input into a deep neural network. After layer-by-layer forward computation through four hidden layers and weighted processing by an attention mechanism module, the network outputs predicted values of 0.00278 for drag coefficient, 0.00432 for lift coefficient, and 0.00085 for pitch moment coefficient. Multiplying the dimensionless coefficients by their corresponding scaling factors and adding an offset, followed by denormalization, yields predicted drag values of 48.6 kN, predicted lift values of 2.1 kN, and predicted pitch moment values of 8.7 kNm. The entire prediction process takes 7 milliseconds on a graphics processing unit (GPU) and 63 milliseconds on a central processing unit (CPU).
[0095] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects.
[0096] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for rapid prediction of ship hydrodynamic performance based on deep learning, characterized in that, Includes the following steps: Collect multiple core geometric parameters of the target vessel; The multiple core geometric parameters are standardized and encoded, and each geometric parameter is mapped to a normalized interval of 0 to 1 to obtain a standardized parameter vector. Based on the standardized parameter vector, the product between each pair of basic features is calculated as a feature cross term, and the basic features and the feature cross term are concatenated to form a multidimensional geometric feature vector. The multidimensional geometric feature vector is input into a trained deep neural network mapping model, which includes an input layer, multiple hidden layers, a batch normalization layer, a multi-head self-attention mechanism module, and an output layer. The multi-head self-attention mechanism module is embedded between the first and second hidden layers to adaptively recalibrate the features and generate an attention weight matrix. A batch normalization layer is configured after each hidden layer. The activation function of the hidden layers uses a modified linear unit, and the activation function of the output layer uses a linear activation function. The forward inference calculation of the deep neural network mapping model outputs dimensionless coefficients of hydrodynamic performance parameters, including drag coefficient, lift coefficient and pitch moment coefficient. The dimensionless coefficients are denormalized to obtain the hydrodynamic performance prediction results of the target ship.
2. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 1, characterized in that, The core geometric parameters include ship length, ship width, draft, rhombus coefficient, longitudinal position of the center of buoyancy, and vertical position of the center of buoyancy.
3. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 2, characterized in that, The standardization coding specifically includes: for geometric parameters with a uniform distribution, linear extremum standardization is used; for geometric parameters with a distribution biased to one side, nonlinear standardization based on the cumulative distribution function is used, and the parameter value of the geometric parameter is substituted into the cumulative distribution function to obtain the cumulative probability value as the standardization result, so that the skewed distribution parameter is transformed into an approximately uniform distribution in the range of 0 to 1.
4. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 2, characterized in that, The specific cross terms include the following: the product of ship length and ship width, the product of ship length and draft, the product of rhombus coefficient and longitudinal position of the center of buoyancy, the product of ship width and draft, and the normalized ratio of the square of ship length to the rhombus coefficient.
5. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 1, characterized in that, The multi-head self-attention mechanism module adopts a multi-head self-attention structure with 4 or 8 attention heads. Each attention head multiplies the input feature vector with the weights of the trainable query vector matrix, the key vector matrix, and the value vector matrix, respectively, to generate the query vector matrix, the key vector matrix, and the value vector matrix. The output feature of the attention head is obtained by scaling dot product attention calculation. The attention weights of each attention head are averaged to obtain the average attention weight. The average attention weight is then transformed into an M×N matrix through a trainable linear mapping layer, where M is the number of geometric parameters and N is the number of hydrodynamic performance indicators. After softmax normalization, the attention weight matrix is formed.
6. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 1, characterized in that, The deep neural network mapping model has 4 to 8 hidden layers, with 64 to 512 neurons in each layer.
7. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 1, characterized in that, The training process of the deep neural network mapping model includes constructing a multi-ship type training sample library. This library covers bulk carriers, container ships, oil tankers, and passenger ships, collecting 500 to 2000 samples for each type. Each sample contains the core geometric parameters and corresponding hydrodynamic performance labels. The hydrodynamic performance labels are obtained through computational fluid dynamics simulation or model experiments. The collected original samples undergo a dual validity screening: the first screening removes abnormal samples whose drag coefficient, lift coefficient, and pitch moment coefficient exceed a preset reasonable range; the second screening removes samples whose geometric parameters are within 5% of their respective value range boundaries. After screening, a random perturbation following a normal distribution is applied to each core geometric parameter of each sample, with the perturbation amplitude being 0.1 to 0.3 times the standard deviation of the corresponding parameter. Each original sample is expanded into 5 to 10 enhanced samples to form a training set.
8. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 1, characterized in that, The forward inference computation of the deep neural network mapping model adopts a static computation graph and memory pre-allocation strategy: before the prediction task starts, the construction of the entire computation graph is completed at once based on the deep learning inference engine, and the computation graph is organized in the form of a directed acyclic graph. Based on the shape and precision of each tensor in the computation graph, a fixed-size memory buffer is allocated for all intermediate variables at once.
9. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 1, characterized in that, After the deep neural network mapping model is trained and before forward inference computation is performed, the deep neural network mapping model is quantized and compressed: a symmetric quantization scheme is adopted, and the quantization scaling factor is determined by the maximum absolute value of the parameter tensor. The model parameters represented by 32-bit floating-point numbers are linearly mapped to the 8-bit integer range to reduce the model storage space.
10. The method for rapid prediction of ship hydrodynamic performance based on deep learning according to claim 1, characterized in that, The forward inference computation of the deep neural network mapping model supports both graphics processor (GPU) computing mode and CPU computing mode. When the GPU is detected to be unavailable or the video memory is insufficient, it automatically switches to CPU computing mode. In CPU computing mode, inference is performed through multi-threaded parallel computation and vectorized instructions.