A method and system for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM
By constructing a CNN-BiLSTM network and combining attitude sensor data and multi-physical input, the problems of insufficient model applicability and multi-step prediction performance in the attitude prediction of floating objects on the water surface are solved, and accurate and stable prediction of the attitude of floating objects on the water surface is achieved.
Patent Information
- Application Number
- CN202611270540.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing techniques for predicting the attitude of floating objects on the water surface suffer from limitations in the applicability of physical mechanism models, computational complexity, insufficient ability of traditional time series analysis and machine learning methods to express nonlinear dynamics and long-range dependencies, and a lack of deep fusion mechanisms for joint information of multiple physical quantities, resulting in poor multi-step prediction performance.
A CNN-BiLSTM-based method for predicting the attitude of floating objects on the water surface is adopted. Data is collected by attitude sensors to construct a joint input vector of attitude angle, angular velocity and angular acceleration. Multi-step prediction is performed using a one-dimensional convolutional residual feature extraction module, a bidirectional long short-term memory network module and a temporal attention module. The model is optimized by combining a sliding window and a joint loss function.
It achieves accurate fitting and stable prediction of the attitude of floating objects on the water surface, improves the accuracy and robustness of multi-step prediction, and maintains high prediction reliability even under small sample or low sampling frequency conditions.
Smart Images

Figure CN123115658A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent water monitoring and artificial intelligence, and in particular to a method and system for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM. Background Technology
[0002] In scenarios such as maritime rescue and salvage, return capsule recovery, surface buoy monitoring, floating platform operations, and marine environmental monitoring, floating objects on the water surface are subjected to the coupled effects of waves, ocean currents, and wind loads for a long time. Their motion responses, such as roll, pitch, bow, and heave, have significant nonlinearity, time-varying nature, and randomness. If the attitude change trend in the near future cannot be obtained in advance, it can easily lead to inaccurate judgment of the timing of operations such as clamping, hoisting, berthing, and recovery, thereby affecting the safety and efficiency of the operation.
[0003] Traditional methods for predicting the attitude of floating objects on the water surface mainly include numerical simulation based on hydrodynamic equations, frequency domain response analysis, Kalman filtering, autoregressive models, and single recurrent neural network models. Numerical simulation methods usually require accurate geometric parameters, boundary conditions, and wave field information, resulting in high computational costs and making it difficult to meet the needs of real-time online prediction. Linear statistical models have limited ability to describe complex nonlinear and strongly time-varying attitude responses. Although a single LSTM model can learn temporal dependencies, it is prone to peak underestimation, local oversmoothing, phase shift, and error accumulation in multi-step prediction.
[0004] It should be noted that although both ship motion attitude prediction and floating object attitude prediction fall under the category of surface target motion response prediction, they differ significantly in their motion characteristics and data features. Ships typically have defined hull dimensions, heading control, propulsion systems, and large inertial masses, and their motion response is relatively constrained by hull structure, hydrodynamic parameters, and navigation conditions. Floating objects, on the other hand, generally lack active propulsion and attitude control capabilities, exhibit significant differences in size, shape, mass distribution, and wave-exposed area, making them prone to random drift, localized impacts, abrupt attitude changes, and non-stationary oscillations under the influence of waves, wind loads, and ocean currents. Especially for floating targets such as return capsules, buoys, floating hulls, and rescue and recovery platforms, their attitude responses are more susceptible to the effects of localized wave impacts, sensor installation locations, floating object center of gravity shifts, and short-term coupled motions, resulting in more pronounced local peaks and troughs, short-term amplitude abrupt changes, and phase variations in the attitude data. Therefore, ship motion attitude prediction methods cannot be simply transferred directly to the floating object attitude prediction scenario.
[0005] However, existing technologies for predicting the attitude of floating objects on the water surface still have the following shortcomings: physical mechanism models are highly sensitive to environmental parameters and computationally complex, limiting their applicability in practical engineering; traditional time series analysis and machine learning methods are insufficient in expressing nonlinear dynamics and long-range dependencies; existing deep learning methods mostly adopt a single network architecture, failing to fully utilize the complementary advantages of different neural network structures in feature extraction, lacking a deep fusion mechanism for joint information of multiple physical quantities, and exhibiting poor multi-step prediction performance. Summary of the Invention
[0006] This invention provides a method and system for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM, in order to solve the problems of limited applicability of existing physical mechanism models in practical engineering, insufficient ability of existing methods to express nonlinear dynamics and long-range dependencies, lack of deep fusion mechanism of joint information of multiple physical quantities in existing network architecture, and poor multi-step prediction performance.
[0007] To achieve the above objectives, the technical solution of the present invention is as follows: A method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM includes: S1. By using an attitude sensor installed on the body of the floating object on the water surface, the attitude time series data of the floating object is collected, and the attitude dynamic feature data is obtained through preprocessing. S2. Based on the attitude dynamic feature data, construct a joint input vector with the attitude angle, corresponding angular velocity and corresponding angular acceleration of the target degree of freedom as components, and generate a sample dataset for multi-step prediction through a sliding window. S3. Construct a CNN-BiLSTM pose prediction model and train it based on the sample dataset used for multi-step prediction to obtain the trained water surface floating object pose prediction model. S4. Input the historical attitude dynamic feature data into the trained water surface floating object attitude prediction model to obtain the attitude angle prediction sequence within the preset time period in the future; generate a visual prediction result based on the attitude angle prediction sequence within the preset time period in the future to realize the prediction of the attitude of the water surface floating object.
[0008] Furthermore, the specific steps of the preprocessing include: S11. Based on the attitude time series data of floating objects on the water surface, multivariate time series data with a uniform sampling frequency are obtained by sequentially aligning with timestamps and resampling. S12. Based on the multivariate time series data with a unified sampling frequency, noise-removed multivariate time series data are obtained by sequentially performing outlier removal, missing value imputation, coordinate transformation, and unit unification. S13. Based on the noise-removed multivariate time series data, the data is processed sequentially through detrending and bandpass filtering to obtain the filtered multivariate time series data. S14. Based on the filtered multivariate time series data, the attitude dynamic feature data is obtained through downsampling and normalization. The attitude dynamic characteristic data includes the time-series data of the target's attitude angles, corresponding angular velocities, and corresponding angular accelerations for each degree of freedom.
[0009] Furthermore, the joint input vector can be represented as:
[0010] In the formula, For the target degrees of freedom The joint input vector; For the target degrees of freedom attitude angle; For the target degrees of freedom The corresponding angular velocity; For the target degrees of freedom The corresponding angular acceleration; For the target degree of freedom; For a specific moment; The sample dataset used for multi-step prediction is defined as follows:
[0011]
[0012] In the formula, For the target degrees of freedom Input in the history window; For the target degrees of freedom The future attitude angle label sequence; For the first Each target degree of freedom The joint input vector; For the first Each target degree of freedom The future posture of the corner tag; The length of the history window; To predict the step size.
[0013] Furthermore, the trained water surface floating object attitude prediction model includes a one-dimensional convolutional residual feature extraction module, a bidirectional long short-term memory network module, a temporal attention module, and a regression output module; The one-dimensional convolutional residual feature extraction module is used to obtain a convolutional fusion feature sequence based on historical pose dynamic feature data. The bidirectional long short-term memory network module is used to obtain the context hidden state sequence based on the convolutional fusion feature sequence; The temporal attention module is used to obtain a context vector based on the context hidden state sequence; The regression output module is used to obtain the attitude angle prediction sequence within a preset time period based on the context vector.
[0014] Furthermore, the one-dimensional convolutional residual feature extraction module includes a convolutional main branch, a convolutional residual branch, and a fusion sub-module; The main convolutional branch includes a first one-dimensional convolutional layer, a first batch of normalized layers, a first GELU activation layer, a second one-dimensional convolutional layer, a second batch of normalized layers, and a second GELU activation layer. The first one-dimensional convolutional layer is used to obtain the first convolutional feature by local convolution processing based on historical pose dynamic feature data; The first batch of normalization layers is used to obtain the first normalized convolutional features by normalization processing based on the first convolutional features. The first GELU activation layer is used to obtain the first nonlinear convolution feature by nonlinear mapping based on the first normalized convolution feature; The second one-dimensional convolutional layer is used to obtain the second convolutional feature based on the first nonlinear convolutional feature through local convolution processing; The second batch of normalization layers is used to obtain the second normalized convolutional features by normalization based on the second convolutional features; The second GELU activation layer is used to obtain the second nonlinear convolution feature by nonlinear mapping based on the second normalized convolution feature; The convolutional residual branch is a one-dimensional convolutional layer used to obtain residual mapping features based on historical pose dynamic feature data through channel mapping processing. The fusion submodule is used to obtain a convolutional fusion feature sequence through a fusion operation based on the second nonlinear convolutional feature and the residual mapping feature.
[0015] Furthermore, the temporal attention module is used to calculate the attention weights at different times within the historical window based on the contextual hidden state sequence, expressed as:
[0016] In the formula, Attention weights at different moments within the historical window; , and These are learnable parameters; For a moment The context of hidden state; For transpose; Based on the attention weights at different times within the historical window, a context vector is obtained by weighted aggregation of the context hidden state sequence, expressed as:
[0017] In the formula, For context vectors; This is the length of the history window.
[0018] Furthermore, the regression output module includes a linear layer, a GELU activation layer, a Dropout layer, an output linear layer, and an output terminal; The linear layer is used to obtain the regression latent features based on the context vector through feature mapping. The GELU activation layer is used to obtain nonlinear regression features through nonlinear activation processing based on the latent regression features. The Dropout layer is used to obtain regularized regression features based on nonlinear regression features through random deactivation regularization. The output linear layer is used to obtain the initial prediction sequence of attitude angles for several future time moments through mapping processing based on regularized regression features. The output terminal is used to perform scale correction and offset correction on the initial prediction sequence of attitude angles at several future time points using learnable affine correction parameters, to obtain the attitude angle prediction sequence within a preset time period in the future, expressed as:
[0019] In the formula, A sequence of attitude angle predictions for a predetermined time period in the future; This is the initial prediction sequence of attitude angles for several future moments; and For learnable affine correction parameters.
[0020] Furthermore, the CNN-BiLSTM pose prediction model is trained using a joint loss function, expressed as:
[0021] In the formula, For the joint loss function; A sequence of attitude angle predictions for a predetermined time period in the future; The true sequence of attitude angles within a preset time period in the future; The difference between adjacent time points; , and These are the weighting coefficients; Mean squared error; This represents the mean absolute error.
[0022] A CNN-BiLSTM-based system for predicting the attitude of floating objects on the water surface is characterized by comprising: a sensor acquisition and data preprocessing module, a sample construction module, an attitude prediction module, an output module, and a data caching and model management module. The sensor acquisition and data preprocessing module acquires the attitude time-series data of the floating object by means of an attitude sensor installed on the floating object body, and obtains the attitude dynamic feature data through preprocessing. The sample construction module constructs a joint input vector with the attitude angle, corresponding angular velocity, and corresponding angular acceleration of the target degree of freedom as components based on the attitude dynamic feature data, and generates a sample dataset for multi-step prediction through a sliding window. The attitude prediction module inputs historical attitude dynamic feature data into the trained water surface floating object attitude prediction model to obtain the attitude angle prediction sequence within a preset time period in the future. The output module generates a visual prediction result based on the attitude angle prediction sequence within a preset time period in order to predict the attitude of floating objects on the water surface. The data caching and model management module is used to store real-time acquired data, preprocessing results, training samples, model parameters, and prediction results.
[0023] Beneficial effects: This invention fully leverages the advantages of two different architectures by constructing a CNN-BiLSTM fusion network. The Convolutional Neural Network (CNN) module can effectively extract local spatial features and short-term fluctuation patterns in attitude time series data, and has natural robustness to sensor noise. The Bidirectional Long Short-Term Memory (BiLSTM) module, through forward and backward bidirectional memory mechanisms, comprehensively captures the deep temporal dependencies between attitude angle, angular velocity, and angular acceleration, avoiding the gradient vanishing problem that occurs in long-sequence prediction of traditional Recurrent Neural Networks (RNNs). This achieves accurate fitting of attitude changes and stable prediction of future multi-step durations, significantly outperforming single linear regression or traditional time series prediction models. This invention extracts dynamic posture feature data during the preprocessing stage and constructs a joint input vector with the posture angle, corresponding angular velocity, and corresponding angular acceleration of the target degree of freedom as components. This three-dimensional joint input structure not only fully preserves the kinematic constraint information of the floating object in the six-degree-of-freedom space, but also fully expands the sample dataset through the sliding window mechanism, enabling the model to learn richer motion patterns during training, thus maintaining high prediction reliability even with small samples or low sensor sampling frequency. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating the method for predicting the attitude of floating objects on the water surface according to the present invention. Figure 2 This is a schematic diagram of the structure of the water surface floating object attitude prediction system of the present invention; Figure 3 This is a schematic diagram of the CNN-BiLSTM pose prediction model structure in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the one-dimensional convolutional residual feature extraction module in an embodiment of the present invention; Figure 5 This is a schematic diagram comparing the prediction results of the CNN-BiLSTM attitude prediction model and the traditional ship prediction model in an embodiment of the present invention. Figure 6 This is a schematic diagram comparing the error indices of the CNN-BiLSTM attitude prediction model and the traditional ship prediction model in an embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] This embodiment provides a method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM, such as Figure 1 As shown, it includes: S1. By using an attitude sensor installed on the body of the floating object on the water surface, the attitude time series data of the floating object is collected, and the attitude dynamic feature data is obtained through preprocessing. Specifically, the floating object on the water surface can be a return capsule, a buoy, a floating box, a floating platform, or other objects that float on the water surface and are excited by waves; An attitude sensor is installed on the floating object body. The attitude sensor can be pre-installed before the floating object is deployed, or installed on-site after the floating object is deployed. The attitude sensor includes at least one of a nine-axis inertial measurement unit, a three-axis gyroscope, a three-axis accelerometer, a magnetometer, a GNSS receiver, an tilt sensor, or a wave sensor. It is fixed to the floating object body by bolts, clamps, waterproof tape, or an integrated encapsulation structure. The sensor can be installed at least at one of the following locations: near the center of gravity of the floating object, at the bow, stern, port edge, starboard edge, support structure, or localized areas susceptible to wave excitation.
[0028] In this embodiment, the attitude sensor continuously collects the roll angle, pitch angle, yaw angle, three-axis angular velocity, three-axis acceleration, and timestamp data of the floating object on the water surface. After preprocessing, the attitude angle time series data, corresponding angular velocity time series data, and corresponding angular acceleration time series data of the target degree of freedom (such as roll) are extracted as attitude dynamic feature data. The preprocessing process does not change the physical meaning and type of the data, but only performs quality improvement processing such as denoising, filtering, and normalization. In an optional embodiment, the collected attitude time series data also includes at least one of wave height, wave period, wind speed, current velocity, floating object position, heading angle, and load state to further enrich the input features in specific engineering scenarios.
[0029] In a specific embodiment, the sensor continuously records the roll angle, pitch angle, triaxial angular velocity, and triaxial acceleration at a sampling interval of 0.1 seconds; in other embodiments, the sampling interval can be set to 0.02 seconds to 1 second depending on the size of the floating object, wave frequency, and real-time prediction requirements.
[0030] Preferably, the specific steps of the preprocessing include: S11. Based on the attitude time series data of floating objects on the water surface, multivariate time series data with a uniform sampling frequency are obtained by sequentially aligning with timestamps and resampling. S12. Based on the multivariate time series data with a unified sampling frequency, noise-removed multivariate time series data are obtained by sequentially performing outlier removal, missing value imputation, coordinate transformation, and unit unification. S13. Based on the noise-removed multivariate time series data, the data is processed sequentially through detrending and bandpass filtering to obtain the filtered multivariate time series data. Specifically, detrending processing is used to remove the zero bias and low-frequency drift of the attitude sensor, thereby reducing the low-frequency baseline offset caused by sensor installation deviation, temperature drift, and long-term floating; bandpass filtering is used to retain the effective attitude response frequency band generated by wave excitation and filter out high-frequency noise and ultra-low-frequency interference that are irrelevant to the attitude prediction task; the cutoff frequency of the bandpass filter is set according to the main energy frequency band of the actual wave environment. S14. Based on the filtered multivariate time series data, the attitude dynamic feature data is obtained through downsampling and normalization. The attitude dynamic characteristic data includes the time-series data of the target's attitude angles, corresponding angular velocities, and corresponding angular accelerations for each degree of freedom.
[0031] In this embodiment, the outlier removal, missing value interpolation, coordinate transformation, unit unification, downsampling, and normalization are existing technologies and will not be described in detail here.
[0032] S2. Based on the attitude dynamic feature data, construct a joint input vector with the attitude angle, corresponding angular velocity and corresponding angular acceleration of the target degree of freedom as components, and generate a sample dataset for multi-step prediction through a sliding window. Preferably, the attitude angle, angular velocity, and angular acceleration of the target degree of freedom at time t are obtained from the attitude dynamic feature data, and these three components are combined into a joint input vector; The joint input vector can be represented as:
[0033] In the formula, For the target degrees of freedom The joint input vector; For the target degrees of freedom attitude angle; For the target degrees of freedom The corresponding angular velocity; For the target degrees of freedom The corresponding angular acceleration; For the target degree of freedom; For a specific moment; The sample dataset used for multi-step prediction is defined as follows:
[0034]
[0035] In the formula, For the target degrees of freedom Input in the history window; For the target degrees of freedom The future attitude angle label sequence; For the first Each target degree of freedom The joint input vector; For the first Each target degree of freedom The future posture of the corner tag; The length of the history window; To predict the step size.
[0036] In a specific embodiment, the original sampling interval is 0.1 seconds, and after 4x downsampling, the time resolution is 0.4 seconds. The historical window length is 60 seconds, corresponding to the historical window length... The value is 150, the prediction duration is 100 seconds, and the corresponding prediction step size is... It is 250.
[0037] S3. Construct a CNN-BiLSTM pose prediction model and train it based on the sample dataset used for multi-step prediction to obtain the trained water surface floating object pose prediction model. Specifically, the sample dataset used for multi-step prediction is divided into a training set, a validation set, and a test set, with the ratio of training set, validation set, and test set being 70%:15%:15%. The training set is used to update the network parameters of the CNN-BiLSTM pose prediction model, the validation set is used to adjust the model hyperparameters, select the optimal model parameters, and trigger the early stopping mechanism, and the test set is used to evaluate the model's prediction performance after the model training is completed. Preferably, the CNN-BiLSTM pose prediction model is trained using a joint loss function, expressed as follows:
[0038] In the formula, For the joint loss function; A sequence of attitude angle predictions for a predetermined time period in the future; The true sequence of attitude angles within a preset time period in the future; The difference between adjacent time points; , and These are the weighting coefficients; Mean squared error; This represents the mean absolute error.
[0039] The joint loss function can simultaneously constrain numerical error, overall bias, and trend error, thereby improving the model's predictive stability for peak, trough, and phase changes.
[0040] In this embodiment, the AdamW optimizer is used to update the model parameters with an initial learning rate of 0.001. An adaptive learning rate decay strategy based on validation set loss, an early stopping mechanism, and gradient pruning are employed to ensure model convergence stability and generalization ability. The adaptive learning rate decay strategy is used to automatically reduce the learning rate when the validation set loss no longer decreases significantly over several consecutive epochs, so that the model can converge more finely to the optimal parameters in the later stages of training. The early stopping mechanism is used to monitor changes in the validation set loss. When the validation set loss no longer improves within several consecutive epochs, training is terminated early to prevent the model from overfitting on the training set. The gradient clipping is used to clip the gradients during backpropagation to prevent gradient explosion and ensure numerical stability during training.
[0041] S4. Input the historical attitude dynamic feature data into the trained water surface floating object attitude prediction model to obtain the attitude angle prediction sequence within the preset time period in the future; generate a visual prediction result based on the attitude angle prediction sequence within the preset time period in the future to realize the prediction of the attitude of the water surface floating object.
[0042] Preferred, such as Figure 3 As shown, the trained water surface floating object attitude prediction model includes a one-dimensional convolutional residual feature extraction module, a bidirectional long short-term memory network module, a temporal attention module, and a regression output module; The one-dimensional convolutional residual feature extraction module is used to obtain a convolutional fusion feature sequence based on historical pose dynamic feature data. The bidirectional long short-term memory network module is used to obtain the context hidden state sequence based on the convolutional fusion feature sequence; The temporal attention module is used to obtain a context vector based on the context hidden state sequence; The regression output module is used to obtain the attitude angle prediction sequence within a preset time period based on the context vector.
[0043] Preferred, such as Figure 4 As shown, the one-dimensional convolutional residual feature extraction module includes a convolutional main branch, a convolutional residual branch, and a fusion sub-module; The main convolutional branch includes a first one-dimensional convolutional layer, a first batch of normalized layers, a first GELU activation layer, a second one-dimensional convolutional layer, a second batch of normalized layers, and a second GELU activation layer. The first one-dimensional convolutional layer is used to obtain the first convolutional feature by local convolution processing based on historical pose dynamic feature data; the kernel size of the first one-dimensional convolutional layer is 5, and the number of output channels is 64. The first batch of normalization layers is used to obtain the first normalized convolutional features by normalization processing based on the first convolutional features. The first GELU activation layer is used to obtain the first nonlinear convolution feature by nonlinear mapping based on the first normalized convolution feature; The second one-dimensional convolutional layer is used to obtain the second convolutional feature by local convolution processing based on the first nonlinear convolutional feature; the kernel size of the second one-dimensional convolutional layer is 3, and the number of output channels is 64. The second batch of normalization layers is used to obtain the second normalized convolutional features by normalization based on the second convolutional features; The second GELU activation layer is used to obtain the second nonlinear convolution feature by nonlinear mapping based on the second normalized convolution feature; The convolutional residual branch is a one-dimensional convolutional layer used to obtain residual mapping features based on historical pose dynamic feature data through channel mapping processing; in other embodiments, the convolutional residual branch can also be a linear projection layer. The fusion submodule is used to obtain a convolutional fusion feature sequence through a fusion operation based on the second nonlinear convolutional feature and the residual mapping feature.
[0044] In this embodiment, the one-dimensional convolutional residual feature extraction module is used to extract local periodic components, peak and valley shapes, slope changes and short-term dynamic features between adjacent time steps within the historical window. At the same time, it retains the original input feature information through convolutional residual connections, avoids the loss of temporal information caused by multi-layer convolution, and enhances the model's ability to express the local dynamic patterns of floating objects on the water surface.
[0045] Specifically, the bidirectional long short-term memory network module receives the convolutional fusion feature sequence output by the one-dimensional convolutional residual feature extraction module, and performs forward and backward traversal of the time steps within the historical window through forward LSTM and backward LSTM respectively to extract the forward and backward temporal dependencies within the historical window; the hidden states of the forward LSTM at each time step are concatenated with the hidden states of the backward LSTM at the corresponding time steps to form the context hidden states of each time step, thus obtaining the context hidden state sequence. In a specific embodiment, the unidirectional hidden layer dimension of the bidirectional long short-term memory network module is 128, and after bidirectional splicing, the context hidden state dimension of each time step is 256; in other embodiments, the hidden layer dimension can be adjusted according to the computational resources and model complexity requirements.
[0046] Preferably, the temporal attention module is used to calculate the attention weights at different times within the historical window based on the contextual hidden state sequence, expressed as:
[0047] In the formula, Attention weights at different moments within the historical window; , and These are learnable parameters; For a moment The context of hidden state; For transpose; Based on the attention weights at different times within the historical window, a context vector is obtained by weighted aggregation of the context hidden state sequence, expressed as:
[0048] In the formula, For context vectors; The length of the history window; Through the time attention module, the trained water surface floating object attitude prediction model can automatically identify key dynamic moments (such as peaks, troughs, or moments of rapid change) within the historical window and assign them higher weights, thereby improving the amplitude tracking ability and phase consistency of future attitude sequence prediction.
[0049] Preferably, the regression output module includes a linear layer, a GELU activation layer, a Dropout layer, an output linear layer, and an output terminal; The linear layer is used to obtain the regression latent features based on the context vector through feature mapping. The GELU activation layer is used to obtain nonlinear regression features through nonlinear activation processing based on the latent regression features. The Dropout layer is used to obtain regularized regression features based on nonlinear regression features through random deactivation regularization. The output linear layer is used to obtain the initial prediction sequence of attitude angles for several future time moments through mapping processing based on regularized regression features. The output terminal is used to perform scale correction and offset correction on the initial prediction sequence of attitude angles at several future time points using learnable affine correction parameters, to obtain the attitude angle prediction sequence within a preset time period in the future, expressed as:
[0050] In the formula, A sequence of attitude angle predictions for a predetermined time period in the future; This is the initial prediction sequence of attitude angles for several future moments; and Both are learnable affine correction parameters, which are adaptively learned during model training and do not require manual setting. The setting of the learnable affine correction parameters can enhance the model's adaptability to attitude prediction under different wave conditions, different floating object sizes, and different sensor arrangements, and reduce systematic prediction errors caused by the shift in the distribution of conditions.
[0051] The second embodiment provides a CNN-BiLSTM-based system for predicting the attitude of floating objects on the water surface, such as... Figure 2As shown, it includes: a sensor acquisition and data preprocessing module, a sample construction module, a pose prediction module, an output module, and a data caching and model management module; The sensor acquisition and data preprocessing module acquires the attitude time-series data of the floating object by means of an attitude sensor installed on the floating object body, and obtains the attitude dynamic feature data through preprocessing. The sample construction module constructs a joint input vector with the attitude angle, corresponding angular velocity, and corresponding angular acceleration of the target degree of freedom as components based on the attitude dynamic feature data, and generates a sample dataset for multi-step prediction through a sliding window. The attitude prediction module inputs historical attitude dynamic feature data into the trained water surface floating object attitude prediction model to obtain the attitude angle prediction sequence within a preset time period in the future. The output module generates a visual prediction result based on the attitude angle prediction sequence within a preset time period in order to predict the attitude of floating objects on the water surface. The data caching and model management module is used to store real-time acquired data, preprocessing results, training samples, model parameters, and prediction results.
[0052] In the third embodiment, during the model deployment phase, a dynamic attitude feature data cache queue is established to cache the preprocessed dynamic attitude feature data in real time according to timestamp order. The dynamic attitude feature data includes the attitude angles, corresponding angular velocities, and corresponding angular accelerations of the floating object within consecutive time steps. The cache queue is maintained when the data length is not less than the historical window length. At that time, retrieve the most recent one from the cache queue. The data from each time step constitutes the current historical window input matrix; the buffer queue is updated according to the first-in, first-out (FIFO) principle, automatically removing the oldest time step data each time new time step data is received, maintaining the queue length at least [number missing]. ; Input the current historical window into the matrix and then input it into the trained water surface floating object attitude prediction model; the model will then continuously output the future... An attitude angle prediction sequence for each time step; the attitude angle prediction sequence includes a roll angle prediction sequence, a pitch angle prediction sequence and / or a yaw angle prediction sequence, which are output according to the target degree of freedom setting; Based on the attitude angle prediction sequence, a corresponding attitude prediction curve is generated. The current historical attitude curve and the future attitude prediction curve are displayed simultaneously on the display interface to realize real-time visualization of the future attitude change trend of floating objects on the water surface, and to provide attitude prediction support for offshore hoisting, clamping, recovery and unmanned operations.
[0053] In the fourth embodiment, to verify the effectiveness of the method described in this embodiment in the scenario of water surface floating object attitude prediction, the same set of water surface floating object attitude time series data was selected, and under the condition of using the same training set, validation set and test set, the traditional CNN-BiLSTM ship attitude prediction model and the CNN-BiLSTM attitude prediction model of this embodiment were trained and evaluated respectively. To further illustrate the difference between the CNN-BiLSTM attitude prediction model in this embodiment and the traditional CNN-BiLSTM ship motion attitude prediction approach, the following comparative models were constructed under the same training, validation, and test sets: (1) Traditional CNN-BiLSTM ship attitude prediction model. This model uses normalized historical attitude data as input, first extracts features through ordinary CNN structure, and then predicts attitude sequence through BiLSTM network. (2) The CNN-BiLSTM pose prediction model in this embodiment uses pose angle, corresponding angular velocity and corresponding angular acceleration as joint inputs, and combines one-dimensional convolutional residual feature extraction, temporal attention weighted aggregation, joint loss function and learnable affine output correction to predict future pose angles; On the test set, mean square error (MSE), root mean square error (RMSE), and mean absolute error (MAE) were used as evaluation metrics, and the performance of different models in terms of local peak and valley preservation, short-term amplitude change tracking, and phase consistency was compared. Taking the prediction of the roll angle of floating objects on the water surface as an example, the comparison of the prediction results and error indices of the two models are as follows: Figure 5 and Figure 6 As shown, under the same data conditions, the CNN-BiLSTM attitude prediction model in this embodiment outperforms the traditional CNN-BiLSTM ship attitude prediction model in terms of MSE, RMSE, and MAE. It also demonstrates higher tracking accuracy for local peak-valley structures, short-term amplitude abrupt changes, and phase changes in the real attitude angle sequence. Compared with the traditional CNN-BiLSTM ship attitude prediction model, the CNN-BiLSTM attitude prediction model in this embodiment, through the aforementioned combined techniques, effectively reduces peak underestimation, local oversmoothing, phase shift, and error accumulation in multi-step prediction, thereby improving the accuracy and stability of attitude prediction for floating objects on the water surface.
[0054] The present invention has the following beneficial effects: This invention fully leverages the advantages of two different architectures by constructing a CNN-BiLSTM fusion network. The Convolutional Neural Network (CNN) module can effectively extract local spatial features and short-term fluctuation patterns in attitude time series data, and has natural robustness to sensor noise. The Bidirectional Long Short-Term Memory (BiLSTM) module, through forward and backward bidirectional memory mechanisms, comprehensively captures the deep temporal dependencies between attitude angle, angular velocity, and angular acceleration, avoiding the gradient vanishing problem that occurs in long-sequence predictions of traditional Recurrent Neural Networks (RNNs). This achieves accurate fitting of attitude changes and stable prediction of future multi-step durations, significantly outperforming single linear regression or traditional time series prediction models. This invention extracts dynamic posture feature data during the preprocessing stage and constructs a joint input vector with the posture angle, corresponding angular velocity, and corresponding angular acceleration of the target degree of freedom as components. This three-dimensional joint input structure not only fully preserves the kinematic constraint information of the floating object in the six-degree-of-freedom space, but also fully expands the sample dataset through the sliding window mechanism, enabling the model to learn richer motion patterns during training, thus maintaining high prediction reliability even with small samples or low sensor sampling frequency.
[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM, characterized in that, include: S1. By using an attitude sensor installed on the body of the floating object on the water surface, the attitude time series data of the floating object is collected, and the attitude dynamic feature data is obtained through preprocessing. S2. Based on the attitude dynamic feature data, construct a joint input vector with the attitude angle, corresponding angular velocity and corresponding angular acceleration of the target degree of freedom as components, and generate a sample dataset for multi-step prediction through a sliding window. S3. Construct a CNN-BiLSTM pose prediction model and train it based on the sample dataset used for multi-step prediction to obtain the trained water surface floating object pose prediction model. S4. Input the historical attitude dynamic feature data into the trained water surface floating object attitude prediction model to obtain the attitude angle prediction sequence within the preset time period in the future; generate a visual prediction result based on the attitude angle prediction sequence within the preset time period in the future to realize the prediction of the attitude of the water surface floating object.
2. The method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM according to claim 1, characterized in that, The specific steps of the preprocessing include: S11. Based on the attitude time series data of floating objects on the water surface, multivariate time series data with a uniform sampling frequency are obtained by sequentially aligning with timestamps and resampling. S12. Based on the multivariate time series data with a unified sampling frequency, noise-removed multivariate time series data are obtained by sequentially performing outlier removal, missing value imputation, coordinate transformation, and unit unification. S13. Based on the noise-removed multivariate time series data, the data is processed sequentially through detrending and bandpass filtering to obtain the filtered multivariate time series data. S14. Based on the filtered multivariate time series data, the attitude dynamic feature data is obtained through downsampling and normalization. The attitude dynamic characteristic data includes the time-series data of the target's attitude angles, corresponding angular velocities, and corresponding angular accelerations for each degree of freedom.
3. The method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM according to claim 1, characterized in that, The joint input vector can be represented as: In the formula, For the target degrees of freedom The joint input vector; For the target degrees of freedom attitude angle; For the target degrees of freedom The corresponding angular velocity; For the target degrees of freedom The corresponding angular acceleration; For the target degree of freedom; For a specific moment; The sample dataset used for multi-step prediction is defined as follows: In the formula, For the target degrees of freedom Input in the history window; For the target degrees of freedom The future attitude angle label sequence; For the first Each target degree of freedom The joint input vector; For the first Each target degree of freedom The future posture of the corner tag; The length of the history window; To predict the step size.
4. The method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM according to claim 1, characterized in that, The trained water surface floating object attitude prediction model includes a one-dimensional convolutional residual feature extraction module, a bidirectional long short-term memory network module, a temporal attention module, and a regression output module. The one-dimensional convolutional residual feature extraction module is used to obtain a convolutional fusion feature sequence based on historical pose dynamic feature data. The bidirectional long short-term memory network module is used to obtain the context hidden state sequence based on the convolutional fusion feature sequence; The temporal attention module is used to obtain a context vector based on the context hidden state sequence; The regression output module is used to obtain the attitude angle prediction sequence within a preset time period based on the context vector.
5. The method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM according to claim 4, characterized in that, The one-dimensional convolutional residual feature extraction module includes a convolutional main branch, a convolutional residual branch, and a fusion sub-module; The main convolutional branch includes a first one-dimensional convolutional layer, a first batch of normalized layers, a first GELU activation layer, a second one-dimensional convolutional layer, a second batch of normalized layers, and a second GELU activation layer. The first one-dimensional convolutional layer is used to obtain the first convolutional feature by local convolution processing based on historical pose dynamic feature data; The first batch of normalization layers is used to obtain the first normalized convolutional features by normalization processing based on the first convolutional features. The first GELU activation layer is used to obtain the first nonlinear convolution feature by nonlinear mapping based on the first normalized convolution feature; The second one-dimensional convolutional layer is used to obtain the second convolutional feature based on the first nonlinear convolutional feature through local convolution processing; The second batch of normalization layers is used to obtain the second normalized convolutional features by normalization based on the second convolutional features; The second GELU activation layer is used to obtain the second nonlinear convolution feature by nonlinear mapping based on the second normalized convolution feature; The convolutional residual branch is a one-dimensional convolutional layer used to obtain residual mapping features based on historical pose dynamic feature data through channel mapping processing. The fusion submodule is used to obtain a convolutional fusion feature sequence through a fusion operation based on the second nonlinear convolutional feature and the residual mapping feature.
6. The method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM according to claim 4, characterized in that, The temporal attention module is used to calculate the attention weights at different times within the historical window based on the contextual hidden state sequence, expressed as: In the formula, Attention weights at different moments within the historical window; , and These are learnable parameters; For a moment The context of hidden state; For transpose; Based on the attention weights at different times within the historical window, a context vector is obtained by weighted aggregation of the context hidden state sequence, expressed as: In the formula, For context vectors; This is the length of the history window.
7. The method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM according to claim 4, characterized in that, The regression output module includes a linear layer, a GELU activation layer, a Dropout layer, an output linear layer, and an output terminal; The linear layer is used to obtain the regression latent features based on the context vector through feature mapping. The GELU activation layer is used to obtain nonlinear regression features through nonlinear activation processing based on the latent regression features. The Dropout layer is used to obtain regularized regression features based on nonlinear regression features through random deactivation regularization. The output linear layer is used to obtain the initial prediction sequence of attitude angles for several future time moments through mapping processing based on regularized regression features. The output terminal is used to perform scale correction and offset correction on the initial prediction sequence of attitude angles at several future time points using learnable affine correction parameters, to obtain the attitude angle prediction sequence within a preset time period in the future, expressed as: In the formula, A sequence of attitude angle predictions for a predetermined time period in the future; This is the initial prediction sequence of attitude angles for several future moments; and For learnable affine correction parameters.
8. The method for predicting the attitude of floating objects on the water surface based on CNN-BiLSTM according to claim 1, characterized in that, The CNN-BiLSTM pose prediction model is trained using a joint loss function, expressed as follows: In the formula, For the joint loss function; A sequence of attitude angle predictions for a predetermined time period in the future; The true sequence of attitude angles within a preset time period in the future; The difference between adjacent time points; , and These are the weighting coefficients; Mean squared error; This represents the mean absolute error.
9. A system for predicting the attitude of floating objects on the water surface based on the method of any one of claims 1 to 8, characterized in that, include: The system includes a sensor acquisition and data preprocessing module, a sample construction module, an attitude prediction module, an output module, and a data caching and model management module. The sensor acquisition and data preprocessing module acquires the attitude time-series data of the floating object by means of an attitude sensor installed on the floating object body, and obtains the attitude dynamic feature data through preprocessing. The sample construction module constructs a joint input vector with the attitude angle, corresponding angular velocity, and corresponding angular acceleration of the target degree of freedom as components based on the attitude dynamic feature data, and generates a sample dataset for multi-step prediction through a sliding window. The attitude prediction module inputs historical attitude dynamic feature data into the trained water surface floating object attitude prediction model to obtain the attitude angle prediction sequence within a preset time period in the future. The output module generates a visual prediction result based on the attitude angle prediction sequence within a preset time period in order to predict the attitude of floating objects on the water surface. The data caching and model management module is used to store real-time acquired data, preprocessing results, training samples, model parameters, and prediction results.
