Training of resistance prediction networks, methods and devices for predicting ship resistance.
By using a resistance prediction network composed of multi-scale long short-term memory networks, the problems of high computational fluid dynamics time consumption and insufficient accuracy of long short-term memory networks are solved, achieving more efficient and accurate ship resistance prediction.
Patent Information
- Application Number
- CN202210712961.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-06-22
AI Technical Summary
Existing technologies for predicting resistance in ship 3D simulations rely on computational fluid dynamics methods, which are time-consuming and costly, and long short-term memory networks, which lack sufficient accuracy, leading to inaccurate resistance predictions.
A multi-scale resistance prediction network is constructed by using multiple long short-term memory networks with different numbers of nodes. Through training and testing, the network learns the temporal features at different scales to predict ship resistance.
It improves the accuracy of resistance prediction, reduces the processing time of high-dimensional datasets, and enhances prediction efficiency.
Smart Images

Figure CN114936429B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine technology, and in particular to a resistance prediction network training method, a method for predicting ship resistance, and related devices. Background Technology
[0002] When performing three-dimensional simulations of ships, the resistance experienced by the ship during navigation is one of the important factors to consider when designing and optimizing the ship's hull shape.
[0003] Currently, in the 3D simulation of ships, the main methods for predicting the resistance experienced by ships are CFD (Computational Fluid Dynamics) and Long Short-Term Memory (LSTM) networks. When using CFD to predict ship resistance, the resistance of the 3D ship is typically solved using the momentum conservation equation, energy conservation equation, and turbulent kinetic energy and turbulent kinetic energy dissipation rate equations of fluid flow. This calculation process is time-consuming and computationally expensive. Furthermore, improving the accuracy of resistance calculations based on CFD often generates large, high-dimensional datasets containing a large number of degrees of freedom, and processing these degrees of freedom also consumes significant computational time and resources. When predicting the resistance experienced by a ship using a Long Short-Term Memory (LSTM) network, the LSTM network is often chosen. Based on its ability to learn temporal characteristics from data for prediction, a large amount of ship operational data is input into the network for training. Then, the ship's current operational data is input into the trained LSTM network to predict the resistance experienced by the ship at the next moment. However, this method is often limited by the single size of the LSTM network, resulting in low sufficiency of the temporal characteristics learned from the data. Consequently, the accuracy of resistance prediction based on these temporal characteristics will decrease. Summary of the Invention
[0004] This invention provides a method and apparatus for training a resistance prediction network, predicting the resistance of a ship, and related devices, in order to solve the problems of time-consuming and costly computation when using computational fluid dynamics to perform numerical simulations of three-dimensional ships and solve for the resistance of the three-dimensional hull.
[0005] According to one aspect of the present invention, a training method for a drag prediction network is provided, comprising: obtaining three-dimensional first simulated flow field data of a ship during navigation by computational fluid dynamics, wherein the first simulated flow field data includes flow field data of the flow field in which the ship is located and three-dimensional hull data of the ship;
[0006] Multiple first long short-term memory networks and second long short-term memory networks are trained. The first long short-term memory network is used as input to predict the first resistance experienced by the ship in three-dimensional first simulated flow field data. The second long short-term memory network is used as input to predict the second resistance experienced by the ship in multiple spliced first resistances.
[0007] Detect whether multiple first long short-term memory networks and second long short-term memory networks meet preset evaluation criteria;
[0008] If the conditions are met, multiple first long short-term memory networks and second long short-term memory networks are combined to form a multi-scale resistance prediction network.
[0009] According to another aspect of the present invention, a method for predicting the resistance of a ship is provided, comprising:
[0010] Obtain a multi-scale resistance prediction network trained by the method described in one aspect of the present invention, consisting of multiple first long short-term memory networks and second long short-term memory networks;
[0011] Obtain the three-dimensional third-dimensional simulated flow field data of the simulated ship at the first moment;
[0012] The three-dimensional third simulated flow field data is sliced into two-dimensional third simulated flow field data;
[0013] The two-dimensional third simulated flow field data are input into multiple first long short-term memory networks to obtain multiple first target resistances;
[0014] The spliced first target resistances are input into the second long short-term memory network to obtain the second target resistance, which is the predicted resistance experienced by the ship at a second time point, which is adjacent to and after the first time point.
[0015] According to another aspect of the present invention, a training apparatus for a resistance prediction network is provided, comprising:
[0016] The first simulation flow field data acquisition module is used to acquire three-dimensional simulation flow field data of the simulated ship during navigation. The first simulation flow field data includes flow field data of the flow field where the ship is located and three-dimensional hull data of the ship.
[0017] The network training module is used to train multiple first long short-term memory networks and second long short-term memory networks. The first long short-term memory network takes three-dimensional first simulated flow field data as input to predict the first resistance experienced by the ship, and the second long short-term memory network takes multiple spliced first resistances as input to predict the second resistance experienced by the ship.
[0018] The network detection module is used to detect whether multiple first long short-term memory networks and second long short-term memory networks meet preset evaluation criteria;
[0019] The network composition module is used to combine multiple first long short-term memory networks and second long short-term memory networks into a multi-scale resistance prediction network if the conditions are met.
[0020] According to another aspect of the present invention, a ship resistance prediction device is provided, comprising:
[0021] The network acquisition module is used to acquire a multi-scale resistance prediction network trained by the device as described in one aspect of the present invention, which consists of multiple first long short-term memory networks and second long short-term memory networks.
[0022] The third simulation flow field data acquisition module is used to acquire the three-dimensional third simulation flow field data of the simulated ship at the first moment.
[0023] The third simulation flow field data slicing module is used to slice the three-dimensional third simulation flow field data into two-dimensional third simulation flow field data;
[0024] The first target resistance acquisition module is used to input the two-dimensional third simulated flow field data into multiple first long short-term memory networks to obtain multiple first target resistances.
[0025] The second target resistance prediction module is used to input multiple spliced first target resistances into the second long short-term memory network to obtain a second target resistance, which is a prediction of the resistance experienced by the ship at a second time moment, which is adjacent to and after the first time moment.
[0026] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0027] At least one processor; and
[0028] A memory communicatively connected to the at least one processor; wherein,
[0029] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the training of the resistance prediction network and the resistance prediction method for ships according to any embodiment of the present invention.
[0030] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the training of the resistance prediction network and the resistance prediction method for ships according to any embodiment of the present invention.
[0031] The technical solution provided by this invention acquires three-dimensional simulated flow field data of a ship during navigation, and trains multiple first long short-term memory (LSM) networks and second LSM networks. The first LSM networks use the three-dimensional simulated flow field data as input to predict the first resistance experienced by the ship, while the second LSM networks use multiple concatenated first resistances as input to predict the second resistance experienced by the ship. After training, the first and second LSM networks are tested to see if they meet preset evaluation criteria. If they do, the first and second LSM networks are combined into a multi-scale resistance prediction network. Since the number of nodes varies among the multiple first LSM networks, the different numbers of nodes allow them to learn the temporal characteristics of the same three-dimensional simulated flow field data at different scales, achieving a thorough learning effect. Therefore, when predicting the resistance experienced by the ship using the multi-scale resistance prediction network composed of the first and second LSM networks obtained through training, the accuracy of resistance prediction is improved. It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of this invention, nor is it intended to limit the scope of this invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a flowchart of a training method for a resistance prediction network according to Embodiment 1 of the present invention;
[0034] Figure 2 This is a schematic diagram of the structure of a multi-scale resistance prediction network according to Embodiment 1 of the present invention;
[0035] Figure 3 This is a flowchart of a method for predicting the resistance of a ship according to Embodiment 2 of the present invention;
[0036] Figure 4This is a schematic diagram of the structure of a training device for a resistance prediction network provided in Embodiment 3 of the present invention;
[0037] Figure 5 This is a schematic diagram of the structure of a ship resistance prediction device according to Embodiment 4 of the present invention;
[0038] Figure 6 This is a schematic diagram of the structure of an electronic device for training the resistance prediction network and predicting the resistance of a ship, as described in this embodiment of the invention. Detailed Implementation
[0039] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0041] Example 1
[0042] Figure 1 This is a flowchart illustrating a training method for a resistance prediction network according to Embodiment 1 of the present invention. This embodiment is applicable to predicting the resistance experienced by a ship based on three-dimensional flow field data of a simulated ship. This method can be executed by a resistance prediction network training device, which can be implemented in hardware and / or software and can be configured in a computer device. Figure 1 As shown, the method includes:
[0043] S110. Obtain the first three-dimensional simulated flow field data of the ship during navigation through computational fluid dynamics. The first simulated flow field data includes the flow field data of the ship's location and the ship's three-dimensional hull data.
[0044] In this embodiment, when optimizing and designing a ship's hull shape, the resistance experienced by the ship during navigation is one of the main factors influencing the design. Generally, minimizing the resistance experienced by the ship is preferred in hull design and optimization, thereby reducing the ship's energy consumption. Furthermore, by simulating the ship's navigation process under different conditions through computational fluid dynamics, such as simulating navigation in turbulent waters or simulating navigation in a real body of water, the optimized or designed hull shape can be made more suitable for operation in the corresponding scenarios. In this embodiment, simulating navigation in turbulent waters can be used as an example to simulate the ship. After simulation, first three-dimensional simulated flow field data about the ship can be obtained. This first simulated flow field data can include various three-dimensional numerical hull data of the simulated ship and various three-dimensional flow field data of the flow field in which the ship is located, such as the turbulent river flow field.
[0045] S120. Train multiple first long short-term memory networks and second long short-term memory networks. The first long short-term memory network takes the first simulated flow field data as input to predict the first resistance experienced by the ship. The second long short-term memory network takes multiple spliced first resistances as input to predict the second resistance experienced by the ship.
[0046] In this embodiment, after acquiring the three-dimensional first simulated flow field data, a ship resistance prediction network can be trained based on the three-dimensional first simulated flow field data. The resistance prediction network can be a neural network composed of multiple long short-term memory networks. Traditionally, ship resistance prediction often uses CFD to simulate a three-dimensional ship and employs the momentum conservation equation, energy conservation equation, and turbulent kinetic energy and turbulent kinetic energy dissipation rate equation of fluid flow to solve for the resistance. This calculation method yields a set of differential equations for calculating resistance. To determine the resistance experienced by the ship in a specific region during navigation, these differential equations are discretized, transforming them into algebraic equations to obtain the discrete distribution of the resistance experienced by the ship in the flow field. However, this traditional method of calculating resistance suffers from high computational time and cost. Improving the accuracy of this method, i.e., using high-fidelity CFD technology, often generates extremely high-dimensional, large datasets containing a large number of degrees of freedom. How to effectively process and analyze these degrees of freedom presents a new technical problem. However, deep learning offers a novel approach to handling these high-dimensional, large datasets. Deep learning, based on a data-driven method, learns the similarities between data points, reducing errors caused by grid partitioning and parameter settings during dataset processing. This improves the accuracy of CFD calculations of ship resistance. In this embodiment, a Long Short-Term Memory (LSTM) network is selected as the neural network model for resistance calculation. This model includes multiple first LSTM networks and a single second LSTM network. The multiple first LSTM networks and the second LSTM network are trained using first simulated flow field data—a process known as deep learning. LSTM is a special variant of RNN (Recurrent Neural Network), overcoming the stability bottleneck encountered in traditional RNNs, enabling its practical application. LSTM can learn and utilize temporal dependencies from data. It also utilizes its internal memory to predict the most recent context in the input sequence as input, rather than using the current state network as the current input. LSTM can see one observation at a time from a sequence and understand which previous observations are relevant and how to use them for prediction. In this embodiment, the turbulence data obtained in the river flow field has temporal characteristics. Therefore, a long short-term memory network is used as the neural network for calculating resistance in this embodiment. Based on the temporal characteristics of the learned turbulence data, the resistance experienced by the ship at the next moment can be predicted after obtaining the turbulence data of the ship at the current moment.
[0047] However, the temporal features of turbulence data learned through a single Long Short-Term Memory (LSTM) network are insufficient, leading to a decrease in the accuracy of drag prediction. Therefore, the drag prediction network proposed in this embodiment can be composed of multiple first LSM networks and second LSM networks. The number of nodes in each of the multiple first LSM networks varies, allowing for the learning of different temporal features during deep learning based on the varying numbers of nodes. In this embodiment, the number of first LSM networks can be set according to the ship dimensions in the established 3D model of the ship, thereby enabling the prediction of drag experienced by ships of different sizes.
[0048] In this embodiment, the first long short-term memory network takes the first simulated flow field data as input. Specifically, since the first long short-term memory network can accept input data in a two-dimensional format, when inputting the first simulated flow field data into the first long short-term memory network in this embodiment, the three-dimensional first simulated flow field data can first be sliced. In this embodiment, the slicing action is derived from the slicing theory. The slicing theory assumes that the ship is slender and divides the hull into several segments along the longitudinal direction, with each cross-section having the same shape. In this application, the cross-section can be represented as the two-dimensional first simulated flow field data formed by slicing the three-dimensional first simulated flow field data.
[0049] In this application, the slicing process can be represented as downsampling the three-dimensional first simulated flow field data to obtain two-dimensional first simulated flow field data. In this embodiment, the slicing process of the three-dimensional first simulated flow field data can be specifically represented as follows:
[0050] The number of nodes in multiple first long short-term memory networks is queried. In this embodiment, the number of nodes in different first long short-term memory networks is not the same, so different first long short-term memory networks can learn the temporal features of turbulent data at different scales according to different number of nodes.
[0051] The target value is determined and is equal to the number of nodes found. In this embodiment, the number of slices of the three-dimensional first simulated flow field data is the target value. The target value can be determined according to the number of nodes of the first long short-term memory network. In this embodiment, the target value of the smart cabinet can be equal to the number of nodes of the first long short-term memory network, so that the size of the first simulated flow field data input to the first long short-term memory network matches the number of nodes of the first long short-term memory network.
[0052] During slicing, the three-dimensional first simulated flow field data can be sliced a target number of times along a preset slicing direction to obtain two-dimensional first simulated flow field data. That is, in this embodiment, each slice of the first simulated flow field data along the preset slicing direction yields the corresponding two-dimensional first simulated flow field data.
[0053] Then, the two-dimensional first simulated flow field data is input into a first long short-term memory network with a different number of nodes to detect the first resistance experienced by the ship, wherein the number of two-dimensional first simulated flow field data corresponds to the number of nodes input into the first long short-term memory network.
[0054] In this embodiment, after obtaining the first resistance output by multiple first long short-term memory networks, the multiple first resistances can be expanded and spliced together to obtain a fused first resistance. Since the fused first resistance includes temporal features of different scales learned by first long short-term memory networks with different numbers of nodes, more accurate resistance prediction can be achieved.
[0055] In this embodiment, the fusion of the first resistance can be accomplished using a second long short-term memory network. Before fusion, multiple first resistances are first spliced together. The splicing process involves slicing the first resistances to obtain one-dimensional first resistances, and then connecting multiple one-dimensional first resistances end-to-end to obtain the spliced first resistance. Since the spliced first resistances still have feature redundancy and insufficient fusion issues, the spliced first resistances are input into the second long short-term memory network. The second long short-term memory network performs feature fusion learning on the input spliced first resistances to detect the second resistances experienced by the ship. In this embodiment, to facilitate the fusion of the first resistances, multiple first long short-term memory networks can be set to have the same preset number of network layers.
[0056] In this embodiment, during the training process of the resistance prediction network, when the second resistance output by the second long short-term memory network is obtained, the first and second long short-term memory networks in the resistance prediction network can be updated according to the difference between the predicted second resistance and the actual resistance experienced by the ship. The specific process can be expressed as follows:
[0057] The simulation obtains the first real resistance encountered by the ship during navigation, and then calculates the difference between the second resistance and the first real resistance as the loss value. Generally, the smaller the loss value calculated during network training, the better the network training performance. Therefore, in this embodiment, after calculating the loss value, it can be determined whether the loss value is less than or equal to a preset threshold. If so, the performance of the resistance prediction network trained at this time meets the requirements, and the training of the resistance prediction network can be determined to be completed. If not, it means that the resistance prediction network trained at this time will update the first long short-term memory network and the second long short-term memory network according to the loss value, and return to train multiple first long short-term memory networks and second long short-term memory networks until the difference between the second resistance output by the retrained second long short-term memory network and the first real resistance meets the preset threshold, and then the training of the resistance prediction network ends.
[0058] S130. Detect whether multiple first long short-term memory networks and second long short-term memory networks meet the preset evaluation criteria. If they do, proceed to step S140.
[0059] In this embodiment, after training the first and second long short-term memory networks in the resistance prediction network, flow field data different from that used during training is input into the first and second long short-term memory networks to verify whether they meet the preset evaluation criteria. Specifically, this detection process in this embodiment can be manifested as follows:
[0060] The simulation of the ship during navigation is carried out in three dimensions. In this embodiment, the three-dimensional second simulation flow field data is not the same as the aforementioned three-dimensional first simulation flow field data. It can be obtained at different time periods during the same navigation scenario of the ship. The second simulation flow field data can also include the flow field data of the simulated ship and the three-dimensional hull data of the ship.
[0061] The three-dimensional second simulated flow field data is sliced to obtain two-dimensional second simulated flow field data. For the same reason as slicing the three-dimensional first simulated flow field data, in this embodiment, after obtaining the three-dimensional second simulated flow field data, the three-dimensional second simulated flow field data is sliced to obtain two-dimensional second simulated flow field data. Then, the two-dimensional second simulated flow field data is input into a first long short-term memory network with a different number of nodes to detect the third resistance experienced by the ship. The third resistance has the same nature as the first resistance in this embodiment.
[0062] Then, multiple third resistances output by the first long short-term memory network are spliced together, and the spliced third resistances are input into the second long short-term memory network to detect the fourth resistance experienced by the ship. The fourth resistance has the same properties as the second resistance in this embodiment.
[0063] After obtaining the fourth resistance experienced by the ship, the second real resistance experienced by the simulated ship during navigation can be obtained. Based on the average absolute error between the calculated fourth resistance and the second real resistance, it is determined whether the first long short-term memory network and the second long short-term memory network meet the preset evaluation criteria. For example, in this embodiment, the evaluation criteria can be set to an average absolute percentage error of less than 3%. If the calculated average absolute percentage error is less than the preset error threshold, it can be determined that multiple first long short-term memory networks and second long short-term memory networks meet the preset evaluation criteria.
[0064] S140. Multiple first long short-term memory networks and second long short-term memory networks are combined to form a multi-scale resistance prediction network.
[0065] In this embodiment, if multiple first long short-term memory networks and second long short-term memory networks meet preset evaluation criteria, then these networks can be combined into a multi-scale long short-term memory network, i.e., a resistance prediction network. In this embodiment, it can be assumed that the number of first long short-term memory networks is two. Therefore, the connection and composition relationship between the resistance prediction network 210, the first long short-term memory network 220, and the second long short-term memory network 230 can be as follows: Figure 2 As shown.
[0066] The technical solution provided by this invention acquires three-dimensional simulated flow field data of a ship during navigation, and trains multiple first long short-term memory (LSM) networks and second LSM networks. The first LSM networks use the three-dimensional simulated flow field data as input to predict the first resistance experienced by the ship, while the second LSM networks use multiple concatenated first resistances as input to predict the second resistance experienced by the ship. After training, the first and second LSM networks are tested to see if they meet preset evaluation criteria. If they do, the first and second LSM networks are combined into a multi-scale resistance prediction network. Since the number of nodes varies among the multiple first LSM networks, the different numbers of nodes allow them to learn the temporal characteristics of the same three-dimensional simulated flow field data at different scales, achieving a thorough learning effect. Therefore, when predicting the resistance experienced by the ship using the multi-scale resistance prediction network composed of the first and second LSM networks obtained through training, the accuracy of resistance prediction is improved. It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of this invention, nor is it intended to limit the scope of this invention. Other features of the invention will become readily apparent from the following description.
[0067] Example 2
[0068] Figure 3 This is a flowchart of a ship resistance prediction method provided in Embodiment 2 of the present invention. This embodiment predicts the resistance experienced by the ship using a multi-scale resistance prediction network trained in the above embodiments. This method can be executed by a ship resistance prediction device, which can be implemented in hardware and / or software and can be configured in a computer device. Figure 3 As shown, the method includes:
[0069] Step 301: Obtain a multi-scale resistance prediction network composed of multiple first long short-term memory networks and second long short-term memory networks.
[0070] In this embodiment, after training the multi-scale resistance prediction network as shown in Embodiment 1, the multi-scale resistance prediction network can be applied to predict the resistance experienced by the ship in the flow field when optimizing and improving the ship's hull shape.
[0071] Step 302: Obtain the three-dimensional third-dimensional simulated flow field data of the simulated ship at the first moment.
[0072] In this embodiment, when predicting the resistance of a simulated ship in a preset flow field, it is also necessary to obtain the third simulated flow field data of the three-dimensional model of the simulated ship at the first moment before the moment when it experiences the predicted resistance. The third simulated flow field data includes the flow field data of the simulated ship and the three-dimensional hull data of the ship itself. Thus, the resistance experienced by the ship at the second moment after the first moment can be predicted based on this third simulated flow field data.
[0073] Step 303: Slice the three-dimensional third simulation flow field data into two-dimensional third simulation flow field data.
[0074] The three-dimensional third simulated flow field data obtained in this embodiment is not suitable as input to the first long short-term memory network in the multi-scale drag prediction network. Therefore, in this embodiment, the three-dimensional third simulated flow field data can be sliced before predicting drag based on the third simulated flow field data to obtain two-dimensional third simulated flow field data.
[0075] Step 304: Input the two-dimensional third simulation flow field data into multiple first long short-term memory networks to obtain multiple first target resistances.
[0076] In this embodiment, after obtaining the two-dimensional third simulated flow field data, the two-dimensional third simulated flow field data can be input into the multiple first long short-term memory networks obtained and trained in this embodiment, according to the step of inputting the two-dimensional first simulated flow field data into the first long short-term memory network in Embodiment 1, to obtain multiple first target resistances.
[0077] Step 305: Input the spliced first target resistances into the second long short-term memory network to obtain the second target resistance. The second target resistance is the predicted resistance that the ship experiences at the second moment. The second moment is adjacent to the first moment and is located after the first moment.
[0078] In this embodiment, after obtaining multiple first target resistances, the second target resistance can be obtained by fusing the multiple first target resistances according to the second long short-term memory network. The second target resistance can be used as the resistance predicted for the simulated ship in the preset flow field scenario at the second moment. The second moment is adjacent to and follows the first moment, which is the time when the input third simulated flow field data acquisition time is - the first moment. In this embodiment, the calculated multiple first target resistances can be spliced before being input into the second long short-term memory network. The specific splicing method can be found in one embodiment of the method for splicing first resistances.
[0079] The technical solution provided in this embodiment uses a multi-scale resistance prediction network trained as described in Embodiment 1 above, and acquires the three-dimensional third simulated flow field data of the simulated ship at the first moment. The one-dimensional third simulated flow field data formed by slicing the three-dimensional third simulated flow field data is input into multiple first long short-term memory networks in the resistance prediction network to predict the first target resistance. The spliced first target resistance is input into a second long short-term memory network to obtain the second target resistance predicted for the ship. Thus, when predicting the resistance of the ship based on the multi-scale resistance prediction network composed of the first long short-term memory network and the second long short-term memory network, the accuracy of resistance prediction is improved. At the same time, compared with predicting resistance through computational fluid dynamics, it saves the time of analyzing large high-dimensional datasets and improves the efficiency of ship resistance prediction.
[0080] Example 3
[0081] Figure 4 This is a schematic diagram of the structure of a training device for a resistance prediction network provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes:
[0082] The first simulation flow field data acquisition module 410 is used to acquire three-dimensional simulation flow field data of a ship during navigation through computational fluid dynamics. The first simulation flow field data includes flow field data of the flow field where the ship is located and three-dimensional hull data of the ship.
[0083] The network training module 420 is used to train multiple first long short-term memory networks and second long short-term memory networks. The first long short-term memory network uses three-dimensional first simulated flow field data as input to predict the first resistance experienced by the ship. The second long short-term memory network uses multiple spliced first resistances as input to predict the second resistance experienced by the ship.
[0084] The network detection module 430 is used to detect whether multiple first long short-term memory networks and second long short-term memory networks meet preset evaluation criteria.
[0085] The network composition module 440 is used to combine multiple first long short-term memory networks and second long short-term memory networks into a multi-scale long short-term memory network if the conditions are met.
[0086] Optionally, the network training module 420 includes:
[0087] The first slicing module is used to slice the three-dimensional first simulated flow field data to obtain two-dimensional first simulated flow field data;
[0088] The first resistance prediction module is used to input the two-dimensional flow field data into a first long short-term memory network with a different number of nodes to detect the first resistance experienced by the ship.
[0089] The first resistance splicing module is used to splice multiple first resistances;
[0090] The second resistance prediction module is used to input the spliced first resistance into the second long short-term memory network to detect the second resistance experienced by the ship.
[0091] The network update module is used to update multiple first long short-term memory networks and second long short-term memory networks according to the second resistance.
[0092] Optionally, the first slicing module includes:
[0093] The node count query module is used to query the node count of multiple first long short-term memory networks as the first node count;
[0094] A target value determination module is used to determine a target value, wherein the target value is equal to the number of the first nodes;
[0095] The two-dimensional data acquisition module is used to perform a slicing operation on the three-dimensional first simulated flow field data a number of times along a preset slicing direction, thereby obtaining the two-dimensional first simulated flow field data.
[0096] Optionally, the first resistance splicing module includes:
[0097] The second slicing module is used to slice the first resistance to obtain a one-dimensional first resistance.
[0098] A one-dimensional first resistance splicing module is used to connect multiple one-dimensional first resistances end to end to obtain a spliced first resistance.
[0099] Optionally, the network update module includes:
[0100] The first real resistance acquisition module is used to acquire the first real resistance experienced by the simulated ship during navigation.
[0101] The loss value calculation module is used to calculate the difference between the second resistance and the first true resistance as the loss value;
[0102] The loss value determination module is used to determine whether the loss value is less than or equal to a preset threshold. If yes, the training completion determination module is called; otherwise, the loss value update module is called.
[0103] The training completion confirmation module is used to confirm that training has been completed.
[0104] The loss value update module is used to update the first long short-term memory network and the second long short-term memory network according to the loss value, and then return to call the loss value calculation module.
[0105] Optionally, the network detection module 430 includes:
[0106] The second simulation flow field data acquisition module is used to acquire three-dimensional simulation flow field data of the simulated ship during navigation.
[0107] The third slicing module is used to slice the three-dimensional first simulated flow field data to obtain two-dimensional first simulated flow field data;
[0108] The third resistance prediction module is used to input the two-dimensional flow field data into a first long short-term memory network with a different number of nodes to detect the third resistance experienced by the ship.
[0109] The third resistance splicing module is used to splice multiple third resistances;
[0110] The fourth resistance calculation module is used to input the spliced third resistance into the second long short-term memory network to detect the fourth resistance experienced by the ship;
[0111] The second real resistance acquisition module is used to acquire the simulated second real resistance experienced by the ship during navigation.
[0112] The mean absolute error calculation module is used to calculate the mean absolute error between the fourth resistance and the second true resistance.
[0113] The evaluation criteria conformity determination module is used to determine that multiple first long short-term memory networks and second long short-term memory networks conform to the preset evaluation criteria if the mean absolute error is less than a preset error threshold.
[0114] The training device for the resistance prediction network provided in this embodiment of the invention can execute the training method for the resistance prediction network provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0115] Example 4
[0116] Figure 5 This is a schematic diagram of a ship resistance prediction device provided in Embodiment 4 of the present invention. Figure 5 As shown, the device includes:
[0117] The network acquisition module 510 is used to acquire the multi-scale resistance prediction network trained by the device in Embodiment 3, which consists of multiple first long short-term memory networks and second long short-term memory networks.
[0118] The third simulation flow field data acquisition module 520 is used to acquire the three-dimensional third simulation flow field data of the simulated ship at the first moment.
[0119] The third simulation flow field data slicing module 530 is used to slice the three-dimensional third simulation flow field data into two-dimensional third simulation flow field data.
[0120] The first target resistance acquisition module 540 is used to input the two-dimensional third simulation flow field data into multiple first long short-term memory networks to obtain multiple first target resistances.
[0121] The second target resistance acquisition module 550 is used to input multiple spliced first target resistances into the second long short-term memory network to obtain a second target resistance, wherein the second target resistance is a prediction of the resistance experienced by the ship at a second time moment, and the second time moment is adjacent to and after the first time moment.
[0122] The ship resistance prediction device provided in the embodiments of the present invention can execute the ship resistance prediction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0123] Example 5
[0124] Figure 6A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0125] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0126] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0127] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as training a resistance prediction network and a method for predicting the resistance of a ship.
[0128] In some embodiments, the training of the drag prediction network and the method for predicting the drag of a ship can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the training of the drag prediction network and the method for predicting the drag of a ship described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the training of the drag prediction network and the method for predicting the drag of a ship by any other suitable means (e.g., by means of firmware).
[0129] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0131] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0133] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0134] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0135] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0136] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A training method for a resistance prediction network, characterized in that, The resistance prediction network includes a first long short-term memory network and a second long short-term memory network with different numbers of nodes. The method includes: The first three-dimensional simulated flow field data of the ship during navigation is obtained by computational fluid dynamics. The first simulated flow field data includes the flow field data of the flow field where the ship is located and the three-dimensional hull data of the ship. Multiple first long short-term memory networks and second long short-term memory networks are trained. The first long short-term memory network is used as input to predict the first resistance experienced by the ship in three-dimensional first simulated flow field data. The second long short-term memory network is used as input to predict the second resistance experienced by the ship in multiple spliced first resistances. Detect whether multiple first long short-term memory networks and second long short-term memory networks meet preset evaluation criteria; If the conditions are met, multiple first long short-term memory networks and second long short-term memory networks are combined to form a multi-scale resistance prediction network.
2. The method according to claim 1, characterized in that, The training of multiple first long short-term memory networks and second long short-term memory networks includes: The three-dimensional simulated flow field data is sliced to obtain the two-dimensional simulated flow field data. The two-dimensional simulated flow field data is input into a first long short-term memory network with a different number of nodes to detect the first resistance experienced by the ship. Splice multiple of the first resistance; The spliced first resistance is input into the second long short-term memory network to detect the second resistance experienced by the ship; The first long short-term memory network and the second long short-term memory network are updated according to the second resistance.
3. The method according to claim 2, characterized in that, The step of slicing the three-dimensional first simulated flow field data to obtain two-dimensional first simulated flow field data includes: Query the number of nodes in multiple first long short-term memory networks; Determine a target value, which is equal to the number of nodes; Along a preset slicing direction, the three-dimensional first simulated flow field data is sliced a number of times equal to the target value to obtain two-dimensional first simulated flow field data.
4. The method according to claim 2, characterized in that, The splicing of multiple first resistances includes: The first resistance is sliced to obtain a one-dimensional first resistance. By connecting multiple one-dimensional first resistances end to end, a spliced first resistance is obtained.
5. The method according to claim 2, characterized in that, The step of updating multiple first long short-term memory networks and second long short-term memory networks according to the second resistance includes: Obtain the first real resistance experienced by the simulated ship during navigation; Calculate the difference between the second resistance and the first true resistance as the loss value; Determine whether the loss value is less than or equal to a preset threshold; If so, then the training is complete; If not, update the first long short-term memory network and the second long short-term memory network according to the loss value, and return the difference between the calculated second resistance and the first true resistance as the loss value.
6. The method according to claim 1, characterized in that, The step of detecting whether multiple first long short-term memory networks and second long short-term memory networks meet preset evaluation criteria includes: Obtain three-dimensional secondary simulated flow field data of the simulated ship during navigation; The three-dimensional second simulated flow field data is sliced to obtain two-dimensional second simulated flow field data; The two-dimensional simulated flow field data is input into a first long short-term memory network with a different number of nodes to detect the third resistance experienced by the ship. Multiple third resistance components are spliced together; The spliced third resistance is input into the second long short-term memory network to detect the fourth resistance experienced by the ship; Obtain the simulated second real resistance experienced by the ship during navigation; Calculate the average absolute percentage error between the fourth resistance and the second true resistance; If the mean absolute percentage error is less than a preset error threshold, then multiple first long short-term memory networks and second long short-term memory networks are determined to meet the preset evaluation criteria.
7. The method according to claim 1, characterized in that, Multiple first long short-term memory networks have the same preset number of network layers.
8. A method for predicting ship resistance, characterized in that, Applied to ships, the method includes: Obtain a multi-scale resistance prediction network trained by the method as described in any one of claims 1-7, consisting of multiple first long short-term memory networks and second long short-term memory networks; Obtain the three-dimensional third-dimensional simulated flow field data of the simulated ship at the first moment; The three-dimensional third simulated flow field data is sliced into two-dimensional third simulated flow field data; The two-dimensional third simulated flow field data are input into multiple first long short-term memory networks to obtain multiple first target resistances; The spliced first target resistances are input into the second long short-term memory network to obtain the second target resistance, which is the predicted resistance experienced by the ship at a second time point, which is adjacent to and after the first time point.
9. A training device for a resistance prediction network, characterized in that, include: The first simulation flow field data acquisition module is used to acquire three-dimensional simulation flow field data of a ship during navigation through computational fluid dynamics. The first simulation flow field data includes flow field data of the flow field where the ship is located and three-dimensional hull data of the ship. The network training module is used to train multiple first long short-term memory networks and second long short-term memory networks. The first long short-term memory network takes the three-dimensional first simulated flow field data as input to predict the first resistance experienced by the ship. The second long short-term memory network takes multiple spliced first resistances as input to predict the second resistance experienced by the ship. The network detection module is used to detect whether multiple first long short-term memory networks and second long short-term memory networks meet preset evaluation criteria; The network composition module is used to combine multiple first long short-term memory networks and second long short-term memory networks into a multi-scale resistance prediction network if the conditions are met.
10. A ship resistance prediction device, characterized in that, include: The network acquisition module is used to acquire the multi-scale resistance prediction network trained by the training device of the resistance prediction network as described in claim 9, which consists of multiple first long short-term memory networks and second long short-term memory networks. The third simulation flow field data acquisition module is used to acquire the three-dimensional third simulation flow field data of the simulated ship at the first moment. The third simulation flow field data slicing module is used to slice the three-dimensional third simulation flow field data into two-dimensional third simulation flow field data; The first target resistance acquisition module is used to input the two-dimensional third simulated flow field data into multiple first long short-term memory networks to obtain multiple first target resistances. The second target resistance prediction module is used to input multiple spliced first target resistances into the second long short-term memory network to obtain a second target resistance, which is a prediction of the resistance experienced by the ship at a second time moment, which is adjacent to and after the first time moment.
11. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the training method for the resistance prediction network as described in any one of claims 1-7 or the resistance prediction method for a ship as described in claim 8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the training method for the resistance prediction network of any one of claims 1-7 or the resistance prediction method for a ship as described in claim 8.
Citation Information
Patent Citations
Complex maneuvering aircraft flight path estimation method based on learnable extended Kalman filtering
CN109858137A
High-altitude littering detection method and device, computer equipment and storage medium
CN112418069A