Ship attitude prediction method, system and equipment based on long short-term memory artificial neural network, and medium
Through the method based on long and short-term memory artificial neural network, the problems of short-term recording period and low prediction accuracy in ship attitude prediction are solved, and the accurate prediction of ship motion attitude is achieved, which improves the work efficiency of maritime tasks.
Patent Information
- Application Number
- CN202411692823.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, ship attitude prediction has problems such as short recording period and low prediction accuracy, and it is difficult to accurately predict the shaking state of the ship, which affects the success rate of the target aircraft launch.
Using a method based on long and short-term memory artificial neural network, the prediction and visualization of ship pose time series data is carried out by constructing sample databases, data preprocessing, constructing and training long and short-term memory artificial neural network models.
Accurate and efficient prediction of the ship's moving attitude condition is achieved, reducing the difficulty of technicians in judging ship attitude motion in the future, and improving the working efficiency of offshore ship tasks.
Smart Images

Figure CN119749805A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship motion attitude prediction, and in particular to a ship attitude prediction method, system, equipment and medium based on long short-term memory artificial neural network. Background Art
[0002] As a military aircraft for shooting training targets, target drones can be used to simulate enemy aircraft or incoming missiles during military exercises or weapon tests. They provide imaginary targets and shooting opportunities for various types of artillery or missile systems. The development of air defense weapons for naval ships is inseparable from target drones. The launch of target drones on ships is very different from that on land. On ships, especially small and medium-sized ships, complex sea conditions can cause problems such as hull shaking and vortexes on the ship surface, causing the warship to be in a swaying state. The uncertain swaying state makes it difficult to grasp the timing of the target drone launch. If the launch timing is not chosen reasonably, it is easy to have an angle deviation, and even cause the target drone to fail to launch. Therefore, it is of great significance to study the problems related to warship attitude prediction and accurately predict the stable period of warship movement, which is of great significance to improving the reliability of target drone launch.
[0003] The motion of the ship can be described by six degrees of freedom, namely, sway, sway, bow roll, roll, pitch, and heave. When facing sea conditions above level 4, the wave height around the ship exceeds 2 meters. Under the influence of the sea breeze, the sway angle of small ships will become very large, usually close to or even exceeding plus or minus 15°. This sway (especially pitch) will cause the tail of the ship to fluctuate violently in the wind and waves. In this complex and changeable situation, it is necessary to judge the degree of sway of the hull in the next few seconds based on the actual situation of the ship and combined with experience, and choose the stable state of the ship to complete the launch mission of the target drone. The roll indicator equipped on modern ships can display the roll angle of the ship in real time, but it does not have the ability to show the overall posture, nor does it have the recording and prediction functions. Under limited conditions, it is difficult for the target drone launcher to obtain enough information and accurately predict the sway state of the ship, which causes certain difficulties for the launch of the target drone. If the motion state of the ship in the short term in the future can be given as a reference, and on this basis, one or more relatively stable periods of ship motion can be predicted as the timing of the target drone launch, the success rate of the target drone launch can be significantly improved.
[0004] In the above context, there is an urgent need for a method that can consider the use of deep learning to guide ship attitude prediction and develop a ship attitude prediction and analysis method based on long short-term memory artificial neural network to provide guarantee for the safe implementation of maritime missions. Summary of the invention
[0005] In order to solve the problems existing in the prior art, the present invention provides a ship attitude prediction method, system, device and medium based on long short-term memory artificial neural network, which solves the problems of short recording period and low prediction accuracy in the existing ship attitude prediction mentioned in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solution: a ship attitude prediction method based on long short-term memory artificial neural network, comprising the following steps:
[0007] S1. Build a sample database based on simulation data;
[0008] S2, data preprocessing;
[0009] S3, construct a long short-term memory artificial neural network algorithm model;
[0010] S4, train the algorithm model and adjust the hyperparameters;
[0011] S5. Predict the ship attitude time series data through the trained algorithm model and visualize the prediction results.
[0012] Preferably, in step S1, a sample database is constructed by inputting time series data of roll, pitch and heave of the ship's motion posture under the influence of wave height and wind speed factors under different sea conditions obtained by software simulation.
[0013] Preferably, in step S2, the data preprocessing includes: performing normalization processing using a Gaussian normalization method, and after processing, all sample data are converted into a standard normal distribution with a mean of 0 and a standard deviation of 1, so that the sample data are in the same range and order of magnitude.
[0014] Preferably, in step S3, the long short-term memory artificial neural network algorithm model consists of an input layer, a hidden layer and an output layer; the time series data of the ship's roll, pitch and heave, a total of three parameters, are used as input; and the time series data of the ship's posture prediction in the future period is used as output.
[0015] Preferably, in step S4, the preprocessed sample data is input into the ship attitude prediction algorithm model of the long short-term memory artificial neural network for training, and MSELoss (Mean Squared Error Loss) is used as the loss function to evaluate the performance of the algorithm model. Optuna is used to perform hyperparameter tuning on multiple hyperparameters of the model to obtain the algorithm model after training.
[0016] Preferably, in step S4, the training process of the model is executed using the train function, which specifically includes: loading the database as a PyTorch DataLoader object; creating an initialization model according to the settings in Config; performing forward propagation and back propagation once for each batch to update the model parameters; and using an early stopping mechanism to stop training in advance when the loss does not decrease over multiple rounds according to the change in function loss.
[0017] Preferably, the hyperparameter tuning is performed by automatic hyperparameter optimization through Optuna, and the process is as follows:
[0018] First, the Sampler is used to determine the parameter values in each experiment. Then, the sampling strategy TPE (Tree-structured Parzen Estimator) based on Bayesian optimization is used to sample parameters. Then, Optuna randomly samples some parameters. Then, a probability model is created based on the sampling parameters of TPE and the corresponding objective function values, which is used to describe the relationship between the parameters and the objective function. Optuna samples in the parameter space area predicted by the currently constructed probability model, looking for parameter combinations that make the objective function reach the extreme value and gradually approach the optimal hyperparameter configuration, that is, the parameter combination that achieves the best value of the objective function. After Optuna runs multiple random samplings, it updates the sampling strategy and gradually adjusts the sampling range. In the parameter area with better performance, that is, in the parameter space where the objective function value is closer to the extreme value, it gradually looks for new parameter combinations to make the objective function value closer to the extreme value. Finally, when it is detected that the objective function value of the new parameter combination sampled over a period of time has a very limited improvement, or even shows a trend of performance fluctuation and decline, the early stopping mechanism is used to stop the experiment in advance.
[0019] On the other hand, to achieve the above-mentioned purpose, the present invention also provides the following technical solution: a ship attitude prediction system based on long short-term memory artificial neural network, the system comprising the following modules:
[0020] A sample database construction module is used to construct a sample database according to simulation data;
[0021] The data preprocessing module uses Gaussian normalization method to normalize the sample data;
[0022] Algorithm model building module, building long short-term memory artificial neural network algorithm model;
[0023] Model training module, training algorithm model, and adjusting hyperparameters;
[0024] The prediction module predicts the ship attitude time series data through the trained algorithm model and visualizes the prediction results.
[0025] On the other hand, to achieve the above-mentioned purpose, the present invention also provides the following technical solution: an electronic device, the electronic device comprising: a processor; and a memory for storing one or more programs;
[0026] When the one or more programs are executed by the processor, the processor executes the ship attitude prediction method based on the long short-term memory artificial neural network.
[0027] On the other hand, to achieve the above-mentioned purpose, the present invention also provides the following technical solution: a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the ship attitude prediction method based on the long short-term memory artificial neural network is implemented.
[0028] The beneficial effects of the present invention are as follows: the ship attitude prediction method based on the long short-term memory artificial neural network of the present invention provides the time series data of the ship's roll, pitch, and heave in the future, accurately and efficiently predicts the ship's motion attitude, reduces the difficulty of technical personnel in judging the ship's attitude movement in the future, and improves the work efficiency of marine ship tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the steps of the ship attitude prediction method based on the long short-term memory artificial neural network of the present invention;
[0030] Figure 2 A comparison diagram of the actual and predicted rolling time series curves of the ship obtained by predicting and analyzing the ship attitude time series data under actual sea conditions in the present invention;
[0031] Figure 3 Schematic diagram of a ship attitude prediction system module based on a long short-term memory artificial neural network in an embodiment of the present invention;
[0032] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present invention;
[0033] In the figure, 110 - sample database construction module; 120 - data preprocessing module; 130 - algorithm model construction module; 140 - model training module; 150 - prediction module; 210 - processor; 220 - storage. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] See also Figure 1 The present invention provides a technical solution: a ship attitude prediction method based on long short-term memory artificial neural network, comprising the following steps:
[0036] Step S1: construct a sample database by inputting the time series data of roll, pitch, and heave of the ship's motion posture under different sea conditions affected by factors such as wave height and wind speed obtained by software simulation;
[0037] Step S2: preprocessing the sample data to obtain preprocessed sample data;
[0038] Step S3: constructing a ship attitude prediction algorithm model of a long short-term memory artificial neural network, inputting the preprocessed sample data into the ship attitude prediction algorithm model of the long short-term memory artificial neural network for training, and the obtained prediction model realizes the preliminary prediction of the ship attitude time series;
[0039] Step S4: Use MSELoss as the loss function to evaluate the performance of the algorithm model, and use Optuna to optimize multiple hyperparameters of the model to obtain the parameter configuration for the best performance of the model;
[0040] Step S5: Predict the ship's attitude through the trained algorithm model and visualize the prediction results.
[0041] Furthermore, in step S2, the Gaussian normalization method is used for normalization processing, and all sample data are converted into a standard normal distribution with a mean of 0 and a standard deviation of 1 after processing, so that the sample data are in the same range and order of magnitude.
[0042] Furthermore, in step S3, the long short-term memory artificial neural network algorithm model constructed specifically includes:
[0043] The model consists of an input layer, a hidden layer, and an output layer. The basic framework of the model is constructed based on the long short-term memory artificial neural network algorithm, taking the time series data of the ship's roll, pitch, and heave as input, and the time series data of the ship's attitude prediction in the future as output.
[0044] Furthermore, in step S3, the model training process is performed using the train function, which specifically includes:
[0045] Load the training set and validation set data as PyTorch's DataLoader object; create and initialize the LSTM model according to the settings in Config; perform forward propagation and backpropagation once for each batch to update the model parameters; use the early stopping mechanism to stop training in advance when the loss does not decrease after multiple rounds according to the loss changes of the monitored validation set; and record the loss values of each round of training and validation of the model in a visual manner.
[0046] Furthermore, in step S4, Optuna is used to automatically optimize hyperparameters. The process is as follows:
[0047] First, the Sampler is used to determine the parameter values in each experiment. Then, the sampling strategy TPE (Tree-structured Parzen Estimator) based on Bayesian optimization is used to sample parameters. Then, Optuna randomly samples some parameters. Then, a probability model is created based on the sampling parameters of TPE and the corresponding objective function values, which is used to describe the relationship between the parameters and the objective function. Optuna samples in the parameter space area predicted by the currently constructed probability model, looking for parameter combinations that make the objective function reach the extreme value and gradually approach the optimal hyperparameter configuration, that is, the parameter combination that achieves the best value of the objective function. After Optuna runs multiple random samplings, it updates the sampling strategy and gradually adjusts the sampling range. In the parameter area with better performance, that is, in the parameter space where the objective function value is closer to the extreme value, it gradually looks for new parameter combinations to make the objective function value closer to the extreme value. Finally, when it is detected that the objective function value of the new parameter combination sampled over a period of time has a very limited improvement, or even shows a trend of performance fluctuation and decline, the early stopping mechanism is used to stop the experiment in advance.
[0048] The above simulated data is used to construct a test set to test the prediction accuracy of the algorithm model. Figure 2 As shown in the figure, it can be seen from the test results that the predicted results are very consistent with the simulation results.
[0049] The ship attitude prediction and analysis method based on long short-term memory artificial neural network of the present invention provides the time series data of the ship's roll, pitch, and heave in the future, accurately and efficiently predicts the ship's motion attitude, reduces the difficulty of technical personnel in judging the ship's attitude movement in the future, and improves the work efficiency of marine ship tasks.
[0050] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a ship attitude prediction system based on a long short-term memory artificial neural network, which can realize the functions provided by the above method embodiment, such as Figure 3As shown, the system includes the following modules:
[0051] A sample database construction module 110 constructs a sample database according to simulation data;
[0052] The data preprocessing module 120 uses a Gaussian normalization method to normalize the sample data;
[0053] Algorithm model building module 130, building a long short-term memory artificial neural network algorithm model;
[0054] Model training module 140, training algorithm model and adjusting hyperparameters;
[0055] The prediction module 150 predicts the ship attitude time series data through the trained algorithm model and visualizes the prediction results.
[0056] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides an electronic device, such as Figure 4 As shown, the device includes: a processor 210; and a memory 220, for storing one or more programs;
[0057] When the one or more programs are executed by the processor 210, the processor executes the ship attitude prediction method based on the long short-term memory artificial neural network.
[0058] The ship attitude prediction method based on long short-term memory artificial neural network comprises the following steps:
[0059] S1. Build a sample database based on simulation data;
[0060] S2, data preprocessing;
[0061] S3, construct a long short-term memory artificial neural network algorithm model;
[0062] S4, train the algorithm model and adjust the hyperparameters;
[0063] S5. Predict the ship attitude time series data through the trained algorithm model and visualize the prediction results.
[0064] Based on the same inventive concept as the above-mentioned method embodiment, the embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 210, the ship attitude prediction method based on the long short-term memory artificial neural network is implemented.
[0065] The ship attitude prediction method based on long short-term memory artificial neural network comprises the following steps:
[0066] S1. Build a sample database based on simulation data;
[0067] S2, data preprocessing;
[0068] S3, construct a long short-term memory artificial neural network algorithm model;
[0069] S4, train the algorithm model and adjust the hyperparameters;
[0070] S5. Predict the ship attitude time series data through the trained algorithm model and visualize the prediction results.
[0071] Through the ship attitude prediction method based on long short-term memory artificial neural network of the present invention, the time series data of the ship's roll, pitch and heave in the future period is given, and the ship's motion attitude is accurately and efficiently predicted, which reduces the difficulty of technical personnel in judging the ship's attitude movement in the future period and improves the work efficiency of marine ship tasks.
[0072] In several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0073] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0074] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or partly contributed to the prior art or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. It should be noted that, in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0075] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0076] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0077] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0078] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0079] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A ship attitude prediction method based on long short-term memory artificial neural network, characterized in that: The steps include: S1. Build a sample database based on simulation data; S2, data preprocessing; S3, construct a long short-term memory artificial neural network algorithm model; S4, train the algorithm model and adjust the hyperparameters; S5. Predict the ship attitude time series data through the trained algorithm model and visualize the prediction results.
2. The ship attitude prediction method based on long short-term memory artificial neural network according to claim 1 is characterized in that: In step S1, a sample database is constructed by inputting time series data of roll, pitch and heave of the ship's motion posture under different sea conditions under the influence of wave height and wind speed factors obtained by software simulation.
3. The ship attitude prediction method based on long short-term memory artificial neural network according to claim 1 is characterized in that: In step S2, the data preprocessing includes: performing normalization processing using a Gaussian normalization method, and after processing, all sample data are converted into a standard normal distribution with a mean of 0 and a standard deviation of 1, so that the sample data are in the same range and order of magnitude.
4. The ship attitude prediction method based on long short-term memory artificial neural network according to claim 1 is characterized in that: In step S3, the long short-term memory artificial neural network algorithm model consists of an input layer, a hidden layer and an output layer; the time series data of the ship's roll, pitch and heave are used as input; and the time series data of the ship's posture prediction in the future is used as output.
5. The ship attitude prediction method based on long short-term memory artificial neural network according to claim 1 is characterized in that: In step S4, the preprocessed sample data is input into the ship attitude prediction algorithm model of the long short-term memory artificial neural network for training. MSELoss is used as the loss function to evaluate the performance of the algorithm model. Optuna is used to optimize multiple hyperparameters of the model to obtain the algorithm model after training.
6. The ship attitude prediction method based on long short-term memory artificial neural network according to claim 1 is characterized in that: In step S4, the train function is used to execute the model training process, which specifically includes: loading the database as a PyTorch DataLoader object; creating an initialization model according to the settings in Config; performing forward propagation and back propagation once for each batch to update the model parameters; and using an early stopping mechanism to stop training in advance when the loss does not decrease after multiple rounds of loss according to the change in function loss.
7. The ship attitude prediction method based on long short-term memory artificial neural network according to claim 1 is characterized in that: The hyperparameter tuning is performed by Optuna to automatically optimize the hyperparameters. The process is as follows: First, the Sampler is used to determine the parameter values in each experiment. Then, the sampling strategy TPE based on Bayesian optimization is used to sample parameters. Then, Optuna randomly samples some parameters. Then, a probability model is created based on the sampling parameters of TPE and the corresponding objective function values, which is used to describe the relationship between the parameters and the objective function. Optuna samples in the parameter space area predicted by the currently constructed probability model, looking for parameter combinations to make the objective function reach the extreme value and gradually approach the optimal hyperparameter configuration, that is, the parameter combination that achieves the best value of the objective function. After Optuna runs multiple random samplings, it updates the sampling strategy and gradually adjusts the sampling range. In the parameter area with better performance, that is, in the parameter space where the objective function value is closer to the extreme value, it gradually looks for new parameter combinations to make the objective function value closer to the extreme value. Finally, when it is detected that the objective function value of the new parameter combination sampled over a period of time has been improved very limitedly, or even shows a trend of performance fluctuation and decline, the early stopping mechanism is used to stop the experiment in advance.
8. A system for ship attitude prediction method based on long short-term memory artificial neural network according to any one of claims 1 to 7, characterized in that: The system includes the following modules: A sample database construction module (110) constructs a sample database according to simulation data; A data preprocessing module (120) performs normalization processing on the sample data using a Gaussian normalization method; An algorithm model building module (130) is used to build a long short-term memory artificial neural network algorithm model; Model training module (140), training algorithm model and adjusting hyperparameters; The prediction module (150) predicts the ship attitude time series data through the trained algorithm model and visualizes the prediction results.
9. An electronic device, characterized in that: The electronic device comprises: a processor (210); and a memory (220) for storing one or more programs; When the one or more programs are executed by the processor (210), the processor executes the ship attitude prediction method based on long short-term memory artificial neural network as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by the processor (210), the ship attitude prediction method based on the long short-term memory artificial neural network as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Ship swaying forecasting visual system and method based on improved Transform model
CN116910838A
PSO-LSTM-based ship motion prediction method, electronic equipment and storage medium
CN118811042A
A system for operating an unmanned surface vehicle and an operation method therefor
KR102530977B1
Artificial-intelligence-based waterway information system
US20210334650A1
Cited By
Ship motion attitude prediction method and device, medium and electronic equipment
CN122065236A