A method and system for extremely short-term prediction of ship motion based on LSTM neural network
Through the method based on LSTM neural network, extremely short-term forecasts are made for ship motion, and multiple preset models are used to compare the prediction results, which solves the problem of inaccurate forecasts in the prior art, and improves the accuracy and calculation efficiency of forecasts.
Patent Information
- Application Number
- CN202110803068.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-07-15
AI Technical Summary
In the prior art, artificial neural networks are used to predict ship movements very short-term problems, and there is a problem that the forecast is not accurate enough.
Using the LSTM neural network method, by obtaining the ship's motion itself data, other ship's motion posture data and wave height data for preprocessing, multiple preset LSTM neural network models are used to predict, and multiple prediction results are compared to generate The final forecast results improve prediction accuracy.
Through multiple input data, the accuracy of extremely short-term forecasts of ship motion is improved, the impact of noise data is reduced, the training convergence speed is accelerated, and the calculation efficiency is improved.
Smart Images

Figure CN113408711B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of extremely short-term prediction of ship motion, and in particular to an extremely short-term prediction method and system for ship motion based on LSTM neural network. Background Art
[0002] The extremely short-term prediction of ship motion refers to the prediction of the motion posture of the ship in the next few seconds to more than ten seconds. Its effective implementation helps to ensure the safety of ship navigation and operation at sea. In recent years, with the vigorous development of artificial neural network algorithms, more and more scholars have used artificial neural networks for extremely short-term prediction of ship motion.
[0003] At present, the use of artificial neural networks for extremely short-term forecasting of ship motion has the problem of insufficient accuracy. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for extremely short-term prediction of ship motion based on LSTM neural network, so as to improve the problem of inaccurate prediction in the existing technology of extremely short-term prediction of ship motion using artificial neural network.
[0005] In a first aspect, an embodiment of the present application provides a method for extremely short-term prediction of ship motion based on an LSTM neural network, which comprises the following steps:
[0006] Acquiring initial data, the initial data including the ship's own motion data, other ships' motion attitude data and wave height data;
[0007] Preprocessing the initial data to generate effective initial data;
[0008] According to the effective initial data, multiple preset LSTM neural network models are used to predict the ship motion to generate multiple prediction results;
[0009] The multiple prediction results are compared to generate comparison results, and the final forecast result information is obtained based on the comparison results.
[0010] In the above implementation process, by obtaining initial data, the above initial data includes the ship motion data itself, other ship motion posture data and wave height data, and then preprocessing the initial data to generate effective initial data. By preprocessing the initial data, noise data can be removed, and the influence of data magnitude differences can be reduced. At the same time, the training convergence speed is accelerated and the calculation efficiency is improved. Then, according to the effective initial data, a variety of preset LSTM neural network models are used to predict the ship motion to generate a variety of prediction results. By using different input data from several aspects for prediction, and then comparing the multiple prediction results to generate comparison results, and obtaining the final forecast result information based on the comparison results, the prediction result is not only predicted based on one input data, but predicted from multiple aspects, and the prediction results are compared. The smaller the difference between the prediction results, the more prepared the prediction results are, thereby improving the accuracy of the extremely short-term forecast of the ship motion.
[0011] Based on the first aspect, in some embodiments of the present invention, the step of respectively using a plurality of preset LSTM neural network models to predict the ship motion according to the effective initial data to generate a plurality of prediction results includes the following steps:
[0012] Extracting and inputting the ship motion data from the valid initial data into a preset first LSTM neural network model to generate a first prediction result;
[0013] Extracting and inputting the ship motion data and other ship motion posture data in the valid initial data into a preset second LSTM neural network model to generate a second prediction result;
[0014] The ship motion data and wave height data in the valid initial data are extracted and input into the preset third LSTM neural network model to generate a third prediction result.
[0015] Based on the first aspect, in some embodiments of the present invention, the step of preprocessing the initial data to generate valid initial data includes the following steps:
[0016] Inputting the initial data into a preset smoothing filter to generate preprocessed data;
[0017] The preprocessed data is brought into a preset normalized mathematical expression for calculation to generate effective initial data.
[0018] Based on the first aspect, in some embodiments of the present invention, the above normalized mathematical expression is:
[0019] Among them, x* is the effective initial data, x is the preprocessed data, and x minand x max They are the minimum and maximum values in the preprocessed data respectively.
[0020] Based on the first aspect, in some embodiments of the present invention, the following steps are further included:
[0021] Obtaining sample initial data; the initial data includes ship motion attitude data and wave height data;
[0022] Get model parameters;
[0023] The LSTM neural network framework is constructed according to the model parameters and sample initial data and iterative training is performed to obtain the LSTM neural network model.
[0024] Based on the first aspect, in some embodiments of the present invention, the step of obtaining the model parameters includes the following steps:
[0025] Set initial model parameters based on sample initial data;
[0026] The particle swarm optimization algorithm is used to optimize the initial model parameters to generate optimized model parameters, and the optimized model parameters are used as model parameters.
[0027] Based on the first aspect, in some embodiments of the present invention, the following steps are also included:
[0028] Extract and perform multi-layer LSTM neural network calculation on the data vector group in the sample initial data to generate target data;
[0029] Bring the target data into the preset loss function expression for calculation to obtain the loss value;
[0030] The LSTM neural network model is optimized using a preset optimizer according to the loss value to generate an optimized LSTM neural network model.
[0031] Based on the first aspect, in some embodiments of the present invention, the above-mentioned step of comparing multiple prediction results to generate a comparison result, and obtaining final forecast result information according to the comparison result includes the following steps:
[0032] Compare any two prediction results among the multiple prediction results to obtain multiple comparison results;
[0033] The multiple comparison results are compared with the preset thresholds respectively. If the multiple comparison results are all smaller than the preset thresholds, any one of the multiple prediction results is used as the final forecast result information; if at least one comparison result is not smaller than the preset threshold, the initial data is obtained.
[0034] In a second aspect, an embodiment of the present application provides an extremely short-term prediction system for ship motion based on an LSTM neural network, comprising:
[0035] A data acquisition module is used to acquire initial data; the initial data includes the ship's own motion data, other ships' motion posture data and wave height data;
[0036] A data preprocessing module, used for preprocessing the initial data to generate effective initial data;
[0037] The LSTM neural network model prediction module is used to predict the ship motion using a variety of preset LSTM neural network models according to the effective initial data to generate a variety of prediction results;
[0038] The prediction result comparison module is used to compare multiple prediction results to generate and obtain final forecast result information based on the comparison results.
[0039] In the above implementation process, the initial data is obtained through the data acquisition module, and the above initial data includes the ship motion data itself, other ship motion posture data and wave height data. Then the data preprocessing module preprocesses the initial data to generate effective initial data. By preprocessing the initial data, noise data can be removed, and the influence of data magnitude differences can be reduced. At the same time, the training convergence speed is accelerated and the calculation efficiency is improved. Then the LSTM neural network model prediction module uses a variety of preset LSTM neural network models to predict the ship motion according to the effective initial data to generate a variety of prediction results. By using different input data from several aspects for prediction, the prediction result comparison module compares the multiple prediction results to generate a comparison result, and obtains the final forecast result information according to the comparison result, so that the prediction result is not only predicted based on one input data, but predicted from multiple aspects, and the prediction results are compared. The smaller the difference between the prediction results, the more prepared the prediction result is, thereby improving the accuracy of the extremely short-term forecast of the ship motion.
[0040] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory for storing one or more programs; and a processor. When the one or more programs are executed by the processor, the method described in any one of the first aspects is implemented.
[0041] The embodiments of the present invention have at least the following advantages or beneficial effects:
[0042] The embodiment of the present invention provides a method and system for extremely short-term prediction of ship motion based on LSTM neural network, by obtaining initial data, the above-mentioned initial data includes ship motion data itself, other ship motion posture data and wave height data, and then preprocessing the initial data to generate effective initial data. By preprocessing the initial data, noise data can be removed, and the influence of data magnitude difference can be reduced, while accelerating the training convergence speed and improving the calculation efficiency. Then, according to the effective initial data, multiple preset LSTM neural network models are used to predict the ship motion to generate multiple prediction results, and different input data are used for prediction from several aspects, and then the multiple prediction results are compared to generate comparison results, and the final prediction result information is obtained according to the comparison result, so that the prediction result is not only predicted according to one input data, but predicted from multiple aspects, and the prediction results are obtained by comparing, the smaller the difference between the prediction results, the more prepared the prediction result is, thereby improving the accuracy of the extremely short-term prediction of ship motion. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A flowchart of a method for extremely short-term prediction of ship motion based on an LSTM neural network provided in an embodiment of the present invention;
[0045] Figure 2 A structural block diagram of a ship motion extremely short-term prediction system based on an LSTM neural network provided in an embodiment of the present invention;
[0046] Figure 3 A structural block diagram of an electronic device provided by an embodiment of the present invention.
[0047] Icon: 110 - data acquisition module; 120 - data preprocessing module; 130 - LSTM neural network model prediction module; 140 - prediction result comparison module; 101 - memory; 102 - processor; 103 - communication interface. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0049] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0050] Example
[0051] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0052] Please see Figure 1 , Figure 1 A flowchart of a very short-term prediction method for ship motion based on an LSTM neural network provided by an embodiment of the present invention. The very short-term prediction method for ship motion based on an LSTM neural network comprises the following steps:
[0053] Step S110: Acquire initial data; the initial data includes the ship motion data, other ship motion attitude data and wave height data; the ship motion data includes the ship rolling motion duration data, other ship motion attitude data includes the ship six-degree-of-freedom motion data; the wave height data includes the wave height data at different positions. The initial data can be obtained by setting wave height monitoring points and various sensors on the ship.
[0054] Step S120: preprocessing the initial data to generate valid initial data; the data preprocessing is processing the distribution of each group of data, and the preprocessing includes the following steps:
[0055] First, the initial data is input into a preset smoothing filter to generate preprocessed data; the smoothing filter mainly smoothes the initial data to remove noise in the initial data, thereby obtaining useful initial data. The smoothing filter can be obtained by using a moving average smoothing filter algorithm and a wavelet decomposition filter algorithm, which belong to the prior art and will not be described in detail here.
[0056] Then, the preprocessed data is brought into the preset normalized mathematical expression for calculation to generate effective initial data. The above preprocessed data is nonlinear data, and after normalization processing, a smooth preprocessed data curve is obtained. The above normalized mathematical expression is:
[0057] Among them, x* is the effective initial data, x is the preprocessed data, and x min and x max are the minimum and maximum values in the preprocessed data, respectively. By normalizing the preprocessed data, the impact of data magnitude differences can be reduced, while accelerating the training convergence speed and improving the computational efficiency.
[0058] Step S130: According to the effective initial data, a plurality of preset LSTM neural network models are respectively used to predict the ship motion to generate a plurality of prediction results; LSTM neural network is a special recurrent neural network that can effectively solve the gradient explosion problem of traditional recurrent neural network. At the same time, LSTM neural network can process long time series data and has long-term memory ability. The above-mentioned prediction of ship motion using a plurality of preset LSTM neural network models mainly includes the following:
[0059] The first step is to extract and input the ship motion data from the effective initial data into the preset first LSTM neural network model to generate the first prediction result; the above-mentioned first LSTM neural network model refers to an LSTM neural network model established using the ship motion data itself, and data prediction is performed by inputting the ship motion data itself. For example, a set of ship rolling motion duration data obtained in the effective initial data is input into the first LSTM neural network model to predict the rolling, and the rolling data of the ship motion is predicted. This prediction method predicts the ship motion by mining the inherent laws of the data itself.
[0060] The second step is to extract and input the ship motion data and other ship motion posture data in the effective initial data into the preset second LSTM neural network model to generate the second prediction result; the above second LSTM neural network model refers to the LSTM neural network model established using the ship motion posture data. Considering that the six free motions of the ship are mutually coupled, the characteristics of LSTM multi-feature input are used to take multiple ship motion postures as input to make an extremely short-term forecast of a certain motion of the ship, thereby improving the forecast accuracy.
[0061] The third step is to extract and input the ship motion data and wave height data in the effective initial data into the preset third LSTM neural network model to generate the third prediction result. The above third LSTM neural network model mainly refers to the LSTM neural network model established by using the mapping relationship between wave height and ship. During the operation of ships in waves, since waves are the main excitation factor for the swaying motion of ships, the mapping relationship between wave height and ship motion can be established through the LSTM neural network. Since it takes a certain time for waves to propagate in space and waves have a memory effect, the optimal response relationship between waves and ship motion has a certain time delay. The extremely short-term forecast of ship motion is carried out through waves, which can effectively improve the forecast time. Considering that there may be a short-term loss of wave height during the acquisition process, the LSTM neural network can be used to predict the wave height to fill in the missing fragments, so as to obtain more accurate prediction data.
[0062] The above three LSTM neural network model prediction methods can be performed separately or simultaneously.
[0063] Step S140: compare the multiple prediction results to generate a comparison result, and obtain the final forecast result information according to the comparison result. The above comparison process includes the following processes:
[0064] First, any two prediction results among the multiple prediction results are compared to obtain multiple comparison results; the above comparison refers to comparing the difference values of any two prediction results among the multiple prediction results, for example, the prediction result A obtained by predicting using the first LSTM neural network model is 0.028, the prediction result B obtained by predicting using the second LSTM neural network model is 0.025, and the prediction result C obtained by predicting using the third LSTM neural network model is 0.027; the prediction result A is compared with the prediction result B to obtain a difference value between the prediction result A and the prediction result B of 0.002, the prediction result A is compared with the prediction result C to obtain a difference value between the prediction result A and the prediction result C of 0.001, and the prediction result B is compared with the prediction result C to obtain a difference value between the prediction result B and the prediction result C of 0.002.
[0065] Then, multiple comparison results are compared with the preset thresholds. Since the extremely short-term forecast of ship motion is carried out, there is a strong continuity between the data, and the predicted value will not jump with the real value of the previous moment. The slope correlation theory between data can be used to set an effective judgment threshold and use it as the preset threshold. If multiple comparison results are all less than the preset threshold, any one of the multiple prediction results is used as the final prediction result information; if at least one comparison result is not less than the preset threshold, the initial data is obtained. For example: prediction result A, prediction result B, and prediction result C are obtained, the difference between prediction result A and prediction result B is 0.001, the difference between prediction result A and prediction result C is 0.002, and the difference between prediction result B and prediction result C is 0.002. The preset threshold is 0.005. After comparison, any one of the prediction results A, prediction result B, and prediction result C is less than 0.005, that is, less than the preset threshold, and any one of the prediction results A, prediction result B, or prediction result C is used as the final prediction result information. For example: prediction results D, prediction results E, and prediction results F are obtained, the difference between prediction results D and prediction results E is 0.003, the difference between prediction results D and prediction results F is 0.007, the difference between prediction results E and prediction results F is 0.009, and the preset threshold is 0.004. After comparison, the difference between prediction results D, prediction results E, and prediction results F is less than 0.005, the difference between prediction results D and prediction results, and the difference between prediction results E and prediction results F are all greater than the preset threshold, that is, there is a comparison result that is not less than the preset threshold, then it is considered that the prediction is not accurate enough, and continue with the next prediction, that is, obtain initial data for the next prediction.
[0066] In the above implementation process, initial data is obtained, including data of the ship's motion itself, other ship's motion attitude data and wave height data, and then the initial data is preprocessed to generate effective initial data. By preprocessing the initial data, noise data can be removed, and the influence of data magnitude differences can be reduced. At the same time, the training convergence speed is accelerated and the calculation efficiency is improved. Then, according to the effective initial data, a variety of preset LSTM neural network models are used to predict the ship's motion to generate a variety of prediction results. By using different input data from several aspects for prediction, and then comparing the multiple prediction results to generate comparison results, the final forecast result information is obtained according to the comparison results, so that the prediction result is not only predicted based on one input data, but predicted from multiple aspects, and the prediction results are compared. The smaller the difference between the prediction results, the more prepared the prediction results are, thereby improving the accuracy of the extremely short-term forecast of the ship's motion.
[0067] The first LSTM neural network model, the second LSTM neural network model, and the third LSTM neural network model are all LSTM neural network models. The construction of the above LSTM neural network models mainly includes the following processes:
[0068] First, obtain sample initial data; the sample initial data can be set in multiples according to actual conditions, for example, the sample initial data can be 4000 or 2000.
[0069] Then, obtain the model parameters; the above model parameters mainly refer to the main parameters of the LSTM model, including the number of input steps, the number of neuron nodes, the number of hidden layers, the optimizer type and learning rate, the number of training iterations, the training batch size, etc. Some of the parameter settings not only affect the model training efficiency, but also affect the forecast accuracy. Therefore, it is necessary to select appropriate model parameters to effectively improve the training efficiency while ensuring the forecast accuracy. For example: the number of neuron nodes is 16, the number of hidden layers is 2, the optimizer is Adam (Adaptive Moment Estimation), the learning rate is set to 0.0006, the number of training iterations is 30000, and the training batch size is 32. The number of training samples is 4000, and the duration is 1600 seconds. Considering the different sea state cycles of level 3, 4, and 5, the number of test samples is 100, 150, and 200, respectively, and the test duration is 40, 60, and 80 seconds, respectively.
[0070] The LSTM model parameter setting usually needs to be judged by experience to find the optimal parameters. To improve the accuracy of the data, the above model parameters can also be optimized and calculated using the particle swarm optimization algorithm. The following steps are included:
[0071] The first step is to set the initial model parameters according to the initial sample data; the initial model parameters can be set based on experience, mainly including the number of input steps, the number of neuron nodes, the number of hidden layers, the optimizer type and learning rate, the number of training iterations, the training batch size, etc.
[0072] In the second step, the particle swarm optimization algorithm is used to optimize the initial model parameters to generate optimized model parameters, and the optimized model parameters are used as model parameters. The above-mentioned optimization calculation mainly refers to optimizing the initial model parameters using the particle swarm optimization algorithm to obtain the optimized model parameters. First, all particles in the space are assigned initial random positions and initial random velocities. Then, the position of each particle is advanced in turn according to the speed of each particle, the optimal global position known in the problem space, and the optimal position known to the particle. As the calculation progresses, by exploring and utilizing the known favorable positions in the search space, the particles gather or aggregate around one or more optimal points. The above-mentioned particle swarm optimization algorithm belongs to the prior art and will not be repeated here.
[0073] Finally, the LSTM neural network framework is constructed according to the model parameters and the sample initial data and iterative training is performed to obtain the LSTM neural network model. The LSTM neural network framework is constructed by the obtained model parameters, and then the sample initial data is brought into the LSTM neural network framework for iterative training to obtain the LSTM neural network model.
[0074] The establishment of the above LSTM neural network model also includes the following steps:
[0075] First, extract and perform multi-layer LSTM neural network calculation on the data vector group in the sample initial data to generate target data; multi-layer LSTM neural network means that the LSTM unit structure consists of a forget gate, an input gate, an output gate and a unit state. At the current moment, the LSTM network has three input parameters: the input value at the current moment (such as wave height), the output value at the previous moment (such as ship movement), and the unit state at the previous moment. There are two output parameters: the output value at the current moment and the unit state at the current moment. LSTM controls the three gates through activation functions, thereby retaining and forgetting historical information. For example: the wave height time series data is (h1, h2, h3,..., ht), and the ship roll angle data is (θ 1 ,θ 2 ,θ 3 ......, θ t ), and input it into the multi-layer LSTM neural network for calculation to obtain the ship roll angle data corresponding to the future n-th data.
[0076] Then, the target data is brought into the preset loss function expression for calculation to obtain the loss value; the above loss function expression can adopt the root mean square loss function, and the expression of the root mean square loss function is: Among them: prediction represents the target data, label represents the theoretical data, and N represents the total number of samples. The root mean square loss function reflects the overall prediction error.
[0077] Finally, the LSTM neural network model is optimized using a preset optimizer according to the loss value to generate an optimized LSTM neural network model. The above loss function, i.e., the difference function between the value of the objective function and the true value, is actually the function of the parameters to be optimized. The task of the optimizer is to calculate the gradient of the loss function in each time period and then update the model parameters. The above optimizer includes an Adam optimizer, which optimizes the model parameters according to the loss value to obtain new model parameters, and then iterates the training according to the new model parameters to obtain the optimized LSTM neural network model. The above Adam optimizer is a prior art and will not be described in detail here.
[0078] Based on the same inventive concept, the present invention also proposes a ship motion short-term prediction system based on LSTM neural network, please refer to Figure 2 , Figure 2 A structural block diagram of a ship motion extremely short-term prediction system based on an LSTM neural network provided in an embodiment of the present invention. The ship motion extremely short-term prediction system based on an LSTM neural network includes:
[0079] The data acquisition module 110 is used to acquire initial data; the initial data includes the ship motion data, other ship motion posture data and wave height data;
[0080] The data preprocessing module 120 is used to preprocess the initial data to generate effective initial data;
[0081] The LSTM neural network model prediction module 130 is used to predict the ship motion using a plurality of preset LSTM neural network models according to the effective initial data to generate a plurality of prediction results;
[0082] The prediction result comparison module 140 is used to compare the multiple prediction results to generate and obtain the final forecast result information according to the comparison results.
[0083] In the above implementation process, the initial data is acquired by the data acquisition module 110, and the initial data includes the ship motion data itself, other ship motion posture data and wave height data. Then the data preprocessing module 120 preprocesses the initial data to generate effective initial data. By preprocessing the initial data, noise data can be removed, and the influence of data magnitude differences can be reduced. At the same time, the training convergence speed is accelerated and the calculation efficiency is improved. Then the LSTM neural network model prediction module 130 uses a plurality of preset LSTM neural network models to predict the ship motion according to the effective initial data to generate a plurality of prediction results. By using different input data for prediction from several aspects, the prediction result comparison module 140 compares the plurality of prediction results to generate a comparison result, and obtains the final forecast result information according to the comparison result, so that the prediction result is not only predicted based on one input data, but predicted from multiple aspects, and the prediction results are obtained by comparing the prediction results. The smaller the difference between the prediction results, the more prepared the prediction results are, thereby improving the accuracy of the extremely short-term forecast of the ship motion.
[0084] See also Figure 3 , Figure 3A schematic structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device includes a memory 101, a processor 102 and a communication interface 103, and the memory 101, the processor 102 and the communication interface 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, such as the program instructions / modules corresponding to the extremely short-term prediction system for ship motion based on LSTM neural network provided in an embodiment of the present application, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used to communicate signaling or data with other node devices.
[0085] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0086] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0087] Understandably, Figure 3 The structure shown is for illustration only. The electronic device may also include Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown. Figure 3Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0088] In the embodiments provided in the present application, it should be understood that the disclosed systems and methods can also be implemented in other ways. The system 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 systems, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the above-mentioned module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. 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 the flowchart, and the combination of the boxes in the block diagram and / or the 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.
[0089] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0090] If the above 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 this understanding, the technical solution of the present application, or the part that contributes to the prior art or the 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 for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods in each embodiment of the present application. 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.
[0091] In summary, an embodiment of the present application provides a method and system for extremely short-term prediction of ship motion based on an LSTM neural network. The method for extremely short-term prediction of ship motion based on an LSTM neural network obtains initial data, and the initial data includes data of the ship motion itself, other ship motion posture data, and wave height data. Then, the initial data is preprocessed to generate effective initial data. By preprocessing the initial data, noise data can be removed, and the influence of data magnitude differences can be reduced. At the same time, the training convergence speed is accelerated and the calculation efficiency is improved. Then, according to the effective initial data, a plurality of preset LSTM neural network models are used to predict the ship motion to generate a plurality of prediction results. By using different input data for prediction from several aspects, the plurality of prediction results are compared to generate a comparison result, and the final prediction result information is obtained according to the comparison result, so that the prediction result is not only predicted based on one input data, but is predicted from multiple aspects, and the prediction results are compared to obtain the prediction result. The smaller the difference between the prediction results, the more prepared the prediction result is, thereby improving the accuracy of the extremely short-term prediction of the ship motion.
[0092] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0093] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A very short-term prediction method for ship motion based on LSTM neural network, characterized in that: The following steps are involved: Acquiring initial data; the initial data includes the ship's own motion data, other ships' motion posture data and wave height data; Preprocessing the initial data to generate effective initial data; According to the effective initial data, multiple preset LSTM neural network models are used to predict the ship motion to generate multiple prediction results; Compare multiple prediction results to generate comparison results, and obtain final forecast result information based on the comparison results; The step of using a plurality of preset LSTM neural network models to predict the ship motion according to the effective initial data to generate a plurality of prediction results comprises the following steps: Extracting and inputting the ship motion data from the valid initial data into a preset first LSTM neural network model to generate a first prediction result; Extracting and inputting the ship motion data and other ship motion posture data in the valid initial data into a preset second LSTM neural network model to generate a second prediction result; Extracting and inputting the ship motion data and wave height data in the effective initial data into a preset third LSTM neural network model to generate a third prediction result; The step of comparing the multiple prediction results to generate a comparison result, and obtaining the final forecast result information according to the comparison result includes the following steps: Compare any two prediction results among the multiple prediction results to obtain multiple comparison results; The multiple comparison results are compared with the preset thresholds respectively. If the multiple comparison results are all smaller than the preset thresholds, any one of the multiple prediction results is used as the final forecast result information; if at least one comparison result is not smaller than the preset threshold, the initial data is obtained.
2. The method for extremely short-term prediction of ship motion based on LSTM neural network according to claim 1 is characterized in that: The step of preprocessing the initial data to generate effective initial data comprises the following steps: Inputting the initial data into a preset smoothing filter to generate preprocessed data; The preprocessed data is brought into a preset normalized mathematical expression for calculation to generate effective initial data.
3. The method for extremely short-term prediction of ship motion based on LSTM neural network according to claim 2 is characterized in that: The normalized mathematical expression is: in, is the effective initial data, To preprocess the data, and They are the minimum and maximum values in the preprocessed data respectively.
4. The method for extremely short-term prediction of ship motion based on LSTM neural network according to claim 1 is characterized in that: The following steps are involved: Get sample initial data; Get model parameters; The LSTM neural network framework is constructed according to the model parameters and sample initial data and iterative training is performed to obtain the LSTM neural network model.
5. The method for extremely short-term prediction of ship motion based on LSTM neural network according to claim 4 is characterized in that: The step of obtaining model parameters comprises the following steps: Set initial model parameters based on sample initial data; The particle swarm optimization algorithm is used to optimize the initial model parameters to generate optimized model parameters, and the optimized model parameters are used as model parameters.
6. The method for extremely short-term prediction of ship motion based on LSTM neural network according to claim 5 is characterized in that: The following steps are also included; Extract and perform multi-layer LSTM neural network calculation on the data vector group in the sample initial data to generate target data; Bring the target data into the preset loss function expression for calculation to obtain the loss value; The LSTM neural network model is optimized using a preset optimizer according to the loss value to generate an optimized LSTM neural network model.
7. A ship motion extreme short-term prediction system based on an LSTM neural network that executes the ship motion extreme short-term prediction method based on an LSTM neural network as described in any one of claims 1 to 6, characterized in that: include: A data acquisition module, used to acquire initial data; The initial data includes the ship's own motion data, other ships' motion posture data and wave height data; A data preprocessing module, used for preprocessing the initial data to generate effective initial data; The LSTM neural network model prediction module is used to predict the ship motion using a variety of preset LSTM neural network models according to the effective initial data to generate a variety of prediction results; The prediction result comparison module is used to compare multiple prediction results to generate and obtain final forecast result information based on the comparison results.
8. An electronic device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
