Method for predicting drifting trajectory of personnel falling into water at sea

By adopting the improved Transformer model of deep learning in the prediction of drift trajectory of people who fell into the sea, introducing an adaptive multi-head attention weight mechanism and LSTM layer, the shortcomings of the existing methods in generalization and timing relationship processing are solved, and a higher precision prediction result is achieved.

CN119538755AActive Publication Date: 2025-02-28FUJIAN UNIV OF TECH

Patent Information

Application Number
CN202510106186.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-02-28
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

The existing method of drift trajectory prediction for people who fell into the sea lacks generalization when processing different locations and meteorological data, and cannot effectively capture the timing relationship between the data, resulting in low prediction accuracy.

Method used

The deep learning method is used to improve the Transformer model, and by introducing the adaptive multi-head attention weight mechanism (AMWM) and LSTM layers in Transformer, the model's processing ability on time sequence data and the weight allocation ability of different influencing factors is enhanced.

Benefits of technology

It improves the accuracy and reliability of the drift trajectory prediction of sea-falling personnel, can more effectively capture the influencing factors of different time periods and locations, and improves the efficiency and accuracy of search and rescue operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538755A_ABST
    Figure CN119538755A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of maritime search and rescue, and particularly discloses a maritime overboard person drifting trajectory prediction method, which comprises the following steps: S1, collecting related data of a maritime overboard person; s2, carrying out normalization processing on the data; s3, making a data Loader for training and testing according to the processed data set; s4, carrying out loop iteration for multiple times, feeding data in each batch into the AMWM-Transformer model, obtaining the output of the model and original label data, carrying out loss value calculation, updating model parameters according to the loss value, and completing model training; and S5, according to the trained model, feeding tested input features to obtain output, performing accumulation calculation on loss values of the input features and a real label to obtain a total loss value of final test data, and evaluating an experimental result by using ADE and FDE. According to the method for predicting the drifting trajectory of the personnel falling into water on the sea, sea condition factors such as ocean current and wind speed are analyzed, trajectory prediction is conducted through AMWM-Transform, and the prediction accuracy and reliability can be improved to a certain degree.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of marine search and rescue, and in particular to a method for predicting the drifting trajectory of a person who falls into water at sea. Background Art

[0002] In the search and rescue operation at sea, the rescue of people who fall into the water is a very critical and urgent task, but the uncertainty of the weather and the complexity of drifting make the operation particularly difficult. First of all, the search and rescue of people who fall into the water at sea requires accurate positioning. A drifting object moves under the net balance force of wind, water flow and waves acting on it. If the trajectory of the drifting object or the most likely search area cannot be accurately predicted, it is difficult to find the drifting object. Therefore, how to model the movement of drifting objects has been a research hotspot in the past two decades. The prediction of drifting trajectories can allow rescuers to more effectively and conveniently understand the location and drifting movement of people who fall into the water, and then formulate targeted search and rescue operations. In addition, searching in such a wide range at sea is very time-consuming and labor-intensive. By predicting the drifting trajectory, the search range can be narrowed, the search time can be minimized, and the rescue success rate can be improved. Therefore, accurately predicting the drifting trajectory of people who fall into the water to improve the success rate of rescue has become one of the important research directions. How to achieve efficient and accurate trajectory prediction of falling targets is particularly important.

[0003] In the category of trajectory prediction, the prediction of the drifting path of people who fall into the sea also belongs to one of the categories of particle prediction. In particle prediction, traditional numerical model methods are usually used to simulate and predict particle motion. Some researchers use analytical methods to predict drift trajectories. Since the drifting motion of people who fall into the sea is a complex synthetic motion under the action of external forces such as wind, waves, and currents, this method first obtains some data factors that will have a direct impact on the drifting trajectory of people who fall into the sea, thereby determining the motion equation model (compared to the simple flow field model). Then, the initial conditions of the current person who falls into the water (initial velocity, weight, falling position, direction, etc.) are used as the input of the motion equation model to solve, and the displacement of the drifting trajectory obtained according to different time is obtained, thereby determining the position at a certain moment. For example, taking u, v (drift decomposition speed), x, y (drift coordinate position) as an example, to predict the drifting position and decomposition speed at the future time t, the time t can be divided into several blocks by this numerical simulation method. , after predicting the drift position and decomposition speed of each block, the Runge-Kutta method is used for prediction. The specific formula is as follows: ; Due to the shortcomings of the analytical method, such as ignoring randomness (the analytical method uses a deterministic formula to describe changes, ignoring the occurrence of emergencies), and being limited to simplified models, some researchers have proposed the Monte Carlo simulation method. The basic idea is that when the problem to be solved is the probability of a certain random event, or the expected value of a random variable, the probability of this random event is estimated by the frequency of occurrence of this event through some experimental method, or the digital characteristics of this random variable are obtained and used as the solution to the problem. This method adds randomly generated data to the numerical model in order to simulate the random influence of the drifting process, and then performs a large number of sampling, multiple simulations, and adding different random values ​​to obtain the corresponding multiple drift prediction trajectories, and then conducts a comprehensive evaluation and analysis. This method can take into account a variety of situations in the simulation, so that the final predicted trajectory is more accurate and reliable.

[0004] Secondly, some researchers have proposed the Lagrangian particle tracking method, the basic idea of ​​which is to track the movement of fluid particles and integrate the movement of all particles to construct the entire fluid dynamics. Combining the characteristics of the research object (lost ship or aircraft) and the environment, the constraints and solution process were studied. Simply put, the Lagrangian particle tracking method is to simulate a large number of particles and estimate the drift trajectory of real particles based on the simulated path. First, it is necessary to divide the flow field under study into discrete networks, that is, several sub-networks. Multiple particles can be set in each sub-network, and these particles are given initial positions, velocities and other necessary attributes. Then, the movement of each particle is calculated according to the flow field data or the flow field motion equation, so as to obtain the dynamic behavior of the entire flow field and help understand the flow field motion law. However, this method also has certain limitations. The initial position and other attribute data of real particles, such as people who fall into the water at sea, may be different from the attributes of simulated particles, resulting in poor prediction results.

[0005] However, due to the complexity and uncertainty of the ocean environment; the traditional methods are based on certain assumptions; and the predicted drift position is not only related to the information at the last moment, the traditional numerical simulation method cannot obtain a more accurate prediction path. In addition, the task of drift trajectory prediction is usually defined as predicting the trajectory in the future period based on a series of historical drift data. Therefore, researchers often use methods based on statistics and machine learning to convert the trajectory prediction problem into an ordered time series prediction problem to improve the accuracy of the prediction. Summary of the invention

[0006] The purpose of the present invention is to provide a method for predicting the drifting trajectory of a person who falls into the water at sea, which solves some technical problems faced in the existing prediction of the drifting trajectory of a person who falls into the water, such as the lack of strong generalization for different locations and meteorological data, the inability to capture the temporal relationship between data well, etc., resulting in low prediction accuracy. The present invention directly uses the deep learning method for experiments and comparisons, and provides a novel and effective model method by improving the original Transformer, which achieves more reliable prediction results in the field of search and rescue of people who fall into the water, and is expected to provide new tools and methods for research in this field.

[0007] To achieve the above object, the present invention provides a method for predicting the drifting trajectory of a person falling into the water at sea, comprising the following steps: S1. Collect data related to people falling into the water at sea; S2, normalize the data; S3, create data Loader for training and testing based on the processed data set; S4, iterate the loop multiple times, feed the data in each batch into the AMWM-Transformer model, obtain the model output and the original label data to calculate the loss value, update the model parameters according to the loss value, and complete the model training; S5. According to the trained model, the input features of the test are fed into the output, and the loss value is accumulated with the true label to obtain the total loss value of the final test data. ADE and FDE are used to evaluate the experimental results.

[0008] Preferably, in S1, the data related to the person falling into the sea includes the drifting trajectory information data of a simulated dummy in the offshore waters, including the dummy ID number, date, specific time, longitude, latitude, and decomposition speed information of the sea breeze and current, and the data except the ID number, date and specific time are extracted as experimental data.

[0009] Preferably, in S2, the maximum-minimum normalization method is used to process the original data, and the formula is as follows: ; in, X Indicates the current data. X min Indicates the minimum value in the current data. X max Indicates the maximum value in the current data. X norm Indicates the result after the current data is standardized.

[0010] Preferably, the specific process of S3 is: First, the training set and the test set are divided according to the set ratio. Then, the input features and labels are obtained according to the set historical sliding window size and prediction window size, which are named X train , Y train , X test , Y test , add the input features and labels of the training set to a new list in the form of tuples, and then split it by batch_size to form train_loader and test_loader.

[0011] Preferably, in S4, the loss value is used MSE The calculation formula is as follows: ; in, represents the data sample size, Represents the label value, Represents the model prediction value.

[0012] Preferably, in S4, a multi-head adaptive attention weight mechanism AMWM is newly added to the Transformer, which changes the corresponding weights by differentiating the activity levels of the attention heads, so as to replace the mechanism in which the original attention matrix only uses the same weight distribution, and replaces the feedforward network containing only the fully connected layer in the Transformer structure with the LSTM layer.

[0013] Preferably, in S4, the adaptive attention weight mechanism AMWM is performed after the attention matrix is ​​obtained. In the attention matrix acquisition part of the original Transformer, the input data is a time series data sequence, that is, the drift trajectory position data and meteorological data of the past period of time are stacked: Assume that its data shape is [batch_size, seq_len, features_num], where batch_size represents the number of samples in each batch, seq_len represents the length of the time series data, and features_num represents the number of features for each data point; According to the input data, three vectors of the attention matrix are constructed: query Q vector, key K vector and value V vector. Matrix multiplication and softmax operation are used to calculate the results of Q and K to obtain the attention score, and then the attention matrix is ​​obtained by weighted average calculation with the V vector. The obtained result shape is [batch_size, seq_len, seq_len], which represents the relationship between each time series data point and other time series data points in each sample data. In a multi-head Transformer, the attention matrix data shape is [batch_size, n_heads, seq_len, seq_len], which represents the relationship matrix between each time series data point and other data points under different attention head environments. Each attention head focuses on different contextual features to capture different dependencies in the data. n_heads represents the number of attention heads in a multi-head Transformer.

[0014] Preferably, in S4, the variance, standard deviation and mean square error are used to obtain the attribute data in the attention matrix, different attributes are added and the standard deviation is calculated to obtain the degree of dispersion of the overall data, and finally, a mean operation is performed on the attribute data to obtain a specific indicator for comprehensively evaluating the activity of the attention head. The specific formula is as follows: ; in, Expressed as A head of attention, variance , std_deviation and mean_square_ error Represent the variance, standard deviation and mean square error of the attention matrix corresponding to the attention head, respectively. Indicates the current A batch is analyzed; After multiplying the result obtained by the softmax function with the attention matrix, the final calculation result is obtained. After waiting for a full batch of data analysis to be completed, the attention head weight list under this loop iteration is obtained. The weight list is used to multiply the attention matrix next time to obtain the attention matrix under different degrees of influence, and then the model parameters are updated.

[0015] Preferably, in S4, the LSTM neurons in the LSTM layer are used to add, maintain or delete information transmitted through the feedback loop, and the gate is composed of a sigmoid neural network layer, which selects to let part of the information pass according to the input value. The sigmoid layer outputs a value between 0 and 1 to indicate how much information is allowed to pass, and controls how much information is retained according to the new input and the previous iteration value. The specific formula is as follows: ; in, W and b They refer to the weights and biases of different gates respectively. represents the current time t, Represented as the input at the current time t, usually a vector or matrix, Represents the activation function.

[0016] Preferably, in S5, the difference unit in latitude and longitude is converted from degrees to kilometers, and then evaluated by the ADE_custom and FDE_custom formulas shown below: ; ; in, Indicates samples, Indicates the subscript of the last data. Represented as the first values, Represented as the first value.

[0017] Therefore, the present invention adopts the above-mentioned method for predicting the drifting trajectory of a person falling into the water at sea, and the beneficial effects are as follows: (1) Traditional drift trajectories often only consider conventional influencing factors, and most of them are predicted using numerical model simulation methods. This results in the inability of models based on stable influencing factors and deterministic laws to obtain the nonlinear characteristics of drift behavior, which poses a great challenge to providing accurate and reliable drift trajectories and causes unnecessary losses. The drift trajectory prediction model based on deep learning in the present invention can capture the influencing factors of different time periods and different locations.

[0018] (2) Under the basic framework of the deep learning model, the present invention first adds the LSTM recurrent network layer to the original model, which can better model the complex relationship between data points at different moments and improve the spatiotemporal continuity.

[0019] (3) The present invention adopts a new mechanism of adaptive multi-head attention weights, which assigns different values ​​to different influencing factors. The drift trajectory prediction after adding this mechanism helps to improve the efficiency of search and rescue operations, reduce the waste of manpower and material resources, and can respond quickly and take more precise measures to improve the survival rate of people who fall into the water.

[0020] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is an overall flow chart of an embodiment of a method for predicting the drifting trajectory of a person falling into the water at sea according to the present invention; Figure 2 This is a flow chart of an adaptive multi-head attention weight updating mechanism of an embodiment of a method for predicting the drifting trajectory of a person falling into the water at sea according to the present invention; Figure 3This is a LSTM structural block diagram of an embodiment of a method for predicting the drifting trajectory of a person falling into the water at sea according to the present invention; Figure 4 This is a graph showing the results of a single-step prediction multi-model comparison experiment on dummy No. 582401 according to an embodiment of a method for predicting the drifting trajectory of a person falling into the water at sea in the present invention. DETAILED DESCRIPTION

[0022] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0023] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.

[0024] Compared with the traditional numerical simulation method for trajectory prediction, the deep learning method can achieve faster prediction speed and reduce the time complexity and time cost of calculation; in addition, the complex nonlinear relationship between input and output can be learned to improve its accuracy. Since the drift trajectory prediction of the drowning person is itself a time series prediction, recurrent neural network (RNN), long short-term memory network (LSTM), gated recurrent unit (GRU), Transformer and its variants can be used to predict the drift trajectory. Similarly, the use of RNN neural network for vehicle path prediction has good results and can learn the relationship between moments from the data, thereby providing more accurate prediction results.

[0025] like Figure 1 As shown, a method for predicting the drifting trajectory of a person falling into the water at sea comprises the following steps: S1. Collect data related to people falling into the water at sea; The data set formed by the relevant data of people falling into the water at sea contains the drifting trajectory information data of a simulation dummy in the offshore waters, a total of 2880 data, including the dummy ID number, date, specific time, longitude, latitude, sea breeze and current decomposition speed information, a total of nine attributes. The data except the ID number, date and specific time are extracted as experimental data.

[0026] S2, normalize the data; Taking sea breeze data as an example, the maximum and minimum values ​​are obtained from the sea breeze data at all time points, and the maximum-minimum normalization method is used to process the original data. The formula is as follows: ; in, X Indicates the current data. X min Indicates the minimum value in the current data. X max Indicates the maximum value in the current data.X norm Indicates the result after the current data is standardized.

[0027] S3. Create training and testing data loaders based on the processed data set. The specific process is as follows: First, the training set and the test set are divided according to the set ratio. In this embodiment, the training set and the test set are divided according to the ratio of 8:2. Then, the input features and labels are obtained according to the set historical sliding window size and prediction window size. In this embodiment, the historical data window is 30 and the prediction data window is 1 to produce a single-step prediction data set, which are named X train , Y train , X test , Y test , add the input features and labels of the training set to the new list in the form of tuples; then split them by batch_size to form train_loader and test_loader.

[0028] S4, iterate the loop multiple times, feed the data in each batch into the AMWM-Transformer model, obtain the model output and the original label data to calculate the loss value, and the loss value is used MSE The calculation formula is as follows: ; in, represents the data sample size, Represents the label value, Represents the model prediction value. Update the model parameters according to the loss value to complete the model training.

[0029] This embodiment mainly uses the original Transformer structure as the basic framework. First, a multi-head adaptive attention weight mechanism AMWM is newly added to the Transformer. The corresponding weights are changed by the differentiated activity of the attention heads, so as to replace the original attention matrix with the mechanism of only using the same weight allocation, avoiding the inability to fully consider the influence of different attention heads on their prediction results. Secondly, the feedforward network containing only the fully connected layer in the Transformer structure is replaced with the LSTM layer, so as to capture the temporal relationship between the data that cannot be obtained by using only the fully connected layer, and enhance the spatiotemporal continuity of the prediction.

[0030] The adaptive attention weight mechanism AMWM is based on the acquisition of the attention matrix. In the original Transformer's attention matrix acquisition part, the input data is a time series data sequence, that is, the drift trajectory position data and meteorological data of the past period of time are stacked: Assume that its data shape is [batch_size, seq_len, features_num], where batch_size represents the number of samples in each batch, seq_len represents the length of the time series data, and features_num represents the number of features for each data point.

[0031] According to the input data, three vectors of the attention matrix are constructed: query Q vector, key K vector and value V vector. Matrix multiplication and softmax operation are used to calculate the results of Q and K to get the attention score. Finally, the attention matrix is ​​obtained by weighted average calculation with the V vector. The result shape is [batch_size, seq_len, seq_len], which represents the relationship between each time series data point and other time series data points in each sample data.

[0032] In a multi-head Transformer, the attention matrix data shape is [batch_size, n_heads, seq_len, seq_len], which represents the relationship matrix between each time series data point and other data points under different attention head environments. Each attention head focuses on different contextual features to capture different dependencies in the data. n_heads represents the number of attention heads in a multi-head Transformer.

[0033] However, since the relationship matrix obtained by each attention head is different, and its influence on the final result varies, after obtaining the multi-head attention matrix of all samples in a batch, different data samples are randomly sampled to calculate the attention matrix attribute data based on all attention heads in these sampled samples, and the size of the attention head weight is determined based on these data.

[0034] Therefore, in this embodiment, variance, standard deviation and mean square error are used to obtain attribute data in the attention matrix. The three selected in this embodiment are commonly used indicators for measuring data distribution and dispersion. These three attribute data are used to measure the degree of dispersion or deviation. A larger value means that the element values ​​in the attention matrix are more dispersed, which can be used to imply that the attention head pays attention to more positions and information; conversely, it means that the attention distribution is more concentrated, and may only focus on the information of a few positions). The larger the value of these indicators, the stronger the activity level corresponding to each attention head. In each iteration process, when the attributes of all data are fully analyzed, a set of three attributes of all attention heads is obtained.

[0035] Then, we add different attributes and calculate the standard deviation to get the degree of dispersion of the overall data. Finally, we perform a mean operation on the three attribute data to obtain a specific indicator for comprehensively evaluating the activity of the attention head. The specific formula is as follows: ; in, Expressed as A head of attention, variance, std_deviation and mean_square_ error Represent the variance, standard deviation and mean square error of the attention matrix corresponding to the attention head, respectively. Indicates the current This indicator lays the foundation for obtaining the attention head weight list in the future, thereby updating the influence of each attention head on the final result.

[0036] Finally, the result obtained by the softmax function is multiplied by the attention matrix to obtain the final calculation result. After waiting for a full batch of data analysis to be completed, the attention head weight list under this loop iteration is obtained. The next time, this weight list is used to multiply the attention matrix to obtain the attention matrix under different degrees of influence, and then the model parameters are updated.

[0037] The multi-attention head weight optimization algorithm aims to optimize the performance of the model by analyzing the performance of multiple attention heads in different batches and dynamically adjusting the weight of each attention head.

[0038] Define n to represent the number of attention heads, all_batch_list is used to store the feature analysis result list of all batches in each loop iteration, power is the attention head weight list in the current loop, var, std and mse represent variance, standard deviation and mean square error respectively, which are used to measure the statistics of attention matrix features, and selected_num is the number of random samples.

[0039] like Figure 2 As shown in Figure 2, the adaptive multi-head attention weight update mechanism includes the following steps: 1. Initialize weights: Initialize the power list so that the initial weight of each attention head is 1, that is, Initialpower=[1]*n; 2. Start loop iteration: Enter the outer loop, which will continue until a specific termination condition is met (such as reaching the maximum number of iterations or convergence criteria); 3. Calculate the product of the attention matrix and the weight: For each iteration, calculate the result of multiplying the attention matrix and the current power list, that is, attention←attention matrix*Initialpower; 4. Process each batch of data: start the inner loop and traverse the current batch Attention data: extract the current batch of attention data from attention ← attention[i]; perform feature analysis on the extracted attention data to obtain its variance var, standard deviation std and mean square error mse; add these feature data [var, std, mse] to the batch_features list; add the batch_features list to all_batch_list for subsequent processing; 5. End batch processing: After the inner loop ends, the feature analysis results of all batches have been collected into all_batch_list; 6. Random sampling and feature aggregation: Randomly sample all_batch_list and select the number of samples specified by selected_num; for the sampled data, calculate the standard deviation for the three attributes of var, std and mse respectively, and then average these standard deviations to obtain the activity level of each attention head in the current iteration; update the power list to make it equal to the mean calculated above, and normalize it, that is, Power←mean(all_batch)&normalization, and reversely weight the weight list, that is, use 1 minus the weight list to update the model parameters; 7. End loop iteration: When the termination condition is met, end the outer loop; 8. Output results: Output the final optimized attention head weight list power; Through the above steps, the algorithm can dynamically adjust the weight of each attention head, thereby optimizing the performance of the model on different batches. In the final testing stage, there is no need to add a weight list to increase the complexity of the model. The final prediction result can be obtained by directly inputting the test data.

[0040] In S4, regarding the LSTM structure layer, the original purpose of this recursive neural network structure layer is to solve the long-term dependency of the typical recursive RNN model gradient disappearance or explosion. The specific structure diagram is shown in Figure 3 .

[0041] The LSTM neurons in the LSTM layer can be used to add, maintain, or delete information transmitted through the feedback loop. The gate consists of a sigmoid neural network layer that can choose to let some information pass based on the value of the input. This sigmoid layer outputs a value between 0 and 1 to indicate how much information it can allow to pass, thereby controlling how much information is retained based on the new input and the previous iteration value. The specific formula is as follows: ; in, W and b They refer to the weights and biases of different gates respectively. represents the current time t, Represented as the input at the current time t, usually a vector or matrix, Represents the activation function.

[0042] S5. According to the trained model, the input features of the test are fed into the output, and the loss value is accumulated with the real label to obtain the total loss value of the final test data (the loss value calculation formula is the same as above), and its effect is visualized. ADE_custom and FDE_custom are used to evaluate the experimental results.

[0043] In terms of evaluation indicators, the difference units in latitude and longitude are first converted from degrees to kilometers, and then evaluated using the ADE_custom and FDE_custom formulas shown below, named ADE_custom and FDE_custom: ; ; in, Indicates samples, Indicates the subscript of the last data. Represented as the first values, Represented as the first value.

[0044] Finally, if Figure 4 As shown in the figure, the experimental visualization and experimental result evaluation are carried out in comparison with the current more common time series prediction models. The detailed results are shown in Table 1.

[0045] Table 1 Drift trajectory evaluation dummy number of each model 582401 Unit: km ;

[0046] It can be found that the ADE and FDE errors of the AMWM-Transformer proposed in the present invention are 1.2645 km and 0.7931 km respectively, which are reduced by 0.7854 km and 0.7788 km compared with the best comparison model mentioned.

[0047] In summary, the present invention adds an adaptive multi-head attention weight mechanism based on the original Transformer model, and calculates the attention matrix corresponding to each attention head with different weights to determine its influence on the final result. The core idea of ​​this mechanism is to change the weight of each attention head, so that the ones with greater influence on the result are set with large weights; otherwise, small weights are set, so that positive elements increase their influence and negative elements reduce their influence. In addition, in order not to increase the complexity of the model in the final testing stage, reverse weighting is performed to better update the model parameters.

[0048] At the same time, in the multi-head attention mechanism, multiple parallel attention heads are used, and each head can focus on different local context information. However, in the added adaptive multi-head attention weight mechanism, each attention head learns a specific feature weight mode, and the final result is obtained by performing different weighted summations on different features, thereby improving the accuracy of the drift trajectory prediction of people falling into the sea.

[0049] The present invention modifies the feedforward fully connected neural network layer in the original Transformer into an LSTM structure layer: First, since the LSTM structure is a recurrent neural network specifically used to process time series data, compared to the fully connected layer, LSTM can capture the long-term dependencies of time series data, and since the drift trajectory prediction task of people falling into the water at sea often has a certain temporal nature (the current drifting position is related to the historical drifting position), the use of this structure can better model the model. In addition, since the past drifting position and meteorological data information are very important when predicting the current drifting position, it is necessary to use the LSTM network to retain and utilize the previous data information, so as to better predict the current position and improve the accuracy and stability of the prediction.

[0050] Therefore, the present invention adopts the above-mentioned method for predicting the drifting trajectory of people falling into the water at sea, uses deep learning methods for experiments and comparisons, and provides a novel and effective model method by improving the original Transformer, which can achieve more reliable prediction results in the field of search and rescue of people falling into the water, and is expected to provide new tools and methods for research in this field.

[0051] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for predicting the drifting trajectory of a person falling into the water at sea, characterized in that: The following steps are involved: S1. Collect data related to people falling into the water at sea; S2, normalize the data; S3. Create data Loaders for training and testing based on the processed data set; S4, iterate the loop multiple times, feed the data in each batch into the AMWM-Transformer model, obtain the model output and the original label data to calculate the loss value, update the model parameters according to the loss value, and complete the model training; S5. According to the trained model, the input features of the test are fed into the output, and the loss value is accumulated with the true label to obtain the total loss value of the final test data. ADE and FDE are used to evaluate the experimental results.

2. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 1, characterized in that: In S1, the data related to people falling into the sea include the drifting trajectory information data of a simulated dummy in the offshore waters, including the dummy ID number, date, specific time, longitude, latitude, and decomposition speed information of sea breeze and current. Data other than the ID number, date and specific time are extracted as experimental data.

3. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 2, characterized in that: In S2, the maximum-minimum normalization method is used to process the original data. The formula is as follows: ; in, X Indicates the current data. X min Indicates the minimum value in the current data. X max Indicates the maximum value in the current data. X norm Indicates the result after the current data is standardized.

4. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 3, characterized in that: The specific process of S3 is as follows: First, the training set and the test set are divided according to the set ratio. Then, the input features and labels are obtained according to the set historical sliding window size and prediction window size, which are named X train , Y train , X test , Y test , add the input features and labels of the training set to a new list in the form of tuples, and then split it by batch_size to form train_loader and test_loader.

5. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 4, characterized in that: In S4, the loss value is used MSE The calculation formula is as follows: ; in, represents the data sample size, Represents the label value, Represents the model prediction value.

6. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 5, characterized in that: In S4, a multi-head adaptive attention weight mechanism AMWM is newly added to the Transformer. The corresponding weights are changed by differentiating the activity levels of the attention heads, thereby replacing the original attention matrix with the mechanism of only using the same weight distribution, and replacing the feedforward network that only contains fully connected layers in the Transformer structure with LSTM layers.

7. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 6, characterized in that: In S4, the adaptive attention weight mechanism AMWM is based on the acquisition of the attention matrix. In the original Transformer's attention matrix acquisition part, the input data is a time series data sequence, that is, the drift trajectory position data and meteorological data of the past period of time are stacked: Assume that its data shape is [batch_size, seq_len, features_num], where batch_size represents the number of samples in each batch, seq_len represents the length of the time series data, and features_num represents the number of features for each data point; According to the input data, three vectors of the attention matrix are constructed: query Q vector, key K vector and value V vector. Matrix multiplication and softmax operation are used to calculate the results of Q and K to obtain the attention score, and then the attention matrix is ​​obtained by weighted average calculation with the V vector. The obtained result shape is [batch_size, seq_len, seq_len], which represents the relationship between each time series data point and other time series data points in each sample data. In a multi-head Transformer, the attention matrix data shape is [batch_size, n_heads, seq_len, seq_len], which represents the relationship matrix between each time series data point and other data points under different attention head environments. Each attention head focuses on different contextual features to capture different dependencies in the data. n_heads represents the number of attention heads in a multi-head Transformer.

8. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 7, characterized in that: In S4, the variance, standard deviation and mean square error are used to obtain the attribute data in the attention matrix. Different attributes are added and the standard deviation is calculated to obtain the degree of dispersion of the overall data. Finally, a mean operation is performed on the attribute data to obtain a specific indicator for comprehensively evaluating the activity of the attention head. The specific formula is as follows: ; in, Expressed as A head of attention, variance , std_deviation and mean_square_error Represent the variance, standard deviation and mean square error of the attention matrix corresponding to the attention head, respectively. Indicates the current A batch is analyzed; After multiplying the result obtained by the softmax function with the attention matrix, the final calculation result is obtained. After waiting for a full batch of data analysis to be completed, the attention head weight list under this loop iteration is obtained. The weight list is used to multiply the attention matrix next time to obtain the attention matrix under different degrees of influence, and then the model parameters are updated.

9. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 8, characterized in that: In S4, the LSTM neurons in the LSTM layer are used to add, maintain, or delete information transmitted through the feedback loop. The gate consists of a sigmoid neural network layer, which selects to let part of the information pass according to the input value. This sigmoid layer outputs a value between 0 and 1 to indicate how much information is allowed to pass, and controls how much information is retained according to the new input and the previous iteration value. The specific formula is as follows: ; in, W and b They refer to the weights and biases of different gates respectively. represents the current time t, Represented as the input at the current time t, usually a vector or matrix, tanh Represents the activation function.

10. A method for predicting the drifting trajectory of a person falling into the water at sea according to claim 9, characterized in that: In S5, the difference units in latitude and longitude are converted from degrees to kilometers and then evaluated by the ADE_custom and FDE_custom formulas as shown below: ; ; in, Indicates samples, Indicates the subscript of the last data. Represented as the first values, Represented as the first value.

Citation Information

Patent Citations

  • Long time series data prediction method based on bidirectional sparse mechanism Transform

    CN116541435A

  • Short-term photovoltaic power generation power prediction method based on L-Transform

    CN117034055A

  • Offshore personnel drift trajectory prediction method

    CN117114207A

  • Offshore floater trajectory prediction method based on quantum convolutional long-short term memory (QCNN-LSTM) model

    CN117540616A

  • DBASformer model-based AUV drift trajectory prediction method

    CN118735030A

Cited By

  • Water falling track prediction method based on remote sensing and satellite communication positioning

    CN121256723A