Unmanned ship heeling prediction method based on MTCN-LSTM, program, equipment and storage medium
Through the MTCN-LSTM model, high-dimensional mapping and dimensionality reduction of the lateral tilt motion attitude data of the unmanned boat are captured, complex nonlinear relationships are solved, and the prediction limitations in the existing technology are achieved, and more accurate prediction of the lateral angle is ensured. The safety of unmanned boat navigation.
Patent Information
- Application Number
- CN202411209070.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-22
AI Technical Summary
The existing unmanned boats' slant motion attitude prediction methods have prediction limitations when facing complex marine environments, making it difficult to accurately capture nonlinear relationships, affecting the stability and safety of unmanned boats.
Using the prediction method based on MTCN-LSTM, the timing data is mapped and dimensionally reduced through the MTCN module, and combined with the LSTM model to decode it, expand the receptive field, capture complex nonlinearity and long-term correlation, and achieve more accurate horizontal tilt Angle prediction.
It effectively improves the prediction accuracy of the strait motion posture of the unmanned boat, ensures navigation safety, and performs better than traditional LSTM and TCN models.
Smart Images

Figure CN119005444A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data analysis and prediction of the heel motion posture of an unmanned boat, and specifically relates to an unmanned boat heel prediction method, program, device and storage medium based on MTCN-LSTM. Background Art
[0002] In recent years, with the in-depth exploration of the ocean, unmanned boats have been widely used in the field of ocean navigation and play a vital role in performing various surface tasks. Faced with complex marine environmental factors such as strong winds, large waves and ocean currents and their combined effects, unmanned boats usually produce nonlinear six-degree-of-freedom motion. This uncertain motion state, especially heeling motion, will seriously affect its stability and safety. If the heel angle of the unmanned boat is too large, it is very easy to cause it to capsize, thereby threatening navigation safety. Therefore, real-time monitoring and prediction of the heel angle and closed-loop feedback control through the prediction results are crucial to ensure the stable driving of the unmanned boat. In the prediction research of the motion posture of unmanned boats, commonly used methods such as Kalman filtering, regression analysis based on linear theory, and recurrent neural networks based on deep learning all have certain prediction limitations. Summary of the invention
[0003] The purpose of the present invention is to provide an unmanned boat heel prediction method based on MTCN-LSTM, so as to accurately predict the heel motion posture of the unmanned boat, thereby ensuring the safety of the unmanned boat's navigation.
[0004] A method for predicting the heel of an unmanned boat based on MTCN-LSTM comprises the following steps:
[0005] Step 1: Acquire the motion posture data of the unmanned boat for a period of time before the current moment during the navigation process to form a time series matrix; the motion posture data includes the heel angle of the unmanned boat;
[0006] Step 2: construct an MTCN-LSTM model and perform pre-training; the MTCN-LSTM model includes an embedding layer, an MTCN module, an LSTM layer and a fully connected layer;
[0007] Step 3: Input the time series matrix of the unmanned boat at the current moment into the pre-trained MTCN-LSTM model. The input time series matrix is first input into the embedding layer for processing, and the embedded matrix is output. The embedded matrix is input into the MTCN module and outputs a three-dimensional tensor. The three-dimensional tensor is rearranged and input into the LSTM layer. The output of the LSTM layer passes through the fully connected layer to output the predicted heel angle of the unmanned boat in the future.
[0008] Furthermore, the time series matrix X in step 1 in ∈RM×L , where M is the number of types of unmanned boat motion posture data, and L is the length of the time series.
[0009] Furthermore, the MTCN module includes multiple MTCNBlock layers, and the data processing process is as follows:
[0010]
[0011] Among them, Z i represents the output of the i-th layer MTCNBlock; X emb ∈R M×D×N is the embedding matrix output by the embedding layer, D is the dimension of the embedding vector, N is the number of time steps, P is the convolution kernel size of the embedding layer, S is the convolution stride of the embedding layer; Block(·) represents the data processing operation performed by a single MTCNBlock layer.
[0012] Furthermore, the three-dimensional tensor Z output by the last group of MTCN modules is i Before inputting into the LSTM layer, it is rearranged into X LSTM ∈R B×N×(M×D) , where B represents the batch size, M×D represents the feature dimension of each time step, and X LSTM As the input of LSTM layer.
[0013] Furthermore, the data processing process in the LSTM layer is:
[0014] f t =σ(W f ·[h t-1 ,X LSTM ]+b f )
[0015] i t =σ(W i ·[h t-1 ,X LSTM ]+b i )
[0016] C t =f t ΘC t-1 +i t Θtanh(W C ·[h t-1 ,X LSTM ]+b C )
[0017] o t =σ(W o ·[h t-1 ,X LSTM ]+bo )
[0018] h t =o t Θtanh(C t )
[0019] Among them, h t represents the output of the LSTM layer at the current moment, h t-1 represents the output of the LSTM layer at the previous moment; f t 、i t , o t Respectively represent the activation values of the forget gate, input gate and output gate at the current moment; W f , W i , W C , W o represents the weight matrix of the LSTM layer, b f , b i , b C , b o represents the corresponding bias term; C t represents the cell state vector at the current moment, C t-1 represents the cell state vector at the previous moment; σ(·) represents the sigmoid activation function, and Θ represents the element-wise product operation.
[0020] Furthermore, the data processing process in the fully connected layer is:
[0021]
[0022] in, W represents the predicted value of the heel angle of the unmanned boat in the future and the prediction vector composed of its time points; fc1 and W fc2 represents the weight matrix of the fully connected layer, b fc1 and b fc2 is the bias vector.
[0023] A computer device / equipment / system comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-mentioned unmanned boat heel prediction method based on MTCN-LSTM.
[0024] A computer-readable storage medium stores a computer program / instruction, which, when executed by a processor, implements the steps of the unmanned boat heel prediction method based on MTCN-LSTM.
[0025] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned unmanned boat heel prediction method based on MTCN-LSTM.
[0026] The beneficial effects of the present invention are:
[0027] The present invention uses a recurrent neural network model integrating modern convolution for the heel motion posture data of the unmanned boat, uses MTCN as an encoder, and LSTM as a decoder, performs preliminary high-dimensional mapping of the time series data through MTCN, and realizes dimensionality reduction, and then LSTM performs further decoding based on the results after mapping and dimensionality reduction to obtain the final prediction output. The present invention can effectively capture the complex nonlinear relationship in the heel motion posture data of the unmanned boat, make full use of the advantages of convolutional neural networks in capturing spatial information, expand the receptive field of the model, and make up for the problem of decreased prediction accuracy of LSTM in the long-term dimension, forming a hybrid neural network that can learn long-term correlation and complex nonlinear relationships, effectively predict the future heel angle state changes of the unmanned boat in the long-term dimension, and obtain better prediction performance than the LSTM model and the TCN model. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic diagram of the overall process of the present invention.
[0029] Figure 2 This is a graph showing the prediction results of the heeling motion posture of the unmanned boat in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The present invention is further described below in conjunction with the accompanying drawings.
[0031] The present invention regards the data of the heeling motion posture of the unmanned boat as a series of time series, and conducts prediction research based on the method of time series analysis. It is found that the long short-term memory network (LSTM) model can effectively capture the long-term dependency of data in processing time series data. However, as the time dimension increases, the prediction accuracy of the LSTM model usually decreases. In response to this problem, the present invention adopts the combination of time convolution network (TCN) to improve the prediction accuracy of LSTM, but the traditional TCN still has shortcomings when processing complex time series data. For example, the fixed size and single scale of the convolution kernel lead to the limitation of the prediction receptive field, making it difficult to predict complex time series data with a long time dimension. Therefore, the present invention utilizes a time convolution network (MTCN) that integrates modern convolution technology and combines it with the LSTM model. Compared with the traditional TCN, the MTCN-LSTM model expands the receptive field through deep separation convolution, and constructs a dynamic mapping relationship between input data and prediction output during the model training and learning process. For the analysis of the heeling motion posture data of the unmanned boat with nonlinear characteristics and complexity, the present invention can provide more accurate and reliable prediction results.
[0032] A method for predicting the heel of an unmanned boat based on MTCN-LSTM comprises the following steps:
[0033] Step 1: Obtain the motion posture data of the unmanned boat during the navigation process before the current moment to form a time series matrix X in ∈R M×L ; Among them, the motion posture data includes the heel angle of the unmanned boat, M is the number of types of motion posture data of the unmanned boat, and L is the length of the time series;
[0034] Step 2: construct an MTCN-LSTM model and perform pre-training; the MTCN-LSTM model includes an embedding layer, an MTCN module, an LSTM layer and a fully connected layer;
[0035] Step 3: Input the time series matrix of the unmanned boat at the current moment into the pre-trained MTCN-LSTM model. The input time series matrix X in ∈R M×L First, input to the embedding layer for processing, and output the embedding matrix X emb ∈R M×D×N :
[0036] X emb =Embedding(X in )
[0037] Where D is the dimension of the embedding vector, N is the number of time steps, P is the convolution kernel size of the embedding layer, and S is the convolution stride of the embedding layer;
[0038] Embedding matrix X emb ∈R M×D×N Input into the MTCN module and output a three-dimensional tensor, where the MTCN module includes multiple layers of MTCNBlock layers. The data processing process is:
[0039]
[0040] Among them, Z i represents the output of the i-th layer MTCNBlock; Block(·) represents a series of convolution and nonlinear transformation operations performed on the input tensor in the MTCN model, including depthwise separable convolution, batch normalization, feedforward neural network, and residual connection;
[0041] The three-dimensional tensor Z output by the last set of MTCN modules i Before inputting into the LSTM layer, it is rearranged into X LSTM ∈R B ×N×(M×D) , where B represents the batch size, M×D represents the feature dimension of each time step, and X LSTMAs input to the LSTM layer;
[0042] The data processing process in the LSTM layer is:
[0043] f t =σ(W f ·[h t-1 ,X LSTM ]+b f )
[0044] i t =σ(W i ·[h t-1 ,X LSTM ]+b i )
[0045] C t =f t ΘC t-1 +i t Θtanh(W C ·[h t-1 ,X LSTM ]+b C )
[0046] o t =σ(W o ·[h t-1 ,X LSTM ]+b o )
[0047] h t =o t Θtanh(C t )
[0048] Among them, h t represents the output of the LSTM layer at the current moment, h t-1 represents the output of the LSTM layer at the previous moment; f t 、i t , o t Respectively represent the activation values of the forget gate, input gate and output gate at the current moment; W f , W i , W C , W o represents the weight matrix of the LSTM layer, b f , b i , b C , b o represents the corresponding bias term; C t represents the cell state vector at the current moment, C t-1 represents the cell state vector at the previous moment; σ(·) represents the sigmoid activation function, and Θ represents the element-wise product operation.
[0049] Finally, the fully connected layer outputs the predicted heel angle of the unmanned boat in the future:
[0050]
[0051] in, W represents the predicted value of the heel angle of the unmanned boat in the future and the prediction vector composed of its time points; fc1 and W fc2 represents the weight matrix of the fully connected layer, b fc1 and b fc2 is the bias vector.
[0052] Embodiment 1:
[0053] First, a real data set of real ship motion is obtained as input, and data initialization is performed to divide it into training set, validation set, and test set, and batch data is prepared for model training.
[0054] The MTCN-LSTM model is built, including an embedding layer, an MTCN module composed of four layers of MTCNBlock, and a single LSTM layer. Each MTCN module contains a depthwise separable convolution layer and two fully convolutional feedforward network layers (ConvFFN).
[0055] Then, the MTCN-LSTM model based on the convolutional neural network is trained. The motion posture data of the unmanned boat in the process of navigation for a period of time before the actual current moment (the time length of the samples in the training set when training the MTCN-LSTM model) is input into the trained model to obtain the predicted value of the heel angle of the unmanned boat in the future, as shown in the attached manual. Figure 2 shown.
[0056] In order to accurately predict the heel motion posture of the unmanned boat, so as to ensure the safety of the unmanned boat's navigation, the present invention proposes an unmanned boat heel prediction method based on MTCN-LSTM. For the heel motion posture data of the unmanned boat, a recurrent neural network model integrating modern convolution is used, MTCN is used as an encoder, and LSTM is used as a decoder. The time series data is initially mapped in a high dimension through MTCN, and dimensionality reduction is achieved. Subsequently, LSTM is further decoded based on the results after mapping and dimensionality reduction to obtain the final prediction output. By combining the time series encoding of MTCN with the decoding output of LSTM, the model can effectively capture the complex nonlinear relationship in the heel motion posture data of the unmanned boat, make full use of the advantages of convolutional neural networks in capturing spatial information, expand the receptive field of the model, and make up for the problem of decreased prediction accuracy of LSTM in the long time dimension, forming a hybrid neural network that can learn long-term correlation and complex nonlinear relationships, effectively predict the future heel angle state changes of the unmanned boat in a longer time dimension, and obtain better prediction performance than the LSTM model and the TCN model.
[0057] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting the heel of an unmanned boat based on MTCN-LSTM, characterized in that: The following steps are involved: Step 1: Acquire the motion posture data of the unmanned boat for a period of time before the current moment during the navigation process to form a time series matrix; the motion posture data includes the heel angle of the unmanned boat; Step 2: construct an MTCN-LSTM model and perform pre-training; the MTCN-LSTM model includes an embedding layer, an MTCN module, an LSTM layer and a fully connected layer; Step 3: Input the time series matrix of the unmanned boat at the current moment into the pre-trained MTCN-LSTM model. The input time series matrix is first input into the embedding layer for processing, and the embedded matrix is output. The embedded matrix is input into the MTCN module and outputs a three-dimensional tensor. The three-dimensional tensor is rearranged and input into the LSTM layer. The output of the LSTM layer passes through the fully connected layer to output the predicted heel angle of the unmanned boat in the future.
2. The unmanned boat heel prediction method based on MTCN-LSTM according to claim 1 is characterized in that: In step 1, the time series matrix X in ∈R M×L , where M is the number of types of unmanned boat motion posture data, and L is the length of the time series.
3. The unmanned boat heel prediction method based on MTCN-LSTM according to claim 2 is characterized in that: The MTCN module includes multiple MTCNBlock layers, and the data processing process is as follows: Among them, Z i represents the output of the i-th layer MTCNBlock; X emb ∈R M×D×N is the embedding matrix output by the embedding layer, D is the dimension of the embedding vector, N is the number of time steps, P is the convolution kernel size of the embedding layer, S is the convolution stride of the embedding layer; Block(·) represents the data processing operation performed by a single MTCNBlock layer.
4. The unmanned boat heel prediction method based on MTCN-LSTM according to claim 3 is characterized by: The three-dimensional tensor Z output by the last set of MTCN modules i Before inputting into the LSTM layer, it is rearranged into X LSTM ∈R B×N×(M×D) , where B represents the batch size, M×D represents the feature dimension of each time step, and X LSTM As the input of LSTM layer.
5. The unmanned boat heel prediction method based on MTCN-LSTM according to claim 4 is characterized in that: The data processing process in the LSTM layer is: f t =σ(W f ·[h t-1 ,X LSTM ]+b f ) i t =σ(W i ·[h t-1 ,X LSTM ]+b i ) C t =f t ΘC t-1 +i t Θtanh(W C ·[h t-1 ,X LSTM ]+b C ) the t =σ(W o ·[h t-1 ,X LSTM ]+b o ) h t =o t Θtanh(C t ) Among them, h t represents the output of the LSTM layer at the current moment, h t-1 represents the output of the LSTM layer at the previous moment; f t 、i t , o t Respectively represent the activation values of the forget gate, input gate and output gate at the current moment; W f , W i , W C , W o represents the weight matrix of the LSTM layer, b f , b i , b C , b o represents the corresponding bias term; C t represents the cell state vector at the current moment, C t-1 represents the cell state vector at the previous moment; σ(·) represents the sigmoid activation function, and Θ represents the element-wise product operation.
6. The unmanned boat heel prediction method based on MTCN-LSTM according to claim 5 is characterized by: The data processing process in the fully connected layer is as follows: in, W represents the predicted value of the heel angle of the unmanned boat in the future and the prediction vector composed of its time points; fc1 and W fc2 represents the weight matrix of the fully connected layer, b fc1 and b fc2 is the bias vector.
7. A computer device / equipment / system comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer program product comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
