Track fracture studying and judging method and device based on variable-length double-attention twinning

By using the deep learning method of encoder and uncertain double-attention twin module in trajectory fracture analysis and judgment, the problem of trajectory fracture analysis and judgment in complex marine environments is solved, and high accuracy and stable analysis and judgment results are achieved.

CN120087418APending Publication Date: 2025-06-03HAINAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510160209.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

In the complex marine environment, the prior art is difficult to achieve efficient and accurate trajectory fracture analysis due to problems such as uneven trajectory sampling rate and noise sampling points.

Method used

The deep learning trajectory fracture analysis method based on the encoder and the uncertain length double attention twin module is adopted. Trajectory features are extracted through the multi-head attention mechanism and the ResNet50 backbone network, and feature fusion is used for the Siamese-FFN layer to achieve trajectory similarity judgment.

Benefits of technology

Under complex sea conditions and dense target scenarios, high-accuracy trajectory fracture analysis and judgment were achieved, significantly improving the performance indicators of Accuracy, Recall, Precision and F1-score.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120087418A_ABST
    Figure CN120087418A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of text data detection and deep learning, in particular to a track fracture studying and judging method and device based on variable-length double-attention twinning, a Transform encoder is adopted as a basic model, an Encoder module, an RL-DAN module and a Siamese-FFN module are introduced into the Transform encoder, the Encoder module firstly carries out first feature extraction on input data, the RL-DAN module carries out second feature extraction on the input data, and the Siamese-FFN module carries out second feature extraction on the input data; according to the method, the spatial features and additional speed and course features of the trajectory are extracted, so that the model can better sense the change of the trajectory. Secondly, the RL-DAN module enables the model to complete the fusion of high-dimensional features and low-dimensional features before final detection, and prevents a deep network from neglecting low-dimensional edge features. And finally, introducing the Siamese-FFN into a loss function for calculation of feature fusion. The accuracy of trajectory similarity prediction of the model is improved by considering more comprehensive constraint conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of text data detection and deep learning, and particularly relates to a method and device for judging trajectory breakage based on variable-length double attention siamese. Background Technique

[0002] With the wide popularization of GPS devices and Internet technologies, the generation speed and scale of trajectory data are continuously increasing. These data not only come from smartphones, vehicle navigation systems, and wearable devices, but also include various application scenarios such as traffic monitoring, logistics control, ship control, and personal health tracking. The explosive growth of these data provides a rich information source for trajectory analysis, but also poses higher requirements for data processing and analysis technologies, especially in how to effectively mine and utilize these massive data.

[0003] During sea navigation, when a ship leaves one shore-based radar and enters the range of the next shore-based radar, it may pass through a radar blind spot, that is, an area beyond the radar scanning range, which will cause the originally normal trajectory to break into two or more segments. Therefore, judging whether these independent trajectories belong to the trajectory of the same ship belongs to the classic problem of trajectory similarity judgment and also belongs to the trajectory classification problem. This problem is crucial for maritime traffic management and ship monitoring.

[0004] At present, many researchers have proposed many classic methods, such as dynamic time warping (DTW), longest common subsequence (LCSS), edit distance with real penalty (ERP), and edit distance on real sequences (EDR). These methods usually have complex calculations and are sensitive to noise, and it is difficult to ensure efficient and accurate matching in complex maritime environments. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to propose a method and device for judging trajectory breakage based on variable-length double attention siamese to solve the problem of difficult matching caused by uneven sampling rates in existing methods.

[0006] Based on the above purpose, the present invention provides a method for judging trajectory breakage based on variable-length double attention siamese, including the following steps:

[0007] S1. Preprocess and normalize the input ship AIS and radar text data;

[0008] S2. Concatenate the longitude and latitude information of two or more trajectories together, input the concatenated data through the Embedding layer and into the Encoder, and extract the feature information in the data through the multi-head attention mechanism;

[0009] S3. Input the headings of two or more trajectories into the dual attention mechanism of the variable-length sequence. Use ResNet50 as the backbone network of RL-DAN to extract the basic features in the data and send them into the dual attention mechanism. Concatenate the two outputs of the dual attention mechanism to obtain the concatenated output features.

[0010] S4. Input the concatenated output features into the FFN layer with shared parameters to extract the feature information of the entire two or more trajectories and extract it into the same distribution domain.

[0011] S5. Concatenate the integrated output with the output of the Encoder layer to obtain the final output result.

[0012] Preferably, step S1 specifically includes: preprocessing and normalizing the input ship AIS and radar text data into text data with a length of 1506.

[0013] Preferably, step S2 specifically includes:

[0014] Concatenate the longitude and latitude data of the input two or more trajectories to obtain D, where V is the length of the input sequence, taking the maximum value of the two trajectories, and T is the number of features;

[0015] Use sine and cosine functions for point sequence position encoding. For the data of the i-th point on the trajectory, update it by adding e i,j as follows:

[0016] D[i,j] = D[i,j] + e i,j

[0017]

[0018] where D[i,j] represents the element in the i-th row and j-th column of matrix D, i represents the i-th point on the trajectory, j represents the feature dimension, and d p is a constant representing the total number of feature dimensions, j / d p and (j - 1) / d p are the scaling factors for position encoding;

[0019] Pass the concatenated data through the Embedding layer and input it into the Encoder. Use three linearly independent layers to convert the input data matrix into query, key, and value matrices for multi-head attention to extract the feature information in the data.

[0020] Preferably, this method further includes:

[0021] After passing through the multi-head attention layer, the obtained features are input into the position feed-forward network to better extract features.

[0022] Preferably, in step S3, the dual attention mechanism includes a position attention module and a channel attention module. The feature extraction process of the position attention module includes:

[0023] Given a piece of data First, it is fed into a convolutional layer to generate two new feature maps A and B respectively, where It is reshaped into where N = V × T is the size of the data volume;

[0024] Perform matrix multiplication between B and the transpose of A, and apply a softmax layer to calculate the spatial attention map Meanwhile, the data D * is input into a convolutional layer to generate a new map and it is reshaped into Then perform matrix multiplication between C and the transpose of S, and reshape the result into Finally, multiply it by a scale parameter α, and perform an element-wise summation operation with the data D * to obtain the final output

[0025] Preferably, step S3 further includes:

[0026] Based on the formula for obtaining the final output a length parameter δ is given to assign an initial weight based on the amount of information in the current trajectory, and more weights are gradually learned in the subsequent process.

[0027] Preferably, in step S3, the feature extraction process of the channel attention module includes:

[0028] Reshape D * into Take the transpose of D * and perform matrix multiplication with D * Apply a softmax layer to obtain the channel attention map

[0029] Perform matrix multiplication between M and the transpose of D * and reshape the result into to obtain the attention features output by the channel attention module.

[0030] The present invention also provides a trajectory break judgment device based on variable-length dual attention siamese, which is applied to execute the above-mentioned trajectory break judgment method. The judgment device uses a Transformer encoder as the basic model and introduces an Encoder module, an RL-DAN module, and a Siamese-FFN module. Among them, the Encoder module is located at the forefront of the network and first performs the first feature extraction on the input data. The RL-DAN module is located at the end of the feature pyramid, enabling the model to complete the fusion of high-dimensional features and low-dimensional features before the final detection. The Siamese-FFN is introduced into the loss function for calculating feature fusion.

[0031] Advantages of the present invention: To meet the need for ship trajectory break judgment, the present invention proposes a deep learning trajectory break judgment method based on an encoder and a variable-length dual attention siamese module. This model solves the problem of difficult trajectory break judgment caused by uneven trajectory sampling rates and noisy sampling points in complex marine environments, and realizes high-accuracy judgment in complex sea conditions and dense target scenarios. Experimental results show that the trajectory break judgment algorithm developed by the present invention achieves accurate and stable ship trajectory break judgment and has excellent robustness in weak targets and complex backgrounds. The Accuracy, Recall, Precision, and F1-score performance indicators of this method on the HN_TM dataset and the ETData dataset have increased by 5.21%, 5.09%, 5.03%, and 5.56% respectively. Description of the Drawings

[0032] To more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only those of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0033] Figure 1 It is the network structure diagram of the trajectory break judgment for the embodiment of the present invention;

[0034] Figure 2 It is the network structure diagram of the RL-DAN for the embodiment of the present invention;

[0035] Figure 3 It is the comparison diagram of the trajectory break judgment network of the embodiment of the present invention with other advanced networks in the real scene. Detailed Embodiments

[0036] To make the objectives, technical solutions, and advantages of the present invention clearer, the following further details the present invention in conjunction with specific embodiments.

[0037] It should be noted that unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the ordinary meanings understood by those with ordinary skills in the field to which the present invention pertains. The "first", "second" and similar terms used in the present invention do not denote any order, quantity or importance, but are only used to distinguish different components. Words such as "comprising" or "including" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. Words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Upper", "lower", "left", "right", etc. are only used to represent relative position relationships, and when the absolute position of the object being described changes, the relative position relationship may also change accordingly.

[0038] The embodiments of this specification provide a deep learning trajectory break judgment method based on an encoder and a variable-length double-attention Siamese module, including the following steps:

[0039] 1. First, continuously input the AIS and radar text data of the ship into the system

[0040] 2. Preprocess and normalize the input text data

[0041] All models in the present invention only receive AIS and radar text data in standard formats, and will automatically crop the input data into sequences of a fixed length. That is, all input data will be preprocessed and normalized into text data with a length of 1506.

[0042] 3. Construct an Encoder module for splicing dual-input features

[0043] In the task of judging ship trajectory breaks, important information for determining whether two or even multiple trajectories are the same trajectory is to observe the longitude and latitude of these trajectories, that is, whether the geographical locations where the trajectories exist are similar, and whether features such as the shape and direction of the trajectories are similar. Therefore, the present invention proposes an Encoder module for splicing dual-input features, which splices the longitude and latitude information of two or more trajectories together and inputs it into the Encoder module with strong feature extraction capabilities to extract its features.

[0044] First, splice the longitude and latitude data of two or more input trajectories together to obtain D, where Let \(V\) be the length of the input sequence, taking the maximum value of the two trajectories, and \(T\) be the number of features, which is 4 for the two trajectories. Secondly, for the trajectory sequence, the relative position relationship of the points on the trajectory, that is, the front - back position relationship, must be considered, which is important information for trajectory similarity measurement. The sine and cosine functions are used for position encoding of the point sequence. For the data of the \(i\)-th point on the trajectory, it is updated by adding the following value \(e\) i,j as follows, shown in the following formulas (1) and (2):

[0045] \(D[i,j]=D[i,j]+e\) i,j (1)

[0046]

[0047] where \(D[i,j]\) represents the element in the \(i\)-th row and \(j\)-th column of the matrix \(D\), \(i\) represents the \(i\)-th point in the trajectory, and \(j\) represents the feature dimension (for example, longitude and latitude, timestamp, etc.). \(d\) p is a constant, usually representing the total number of feature dimensions, and \(j / d\) p and \((j - 1) / d\) p are scaling factors for position encoding. Formula (2) uses the sine and cosine functions to generate position encoding. For even dimensions (\(j = 2,4,6,\cdots\)), the sine function is used. For odd dimensions (\(j = 1,3,5,\cdots\)), the cosine function is used. \(j / d\) p and \((j - 1) / d\) p are used to adjust the frequency so that the position encodings of different dimensions have different change speeds.

[0048] Secondly, the concatenated data is passed through the Embedding layer and input into the Encoder. For the self - attention mechanism in the Encoder, first use three non - shared linear layers to convert the input data matrix into query, key, and value matrices, which can also be regarded as can also be denoted as a combination of a series of vectors \(Q=[q\) 1 ,q\) 2 ,\cdots,q\) N , \(K=[k\) 1 ,k\) 2 ,\cdots,k\) N , \(V=[v\) 1 ,v\) 2 ,\cdots,v\) N . At this time, multi - head attention is performed on these data to extract the feature information in the data, shown in the following formulas (3) - (5):

[0049] \(MultiHead(Q,K,V)=Concat(head\) 1 ,\cdots,head\)h )W O (3)

[0050]

[0051] Among them, MultiHead, head, and Attention represent a function. In this article, 8 attention heads are used, and for each head, d k = d v = d mod e l / h = 64 dimensions.

[0052] After passing through the multi-head attention layer, the obtained features are input into the position feed-forward network to better extract features, as shown in the following formula (6):

[0053] FFN Encdoer (x) = max(0, xW 1 + b 1 )W 2 + b 2 (6)

[0054] Among them, FFN Encoder represents a function, x represents the variable input to the function, and W 1 and W 2 represent the weight parameters of the feed-forward layer.

[0055] Therefore, a feature vector obtained by the network extracting longitude and latitude information is obtained for subsequent use in obtaining the final output result of the network.

[0056] 4. Construct a dual attention mechanism for variable-length sequences (RL-DAN)

[0057] In the trajectory matching task, the auxiliary information for judging whether two trajectories or even multiple trajectories are the same trajectory is the speed and heading of the ship during operation. If only the longitude and latitude information is used to judge whether two trajectories are similar, the result is unreliable. Therefore, referring to the initial dual attention mechanism network, the present invention proposes a dual attention mechanism specifically for variable-length trajectory sequences to extract the features of the auxiliary information in trajectory similarity judgment. As follows Figure 2 shown:

[0058] First, the speed and heading information of the two trajectories are respectively input into RL-DAN. For the convolutional network, each convolution extracts features from the data with a fixed-size convolutional kernel. In the TFFS data, the length is always much larger than the number of features, so after several convolutions, the number of features will be reduced to 1. Therefore, the input D is passed through the embedding layer to expand the number of feature levels. Through this step, the values of V and T are equal, asFigure 2 As shown. At the same time, ResNet50 will be used as the backbone network of RL-DAN. In the experiment, ResNet50 can well extract the basic features in the data and send them into the dual attention mechanism for deeper operations, as shown in Table 1 below:

[0059] Table 1: Results with Different ResNets as Backbone Networks

[0060] Precision Recall F1-score Accuracy ResNet50 96.62 96.94 96.78 96.34 ResNet101 95.42 95.10 95.26 95.48 ResNet152 95.98 96.03 96.04 96.04

[0061] Secondly, the dual attention mechanism proposed in the present invention for processing variable-length sequences includes a position attention module and a channel attention module. The position attention module focuses on extracting rich context from local features. For multivariate time series data, the context data information in the sequence is often strongly correlated, and the position attention module simplifies the more extensive context data information into local features, thereby enhancing the model's extraction ability. Next, this process will be described in detail.

[0062] Given a data First, it is fed into the convolutional layer to generate two new feature maps A and B respectively, where Then they are reshaped into where N = V × T is the data volume size. Then, matrix multiplication is performed between B and the transpose of A, and a softmax layer is applied to calculate the spatial attention map As shown in the following formula (7):

[0063]

[0064] where, s ji represents the influence of position i th on position j th . The more similar the feature representations of two positions are, the greater the correlation between them. exp represents calculating the dot product of A i and B j , and then taking the exponent. A i and B j represent the i-th row of feature A and the j-th column of feature B. At the same time, the data D * is input into the convolutional layer to generate a new map and it is reshaped into Then, matrix multiplication is performed between C and the transpose of S, and the result is reshaped into Finally, it is multiplied by a scale parameter α, and element-wise summation operation is performed with the data D * to obtain the final output As shown in the following formula (8):

[0065]

[0066] Among them, α is initialized to 0 and gradually learns and assigns more weights. C i is the i-th row of feature C, is the value of the original data at the j-th position. It can be inferred from formula (7) that the feature at each extracted position is the weighted sum of the features existing in all vectors and the original features. Therefore, this module can well handle the correlation of data before and after in a long sequence.

[0067] At the same time, the variable-length sequence is different from the fixed-size image data. The change in its length represents the amount of data information. Therefore, a length parameter δ is assigned based on formula (8) to assign an initial weight based on the amount of information of the current trajectory and gradually learn to assign more weights in the follow-up. As shown in the following formula (9):

[0068]

[0069] Among them, C i is the i-th row of feature C, is the value of the original data at the j-th position. Therefore, the attention feature output by the position attention module is obtained.

[0070] For the channel attention module, each feature in the multivariate time series can be regarded as each class separately, and there is still a correlation between each class. For example, the current and voltage features in electronic circuit data, and the speed and heading features in ship data. In this study, it can be known from real-life scenarios that the speed and heading features are strongly correlated. When the ship turns, its speed is usually low. Similarly, when the ship goes straight, its speed is usually high. Therefore, according to this characteristic, the feature relationship in different features can be extracted, and a channel attention module is established to extract the relationship in different features. Different from the position attention module, in order to model the correlation relationship between different channels, and the channel C is defaulted to 1, so directly from the data Calculate the channel attention map Specifically, reshape D * into Then perform matrix multiplication on the transpose of D * and D * , and finally, apply the softmax layer to obtain the channel attention mapping As shown in the following formula (10):

[0071]

[0072] Among them, m ji measures the influence of channel i th on channel j th . exp represents the calculation and take the dot product and then take the exponent. and represent the i-th row and j-th column of data D * Furthermore, perform matrix multiplication between M and the transpose of D * and reshape the result into as shown in the following formula (11):

[0073]

[0074] where β gradually learns the weights from 0. and represent the i-th row and j-th column of data D * T represents the number of features of data D * Formula (10) indicates that the final feature in each dimension of the multivariate time series data is the weighted sum of all features and the original features. It models the relationship between each feature and helps improve the discriminability of the features.

[0075] Therefore, the attention feature output by the channel attention module is obtained. At this time, the outputs of the position attention module and the channel attention module are concatenated, as shown in the following formula (12), and input into the shared-weight FFN layer for further feature extraction.

[0076] F = Concat(O, E) (12)

[0077] where Concat represents concatenating the features O and E dimensionally, and F represents the output feature after concatenation. In Figure 1 , to more clearly show the network structure and the data processing flow, RL-DAN is embodied in the form of two branches. In actual training and testing, following the idea of the Siamese network, only one of the branches is retained, and the input data is processed by this branch respectively. At the same time, attempts have also been made to use two independent branches to process the features of each branch separately, but the results are not much different from those using only one branch. Therefore, it is effective to use only one branch to process the data of each sub-trajectory successively in actual operation.

[0078] 5. Construct a parameter-sharing feedforward layer (Siamese-FFN).

[0079] Siamese networks can be very effective when the inputs to a neural network are similar. Siamese networks are implemented by sharing weights. When extracting features of the same attribute, if two neural networks are used to extract features from data respectively, the features extracted are very likely not in the same distribution domain. At this time, the Siamese neural network can extract features of two input data in the same distribution domain, and then the similarity of the two input images can be judged. The main advantage of the Siamese neural network is that it weakens the labels, making the network have good scalability and being able to learn effective feature representations from a small amount of data.

[0080] Based on this idea, the present invention proposes a parameter-sharing FFN layer (Siamese-FFN). For efficiency considerations, the speed and heading features of each trajectory are simultaneously input into the aforementioned RL-DAN, and the output results are input into the parameter-sharing FFN layer to integrate the feature information extracted from the two trajectories and extract them into the same distribution domain, as shown in the following formula (13):

[0081] FFN Siamese (x 1 ,x 2 ) = W(x 1 ,x 2 ) + b = W(F 1 ,F 2 ) + b (13)

[0082] Among them, x 1 ,x 2 or F 1 ,F 2 respectively represent the feature vectors of the speed and heading of the two trajectories input into the RL-DAN, W represents the weight, and b represents the bias.

[0083] Meanwhile, its output is concatenated with the output of the Encoder layer and input into the final output layer to obtain the final output result, as shown in the following formula (14):

[0084] Output = W × Concat(FFN Encoder + FFN Siamese ) + b (14)

[0085] Among them, Output represents the output judgment result, FFN Encoder and FFN Siamese respectively represent the operations of (6) and (14). W represents the weight, and b represents the bias.

[0086] 6. Construct a new ship wake selection and detection model

[0087] The present invention uses a Transformer encoder as the basic model and incorporates the previously proposed Encoder module, RL-DAN module, and Siamese-FFN module into it. The overall structure of the network is as shown in Figure 1 Figure []. The present invention introduces the Encoder module to the very front end of the network, which first performs the first feature extraction on the input data. It extracts the spatial features of the trajectory and additional speed and heading features, enabling the model to better perceive the changes in the trajectory. Secondly, the present invention introduces the RL-DAN module to the very end of the feature pyramid. It enables the model to complete the fusion of high-dimensional features and low-dimensional features before the final detection, preventing the deep network from ignoring the low-dimensional edge features. Finally, the present invention introduces Siamese-FFN into the loss function for calculating feature fusion. It uses more comprehensive constraint conditions to improve the accuracy of the model's prediction of trajectory similarity.

[0088] After that, the effectiveness of the solution proposed by the present invention is evaluated.

[0089] 1. Experimental Environment and Evaluation Metrics

[0090] In the embodiment of the present invention, the training of the model runs on a server with an Intel Xeon Gold 6132 CPU and an NVIDIA Tesla V100 GPU; all other experiments run on a PC with an Intel Core i5-8750H CPU, an NVIDIA GeForce 1060 GPU, and 16G of memory. This example uses the HN_TM dataset and the ETData dataset as the benchmark datasets for training and testing. The HN_TM dataset is a private dataset constructed for ship trajectory break judgment, containing ship trajectory data in the waters around Hainan Province. The ETData dataset is a publicly available electric taxi trajectory dataset, containing 1,155,654 GPS data of 664 taxis in Shenzhen on a single day. The definitions of these metrics are as follows: The present invention divides it according to the ratio of training set: validation set: test set of 7:2:1.

[0091] The present invention uses Accuracy, Recall, Precision, and F1-score as comprehensive performance evaluation metrics.

[0092] The meaning of accuracy is the proportion of data samples with correct network prediction results and true results among all sample numbers, as shown in the following formula (15):

[0093]

[0094] Among them, TP represents True Positive, which refers to the situation where the true label of the data is a positive example and the prediction result is also a positive example. TN represents True Negative, which refers to the situation where the true label of the data is a negative example and the network prediction result is also a negative example. FP is the opposite of TP, where the true value of the data is a positive example but the prediction result is a negative example. Similarly, FN is the opposite of TN.

[0095] The meaning of Precision is the proportion of actual positive samples among the samples where the network prediction result is positive and the true label is positive, as shown in the following formula (16):

[0096]

[0097] The meaning of Recall is the proportion of samples with true prediction results in all samples with true labels in the network prediction results, as shown in the following formula (17):

[0098]

[0099] The meaning of the F1 value (F1-Score) is a weighted average of Precision and Recall, as shown in the following formula (18):

[0100]

[0101] It can be seen from the above formulas that for the Precision index, the value reflects the discrimination ability of the network model for samples with negative labels. The higher the Precision index, the stronger the discrimination ability of the network model for samples with negative labels; on the contrary, it can be known that the value of the Recall index reflects the discrimination ability of the network model for samples with positive labels. The higher the Recall, the stronger the recognition ability of the network model for samples with positive labels. To sum up, it can be known that the F1-score index is a combination of the above two indexes. The higher the F1-score, the more robust and reliable the model is.

[0102] 2. Performance Index Analysis

[0103] To verify the effectiveness of the algorithm proposed in the present invention, the method of the present invention is compared with existing trajectory similarity calculation and time-series trajectory classification methods, including models such as ED, DTW, ResNet, DA-Net, MF-Net, TimesNet, DKN, and Z-time. The experimental results of these models are shown in Table 2.

[0104] Table 2 Results Obtained by Each Network Using the HN_TM Dataset and the ETData Dataset

[0105]

[0106] As can be seen from the table, the model of the present invention outperforms other methods in terms of the indicators of Accuracy, Recall, Precision, and F1-score on the HN_TM dataset and the ETData dataset. In particular, on the HN_TM dataset, the Accuracy of the present invention reaches 96.35%, which is 5.21% higher than that of Z-time, the second place. On the ETData dataset, the Accuracy of the present invention reaches 95.87%, which is 4.43% higher than that of Z-time, the second place.

[0107] 3. Analysis of actual detection effect

[0108] To better demonstrate the recognition ability of this method, taking the HN_TM dataset as an example, samples with 3 sub-trajectories being the same trajectory and samples with 2 sub-trajectories not being the same trajectory are respectively plotted. Figure 3 (a), to clearly show the positions of two different sub-trajectories on the graph, the first sub-trajectory is highlighted in red and the second sub-trajectory is highlighted in blue. The sub-trajectories corresponding to the first three pictures belong to the same trajectory, and the sub-trajectories corresponding to the last two pictures do not belong to the same trajectory. Figure 3 (b)-(g), the samples highlighted in red represent the samples whose sub-trajectories are determined by the network result to be the same trajectory, and the samples highlighted in blue represent the samples whose sub-trajectories are determined by the network result not to be the same trajectory.

[0109] From Figure 3 the first three rows, it can be clearly seen that the two sub-trajectories belong to the same trajectory. The two sub-trajectories in the fourth and fifth rows do not belong to the same trajectory, but they are still close in geographical location, so the network is likely to misidentify them as belonging to the same trajectory. Each of these five trajectories is input into each network for detection, and then the detection results are redrawn and presented. From the obtained detection results, it can be seen that the network of the present invention accurately identifies whether different sub-trajectories belong to the same trajectory. At the same time, DA-Net, MF-Net, and DKN all show different degrees of misjudgment and missed judgment, while TimesNet and Z-time both show different degrees of misjudgment. The above experimental results prove the superiority of the network proposed by the present invention.

[0110] 4. Effectiveness analysis (ablation experiment)

[0111] To verify the effectiveness of each module proposed in the present invention, ablation experiments were conducted. The experimental results show that the Encoder module, RL-DAN module, and Siamese-FFN module can all effectively improve the performance of the model. When these modules are combined, the model's Accuracy, Recall, Precision, and F1-score metrics all reach the optimal values, as shown in Table 3.

[0112] Table 3. Ablation experiments conducted on the HN_TM dataset

[0113]

[0114] The above experimental results show that the trajectory break judgment method based on the encoder and variable-length double-attention siamese module proposed in the present invention has excellent robustness and generalization in complex marine environments, can effectively address issues such as uneven trajectory sampling rates and noisy sampling points, and significantly improves the accuracy and stability of trajectory break judgment.

[0115] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the present invention is limited to these examples; under the concept of the present invention, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present invention as described above, which are not provided in detail for the sake of brevity. Any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A trajectory break judgment method based on indefinite length double attention twins, characterized in that: The following steps are involved: S1, preprocessing and normalizing the input ship AIS and radar text data; S2, stitching together the longitude and latitude information of two or more trajectories, passing the stitched data through the Embedding layer and inputting it into the Encoder, and extracting feature information from the data through the multi-head attention mechanism; S3, input the headings of two or more trajectories into the dual attention mechanism of indefinite length sequence, use ResNet50 as the backbone network of RL-DAN, extract the basic features in the data, send them into the dual attention mechanism, splice the two outputs of the dual attention mechanism, and obtain the spliced ​​output features; S4, the output features after splicing are input into the parameter-sharing FFN layer, and the feature information extracted from the entire two or more trajectories is extracted into the same distribution domain; S5. Concatenate the integrated output with the output of the Encoder layer to obtain the final output result.

2. The trajectory fracture judgment method based on indefinite length double attention twins according to claim 1 is characterized in that: Step S1 specifically includes: preprocessing and normalizing the input ship AIS and radar text data into text data of 1506 length.

3. The trajectory fracture judgment method based on indefinite length double attention twins according to claim 1 is characterized in that: Step S2 specifically includes: The latitude and longitude data of two or more input trajectories are spliced ​​together to obtain D, where V is the length of the input sequence, taking the maximum value of the two trajectories, and T is the number of features; Sine and cosine functions are used to encode the point sequence position. For the data of the i-th point on the trajectory, e is added i,j To update, as shown below: D[i,j]=D[i,j]+e i,j Where D[i,j] represents the element in the i-th row and j-th column of the matrix D, i represents the i-th point in the trajectory, j represents the feature dimension, and d p is a constant representing the total number of feature dimensions, j / d p and (j―1) / d p is the scaling factor used for position encoding; The concatenated data is passed through the Embedding layer and input into the Encoder. Three linear layers with unshared parameters are used to convert the input data matrix into query, key, and value matrices, and multi-head attention is performed to extract feature information from the data.

4. The trajectory fracture judgment method based on indefinite length double attention twins according to claim 3 is characterized in that: The method further comprises: After the multi-head attention layer, the obtained features are input into the position feed-forward network for better feature extraction.

5. The trajectory fracture judgment method based on indefinite length double attention twins according to claim 1 is characterized in that: In step S3, the dual attention mechanism includes a position attention module and a channel attention module, and the feature extraction process of the position attention module includes: Given a data First, it is sent to the convolutional layer to generate two new feature maps A and B, where Reshape it into Where N = V × T is the amount of data; Perform matrix multiplication between B and the transpose of A and apply a softmax layer to compute the spatial attention map At the same time, the data D * Input into the convolutional layer to generate a new mapping and reshape it into Then perform matrix multiplication between the transpose of C and S and reshape the result into Finally, it is multiplied by a scale parameter α and combined with the data D * Perform element-by-element summation to get the final output 6. The trajectory fracture judgment method based on indefinite length double attention twins according to claim 5 is characterized in that: Step S3 also includes: In the final output Based on the formula of , a length parameter δ is assigned to give an initial weight based on the amount of information in the current trajectory, and more weights are assigned in the subsequent learning.

7. The trajectory fracture judgment method based on indefinite length double attention twins according to claim 5 is characterized in that: In step S3, the feature extraction process of the channel attention module includes: D * Reshape D * The transpose of D * Perform matrix multiplication and apply a softmax layer to obtain the channel attention map In M and D * Perform matrix multiplication between the transposes of and reshape the result into Get the attention features output by the channel attention module.

8. A track fracture analysis device based on indefinite length double attention twins, characterized in that: Applied to executing the trajectory fracture analysis method as described in any one of claims 1 to 7, the analysis device adopts the Transformer encoder as the basic model, and introduces the Encoder module, the RL-DAN module and the Siamese-FFN module, wherein the Encoder module is located at the front end of the network, and first performs the first feature extraction on the input data, the RL-DAN module is located at the end of the feature pyramid, so that the model completes a fusion of high-dimensional features and low-dimensional features before performing the final detection, and the Siamese-FFN is introduced into the loss function for the calculation of feature fusion.