Trajectory prediction method for drift buoy based on time-gated multi-scale residual network

CN122527682APending Publication Date: 2026-08-07OCEAN UNIV OF CHINA +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
OCEAN UNIV OF CHINA
Filing Date
2026-07-09
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0004]为了解决现有漂流浮标轨迹预测方法难以同时融合多尺度轨迹特征与环境驱动因素,且多步预测误差累积导致远期预测精度不足的技术问题,本发明提供一种基于时间门控多尺度残差网络的漂流浮标轨迹预测方法

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122527682A_ABST
    Figure CN122527682A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of drift buoy trajectory prediction, and particularly relates to a drift buoy trajectory prediction method based on a time-gated multi-scale residual network, which comprises the following steps: obtaining historical trajectory data, environmental field data and time marker data of a drift buoy, generating a trajectory motion feature sequence and an environmental feature sequence; using a trajectory baseline prediction module to perform deep time sequence coding and direct displacement mapping on the trajectory motion feature sequence, to generate future multi-step baseline prediction displacement; using a trajectory and environmental coding module to perform multi-scale decomposition and trend detail separation on the trajectory motion feature sequence, and performing independent time sequence coding on the environmental feature sequence; generating a residual correction term according to weighted trend features and weighted detail environmental features, and controlling the correction strength of different prediction steps through a time gating mechanism, and superimposing the correction strength to the baseline prediction displacement to obtain the final prediction displacement, so that the physical consistency and spatial position accuracy of the predicted trajectory are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of drift buoy trajectory prediction technology, and in particular to a drift buoy trajectory prediction method based on time-gated multi-scale residual networks. Background Technology

[0002] Drifting buoys are crucial for marine environmental observation, ocean current inversion, and maritime search and rescue. Their trajectory changes reflect the spatiotemporal evolution of ocean surface dynamic processes. Accurate prediction of drifting buoy trajectories can improve the management efficiency of marine observation equipment, support maritime target drift forecasting, oil spill dispersion early warning, and search and rescue path planning, and has significant engineering application value. Existing drift trajectory prediction methods mainly include physical numerical modeling methods and data-driven methods. Physical numerical models are typically based on ocean circulation, wind field driving, and Lagrange particle tracking to simulate the motion of drifting targets, offering good physical interpretability. Data-driven methods utilize deep learning techniques such as recurrent neural networks, convolutional neural networks, attention mechanisms, and state-space models, which to some extent improve the automatic modeling capability of trajectory prediction.

[0003] However, physical numerical models are highly dependent on high-precision environmental forcing fields and initial conditions. When the resolution of wind and current fields is insufficient or the nearshore dynamic processes are complex, the prediction error increases significantly, and the computational cost is high. Although existing deep learning methods can model time-dependent relationships, they are difficult to simultaneously and effectively characterize the buoy's historical motion state, the influence of wind and current environments, and the dynamic differences between different prediction steps. In multi-step trajectory prediction tasks, the prediction error tends to accumulate gradually with the increase of prediction time, leading to a decrease in long-term prediction accuracy. In addition, existing methods usually lack an explicit separation mechanism for trajectory trends and detailed perturbations, fail to fully integrate multi-scale trajectory features and environmental driving factors, and are difficult to adaptively adjust the residual correction intensity according to the prediction step size. They are also difficult to balance the stability of trajectory prediction with the ability to adapt to environmental perturbations. At present, there is a need for a drifting buoy trajectory prediction method based on time-gated multi-scale residual networks. Summary of the Invention

[0004] To address the technical problem that existing drifting buoy trajectory prediction methods struggle to simultaneously integrate multi-scale trajectory features and environmental driving factors, and that the accumulation of multi-step prediction errors leads to insufficient long-term prediction accuracy, this invention provides a drifting buoy trajectory prediction method based on a time-gated multi-scale residual network.

[0005] Firstly, the drifting buoy trajectory prediction method based on time-gated multi-scale residual networks provided by this invention adopts the following technical solution: A method for predicting the trajectory of drifting buoys based on time-gated multi-scale residual networks includes: Historical trajectory data, environmental field data, and time stamp data of drifting buoys are acquired, and after normalization and feature construction processing, trajectory motion feature sequences and environmental feature sequences are generated. A TC-TGMRNet prediction model is constructed, which includes a trajectory baseline prediction module, a trajectory and environment coding module, a multi-source feature fusion module, and a gated residual output module. The trajectory baseline prediction module is used to generate future multi-step baseline prediction displacement by performing deep temporal encoding and direct displacement mapping on the trajectory motion feature sequence. The trajectory motion feature sequence is decomposed into multiple scales and separated into trend details using a trajectory and environment coding module, and the environment feature sequence is independently time-series coded. Based on baseline predicted displacement, a prediction guidance feature is constructed. The prediction guidance feature is then used to adaptively fuse multiple features output by the trajectory and environment coding module to generate weighted trend features and weighted detailed environment features. The residual correction term is generated based on the weighted trend characteristics and weighted detail environmental characteristics, and the correction intensity of different prediction steps is controlled by the time gating mechanism. The correction term is then superimposed on the baseline prediction displacement to obtain the final prediction displacement. Using the future displacement sequence as the supervision target, a joint loss function is constructed to train the TC-TGMRNet prediction model. The final predicted displacement is then denormalized to the true displacement scale to obtain the future drifting buoy trajectory.

[0006] Furthermore, the generation of trajectory motion feature sequences and environmental feature sequences includes extracting historical position sequences and historical displacement sequences from historical trajectory data, extracting wind field sequences and flow field sequences from environmental field data, and obtaining time stamp sequences; The historical trajectory data and environmental field data were respectively processed by mean and variance normalization; Calculate the displacement change between adjacent historical time steps to obtain the displacement change sequence, and then splice the historical position sequence, historical displacement sequence, displacement change sequence and time stamp sequence along the feature channel to construct the trajectory motion feature sequence. The normalized wind field sequence and flow field sequence are spliced ​​along the characteristic channel to construct the environmental characteristic sequence.

[0007] Furthermore, the generation of future multi-step baseline prediction displacement includes: after feature mapping of the trajectory motion feature sequence, extracting time-dependent features along the forward and reverse directions of historical time using a bidirectional selective state scan temporal encoder, generating time-series encoded features through gating fusion, combining the time-series encoded features with prediction step embedding and generating a nonlinear prediction displacement term through cross-attention query, extracting historical displacement sequences and generating a direct displacement prediction term through linear mapping and Tanh gain control, and adding the nonlinear prediction displacement term and the direct displacement prediction term to obtain the baseline prediction displacement.

[0008] Furthermore, the multi-scale decomposition and trend detail separation of the trajectory motion feature sequence includes mapping the trajectory motion feature sequence to a high-dimensional space and then performing multi-scale downsampling according to a preset scale set to obtain downsampled trajectory feature sequences at each scale. Trend features are extracted at each scale using a learnable low-pass filter, and the downsampled trajectory features at the corresponding scale are subtracted from the trend features to obtain the detail features. The proportion of detail perturbation is calculated based on the energy proportion of trend features and detail features at each scale, and the trend weight and detail weight at each scale are adaptively generated accordingly. The trend features and detail features at each scale are encoded by a trend time encoder and a detail time encoder, respectively. After scale alignment, they are weighted and aggregated according to the trend weight and detail weight to obtain unified trend features and detail features. The expression for the detail scale weight at scale s is as follows: , in, The contribution weights for the aggregation of detailed features at scale s. The percentage of detail perturbations at scale s. For a pre-defined scale set, The percentage of detail perturbations at scale q.

[0009] Furthermore, the independent temporal encoding of the environmental feature sequence includes separating the environmental feature sequence through channels to obtain wind field feature sequence and flow field feature sequence, and inputting them into wind field temporal encoder and flow field temporal encoder respectively after feature mapping to perform independent temporal encoding, thereby obtaining wind field encoded features and flow field encoded features. Calculate the average drift displacement and the drift direction of the historical main body within the historical window, and calculate the lateral disturbance intensity of the historical trajectory based on the lateral orthogonal projection of the historical displacement change relative to the drift direction of the historical main body. The historical wind field and flow field are weighted and aggregated using time decay weights to obtain the recent weighted wind field vector and the recent weighted flow field vector, and their consistency component and lateral driving component with the drift direction of the historical main body are calculated respectively. The environmental disturbance coefficient is calculated based on the consistency component and the lateral driving component, and then coupled with the lateral disturbance intensity of the historical trajectory to generate the historical-environment coupled disturbance coefficient. The expression for the historical-environment coupled disturbance coefficient is as follows: , in, The historical-environmental coupled disturbance coefficient. The intensity of the lateral disturbance in the historical trajectory. This is the environmental disturbance coefficient. , and For learnable parameters, This is the Sigmoid function.

[0010] Furthermore, the adaptive fusion of multiple features output by the trajectory and environment coding module using prediction guidance features includes adding the baseline predicted displacement to the prediction step embedding sequence element by element after nonlinear mapping, and constructing prediction guidance features through layer normalization. Using the predictive guidance feature as the query, multi-head cross-attention reading is performed on the trend feature, and weighted trend features are obtained through weight generation and SoftMax normalization; Using the prediction-guided features as queries, multi-head cross-attention reading is performed on the detail features, wind field coding features, and flow field coding features respectively to obtain the corresponding detail response features, wind field response features, and flow field response features; The predicted guiding features are mapped by a weight generator and normalized by SoftMax to generate fusion weights for three types of features: detail, wind field, and flow field. The detail response features, wind field response features, and flow field response features are then weighted and fused to obtain weighted detail environmental features.

[0011] Furthermore, the step of generating residual correction terms based on weighted trend features and weighted detail environmental features includes generating trend correction terms and environmental correction terms respectively by nonlinear mapping of weighted trend features and weighted detail environmental features, and summing them to obtain the total residual correction term; Project the total residual correction term along the baseline predicted displacement direction to obtain the longitudinal residual component, and subtract the total residual correction term from the longitudinal residual component to obtain the lateral residual component; Based on the normalized prediction step position and the history-environment coupling perturbation coefficient, a lateral residual adjustment coefficient is generated through learnable parameter mapping. Adaptive adjustment of the lateral residual components yields an anisotropic residual correction term. The expression for the lateral residual adjustment coefficient is as follows: , in, Let h be the horizontal residual adjustment coefficient for the h-th prediction step. This is the current prediction step number. Forecast the total number of steps in the future. The historical-environmental coupled disturbance coefficient. , and are learnable parameters, and is the Sigmoid function.

[0012] Furthermore, the step of controlling the correction intensity of different prediction steps through a time-gating mechanism includes concatenating prediction guidance features, weighted trend features, weighted detail environment features, baseline prediction displacement, and history-environment coupling perturbation coefficients along feature channels to construct gated input features. These gated input features are then processed by a gated mapping function to generate time-gating coefficients. Finally, the anisotropic residual correction term is multiplied element-wise by the time-gating coefficients and then superimposed onto the baseline prediction displacement to obtain the final prediction displacement. The gated input features satisfy the following conditions: , in, For the gated input features of the h-th prediction step, For the prediction guidance features of the h-th prediction step, The weighted trend feature for the h-th prediction step. The weighted detailed environmental features for the h-th prediction step. The baseline predicted displacement for the h-th prediction step. The historical-environmental coupled disturbance coefficient. This is a splicing operation along the feature channel.

[0013] Furthermore, the construction of the joint loss function includes decomposing the error between the predicted displacement and the actual displacement into longitudinal error and lateral error along the actual drift direction, and generating lateral error constraint weights based on the prediction step number and the history-environment coupling disturbance coefficient to construct the drift direction decomposition loss. A baseline orientation auxiliary loss is constructed to constrain the trajectory baseline prediction module to learn a stable subject drift trend; Construct a cumulative trajectory position consistency loss and assign higher weights to the long-term prediction step to suppress the accumulation of multi-step recursion error; Construct a trajectory turning shape consistency loss to constrain the consistency of displacement turning shape between adjacent prediction steps; The total loss function is obtained by weighted summing of the drift direction decomposition loss, baseline direction auxiliary loss, cumulative trajectory position consistency loss, and trajectory turning shape consistency loss. The expression for the drift direction decomposition loss is as follows: , in, The loss is decomposed in the drift direction. Forecast the total number of steps in the future. For longitudinal error weighting coefficients, Let h be the longitudinal error of the prediction step. This is the horizontal error weighting coefficient. For the weights of the lateral error constraint, Let be the lateral error of the h-th prediction step.

[0014] Furthermore, obtaining the future drifting buoy trajectory includes multiplying the final predicted displacement by the standard deviation of the trajectory data and adding the mean of the trajectory data, performing inverse normalization to obtain the future predicted displacement at the true displacement scale, and then, starting from the last historical position, accumulating and recursively extrapolating the inverse normalized future predicted displacements to obtain the drifting buoy positions for each future prediction step. The future drifting buoy positions satisfy the following: , in, The predicted position of the drifting buoy in the h-th future step. For the last position in history, This represents the i-th future predicted displacement after inverse normalization.

[0015] In summary, the present invention has the following beneficial technical effects: 1. This invention generates trajectory motion feature sequences and environmental feature sequences by normalizing and constructing features from historical trajectory data, environmental field data and time stamp data of drifting buoys. This achieves a unified technical representation of multi-source heterogeneous observation data and improves the scale consistency and training stability of model input features.

[0016] 2. This invention constructs a TC-TGMRNet prediction model that includes a trajectory baseline prediction module, a trajectory and environment coding module, a multi-source feature fusion module, and a gated residual output module. The trajectory baseline prediction module generates a stable main body drift trend, and the trajectory and environment coding module performs multi-scale trend detail separation of trajectory motion features and independent temporal coding of environmental features. This achieves multi-level technical decoupling of the drifting buoy's motion state and external dynamic conditions, enhancing the model's adaptability and feature expression capabilities to complex marine dynamic environments.

[0017] 3. This invention constructs prediction guidance features based on baseline predicted displacement, adaptively fuses trend features, detail features, wind field coding features and flow field coding features, and combines anisotropic residual correction and time gating mechanism to adaptively control the correction intensity of different prediction steps. This achieves selective dynamic weighting of multi-source features and differential correction of prediction steps, effectively suppresses error accumulation in the multi-step prediction process, and improves long-term prediction accuracy.

[0018] 4. This invention trains the TC-TGMRNet prediction model by constructing a joint loss function that includes drift direction decomposition loss, baseline direction auxiliary loss, cumulative trajectory position consistency loss, and trajectory turning shape consistency loss. This achieves multi-dimensional constraints on the longitudinal error, lateral offset, cumulative trajectory drift, and local turning shape of the predicted displacement, thereby improving the physical consistency and spatial position accuracy of the predicted trajectory. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the overall operation of the drifting buoy trajectory prediction method based on time-gated multi-scale residual networks according to an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the feature mapping layer in an embodiment of the present invention.

[0021] Figure 3 This is a schematic diagram of the architecture of a timing encoder according to an embodiment of the present invention.

[0022] Figure 4 This is a schematic diagram of the baseline prediction information generation module in an embodiment of the present invention.

[0023] Figure 5 This is a schematic diagram of the prediction-guided feature generation module according to an embodiment of the present invention.

[0024] Figure 6 This is a schematic diagram of the trend feature fusion module in an embodiment of the present invention.

[0025] Figure 7 This is a schematic diagram of the architecture of the feature extractor according to an embodiment of the present invention.

[0026] Figure 8 This is a diagram showing the trajectory prediction results of an embodiment of the present invention.

[0027] Figure 9 These are different trajectory prediction structure effect diagrams of embodiments of the present invention. Detailed Implementation

[0028] The present invention will be further described in detail below with reference to the accompanying drawings.

[0029] Example 1 Reference Figure 1 The drifting buoy trajectory prediction method based on time-gated multi-scale residual networks in this embodiment includes: S1. Establish a multi-source data construction module to extract continuous historical windows from drifting buoy observation data, obtaining historical trajectory data, environmental field data, and time-stamped data. For historical trajectory data, the historical input length is L, and the future prediction length is H. Within the historical time window, the trajectory position P of the drifting buoy can be represented as: ; in, , representing the latitude and longitude position at time step t, and the historical displacement sequence. It can be represented as: ; in, Indicate the meridional and latitudinal displacements at the t-th historical time step: ; Environmental field data E can be represented as: , , in This represents environmental field information at the historical trajectory location of position t, including zonal wind speed. Meridional wind speed Zonal flow velocity Radial flow velocity The wind field reflects the influence of sea surface wind stress on buoy drift, while the ocean current field reflects the dynamic background of buoy movement with surface seawater.

[0030] Time-stamped data is represented as: , in It includes time markers such as hours, days of the week, months, and days within the year.

[0031] The multi-source data construction module is the input organization module of TC-TGMRNet. Its main function is to construct a multi-source feature sequence from the historical trajectory, time data and environmental data of the drifting buoy into a sequence that can be processed by the subsequent neural network module.

[0032] This module inputs historical trajectory data. This does not refer solely to the latitude and longitude position sequence of the drifting buoy, but rather to the trajectory input composed of both historical position sequences and historical displacement sequences. , Where P is the historical position sequence and D is the historical displacement sequence. This indicates splicing along the direction of the feature channel.

[0033] The input environmental data is represented as The time characteristics are It is used to characterize the periodic changes during the drifting process, enabling the model to distinguish the differences in drifting motion patterns under different time conditions.

[0034] Because latitude and longitude, displacement, wind speed, and current velocity have different physical dimensions and numerical ranges, directly inputting them into the network can easily lead to inconsistencies in the scale of different channels. Therefore, such as Figure 1 As shown, input the historical trajectory and environmental input Perform mean and variance normalization separately: , , in, The data consists of historical trajectory data after mean-variance normalization, and the input features are the normalized trajectory data. The standard deviation of historical trajectory data in the training samples. The input is the raw historical trajectory data, including historical position sequences and historical displacement sequences. This is the mean of the historical trajectory data in the training samples, used to eliminate the numerical center shift of the historical trajectory data. The environmental field data are after mean and variance normalization. The input is raw environmental field data, including wind field sequences and flow field sequences. This represents the mean of the environmental field data in the training samples. denoted as the standard deviation of the environmental field data in the training samples.

[0035] Through normalization, historical trajectories, displacements, wind fields, and ocean current fields are mapped to similar numerical scales. For ease of representation, the variables mentioned below in this module, except for time features, are... All variables outside the range are normalized variables.

[0036] In the historical trajectory branch, the historical trajectory input, after normalization, still needs to be further constructed as follows: Figure 1 The "Track State Features" section, while retaining the normalized historical position and displacement, further incorporates displacement change information to describe the short-term changes in the drifting buoy's motion state. Displacement changes can be obtained by subtracting adjacent historical displacements. Then, the displacement variation characteristic A under the normalized scale is: ; in, Let be the displacement change at the t-th historical time step, and A be the displacement change characteristic under normalized scaling. This characteristic can reflect the changes in the drifting buoy's direction of motion and drift speed, supplementing the changes in motion state that are difficult to express directly in historical position and historical displacement. Therefore, Figure 1 The "trajectory motion characteristics" in the text can be represented as: , in, It also includes information on historical location, historical displacement, and displacement changes.

[0037] Trajectory motion features and temporal features are concatenated to form a "trajectory motion feature sequence," that is... , in, After the above processing, the multi-source data construction module ultimately outputs two types of core features from the trajectory motion feature sequence: one type is the trajectory motion feature sequence composed of historical trajectory and time data. As input to the trajectory branch in the trajectory baseline prediction module and the trajectory and environment coding module; another type is the environmental features composed of wind field and ocean current field. This serves as the input to the environment branch in the trajectory and environment coding module.

[0038] S2. After that, the trajectory baseline prediction module will generate the main drift trend of the future drifting buoy based on the historical trajectory motion characteristics, so that subsequent modules can make targeted compensation and corrections based on this baseline.

[0039] by Given the input, output the predicted baseline displacement for the next H time steps. For example... Figure 1 As shown, the trajectory baseline prediction module includes two computational paths. The first is a deep temporal prediction path, which includes a feature mapping layer, a trajectory temporal encoder, and a baseline prediction information generation module. The second is a direct displacement mapping path in the lower half, which includes channel extraction, historical displacement sequences, a linear layer, and Tanh gain. The two paths work together to generate the final baseline predicted displacement.

[0040] First, the trajectory motion feature sequence is input into the feature mapping layer. This layer maps the low-dimensional input features to a unified high-dimensional latent space, enabling different types of information, such as historical position, historical displacement, time markers, and displacement changes, to be expressed within the same feature space. The feature mapping layer structure is as follows: Figure 2 As shown, the input sequentially passes through a linear layer, the GeLU nonlinear activation function, and a Dropout layer to reduce overfitting. After being mapped by the linear layer, it undergoes layer normalization to obtain a high-dimensional data representation. It is then fed into the trajectory timing encoder.

[0041] like Figure 3 As shown, the trajectory temporal encoder is used to capture the dependencies of historical trajectory motion features in the time dimension and extract the continuous trend, velocity change, and local state transition information in the motion of the drifting buoy. First, the temporal encoder normalizes the input features to stabilize the numerical scale between different time steps and different channels. Then, multiple sets of intermediate features required for state updates are generated through parallel linear layers (consisting of four linear layers). The first branch generates an adjustment factor R through the linear layers and the Tanh hybrid adjustment function, which modulates the state feature U of the input mapping branch (i.e., the second branch) that directly passes through the linear layers element-wise, resulting in the modulated input mapping feature. This enables the encoder to adaptively adjust the magnitude of input changes based on the current trajectory state. , in, This represents element-wise multiplication. The state features of the input mapping branch that are directly mapped through a linear layer are, i.e., the original high-dimensional trajectory representation without modulation. A regulation factor is generated for the Tanh hybrid regulation function. This design enhances the encoder's ability to express abrupt changes in trajectory state and local motion variations.

[0042] The third branch is the step size constraint branch, which generates non-negative step size parameters through a linear layer and the Softplus function. The state update process has a stable time scale constraint, which is used to control the state update scale in the selective state scan process and helps the model distinguish between slow drift processes and rapid change processes.

[0043] The fourth branch is the gating control branch, which generates gating weights through a linear layer and a Sigmoid gating function to control the degree of preservation of information at different time steps and in different channels in the encoding result.

[0044] After obtaining the above multi-path linear branch outputs, the features of the input mapping branches, after hybrid adjustment, are fed into channel-wise convolution to extract local dynamic features along the time dimension, capturing short-term motion changes between adjacent historical time steps. Subsequently, the convolution result is passed through the GELU activation function to introduce non-linear expressive power. This yields the temporal input features used for state scanning. : , in, This represents the result of a channel-wise convolution operation. , This represents the local dynamic features at the t-th historical time step.

[0045] Then, local dynamic features Non-negative step size parameters generated by step size constraint branch The data will be input into the bidirectional selective state scan structure. The structure used in this method is a bidirectional temporal modeling structure built on the basis of the general selective state scan mechanism and combined with the drifting buoy trajectory prediction task. Compared with unidirectional state scan, bidirectional selective state scan can not only model the continuous evolution process of buoy motion state along the historical time sequence, but also supplement the contextual constraints of subsequent time steps on the current state in the historical window along the reverse time sequence, thereby simultaneously enhancing the expressive power of local motion changes, long-range trend dependence and the overall semantics of the historical window.

[0046] Within the bidirectional selective state scan structure, learnable state transition parameters are set. Learnable input injection parameters Learnable output mapping parameters and input direct connection parameters .in, Used to control the transmission strength of historical states between adjacent time steps. Used to control the degree to which the current input features are injected into the hidden state. Used to map hidden states to scan outputs. It is used to preserve the direct influence of the current input features on the output results. Its initial value is randomly initialized and updated synchronously through backpropagation and gradient optimization based on the trajectory prediction loss during model training.

[0047] Specifically, the step size constraint parameters generated by the third branch can be expressed as: , in, This represents the state update step size corresponding to the t-th time step, used to control the state update scale at different time steps during the state scan. Based on this step size parameter, the selective state scan structure affects the state transition coefficients. and input injection coefficients Adaptive adjustment: , , in, and Let represent the state transition coefficients and input injection coefficients corresponding to time steps t, respectively. By introducing... The model can adaptively adjust the state update intensity according to the amplitude of trajectory motion changes, so that the slow drift phase has a relatively stable state continuation capability, and the rapid change phase has a stronger current input response capability.

[0048] In positive selective state scanning, the model recursively calculates states according to historical time sequence: , , in, This represents the positive state at time step t. This indicates the output of the forward scan, which is used to model the continuous evolution trend of the historical trajectory of a drifting buoy over time.

[0049] Meanwhile, the reverse selective state scan recursively calculates the state in reverse chronological order: , , in, This represents the reverse state at time step t. This indicates the output of a reverse scan. A reverse scan is used to supplement the contextual information of subsequent observations within the historical window for the current time step, compensating for the shortcomings of unidirectional recursion, which relies solely on past states and struggles to fully utilize complete historical window information.

[0050] After completing the bidirectional scan, the forward and reverse scan results are fused, mapping the scan results from both directions to a unified feature space. To this end, learnable fusion weights are further incorporated into the bidirectional selective state scan structure. and learnable bias It is used to linearly fuse the forward and backward scan results, which are updated synchronously during model training through backpropagation and gradient optimization.

[0051] Specifically, the scan outputs from the two directions are concatenated along the channel dimension, and a bidirectional selective state scan output is obtained through linear mapping: , in, , , () indicates a splicing operation. This indicates a bidirectional selective state scan output.

[0052] Finally, the gating weight G generated by the fourth branch is multiplied element-wise with the bidirectional scan output to obtain the gated temporal state representation Y: , Through the above structure, the timing encoder can further integrate bidirectional time information on the basis of selective state scanning, and use gating mechanism to filter effective motion features in different time steps and different channels, thereby improving the modeling ability of the continuous drift trend, short-term velocity changes and local state transitions of the drifting buoy.

[0053] The gated temporal state representation Y sequentially passes through a linear layer, a Dropout layer, and is summed with the first residual. This summation is added to the original input of the temporal encoder. Further, it undergoes layer normalization, a feedforward network (FFN), and a second residual summation to obtain the output features of the temporal encoder. This second residual summation is added to the result after the first residual summation. This two-layer residual structure preserves the original input information and avoids feature degradation during deep encoding; the feedforward network further enhances the nonlinear expressive power of the encoded features.

[0054] After obtaining the trajectory temporal encoded features, the model enters the baseline prediction information generation module. This module is used to convert historical encoded features into prediction information for future prediction steps.

[0055] After obtaining the trajectory temporal coding features, the model enters the baseline prediction information generation module, which further converts the historical coding features into prediction information for future prediction steps. For example... Figure 4 As shown, the module first extracts the state of the last time step of the historical window encoding sequence to obtain the instantaneous motion state at the current moment, and performs time-averaged pooling on the entire historical window to obtain the overall drift trend. The two are then concatenated and mapped by a linear layer, processed by the GELU activation function, the Dropout layer, and the linear layer to obtain the historical context features.

[0056] To distinguish between different future prediction steps, this module introduces prediction step embedding. Let the embedding sequence for the next H prediction steps be: ; in, The learnable embedding for the h-th future prediction step is a set of pre-set learnable parameters within the model. During training, these parameters are updated via backpropagation along with other network weights. The learnable embedding is used to characterize the temporal position differences between different prediction steps, generating different prediction queries for different future moments, thereby improving the discriminative power of multi-step trajectory prediction.

[0057] The prediction step embedding is added element-wise to the historical context features to obtain the baseline prediction query features.

[0058] Then, a multi-head cross-attention operation is used to adaptively focus on key time segments within the historical window for different future prediction steps, thereby generating prediction information related to the future subject drift trend. This allows the model to adaptively focus on more critical time segments within the historical window for different future prediction steps. Afterward, the attention output is processed through a feedforward network and layer normalization to obtain baseline prediction information.

[0059] The direct displacement mapping path extracts historical displacement channels from the input trajectory data to obtain the historical displacement sequence D. Subsequently, a linear layer maps the historical length L to the future prediction length H, forming the direct displacement prediction term. Meanwhile, to control the influence of the direct displacement mapping path on the final baseline prediction, this embodiment introduces Tanh gain: , in, For learnable parameters, This is a direct displacement prediction term. The function can limit the gain within a stable range, avoid excessively large direct shift mapping terms, and thus improve the stability of baseline prediction.

[0060] Finally, the trajectory baseline prediction module adds the displacement prediction term generated by the deep temporal prediction path to the stable displacement term generated by the direct displacement mapping path to obtain the final baseline predicted displacement. : , in, This represents the nonlinear prediction term obtained by the feature mapping, trajectory temporal encoder, and baseline prediction information generation module. For the direct displacement mapping term.

[0061] S3, the trajectory and environment coding module and the trajectory baseline prediction module operate in parallel, both receiving feature information output from the multi-source data construction module. The difference lies in that the trajectory and environment coding module focuses on deep coding of historical trajectory motion features, wind field features, and flow field features, providing trend, detail, and environment-driven features for the subsequent multi-source feature fusion module and gated residual output module.

[0062] like Figure 1 As shown, the trajectory and environment coding module mainly includes three branches: trajectory coding branch, wind field coding branch, and current field coding branch. The trajectory coding branch is used to extract multi-scale trajectory change features from the trajectory motion feature sequence; the wind field coding branch is used to extract the temporal influence of the wind field on the drifting buoy's motion; and the current field coding branch is used to extract the temporal influence of the ocean current field on the drifting buoy's motion.

[0063] In the first branch of this module, namely the trajectory encoding branch, the trajectory motion feature sequence After passing through the trajectory feature mapping layer, the data is mapped to a unified high-dimensional space. The feature extractor used in this operation is the same as the feature mapping layer used in the trajectory baseline prediction module, such as... Figure 2 As shown, through this mapping, the model can convert historical location, historical displacement, time features, and displacement change features into a high-dimensional trajectory representation suitable for time series modeling.

[0064] Subsequently, the trajectory encoding branch performs multi-scale downsampling on the high-dimensional trajectory representation. Drifting buoy motion exhibits distinct multi-timescale characteristics: trajectory changes on longer timescales reflect the overall drift direction and low-frequency trends, while changes on shorter timescales reflect local disturbances and short-term motion details. Therefore, this embodiment sets multiple timescales to perform downsampling processing on the trajectory feature sequence at different scales.

[0065] This embodiment employs three time scales: the original scale, the double downsampling scale, and the quadruple downsampling scale. Let the trajectory motion feature sequence be... The high-dimensional trajectory obtained after the trajectory feature mapping layer is represented as follows: , in, Let L represent the high-dimensional trajectory feature corresponding to the t-th historical time step, and L represent the length of the historical input. In this embodiment, the scale set is set as follows: , Scale s=1 represents the original time scale, scale s=2 represents a double downsampling scale, and scale s=4 represents a quadruple downsampling scale. For any scale s, this module represents the original high-dimensional trajectory according to a time window of length s. Segmentation and aggregation are performed. After downsampling, the original trajectory feature sequence of length L is compressed into a sequence of length L. Scale trajectory feature sequence: , in, This represents the downsampled trajectory feature sequence obtained at scale s; =[ [] indicates the sequence length at that scale, and [] indicates rounding down; This represents the j-th downsampled feature at scale s. It is represented by the original high-dimensional trajectory The Middle The first to the second The features are aggregated from historical time steps. The corresponding calculation process can be represented as: , in, 'r' represents the time step offset within the current downsampling window. This formula means that at scale 's', the high-dimensional trajectory features of every 's' consecutive historical time steps are aggregated into a new scale feature point. When 's'=1, the downsampling result is consistent with the original high-dimensional trajectory representation, preserving complete historical time step information and effectively capturing short-term local changes and detailed perturbations. When 's'=2, each downsampling feature is obtained by aggregating two adjacent historical time steps, making each downsampling feature point correspond to a longer original time segment, thus weakening local high-frequency fluctuations and highlighting stage-based motion changes. When 's'=4, each downsampling feature is obtained by aggregating four adjacent historical time steps, compressing the trajectory features within a longer time segment, allowing the model to focus more on low-frequency changes and the overall drift direction. Through this multi-scale structure, the model can observe the same historical trajectory from complete time resolution, stage-based time resolution, and compressed time resolution, thereby simultaneously obtaining three types of trajectory information: short-term details, medium-term changes, and long-term trends.

[0066] After each downsampling scale, this embodiment sets a learnable low-pass filter. Since the frequency distribution of trajectory changes is different at different time scales, the original scale needs to be more sensitive to retaining short-term changes, while larger scales need to extract smoothing trends more strongly. Therefore, the low-pass filter parameters corresponding to different scale branches are not shared, but the smoothing weights at their respective scales are learned separately.

[0067] Specifically, the learnable low-pass filter consists of a set of learnable convolutional kernels operating along the time dimension. For scale s, let the length of its low-pass filter kernel be K, and the original learnable filter parameters are: , in, Given the original learnable filter parameter sequence at scale s, to ensure the low-pass filter has smooth weighting characteristics, the filter parameters are normalized to obtain the filter weights: , in, This represents the k-th filter weight at scale s. Different scale branches each have independent... Therefore, the parameters of the three low-pass filters do not share each other, and they can automatically learn more suitable smoothing methods at the original scale, double downsampling scale, and quadruple downsampling scale during training.

[0068] For any scale branch, the downsampled trajectory features are passed through a learnable low-pass filter to obtain trend features. This process can be represented as: , in, Let represent the j-th trend feature at scale s, and c represent the center position of the filter window. The trend feature mainly reflects the main drift direction and low-frequency motion changes of the drifting buoy. Subsequently, the downsampled trajectory feature is subtracted from the trend feature to obtain the detailed features at the corresponding scale: , in, This represents the j-th detail feature at scale s, which mainly reflects short-term disturbances, local shifts, and high-frequency fluctuations. Let be the j-th downsampled trajectory feature at scale s.

[0069] To better aggregate trend and detail features across different scales, this embodiment introduces a scale-adaptive calculation method based on the trend-detail energy ratio. This method first calculates the energy of the trend and detail components at each scale to measure the relative intensity of low-frequency main body drift and high-frequency local perturbations in the trajectory change at that scale. For any scale s, the trend energy and detail energy are expressed as follows: , , in, For the trend energy at scale s, The detail energy at scale s For the j-th detail feature at scale s, Let be the sequence length after downsampling at scale s. Based on this, the percentage of detail perturbations at scale s is defined as: , in, To prevent extremely small constants with a denominator of zero, Used to represent the proportion of local perturbation components in trajectory variation at scale s. When the value is small, it indicates that the trajectory change at that scale is mainly a stable trend; when... A larger value indicates that the trajectory at that scale contains strong short-term disturbances, local turns, or high-frequency fluctuations.

[0070] Based on the aforementioned percentage of detail perturbations, this embodiment generates trend-scale weights and detail-scale weights respectively: , , in, This represents the weight of the contribution of scale s to the aggregation of trend features. This represents the weight of the contribution of scale s to the aggregation of detailed features. Let q represent the proportion of detail perturbations at scale q. Through the above calculations, when the trajectory change at a certain scale is more stable, its trend weight increases; when the trajectory change at a certain scale contains stronger local perturbations, its detail weight increases.

[0071] Subsequently, the trend features at each scale are fed into the trend temporal encoder, and the detail features are fed into the detail temporal encoder to obtain the trend encoded features at scale s. and details encoding features Since the sequence lengths differ after downsampling at different scales, this module performs scale alignment on the trend encoding results and detail encoding results at different scales after encoding to obtain aligned trend encoding features. and details encoding features .

[0072] Furthermore, based on the aforementioned trend scale weights and detail scale weights, the encoding results at different scales are adaptively aggregated to form unified trend features. and detailed features : , , in, This indicates a scale alignment operation, used to map encoding results at different scales to a uniform time length or a uniform prediction read space; This indicates the trend characteristics after aggregation. This represents the detailed features after aggregation. Compared with the fixed aggregation method, the above-mentioned scale-adaptive calculation method based on trend-detail energy ratio can dynamically adjust the contribution of each scale according to the actual motion state of the historical trajectory. This allows the model to focus more on low-frequency trend features when the trajectory is drifting smoothly, and to focus more on detailed features when the trajectory has local turning or short-term disturbances, thereby improving the adaptability and stability of multi-step trajectory prediction for drifting buoys.

[0073] The structures of the two types of temporal encoders are consistent with those of the trajectory temporal encoders in the trajectory baseline prediction module, both used to capture the temporal dependencies within the sequence. The difference lies in that the trend temporal encoder mainly processes low-frequency trend components, focusing on extracting long-term drift directions and overall motion states; while the detail temporal encoder mainly processes high-frequency detail components, focusing on extracting short-term disturbances and local trajectory changes.

[0074] In the environmental coding section, the environmental feature sequences are first extracted into wind field channels and flow field channels. The wind field channel extracts the wind field feature sequence; the flow field channel extracts the flow field feature sequence.

[0075] Wind field characteristics include two horizontal components of wind speed, while current field characteristics include two horizontal components of ocean current velocity. Both reflect the influence of different external dynamic conditions on the motion of the drifting buoy.

[0076] Then, the wind field and flow field characteristics were respectively processed as follows: Figure 2 The feature mapping layer structure shown is mapped to high-dimensional wind and flow field representations. Subsequently, the high-dimensional wind field representation is fed into a wind field temporal encoder, and the high-dimensional flow field representation is fed into a flow field temporal encoder. The structures of the wind field and flow field encoders are consistent with the aforementioned temporal encoder, but they model different environmental variables respectively. The wind field temporal encoder is used to extract the influence of wind field changes over time on buoy drift, and the flow field temporal encoder is used to extract the influence of ocean current changes over time on buoy drift. By encoding the wind field and flow field separately, this embodiment avoids the simple mixing of different physical environmental factors at the input stage, thereby enhancing the expressive power of environment-driven features.

[0077] The final output includes multi-scale trend coding features, multi-scale detail coding features, wind field coding features, and flow field coding features, providing rich trajectory and environmental representations for subsequent multi-source feature fusion modules.

[0078] Before feeding the aforementioned trend features, detailed features, wind field features, and flow field features into the multi-source feature fusion module, this embodiment first constructs a history-environment coupling perturbation coefficient to quantify the degree of lateral perturbation of the historical trajectory itself and the driving relationship between the wind field and flow field relative to the main body's drift direction. This coefficient is calculated based on the historical displacement direction, historical local motion changes, and the direction of the external environmental field. It can be used as a lateral residual adjustment variable in the subsequent gated residual output module and as the basis for adjusting the lateral offset error constraint during the training phase.

[0079] Because the historical displacement sequence is: First, calculate the average drift displacement within the historical window. and the direction of historical drift : , , in, To prevent division by zero of extremely small constants, For the displacement vector at the t-th historical time step, this embodiment utilizes the historical subject's drift direction. Construct a transverse orthogonal projection. Specifically, for any historical displacement change... Its component along the main body's drift direction is: , This is the longitudinal component of the displacement change at the t-th historical time step along the historical drift direction, since the changes between adjacent historical displacements have already been calculated. Projecting this change onto the lateral perturbation space perpendicular to the historical drift direction, we obtain: , Let the lateral disturbance component, which is perpendicular to the drift direction of the historical subject, be the displacement change at the t-th historical time step. The lateral disturbance intensity of the historical trajectory is thus defined as follows: , in, This indicates the intensity of the lateral disturbance within the historical trajectory itself. When... When the value is small, it indicates that the historical drift process is relatively stable, and the trajectory mainly moves along the main direction; when... A larger value indicates a significant local shift, lateral oscillation, or short-term disturbance in the historical trajectory, requiring increased attention to lateral residual correction in subsequent forecasts.

[0080] In terms of environmental drivers, let the historical wind field vector sequence and the flow field vector sequence be respectively: , , in, This represents the two-dimensional wind field vector at the t-th historical time step. Let represent the two-dimensional flow field vector at the t-th historical time step. Considering that the environmental field closer to the prediction starting point has a more direct impact on future short-term drift, this embodiment uses time decay weighting to weight and aggregate the historical wind field and flow field: , , , in, This represents the time decay weight corresponding to the t-th historical time step. The attenuation coefficient is... This represents the recent weighted wind field vector. This represents the recent weighted flow field vector.

[0081] Subsequently, the consistency components of the wind field, flow field, and historical main body drift direction were calculated respectively: , , in, and These represent the driving consistency of the wind field and the flow field along the historical drift direction, respectively. When this value is large, it indicates that the environmental field is more inclined to propel the buoy to continue drifting along the historical drift direction; when this value is small or negative, it indicates that the environmental field is inconsistent with the historical drift direction, which may lead to changes in the future drift direction.

[0082] Based on this, this study further calculates the lateral driving components of the wind field and flow field relative to the historical drift direction: , , in, and These represent the lateral driving strength of the wind field and the current field relative to the historical drift direction, respectively. A large value indicates that the external environmental field may cause the buoy to drift laterally away from the historical drift direction.

[0083] To unify historical motion disturbances and environmentally driven disturbances into adjustable variables that can be used by subsequent modules, this embodiment first calculates the environmental disturbance coefficient based on the directional consistency of the wind field and flow field and the lateral driving intensity: , Then, the intensity of the lateral disturbance of the historical trajectory is coupled with the environmental disturbance coefficient to obtain the history-environment coupled disturbance coefficient: , in, This represents the environmental disturbance coefficient. This represents the historical-environmental coupled disturbance coefficient. , , , , , , , For learnable parameters, This represents the Sigmoid function, used to constrain the perturbation coefficient to the range of 0 to 1.

[0084] Through the above calculations, this embodiment can unify the lateral disturbance of the historical trajectory itself, the relationship between the wind field and the main body drift direction, and the relationship between the flow field and the main body drift direction into a history-environment coupling disturbance coefficient. This coefficient reflects the potential risk of lateral shift or directional change in the current sample during future predictions. It is used to adjust the strength of lateral residual correction in the subsequent gated residual output module and to adjust the strength of lateral offset error constraint during the training phase.

[0085] S4, the multi-source feature fusion module, follows the trajectory baseline prediction module and the trajectory and environment coding module. It generates fused features for future prediction steps based on baseline predicted displacement, trend features, detailed features, wind field features, and flow field features. The core function of this module is to adaptively select and combine features from different sources according to the needs of different prediction steps, enabling the model to further perceive long-term trajectory trends, local disturbances, and external environmental driving factors on the basis of stable baseline prediction.

[0086] Let the baseline prediction displacement output by the trajectory baseline prediction module be... The trend features, detail features, wind field features, and flow field features output by the trajectory and environment coding module are as follows: , , , .

[0087] The multi-source feature fusion module takes the above features as input and outputs weighted trend features and weighted detailed environmental features, providing a basis for correction for the subsequent gated residual output module.

[0088] like Figure 1As shown, the main components of the multi-source feature fusion module are prediction-guided feature generation, trend feature fusion, weight generator, detail feature extractor, wind field feature extractor, and flow field feature extractor. Specifically, prediction-guided feature generation constructs query features for future prediction steps based on baseline predicted displacement; trend feature fusion extracts information related to future prediction steps from trend features; the detail feature extractor, wind field feature extractor, and flow field feature extractor extract prediction-related information from detail, wind field, and flow field features, respectively; and the weight generator dynamically generates fusion weights for features from different sources based on the prediction step features.

[0089] First, the prediction guidance feature generation module takes the baseline predicted displacement as input and generates prediction guidance features corresponding to future prediction steps. Since the baseline predicted displacement already contains the model's estimate of the future subject's drift direction and basic motion amplitude, using it to generate prediction guidance features allows the subsequent fusion process to revolve around the future prediction target, rather than relying solely on historical encoded features.

[0090] like Figure 5 As shown, the prediction-guided feature generation module consists of a linear layer, a GELU activation function, a Dropout layer, a linear layer, prediction step embeddings, element-wise addition, and layer normalization. The baseline prediction displacement first undergoes linear mapping and nonlinear transformation to obtain initial prediction features; subsequently, it is added element-wise with the prediction step embedding sequence, giving different positional representations for different future prediction steps; finally, layer normalization yields stable prediction-guided features. The prediction step embedding operation here is consistent with the baseline prediction information generation module in the trajectory baseline prediction module. By introducing prediction step embedding, the model can distinguish the prediction needs of different future time steps, making feature fusion relevant to prediction steps. This process can be summarized as follows:

[0091] in, This represents a mapping function consisting of a linear layer, a GELU activation function, a Dropout layer, and another linear layer. Predicting displacement for the baseline, This represents the embedding vector for the future prediction step.

[0092] Obtain predictive guidance features Subsequently, the multi-source feature fusion module first fuses the trend features. The trend features mainly reflect the main drift direction and low-frequency motion changes of the drifting buoy over a longer time scale, and play an important role in the overall correction of the baseline prediction.

[0093] like Figure 6 As shown, the trend feature fusion module predicts guiding features. As a query, by trend characteristics As a memory feature, multi-head cross-attention is used to read trend information related to each prediction step. Let the dimension of the prediction guidance feature Q be... Trend characteristics The dimension is .

[0094] Where H represents the number of future prediction steps, d represents the length of the trend feature sequence, and d represents the feature dimension. Multi-head cross-attention settings. There are 1 attention head, and the dimensions of each head are: ; For the i-th attention head, first predict the guiding feature Q and the trend feature. Mapped to query, key, and value respectively: , , , in, , and Let represent the query mapping matrix, key mapping matrix, and value mapping matrix corresponding to the i-th attention head, respectively. Query information used to represent different future prediction steps. and This is used to represent historical trend memory information in the trend features. Subsequently, within the i-th attention head, the correlation weight between the prediction step and the trend features is calculated: , in, This represents the trend attention weight generated by the i-th attention head, reflecting the degree of attention each future prediction step pays to different trend feature positions. Based on this attention weight, the trend feature value vector is weighted and summed to obtain the output of the i-th attention head: , The outputs of all attention heads are concatenated, and the predicted trend response features are obtained through output mapping: , in, This represents the multi-head attention output mapping matrix. This indicates a splicing operation. This represents the predictive trend response features read from the trend features.

[0095] After the multi-head cross-attention output, the residuals are successively added (this residual is equal to...). The process involves summing the residuals, layer normalization, a feedforward network, summing the residuals again (adding the result of the first summation to the first), and layer normalization to enhance feature representation and maintain training stability. Subsequently, trend feature weights are obtained through weight generation and SoftMax normalization, forming a weighted trend feature. , , in, The trend weight generation mapping function consists of a linear layer, a non-linear activation layer, and a linear layer. Used to normalize the generated weights; Indicates the trend weights associated with the prediction step; Indicates weighted trend characteristics; This represents element-wise multiplication, i.e., weighted operation based on weights. For ease of representation, the formula uses... This is the vector that has undergone residual summation, layer normalization, feedforward network, residual summation, and layer normalization.

[0096] In addition to trend characteristics, the future trajectory of a drifting buoy is also influenced by short-term local disturbances, wind field driving, and ocean current field driving. Therefore, the multi-source feature fusion module in this embodiment further includes a detail feature extractor, a wind field feature extractor, and a current field feature extractor to extract local and environmental information related to the prediction step from the three types of features, respectively. The three feature extractors have the same structure and all use prediction-guided features. As a query, the encoded features from the corresponding source are used as memory features and read through multi-head cross-attention.

[0097] like Figure 7 As shown, the structure of the three types of feature extractors consists of multi-head cross-attention, residual summation, layer normalization, feedforward network, residual summation again, and layer normalization. This is more efficient than... Figure 6 The trend feature fusion shown reduces layer normalization and weight-related operations, while maintaining the same processing procedure. Through this structure, the model can extract corresponding prediction-related information from detail, wind field, and flow field memory features based on the guiding features of each future prediction step, and produce corresponding prediction information. .

[0098] Detailed features primarily reflect local disturbances and short-term changes in the historical trajectory; wind field features primarily reflect the impact of wind speed changes on buoy drift; and current field features primarily reflect the driving force of ocean current changes on the buoy's drift. The influence of these three features on future predictions is not fixed but varies with the prediction step, the current trajectory state, and the environmental state. Therefore, the multi-source feature fusion module introduces a weight generator to dynamically weight the three types of features: detailed features, wind field features, and current field features.

[0099] The weight generator takes the predicted guiding features as input and passes them sequentially through a linear layer, a GELU activation function, a Dropout layer, another linear layer, and SoftMax normalization to generate fused weights for the three types of features: , in, The weight vectors representing the three types of features: details, wind field, and flow field. , This represents the nonlinear mapping function corresponding to the weight generator. Through SoftMax normalization, the sum of the three weights is 1, enabling the model to adaptively adjust the relative contributions of detail perturbations, wind field influence, and flow field influence at different prediction steps. The weighted fusion process of the three types of features can be represented in detail as follows: , in, Representing the weighted detailed environmental features, the multi-source feature fusion module ultimately outputs two types of fused features: as well as Weighted trend characteristics It primarily provides information on future drift direction and low-frequency motion trends; weighted detailed environmental characteristics. It primarily provides information on local disturbances, wind field driving forces, and flow field driving forces. These are then fed into a subsequent gated residual output module to generate trend-corrected predictions and detailed environmental correction predictions.

[0100] S5, such as Figure 1 As shown, the gated residual output module is located on the far right of TC-TGMRNet. It is used to introduce residual correction terms generated by trend features and detailed environmental features based on the predicted displacement of the trajectory baseline, and to control the correction intensity of different future prediction steps through a time gating mechanism.

[0101] The core idea of ​​this module is that the baseline predicted displacement provides the main motion trend of the future drift trajectory, the trend correction prediction and the environmental correction prediction provide compensation for complex trajectory changes and external dynamic influences, and the time gating coefficient is used to determine how much these compensations should play in different prediction steps. This approach avoids the instability of prediction caused by the model relying entirely on residual correction, and also avoids the problem that simple baseline prediction is difficult to adapt to complex environmental disturbances, thereby improving the stability and accuracy of multi-step drift trajectory prediction.

[0102] First, the weighted trend features enter the trend correction prediction branch. Based on the trend information output by the multi-source feature fusion module, a trend correction term for the baseline predicted displacement is generated. The trend correction prediction branch consists of layer normalization, a linear layer, a GELU activation function, a Dropout layer, and another linear layer. Let the weighted trend features be... The calculation process for the trend correction prediction branch can be expressed as follows: , , , in, Presentation layer normalization operation, and This represents the weights and biases of the first linear layer in the trend-corrected prediction branch. and This represents the weights and biases of the second linear layer in the trend-corrected forecast branch. This represents the intermediate features of the trend correction prediction branch. This indicates the trend correction prediction result. This correction term is mainly used to compensate for possible deviations in the main body drift direction in the baseline prediction, enabling the model to better adapt to long-term trend changes reflected in historical trajectories.

[0103] Secondly, the weighted detailed environmental features enter the environmental correction prediction branch. This branch has the same structure as the trend correction prediction branch. Let the weighted detailed environmental features be... The calculation process of the environmental correction prediction branch can be expressed as follows: , , , in, and This represents the weights and biases of the first linear layer in the environmental correction prediction branch. and This represents the weights and biases of the second linear layer in the environmental correction prediction branch. This represents the intermediate features of the environmental correction prediction branch. This represents the environmental correction prediction result. This correction term is mainly used to compensate for short-term prediction biases caused by local trajectory disturbances, wind field changes, and ocean current field changes.

[0104] Then, the trend correction forecast and the environmental correction forecast are summed to obtain the total residual correction term: , in, If the trend correction forecast term is used, then the total residual correction term for the h-th forecast step is: , To avoid applying the same correction strength to the residual correction term in both the main body drift direction and the lateral offset direction, this embodiment further proposes an anisotropic residual correction method based on directional projection. This method decomposes the total residual correction term into a longitudinal residual component along the main body drift direction and a lateral residual component perpendicular to the main body drift direction. Then, based on the prediction step number and the history-environment coupling perturbation coefficient... Adaptively adjust the intensity of lateral residual correction.

[0105] For the h-th future prediction step, let the baseline prediction displacement be... Then the main body drift direction corresponding to this prediction step can be expressed as: , Subsequently, the total residual correction term Projecting along the baseline drift direction yields the longitudinal residual components. : , in, Let h be the unit vector of the main body drift direction corresponding to the h-th prediction step. This is the total residual correction term for the h-th prediction step, and the lateral residual component perpendicular to the baseline drift direction is obtained. : , in, This represents the residual correction component along the drift direction of the main body, mainly used to correct the drift distance and the trend of the main body's movement; This represents the lateral residual correction component perpendicular to the main body's drift direction, primarily used to correct lateral offsets caused by local disturbances, wind field changes, and ocean currents.

[0106] To adaptively control the intensity of the lateral residual correction based on different prediction steps and the degree of perturbation of different samples, this embodiment defines the lateral residual adjustment coefficient: ; in, This represents the horizontal residual adjustment coefficient for the h-th prediction step. This indicates the normalized prediction step position. This represents the aforementioned history-environment coupling disturbance coefficient. , , For learnable parameters, Let the sigmoid function be represented, and based on this, the anisotropic residual correction term is obtained: , in, This represents the residual correction term after directional decomposition and lateral adjustment. When the historical trajectory is relatively stable and the wind field, flow field, and main drift direction are relatively consistent,... Smaller The corresponding reduction is made, and the model is mainly corrected along the main drift direction; when there is significant lateral disturbance in the historical trajectory, or when the wind field and flow field have strong lateral driving force, The corresponding increase enhances the model's ability to correct for the transverse residual components.

[0107] Then, the time-gating module generates gating coefficients based on prediction guidance features, weighted trend features, weighted detailed environment features, baseline prediction displacement, and history-environment coupling perturbation coefficients. These coefficients are used to control the overall strength of the anisotropic residual correction term in different future prediction steps. First, the above features are concatenated to obtain the gating input features: , The time gating coefficient can be expressed as: ; in, This represents the prediction guidance feature for the h-th prediction step. Indicates weighted trend characteristics. This indicates the weighted detailed environmental characteristics. Indicates the baseline predicted displacement. This represents a gated mapping function consisting of layer normalization, a linear layer, a GELU activation function, a Dropout layer, and a linear layer. This represents the time gating coefficient for the h-th prediction step.

[0108] Finally, the time-gating coefficients are multiplied by the anisotropic residual correction term and added to the baseline predicted displacement to obtain the final predicted displacement: , , in, Let h be the final predicted displacement for the h-th prediction step. The baseline predicted displacement for the h-th prediction step. Let h be the time gating coefficient for the h-th prediction step. This is the anisotropic residual correction term for the h-th prediction step. This is the final predicted displacement sequence for the next H prediction steps.

[0109] S6. In this embodiment, the model is trained using the future displacement sequence as the supervision target. The final predicted future displacement output by the model obtained in step S5 is... The true future displacement sequence is obtained as follows: , Where H represents the number of future prediction steps, and Let represent the predicted displacement and the actual displacement at the h-th future prediction step, respectively.

[0110] To avoid simply using point-to-point mean square error and ignoring the differences in drift direction and lateral offset, this embodiment constructs a drift direction decomposition loss. First, the displacement error of the h-th prediction step is calculated: , Construct a unit direction vector based on the actual drift displacement: , in, To prevent division by zero by a very small constant, and since this loss is only used during the training phase, the true future displacement can be used as a direction reference. Subsequently, the displacement error is decomposed into a longitudinal error along the true drift direction and a lateral error perpendicular to the true drift direction: , , in, This indicates the displacement magnitude error in the drift direction. This represents the lateral offset error perpendicular to the drift direction of the main body. Since lateral offsets in long-term predictions are more likely to cause cumulative trajectory deviations, and historical trajectory disturbances and lateral drives from wind and flow fields also increase the risk of future trajectory yaws, this embodiment introduces a lateral error constraint weight determined jointly by the prediction step number and the historical-environment coupling disturbance coefficient: , in, This represents the weight of the lateral error constraint in the h-th prediction step. This represents the aforementioned history-environment coupling disturbance coefficient. and This is a non-negative weighting parameter. This weighting imposes a stronger constraint on the lateral offset error when the model takes a longer prediction step or when the history-environment coupling perturbation is stronger.

[0111] Therefore, the drift direction decomposition loss can be expressed as: , in, and These represent the weighting coefficients for longitudinal and lateral errors, respectively. This loss allows the model to separately constrain drift distance error and lateral offset error, thus better reflecting the motion characteristics of drift trajectory prediction tasks than ordinary displacement mean square error.

[0112] Meanwhile, since this embodiment adopts the output method of "baseline prediction + gated residual correction", in order to constrain the trajectory baseline prediction module to learn a stable main body drift trend, a baseline direction auxiliary loss is set. Let the baseline prediction displacement output by the trajectory baseline prediction module be: , Define the baseline prediction error as: , And also decompose it along the actual drift direction: , , The baseline direction auxiliary loss is: , in, This represents the baseline lateral offset constraint weight. This loss is used to avoid baseline prediction branch degradation, enabling it to independently learn the main direction and basic displacement magnitude of the drifting buoy's future motion.

[0113] Furthermore, to constrain the consistency of trajectory positions after multi-step recursion, let the predicted trajectory positions and the actual trajectory positions be respectively: , , in, Indicates the last observed position in history. and Let represent the predicted displacement and the actual displacement after inverse normalization, respectively. The cumulative trajectory position consistency loss is: , This item assigns a higher weight to the long-term prediction step to suppress trajectory deviation caused by error accumulation during multi-step recursion.

[0114] Finally, to further maintain the consistency of the steering pattern of the predicted trajectory, the steering cosine between adjacent prediction step displacements is defined as: , The steering cosine corresponding to the actual trajectory is: , The trajectory turning pattern consistency loss is: , The final model's total loss can be expressed as: , in, , and These represent the weighting coefficients for baseline auxiliary loss, cumulative trajectory position consistency loss, and trajectory turning morphology consistency loss, respectively. Through these combined losses, the model can not only reduce numerical errors in future displacements but also simultaneously constrain drift direction, lateral offset, cumulative trajectory position, and local turning morphology, thereby improving the stability and physical consistency of multi-step drift trajectory prediction.

[0115] After the model training is complete, since the model predicts future displacements at a normalized scale, the results obtained are as follows: Afterwards, inverse normalization is required to restore the data to the true latitude and longitude displacement scale. Then, based on the last historical position... The future trajectory of the drifting buoy can be obtained by recursion: , in, This indicates the position of the drifting buoy in the h-th predicted step. This represents the i-th future predicted displacement after inverse normalization.

[0116] Example 2 The difference between this embodiment and Embodiment 1 is that this embodiment provides a simulation experiment of a drifting buoy trajectory prediction method based on a time-gated multi-scale residual network; like Figure 8 , Figure 9 As shown, to verify the effectiveness of the TC-TGMRNet drifting buoy trajectory prediction method proposed in this embodiment, a test set sample was selected for comparative experiments, and the method of this embodiment was compared with several typical time series prediction models and trajectory prediction models. The models included in the comparison are GRU, LSTM, iTransformer, CMamba, and FITS. GRU and LSTM are classic recurrent neural network models, capable of modeling short-term dependencies in time series; iTransformer is a time series prediction model based on an attention mechanism, possessing strong global sequence modeling capabilities; CMamba is a time series modeling method based on a state-space mechanism, suitable for extracting dynamic features from long sequences; and FITS is a frequency domain time series prediction model, capable of extracting sequence variation patterns from a frequency perspective. All of the above models serve as baseline models for the method of this embodiment, used to evaluate the performance of TC-TGMRNet in the multi-step trajectory prediction task of drifting buoys.

[0117] This embodiment uses displacement error and spatial trajectory error as the main evaluation indicators, including mean absolute displacement error (disp_mae), average displacement error (ADE), final displacement error (FDE), and long-term average displacement error (tail6_ADE). Disp_mae measures the mean absolute error between the predicted and actual displacements; ADE measures the mean spatial distance error between the predicted and actual trajectories over the entire prediction period; FDE measures the spatial distance error at the last prediction time; and tail6_ADE measures the mean spatial error over several time steps in the later part of the prediction period, reflecting the model's long-term prediction stability. The smaller the value of these indicators, the more accurate the prediction results. The prediction results of each model on the test set are shown in the table below. Table 1 Prediction results of each model TC-TGMRNet 0.2876 1.9094 3.7685 2.3924 CMamba 0.3139 2.1238 4.1818 2.6551 FITS 0.3122 2.1542 4.1495 2.6832 GRU 0.3075 2.0867 4.0463 2.6057 iTransformer 0.2956 2.0425 3.8892 2.5376 LSTM 0.3151 2.1574 4.1812 2.6921 As shown in the table, the TC-TGMRNet proposed in this embodiment achieves superior results in major trajectory prediction metrics such as disp_mae, ADE, FDE, and tail6_ADE. Specifically, TC-TGMRNet's ADE is 1.9094 km, lower than comparable models such as GRU, LSTM, iTransformer, CMamba, and FITS, indicating that the method in this embodiment can effectively reduce the average spatial error throughout the prediction period. Its FDE is 3.7685 km, also better than the baseline models, showing that the method in this embodiment can maintain good trajectory prediction accuracy even at the final prediction time. Its tail6_ADE is 2.3924 km, indicating that the model has good long-term stability in the later stages of prediction.

[0118] To further illustrate the predictive performance of different models, this embodiment presents a trajectory prediction comparison chart of the test samples. The chart includes the tail segment of the historical trajectory, the actual future trajectory, and the predicted trajectories of each model. The trajectory chart shows that the trajectory predicted by the method in this embodiment is generally closer to the actual future trajectory, exhibiting good consistency in drift direction and trajectory curvature trend. In contrast, some baseline models are prone to directional deviations, excessive trajectory smoothing, or increased long-term bias during the prediction process.

[0119] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network, characterized in that, include: Historical trajectory data, environmental field data, and time stamp data of drifting buoys are acquired, and after normalization and feature construction processing, trajectory motion feature sequences and environmental feature sequences are generated. A TC-TGMRNet prediction model is constructed, which includes a trajectory baseline prediction module, a trajectory and environment coding module, a multi-source feature fusion module, and a gated residual output module. The trajectory baseline prediction module is used to generate future multi-step baseline prediction displacement by performing deep temporal encoding and direct displacement mapping on the trajectory motion feature sequence. The trajectory motion feature sequence is decomposed into multiple scales and separated into trend details using a trajectory and environment coding module, and the environment feature sequence is independently time-series coded. Based on baseline predicted displacement, a prediction guidance feature is constructed. The prediction guidance feature is then used to adaptively fuse multiple features output by the trajectory and environment coding module to generate weighted trend features and weighted detailed environment features. The residual correction term is generated based on the weighted trend characteristics and weighted detail environmental characteristics, and the correction intensity of different prediction steps is controlled by the time gating mechanism. The correction term is then superimposed on the baseline prediction displacement to obtain the final prediction displacement. Using the future displacement sequence as the supervision target, a joint loss function is constructed to train the TC-TGMRNet prediction model. The final predicted displacement is then denormalized to the true displacement scale to obtain the future drifting buoy trajectory.

2. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 1, characterized in that, The generated trajectory motion feature sequence and environmental feature sequence include extracting historical position sequence and historical displacement sequence from historical trajectory data, extracting wind field sequence and flow field sequence from environmental field data, and obtaining time stamp sequence; The historical trajectory data and environmental field data were respectively processed by mean and variance normalization; Calculate the displacement change between adjacent historical time steps to obtain the displacement change sequence, and then splice the historical position sequence, historical displacement sequence, displacement change sequence and time stamp sequence along the feature channel to construct the trajectory motion feature sequence. The normalized wind field sequence and flow field sequence are spliced ​​along the characteristic channel to construct the environmental characteristic sequence.

3. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 1, characterized in that, The process of generating future multi-step baseline prediction displacement includes: mapping the trajectory motion feature sequence; extracting time-dependent features along the forward and reverse directions of historical time using a bidirectional selective state scan time encoder; generating time-coded features through gating fusion; combining the time-coded features with the prediction step embedding and generating a nonlinear prediction displacement term through cross-attention query; extracting the historical displacement sequence and generating a direct displacement prediction term through linear mapping and Tanh gain control; and adding the nonlinear prediction displacement term and the direct displacement prediction term to obtain the baseline prediction displacement.

4. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 1, characterized in that, The multi-scale decomposition and trend detail separation of the trajectory motion feature sequence includes mapping the trajectory motion feature sequence to a high-dimensional space and then performing multi-scale downsampling according to a preset scale set to obtain downsampled trajectory feature sequences at each scale. Trend features are extracted at each scale using a learnable low-pass filter, and the downsampled trajectory features at the corresponding scale are subtracted from the trend features to obtain the detail features. The proportion of detail perturbation is calculated based on the energy proportion of trend features and detail features at each scale, and the trend weight and detail weight at each scale are adaptively generated accordingly. The trend features and detail features at each scale are encoded by a trend time encoder and a detail time encoder, respectively. After scale alignment, they are weighted and aggregated according to the trend weight and detail weight to obtain unified trend features and detail features. The expression for the detail scale weight at scale s is as follows: , in, The contribution weights for the aggregation of detailed features at scale s. The percentage of detail perturbations at scale s. For a pre-defined scale set, The percentage of detail perturbations at scale q.

5. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 4, characterized in that, The independent temporal encoding of the environmental feature sequence includes separating the environmental feature sequence through channels to obtain wind field feature sequence and flow field feature sequence, and then inputting them into the wind field temporal encoder and flow field temporal encoder for independent temporal encoding after feature mapping, so as to obtain wind field encoded features and flow field encoded features. Calculate the average drift displacement and the drift direction of the historical main body within the historical window, and calculate the lateral disturbance intensity of the historical trajectory based on the lateral orthogonal projection of the historical displacement change relative to the drift direction of the historical main body. The historical wind field and flow field are weighted and aggregated using time decay weights to obtain the recent weighted wind field vector and the recent weighted flow field vector, and their consistency component and lateral driving component with the drift direction of the historical main body are calculated respectively. The environmental disturbance coefficient is calculated based on the consistency component and the lateral driving component, and then coupled with the lateral disturbance intensity of the historical trajectory to generate the historical-environment coupled disturbance coefficient. The expression for the historical-environment coupled disturbance coefficient is as follows: , in, The historical-environmental coupled disturbance coefficient. The intensity of the lateral disturbance in the historical trajectory. This is the environmental disturbance coefficient. , and For learnable parameters, This is the Sigmoid function.

6. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 1, characterized in that, The adaptive fusion of multiple features output by the trajectory and environment coding module using prediction guidance features includes adding the baseline predicted displacement to the prediction step embedding sequence element by element after nonlinear mapping, and constructing prediction guidance features through layer normalization. Using the predictive guidance feature as the query, multi-head cross-attention reading is performed on the trend feature, and weighted trend features are obtained through weight generation and SoftMax normalization; Using the prediction-guided features as queries, multi-head cross-attention reading is performed on the detail features, wind field coding features, and flow field coding features respectively to obtain the corresponding detail response features, wind field response features, and flow field response features; The predicted guiding features are mapped by a weight generator and normalized by SoftMax to generate fusion weights for three types of features: detail, wind field, and flow field. The detail response features, wind field response features, and flow field response features are then weighted and fused to obtain weighted detail environmental features.

7. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 1, characterized in that, The step of generating residual correction terms based on weighted trend features and weighted detail environmental features includes generating trend correction terms and environmental correction terms respectively by nonlinear mapping of weighted trend features and weighted detail environmental features, and summing them to obtain the total residual correction term; Project the total residual correction term along the baseline predicted displacement direction to obtain the longitudinal residual component, and subtract the total residual correction term from the longitudinal residual component to obtain the lateral residual component; Based on the normalized prediction step position and the history-environment coupling perturbation coefficient, a lateral residual adjustment coefficient is generated through learnable parameter mapping. Adaptive adjustment of the lateral residual components yields an anisotropic residual correction term. The expression for the lateral residual adjustment coefficient is as follows: , in, Let h be the horizontal residual adjustment coefficient for the h-th prediction step. This is the current prediction step number. Forecast the total number of steps in the future. The historical-environmental coupled disturbance coefficient. , and For learnable parameters, This is the Sigmoid function.

8. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 7, characterized in that, The method of controlling the correction intensity of different prediction steps through a time-gating mechanism includes concatenating prediction guidance features, weighted trend features, weighted detail environment features, baseline prediction displacement, and history-environment coupling perturbation coefficients along feature channels to construct gated input features. These gated input features are then processed by a gated mapping function to generate time-gating coefficients. Finally, the anisotropic residual correction term is multiplied element-wise by the time-gating coefficients and superimposed onto the baseline prediction displacement to obtain the final prediction displacement. The gated input features satisfy the following conditions: , in, For the gated input features of the h-th prediction step, For the prediction guidance features of the h-th prediction step, The weighted trend feature for the h-th prediction step. The weighted detailed environmental features for the h-th prediction step. The baseline predicted displacement for the h-th prediction step. The historical-environmental coupled disturbance coefficient. This is a splicing operation along the feature channel.

9. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 1, characterized in that, The construction of the joint loss function includes decomposing the error between the predicted displacement and the actual displacement into longitudinal error and lateral error along the actual drift direction, and generating lateral error constraint weights based on the prediction step number and the history-environment coupling disturbance coefficient to construct the drift direction decomposition loss. A baseline orientation auxiliary loss is constructed to constrain the trajectory baseline prediction module to learn a stable subject drift trend; Construct a cumulative trajectory position consistency loss and assign higher weights to the long-term prediction step to suppress the accumulation of multi-step recursion error; Construct a trajectory turning shape consistency loss to constrain the consistency of displacement turning shape between adjacent prediction steps; The total loss function is obtained by weighted summing of the drift direction decomposition loss, baseline direction auxiliary loss, cumulative trajectory position consistency loss, and trajectory turning shape consistency loss. The expression for the drift direction decomposition loss is as follows: , in, The loss is calculated by decomposing the drift direction, and the total number of future prediction steps is given. For longitudinal error weighting coefficients, Let h be the longitudinal error of the prediction step. This is the horizontal error weighting coefficient. For the weights of the lateral error constraint, Let be the lateral error of the h-th prediction step.

10. The method for predicting the trajectory of a drifting buoy based on a time-gated multi-scale residual network according to claim 1, characterized in that, The process of obtaining the future drifting buoy trajectory includes multiplying the final predicted displacement by the standard deviation of the trajectory data and adding the mean of the trajectory data, performing inverse normalization to obtain the future predicted displacement at the true displacement scale, and then accumulating and recursively summing the inverse normalized future predicted displacements starting from the last historical position to obtain the drifting buoy position at each future prediction step. The future drifting buoy position satisfies the following: , in, The predicted position of the drifting buoy in the h-th future step. For the last position in history, This represents the i-th future predicted displacement after inverse normalization.