A trajectory similarity measurement method based on multi-channel feature learning

By using a multi-channel convolutional neural network with multi-channel feature learning and attention mechanisms, multi-dimensional features of trajectories are extracted, solving the problems of insufficient feature extraction and complexity in existing trajectory similarity measurement methods, and achieving more accurate trajectory similarity measurement.

CN117034025BActive Publication Date: 2026-03-27SOUTHWEAT UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-12
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing trajectory similarity measurement methods suffer from problems such as insufficient feature extraction, neglect of trajectory shape, high computational complexity, and large memory overhead, making it difficult to effectively capture the multidimensional and shape features of trajectories.

Method used

A multi-channel feature learning method is adopted, which extracts the number of trajectories, the length of trajectory segments, time features and directional angle features, and combines them with a multi-channel convolutional neural network with an attention mechanism to perform deep learning to obtain multi-dimensional features of the trajectory.

Benefits of technology

It achieves a more accurate trajectory similarity measurement, improves the accuracy and efficiency of trajectory similarity measurement, and overcomes the complexity of traditional methods and the problem of insufficient feature extraction in deep learning methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117034025B_ABST
    Figure CN117034025B_ABST
Patent Text Reader

Abstract

The application discloses a trajectory similarity measurement method based on multi-channel feature learning, pre-processes trajectory data, transforms coordinates and enhances data, obtains a trajectory positive and negative sample pair, extracts a trajectory point number feature, a trajectory segment length and time feature and a trajectory direction angle feature, splices the features to obtain a multi-channel feature map, performs deep learning on the multi-channel feature map of the trajectory by using a multi-channel convolutional neural network containing an attention mechanism, and finally outputs a similarity score of the trajectory. The application can effectively extract multi-channel features, time sequence information and capture trajectory shapes of trajectory data, improve the accuracy of trajectory similarity measurement, and provides a new method and approach for trajectory similarity measurement.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of Internet of Vehicles, and in particular relates to a trajectory similarity measurement method based on multi-channel feature learning. BACKGROUND

[0002] Under the background of rapid development of Internet of Vehicles, trajectory similarity measurement is attracting much attention. Trajectory similarity measurement is an effective basis for judging vehicle user behavior. If the trajectory similarity between different users is high, it means that there are similar behaviors between users. Trajectory similarity measurement can provide practical value and theoretical significance for trajectory clustering, traffic analysis, vehicle trajectory behavior detection, malicious user identification, trajectory privacy protection, etc.

[0003] In the trajectory similarity measurement method, the research technology mainly falls into two categories. One is the traditional method, which is characterized by analyzing the data relationship, logical relationship, spatio-temporal characteristics, semantic features, and speed, acceleration, curvature, etc. of the trajectory between trajectories, setting similarity measurement indicators, and the main methods are Hausdorff distance, LCSS (Longest Common Subsequence), DTW (Dynamic Time Warping), EDR (Edit Distance) and Frechet distance. The other method is the trajectory similarity measurement method based on deep learning, mainly including contrastive learning, convolutional neural network, recurrent neural network and variants of recurrent neural network, etc.

[0004] Currently, relevant scholars have explored trajectory similarity measurement based on deep learning. Liu et al. [Xiang L., Tan X., Guo Y., et al. CSTRM: Contrastive Self-Supervised Trajectory Representation Model for Trajectory Similarity Computation[J]. Computer Communications, 2022, 185: 159-167] proposed a contrastive self-supervised trajectory representation model, which uses point-level features and trajectory-level features of trajectories, uses the variant GRU (Gated Recurrent Unit) of recurrent neural network (RNN) to represent the vector of trajectory features, and calculates the similarity between trajectories. This method is similar to the idea of RNN, focusing on extracting time sequence information, but it is difficult to capture the global features of trajectories and ignores the shape features of trajectories.

[0005] Cao et al. [Cao H., Tang H., Wu Y., et al. On Accurate Computation of Trajectory Similarity via Single Image Super Resolution[C]. International Joint Conference on Neural Networks, 2021.] introduced computer vision technology to capture the spatial patterns of trajectories by converting trajectories into images (TrajSR) for embedding. However, the transformed image is a grayscale image, where the pixel value only contains the number of trajectory points, and other features of the trajectory are not fully expressed. Moreover, the use of single-precision grayscale images loses the original features of the trajectory.

[0006] Although the existing related methods can measure the similarity between trajectories to some extent, there are some problems: first, most traditional methods calculate the distance between trajectory points as the similarity of trajectories, lack of multi-dimensional data feature extraction of trajectories, the measurement process is cumbersome, the memory overhead is large, and the time complexity is high; second, in the deep learning method, RNN, GRU, LSTM is the feature learning of discrete trajectory points, which gets the feature representation of the trajectory, depends on the trajectory position and time sequence information, and lacks comprehensive description and effective extraction of the trajectory shape; third, in the deep learning method, the trajectory is converted into a single-channel grayscale image, and the latitude and longitude information of the trajectory point is used as the channel of the image, the trajectory feature representation is single, the trajectory multi-dimensional information loss is large, and the correlation between trajectory points is not fully considered. Therefore, in the similarity measurement of trajectories, not only the time sequence information of the trajectory should be considered, but also the shape feature of the trajectory and the attention relationship between multi-channel features should be considered to effectively measure the similarity of the trajectory. SUMMARY

[0007] The present application aims to overcome the shortcomings of the prior art, and in view of the complexity of the existing trajectory similarity measurement method, the insufficiency of feature extraction, and the problem of focusing on time sequence information while ignoring trajectory shape, a trajectory similarity measurement method based on multi-channel feature learning is provided. In the face of massive and high-dimensional trajectory data, the method can effectively extract multi-dimensional trajectory features and more accurately capture the similarity between trajectory shapes, achieving trajectory similarity measurement with better accuracy.

[0008] In order to achieve the above-mentioned application purpose, the present application provides a trajectory similarity measurement method based on multi-channel feature learning, the specific steps are as follows:

[0009] S1: Obtain the trajectory dataset, pre-process the data, transform the coordinates, and enhance the data to obtain the trajectory positive and negative sample pairs;

[0010] S2: Map each trajectory to an n×n grid, and extract the statistical features of the number of trajectory points, the fusion features of trajectory segment length and time features, and the features of trajectory direction angle to obtain a multi-channel n×n feature map;

[0011] S3: Construct a multi-channel convolutional neural network with an attention mechanism to perform deep learning on the multi-channel feature map of the trajectory;

[0012] S4: Load the paired trajectory multi-channel feature maps into the multi-channel convolutional neural network in S3, train and optimize the network, and save the trained network model.

[0013] S5: Test the trained model and output the similarity score between trajectory pairs.

[0014] As a further optimization of the present invention, in step S1, the trajectory is preprocessed by truncating each trajectory into a sequence of trajectory points with the same number of points, as follows:

[0015]

[0016] in, This indicates the number of points in the trajectory. They represent The first in the trajectory The longitude, latitude, and time of each trajectory point;

[0017] Then, perform coordinate transformation on the latitude and longitude values ​​of each trajectory to convert them to Cartesian coordinates. , The value is calculated as follows:

[0018]

[0019] Where R represents the Earth's equatorial radius, with a value of 6,371,000.0 meters. , These are the x-coordinate and y-coordinate values ​​of the trajectory points, respectively. The trajectory after coordinate transformation is represented as follows:

[0020] ;

[0021] Data augmentation is performed on the coordinate-transformed trajectories using a trajectory point sampling augmentation method. Each trajectory is augmented twice to obtain augmented trajectory 1 and augmented trajectory 2. Augmented trajectories of the same trajectory are positive sample pairs, while augmented trajectories of different trajectories are negative sample pairs. The set of positive sample pairs is... Represented as:

[0022]

[0023] wherein, , denote the enhanced trajectory pair of the th trajectory, denote the number of trajectories in the original data set, and the set of trajectory negative sample pairs denote:

[0024]

[0025] wherein, denote the enhanced trajectory 1 of the th and th trajectory, denote the enhanced trajectory 2 of the th and th trajectory.

[0026] As a further optimization scheme of the present application, in step S2, the multi-channel feature map is processed as follows:

[0027] The trajectory space coordinates are divided into grid, and each trajectory point in the trajectory is mapped to the position in the grid, which is calculated as follows:

[0028]

[0029] wherein, , and are the minimum horizontal coordinate value and the minimum vertical coordinate value in the trajectory point, and are the horizontal coordinate value and the vertical coordinate value of the th point in the trajectory, and are the width and the height of the unit grid, which are calculated as follows:

[0030]

[0031] wherein, n is the grid size, and are the maximum horizontal coordinate value and the maximum vertical coordinate value in the trajectory point;

[0032] The trajectory feature value is extracted to generate a channel feature map, and each channel feature is calculated as follows:

[0033] The first channel feature is a matrix with a size of , and the calculation method is as follows:

[0034] 1) Construct a feature matrix with a size of , let each feature initial value be 0;

[0035] 2) let the iteration number be ;

[0036] 3) let the trajectory point serial number be ;

[0037] 4) count the number of features in the feature matrix at the position ; , calculate as:

[0038]

[0039] wherein, is the th feature value at the position in the feature matrix; when , ; ;

[0040] 5) judge whether satisfies , if yes, go to step 6); if no, go to step 7);

[0041] 6) let , , return to step 4);

[0042] 7) perform maximum-minimum normalization on the feature matrix obtained in the last iteration , to obtain the first channel feature map , and the normalization method is:

[0043]

[0044] wherein, represents the th feature value in the feature matrix obtained in the last iteration, ; and are the maximum value and the minimum value of the elements in the feature matrix obtained in the last iteration, represents the th feature value in the feature map ;

[0045] The second channel feature contains trajectory segment length feature and time feature; the trajectory segment length feature of the trajectory point is the trajectory segment length of the trajectory point ​adjacent trajectory points and The sum of the distances between them The calculation method is as follows:

[0046]

[0047] trajectory points Time characteristics It is a trajectory point Trajectory point at the next moment The time difference between them The calculation method is as follows:

[0048]

[0049] For each trajectory, the trajectory segment length feature and time feature are subjected to max-min normalization: the trajectory segment length feature normalization method is as follows:

[0050]

[0051] in, It is a trajectory point The normalized trajectory segment length feature, and These are the maximum and minimum values ​​of the trajectory segment length feature of the trajectory points, respectively;

[0052] The time feature normalization method is as follows:

[0053]

[0054] in, It is a trajectory point The normalized time characteristics, and These are the maximum and minimum values ​​of the time characteristics of all trajectory points in the trajectory, respectively;

[0055] Second channel features , for size A matrix of size Trajectory segment length feature matrix and size are Time feature matrix The result is obtained by addition, and the calculation method is as follows:

[0056] 1) Construction Feature matrix, size ,make , , Each feature in the matrix is ​​initialized to 0;

[0057] 2) Let the number of iterations be... ;

[0058] 3) Let the trajectory point number ;

[0059] 4) Calculate the trajectory points Trajectory segment length features and update The method for determining the value at the corresponding position in the matrix is ​​as follows:

[0060]

[0061] in, yes In the characteristic matrix Location The eigenvalue of the order, when hour, ;

[0062] 5) Calculate the trajectory points Time characteristics and update The method for determining the value at the corresponding position in the matrix is ​​as follows:

[0063]

[0064] in, yes In the characteristic matrix Location The time characteristics of each. hour, ;

[0065] 6) Fusion of trajectory length features and temporal features as... The characteristics of a matrix are defined by the following method:

[0066]

[0067] 7) Judgment Does it meet the requirements? If yes, proceed to step 8; if no, proceed to step 9.

[0068] 8) Order , (Return to step 4)

[0069] 9) The feature matrix obtained in the last iteration Perform min-max normalization to obtain the second channel feature map. The normalization method is as follows:

[0070]

[0071] where, is the kth eigenvalue of the feature matrix obtained in the last iteration, ; and are the maximum and minimum values of the elements in the feature matrix obtained in the last iteration, is the kth eigenvalue of the feature map ;

[0072] The third channel feature is the trajectory direction angle feature, and the direction angle feature of the trajectory point is obtained by the vector angle between the trajectory point and the previous and next trajectory points , , Separate time information, the calculation method of the direction angle feature is as follows:

[0073]

[0074] where, is the modulus of the trajectory point and the trajectory point , is the modulus of the trajectory point and the trajectory point , is the coordinate difference of the trajectory point and the trajectory point , is the coordinate difference of the trajectory point and the trajectory point , denotes the dot product;

[0075] The maximum and minimum normalization is performed on the trajectory point direction angle feature of each trajectory, and the method is as follows:

[0076]

[0077] where, is the normalized direction angle feature of the trajectory point , and are the maximum and minimum values of the trajectory point direction angle feature of the trajectory, respectively;

[0078] The third channel feature is a matrix with a size of , and the calculation method is as follows:

[0079] 1) Construct ​Feature matrix, size , let Each feature initial value in the matrix is 0;

[0080] 2) Let the number of iterations ;

[0081] 3) Let the trajectory point number ;

[0082] 4) Calculate the time feature of the trajectory point , and update the value of the corresponding position in the feature matrix, denoted as:

[0083]

[0084] Wherein, is the th eigenvalue of the position in the feature matrix , , ;

[0085] 5) Determine whether satisfies , if yes, go to step 6), if not, go to step 7);

[0086] 6) Let , , return to step 4);

[0087] 7) The feature matrix obtained by the last iteration is subjected to maximum and minimum normalization processing, and is taken as the third channel feature, to obtain the third channel feature map , and the normalization method is:

[0088]

[0089] Wherein, represents the th eigenvalue in the feature matrix obtained by the last iteration; and are the maximum value and the minimum value of the elements in the feature matrix obtained by the last iteration, represents the th eigenvalue in the feature map ;

[0090] Splice , , Three channel features to obtain a feature map with a size of​ feature maps, where 3 and are the number of channels and size of the trajectory feature map, respectively.

[0091] As a further optimization scheme of the present application, in step S3, a multi-channel convolutional neural network containing an attention mechanism is constructed, containing three parts, namely a convolutional pooling layer, an attention layer, and a fully connected layer. The specific process is as follows:

[0092] S301: Convolutional pooling layer: this layer includes five modules, the first module performs convolution, regularization, and nonlinear activation operation, the second, third, and fourth modules all contain convolution, regularization, nonlinear activation, and pooling operation, and the fifth module performs convolution, regularization, and nonlinear activation operation.

[0093] In the first module, the input multi-channel feature map is convolved using m1 h1xh1-dimensional convolution kernels, and regularization processing is performed, followed by nonlinear activation function activation, obtaining m1 k1xk1-dimensional feature maps;

[0094] In the second module, m2 h2xh2-dimensional convolution kernels are used for convolution, and regularization processing is performed, and nonlinear activation function activation, obtaining m2 k2xk2-dimensional feature maps, and then through the maximum pooling layer, the k2xk2-dimensional feature maps output by convolution are evenly divided into k3xk3 sub-regions, and the maximum value of each sub-region is down-sampled to generate m2 k3xk3-dimensional feature maps;

[0095] In the third module, m3 h3xh3-dimensional convolution kernels are used for convolution, and regularization processing is performed, and nonlinear activation function activation, obtaining m3 k4xk4-dimensional feature maps, and then through the maximum pooling layer, the k4xk4-dimensional feature maps output by convolution are evenly divided into k5xk5 sub-regions, and the maximum value of each sub-region is down-sampled to generate m3 k5xk5-dimensional feature maps;

[0096] In the fourth module, m4 h4xh4-dimensional convolution kernels are used for convolution, and regularization processing and nonlinear activation function activation, obtaining m4 k6xk6-dimensional feature maps, and then through the maximum pooling layer, the k6xk6-dimensional feature maps output by convolution are evenly divided into k7xk7 sub-regions, and the maximum value of each sub-region is down-sampled to generate m4 k7xk7-dimensional feature maps;

[0097] In the fifth module, m5 h5xh5-dimensional convolution kernels are used for convolution, and regularization processing is performed, followed by nonlinear activation function activation, obtaining m5 k8xk8-dimensional feature maps;

[0098] S302: The attention layer includes the channel attention layer and the spatial attention layer;

[0099] In the channel attention layer, the specific steps are as follows:

[0100] The first layer performs average pooling and max pooling operations on the input feature map, calculating the mean and maximum values ​​of m5 channels, generating a dimension of... The first layer is a tensor; the second layer is a convolutional layer, which yields... The tensor, added in the third layer The activation function, the fourth layer is a convolution operation, resulting in a dimension of Tensors; the fifth layer adds The activation function is used to calculate the channel attention; the sixth layer multiplies the channel attention output from the fifth layer with the feature map output from the fifth module of S301 to obtain... The formula for the channel attention layer is as follows:

[0101]

[0102]

[0103]

[0104] in, These are the input features of the first layer in the channel attention layer. and These represent global average pooling and global max pooling, respectively. and It is a learnable convolutional kernel. and It is a learnable parameter matrix. express function, Indicates a modified linear unit. It is the output of the channel attention layer;

[0105] In the spatial attention layer, the specific steps are as follows:

[0106] The first layer contains an average pooling layer and a max pooling layer, which calculate the mean and maximum value of the input along the k8×k8 dimension to obtain the channel dimension. The first layer is a tensor; the second layer is pooling concatenation, which connects the mean feature map and the maximum feature map along the channel dimension to generate... The third layer is a convolutional layer, and the shape of the output tensor is... Add to the fourth layer The activation function is used to calculate spatial attention, resulting in... tensor, the fifth layer multiplies the tensor output by the fourth layer with the input of the first layer, and outputs tensor; the formula expression of the spatial attention layer is as follows: tensor; the formula expression of the spatial attention layer is as follows:

[0107]

[0108]

[0109] wherein, is the input feature of the first layer in the spatial attention layer, and respectively represent average pooling and maximum pooling, is a learnable convolution kernel, represents a function, represents a rectified linear unit, is the output of the spatial attention layer;

[0110] S303: full connection layer: the first layer concatenation layer flattens the data dimension to , that is, there are neurons, after the second layer linear transformation, there are neurons, the third layer nonlinear excitation function , the fourth layer adds , the fifth layer linear transformation obtains feature values, the sixth layer activation function, to obtain the trajectory similarity score.

[0111] As a further optimization scheme of the present application, in step S4, the network is trained and optimized, and the specific steps are as follows:

[0112] S401: divide the trajectory data into a training set and a test set, convert it into tensor format data, and initialize the model weight parameters;

[0113] S402: input the trajectory pair after splicing into the model, extract the multi-channel feature map, calculate the error between the network output value and the actual value, and adjust the weight matrix by the method of minimizing the loss function, and update the parameters;

[0114] S403: repeat the iterative training until the loss function of the model gradually decreases and tends to be stable, the accuracy and F1 score value indicators rise and tend to be stable, stop training, and save the model.

[0115] As a further optimization scheme of the present application, in step S402, the loss function expression is:

[0116]

[0117] wherein and are a similarity measure value vector and a pseudo label vector, respectively, represents the i-th similarity measure value, represents the i-th pseudo label, represents the i-th similarity measure value, represents the i-th pseudo label, is a binary cross-entropy loss function, which calculates the difference between the similarity score of the positive and negative sample pairs and the pseudo label, and reversely propagates the parameters to optimize the model.

[0118] The present application adopts the above technical method, compared with the prior art, introduces a multi-feature channel learning model to realize the similarity measurement of the trajectory, and compared with the prior art, the present application has the advantages that:

[0119] 1) The features of three channels of the trajectory number feature, the trajectory segment length and time feature, and the trajectory direction angle feature are fused, compared with the features extracted by the method of extracting single channel features, the features are more comprehensive and can effectively represent the trajectory features;

[0120] 2) The attention mechanism is introduced in the multi-channel feature model, which highlights the important areas between the trajectory points and suppresses the unimportant areas, can better solve the shape of the pursuit trajectory, overcome the problem of insufficient feature extraction of the trajectory, and improve the accuracy of the trajectory similarity measurement. BRIEF DESCRIPTION OF DRAWINGS

[0121] Figure 1 is a specific implementation flowchart of the trajectory similarity measurement method based on the multi-channel feature learning of the present application;

[0122] Figure 2 is a specific framework flowchart of the trajectory similarity measurement method based on the multi-channel feature learning of the present application;

[0123] Figure 3 is a specific implementation flowchart of the multi-channel feature network model in the present application;

[0124] Figure 4 is an accuracy comparison chart of the present application and the comparison method on the Geolife dataset;

[0125] Figure 5 is an F1 score value comparison chart of the present application and the comparison method on the Geolife dataset;

[0126] Figure 6 is an accuracy comparison chart of the present application and the comparison method on the Portugal dataset;

[0127] Figure 7 is an F1 score value comparison chart of the present application and the comparison method on the Portugal dataset; DETAILED DESCRIPTION

[0128] In order to better illustrate the technical effects of the present application, the specific embodiments of the present application are described below in conjunction with the accompanying drawings, so that those skilled in the art can better understand the present application. It needs to be specially reminded that in the following description, when the detailed description of known functions and designs may dilute the main content of the present application, these descriptions will be omitted here.

[0129] EMBODIMENT

[0130] Figure 1 is a specific embodiment flowchart of a trajectory similarity measurement method based on multi-channel feature learning of the present application; two actual trajectory data sets are taken as examples to test the trajectory similarity measurement method of the present application and two comparative methods. The specific steps of the trajectory similarity measurement method based on multi-channel feature learning of the present application are as follows:

[0131] S1: Obtain a trajectory data set, pre-process the data, transform the coordinates, and enhance the data to obtain a trajectory positive and negative sample pair, and the process includes the following steps:

[0132] Step one: Obtain a trajectory data set

[0133] The trajectory data set includes a Geolife data set and a Portugal data set. The Geolife is the vehicle trajectory data of 182 users collected by the Geolife project of Microsoft Asia Research from April 2007 to August 2012. The GPS trajectory of the data set is represented by a series of timestamp points, each point contains the information of latitude and longitude, and the data set contains a total of 17621 trajectories, a total distance of 1292951 kilometers, a total duration of 50176 hours, and a sampling time interval of 5 seconds. The Portugal data set is the urban mobile data of GPS trajectory and Wi-Fi fingerprint data collected by the University of Porto and Portugal Telecom Company, which contains the movement trajectories of 442 taxis in the city of Portugal, covering a two-month time span (from September 2013 to November 2013), a total of 1710670 trajectories, and a sampling interval of 15 seconds.

[0134] Step two: trajectory data pre-processing

[0135] Filter the data with too few trajectory points in the two data sets, and process each trajectory into a sequence with the same number of trajectory points by the truncation method, represented as:

[0136]

[0137] wherein, represents the number of trajectory points in the trajectory, In the data set, , in the city of Porto, Portugal dataset, , respectively represent the longitude value, latitude value and time of the i-th trajectory point in the trajectory; Step three: coordinate conversion

[0138] For each trajectory, the longitude and latitude values are converted into x and y values in the Cartesian coordinate system, and the calculation method is as follows:

[0139] wherein R represents the equatorial radius of the earth, and the value is 6371000.0 meters,

[0140]

[0141] wherein x and y respectively represent the horizontal coordinate value and the vertical coordinate value of the trajectory point, and the trajectory after coordinate conversion is represented as:

[0142]

[0143] Step four: data augmentation

[0144] The trajectory after coordinate conversion is augmented, and the augmentation method of trajectory point sampling is used. After twice augmentation of each trajectory, augmented trajectory 1 and augmented trajectory 2 are obtained. The augmented trajectories of the same trajectory are positive sample pairs, and the augmented trajectories of different trajectories are negative sample pairs. The positive sample pair set is represented as:

[0145]

[0146] wherein n represents the number of trajectories in the original dataset, and the negative sample pair set of trajectories is represented as: wherein

[0147] respectively represent augmented trajectory 1 of the i-th trajectory and the j-th trajectory, respectively represent augmented trajectory 2 of the i-th trajectory and the j-th trajectory.

[0148]

[0149] S2: extract each trajectory mapped in the ​​​​​​​​​​​​​The number of trajectory points in the large and small grids is used to extract the distance and time features between each trajectory point, as well as the orientation angle features, to obtain multi-channel features. The processing of large and small feature maps and multi-channel feature maps is as follows:

[0150] The trajectory space coordinates are divided into The grid will contain each trajectory point in the trajectory. Location mapped to the grid The calculation is as follows:

[0151]

[0152] in, , and These are the minimum x-coordinate and y-coordinate values ​​of the trajectory points, respectively. and These are the first in the trajectory The x-coordinate and y-coordinate values ​​of the point, and These are the width and height of the cell grid, respectively, and they are calculated as follows:

[0153]

[0154] in, , is the grid size. and These are the maximum x-coordinate and y-coordinate values ​​of the trajectory points, respectively.

[0155] Extract trajectory feature values ​​and generate channel feature maps. The feature calculation for each channel is as follows:

[0156] First channel characteristics , for size The matrix is ​​calculated as follows:

[0157] 1) Construction Feature matrix, size ,make Each feature is initialized to 0;

[0158] 2) Let the number of iterations be... ;

[0159] 3) Let the trajectory point number ;

[0160] 4) Statistical Trajectory Points exist Position in the feature matrix The numerical characteristics are calculated as follows:

[0161]

[0162] wherein, is the eigenvalue of the position in the feature matrix ; when , ;

[0163] 5) determine whether the condition is met , if yes, go to step 6); if no, go to step 7);

[0164] 6) let , , return to step 4);

[0165] 7) perform maximum-minimum normalization on the feature matrix obtained in the last iteration to obtain the first channel feature map , and the normalization method is:

[0166]

[0167] wherein, denotes the eigenvalue of the th position in the feature matrix obtained in the last iteration; and are the maximum value and the minimum value of the elements in the feature matrix obtained in the last iteration, respectively, denotes the eigenvalue of the th position in the feature map ;

[0168] The second channel feature includes a trajectory segment length feature and a time feature; the trajectory segment length feature of the trajectory point is the sum of the distances between the trajectory point and the adjacent trajectory points and , and the calculation method is:

[0169]

[0170] The time feature of the trajectory point is the time difference between the trajectory point and the next time trajectory point , and the calculation method is:

[0171] ​​​

[0172] The trajectory segment length feature and the time feature of each trajectory are maximum-minimum normalized. The trajectory segment length feature normalization method is:

[0173]

[0174] wherein, is the normalized trajectory segment length feature of the trajectory point , and are the maximum value and the minimum value of the trajectory point trajectory segment length feature of the trajectory respectively.

[0175] The time feature normalization method is:

[0176]

[0177] wherein, is the normalized time feature of the trajectory point , and are the maximum value and the minimum value of the time feature of all trajectory points in the trajectory respectively.

[0178] The second channel feature is a matrix with a size of , which is obtained by adding the trajectory segment length feature matrix and the time feature matrix of the same size, and the calculation method is as follows:

[0179] 1) Construct the feature matrix with a size of , and let , , , The initial value of each feature in the matrix is 0.

[0180] 2) Let the iteration number be .

[0181] 3) Let the trajectory point serial number be .

[0182] 4) Calculate the trajectory segment length feature of the trajectory point , and update the value of the corresponding position in the matrix, and the method is as follows:

[0183]

[0184] wherein, is the value of the position in the feature matrix The eigenvalue of the order, when hour, ;

[0185] 5) Calculate the trajectory points Time characteristics and update The method for determining the value at the corresponding position in the matrix is ​​as follows:

[0186]

[0187] in, yes In the characteristic matrix Location The time characteristics of each. hour, ;

[0188] 6) Fusion of trajectory length features and temporal features as... The characteristics of a matrix are defined by the following method:

[0189]

[0190] 7) Judgment Does it meet the requirements? If yes, proceed to step 8; if no, proceed to step 9.

[0191] 8) Order , (Return to step 4)

[0192] 9) The feature matrix obtained in the last iteration Perform min-max normalization to obtain the second channel feature map. The normalization method is as follows:

[0193]

[0194] in, Represents the characteristic matrix obtained in the last iteration. The k-th eigenvalue in ; and These are the feature matrices obtained from the last iteration. The maximum and minimum values ​​of the elements in the set. Representation of feature map The first in One eigenvalue;

[0195] The third channel feature is the trajectory direction angle feature, trajectory points Directional angle characteristics From this trajectory point The vector angle between the front and rear trajectory points , The direction angle feature is obtained The calculation method of the direction angle feature is as follows:

[0196]

[0197] Wherein, is the module of the trajectory point and the trajectory point , denotes the dot product;

[0198] The maximum and minimum normalization of the trajectory point direction angle feature of each trajectory is as follows:

[0199]

[0200] Wherein, is the normalized direction angle feature of the trajectory point , and are the maximum value and the minimum value of the trajectory point direction angle feature of the trajectory respectively;

[0201] The third channel feature is a matrix with a size of , and the calculation method is as follows:

[0202] 1) Construct a feature matrix with a size of , and let The initial value of each feature in the matrix is 0; 2) Let the iteration number be

[0203] ;

[0204] 3) Let the trajectory point number be ;

[0205] 4) Calculate the time feature of the trajectory point , and update the value of the corresponding position in the feature matrix , which is expressed as:

[0206]

[0207] Wherein, is the th feature value of the position in the feature matrix , when ;

[0208] 5) Judge ​whether the condition is satisfied if yes, go to step 6), if no, go to step 7);

[0209] 6) let , return to step 4);

[0210] 7) the feature matrix obtained in the last iteration is subjected to max-min normalization processing and is taken as the third channel feature, and a third channel feature map is obtained, the normalization method being:

[0211]

[0212] wherein, denotes the i-th feature value in the feature matrix obtained in the last iteration, ; ; and are the maximum value and the minimum value of the elements in the feature matrix obtained in the last iteration, denotes the i-th feature value in the feature map ;

[0213] the three channel features , , are spliced to obtain a feature map with a size of , wherein 3 and are the channel number and the size of the trajectory feature map, respectively.

[0214] S3: a multi-channel convolutional neural network containing an attention mechanism is constructed to perform deep learning on the multi-channel feature map of the trajectory, the network containing three parts, namely a convolutional pooling layer, an attention layer and a fully connected layer, and the specific process being as follows:

[0215] S301: convolutional pooling layer: this layer includes five modules, the first module performing convolution, regularization and nonlinear activation operation, the second, third and fourth modules all containing convolution, regularization, nonlinear activation and pooling operation, and the fifth module performing convolution, regularization and nonlinear activation operation.

[0216] In the first module, the input multi-channel feature map is convolved using 16 dimensional convolution kernels, and is subjected to regularization processing, and then is activated by a nonlinear activation function to obtain 16 126x126 dimensional feature maps;

[0217] ​In the second module, 32 3x3 dimensional convolution kernels are used for convolution, and regularization processing and nonlinear activation function are performed Activation obtains 32 124x124 dimensional feature maps, and then through a maximum pooling layer, the 124x124 dimensional feature maps output by convolution are evenly divided into 62x62 sub-regions, and the maximum value of each sub-region is down-sampled to generate 32 62x62 dimensional feature maps.

[0218] In the third module, 32 3x2 dimensional convolution kernels are used for convolution, and regularization processing and nonlinear activation function are performed Activation obtains 32 60x60 dimensional feature maps, and then through a maximum pooling layer, the 60x60 dimensional feature maps output by convolution are evenly divided into 30x30 sub-regions, and the maximum value of each sub-region is down-sampled to generate 32 30x30 dimensional feature maps.

[0219] In the fourth module, 64 3x3 dimensional convolution kernels are used for convolution, and regularization processing and nonlinear activation function are performed Activation obtains 64 28x28 dimensional feature maps, and then through a maximum pooling layer, the 28x28 dimensional feature maps output by convolution are evenly divided into 14x14 sub-regions, and the maximum value of each sub-region is down-sampled to generate 64 14x14 dimensional feature maps.

[0220] In the fifth module, 128 3x3 dimensional convolution kernels are used for convolution, and regularization processing and nonlinear activation function are performed Activation obtains 128 12x12 dimensional feature maps.

[0221] S302: The attention layer includes a channel attention layer and a spatial attention layer.

[0222] In the channel attention layer, the specific steps are as follows:

[0223] The first layer is to perform average pooling and maximum pooling operations on the input feature map, calculate the mean and maximum values of 128 channels, and generate a tensor with a dimension of The second layer is a convolution layer, and a tensor with a dimension of is obtained, the third layer adds an activation function; the fourth layer is a convolution operation, and a tensor with a dimension of is obtained; the fifth layer adds an activation function to calculate the channel attention; the sixth layer multiplies the channel attention output by the fifth layer with the feature map output by the fifth module of S301 to obtain a tensor with a dimension of The formula expression of the channel attention layer is as follows:

[0224]

[0225]

[0226]

[0227] wherein, is the input feature of the first layer in the channel attention layer, and represent global average pooling and global max pooling, respectively, and is a learnable convolution kernel, and is a learnable parameter matrix, represents a function, represents a rectified linear unit, is the output of the channel attention layer;

[0228] In the spatial attention layer, the specific steps are as follows:

[0229] The first layer includes an average pooling layer and a max pooling layer, which calculate the mean and maximum of the input in the 12x12 dimension, to obtain a tensor with a channel dimension of The second layer is a pooling concatenation, which connects the mean feature map and the maximum feature map along the channel dimension to generate a tensor with a channel dimension of The third layer is a convolution layer, and the shape of the output tensor is The fourth layer adds an activation function, and the spatial attention is calculated through the activation function to obtain a tensor with a channel dimension of The fifth layer multiplies the tensor with a channel dimension of output by the first layer with the input of the first layer, and outputs a tensor with a channel dimension of The formula expression of the spatial attention layer is as follows:

[0230]

[0231]

[0232] wherein, is the input feature of the first layer in the spatial attention layer, and represent average pooling and max pooling, respectively, is a learnable convolution kernel, represents a function, represents a rectified linear unit, is the output of the spatial attention layer;

[0233] S303: Fully connected layer: the first layer concatenation layer flattens the data dimension to , that is, The second layer is a linear transformation, and the third layer is a nonlinear activation function , and the fourth layer is a linear transformation , and the fifth layer is a linear transformation , and the sixth layer is an activation function

[0234] S4: Load the pair of trajectory multi-channel feature maps into the multi-channel convolutional neural network in S3, train and optimize the network, and save the trained network model. The specific steps are as follows:

[0235] S401: Divide the trajectory data into a training set and a test set, convert it into tensor format data, and initialize the model weight parameters;

[0236] S402: Input the concatenated trajectory pair into the model, extract the multi-channel feature map, calculate the error between the network output value and the actual value, and adjust the weight matrix by backpropagation according to the method of minimizing the loss function. Update the parameters, and the loss function expression is:

[0237]

[0238] Where and are the similarity measure value vector and the pseudo label vector respectively, represents the th similarity measure value, represents the th pseudo label, is a binary cross-entropy loss function, which calculates the difference between the similarity score of the positive and negative sample pair and the pseudo label, and optimizes the model by backpropagating the parameters;

[0239] S403: Repeat the iteration training until the loss function of the model gradually decreases and tends to be stable, the accuracy and F1 score value indicators rise and tend to be stable, stop training, and save the model.

[0240] S5: Test the trained model and output the similarity score of the trajectory pair.

[0241] To achieve the technical effect comparison, the CSTRM method (Xiang L., Tan X., Guo Y., et al. CSTRM: Contrastive Self-Supervised Trajectory Representation Model for Trajectory Similarity Computation[J]. Computer Communications, 2022, 185: 159-167.) and the TrajSR method (Cao H., Tang H., Wu Y., et al. On Accurate Computation of Trajectory Similarity via Single Image Super Resolution[C]. International Joint Conference on Neural Networks, 2021.) are used as comparison methods in the example verification, and the accuracy and F1-scores are used as performance evaluation indexes. The CSTRM method uses GRU to process the trajectory time sequence and relies on the before-and-after relationship between the trajectory points. The TrajSR method converts the trajectory into a single-channel image. To better illustrate the technical effect of the present application, the following performance indexes are used in the present example, and the specific calculation expressions of the indexes are as follows:

[0242] The confusion matrix is set, as shown in Table 1:

[0243] Table 1 Confusion matrix

[0244]

[0245] Among them, P represents positive example, N represents negative example, true positive (TP): the true class of the sample is positive example, and it is predicted as positive example; true negative (TN): the true class of the sample is negative example, and it is predicted as negative example; false positive (FP): the true class of the sample is negative example, but it is predicted as positive example; false negative (FN): the true class of the sample is positive example, but it is predicted as negative example. The expression of accuracy (Accuracy) is:

[0246]

[0247] The expression of F1 score value is:

[0248]

[0249] The method takes accuracy and F1 score value as indexes, the higher the accuracy is, the higher the proportion of correct measurement is, and the lower the error rate of similarity measurement is; the F1 score value comprehensively considers recall rate and precision rate, and the higher the value is, the more reliable the measurement result is.

[0250] 80 rounds of experiments are carried out on the Geolife data set and the Portugal data set for each method, and it is found that Figure 4 、 Figure 6 It can be known that the accuracy of the method is higher than that of the comparative method on the two data sets, and it is found that Figure 5 、 Figure 7 It can be known that the F1 score value of the method is higher than that of the comparative method on the two data sets, and it is found that the method has higher accuracy.

[0251] The CSTRM method utilizes the time sequence information of the trajectory, and the accuracy and F1 score value obtained are lower; the TrajSR method converts the trajectory into an image, and the accuracy and F1 score value obtained are slightly higher than those of the CSTRM method; the method converts the trajectory into a multi-channel feature map, and is the best among the three methods, and has the highest accuracy and F1 score value.

[0252] Although the above describes the specific embodiments of the present application in order to facilitate the understanding of the present application by those skilled in the art, it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, it is obvious that various changes are within the spirit and scope of the present application defined and determined by the appended claims, and all the inventions utilizing the concept of the present application are within the scope of protection.

Claims

1. A trajectory similarity measurement method based on multi-channel feature learning, characterized in that, Includes the following steps: S1: Obtain the trajectory dataset, perform data preprocessing, coordinate transformation, and data augmentation to obtain positive and negative trajectory sample pairs; S2: Map each trajectory to an n×n grid, and extract the statistical features of the number of trajectory points, the fusion features of trajectory segment length and time features, and the features of trajectory direction angle to obtain a multi-channel n×n feature map; S3: Construct a multi-channel convolutional neural network with an attention mechanism to perform deep learning on the multi-channel feature map of the trajectory; S4: Load the paired trajectory multi-channel feature maps into the multi-channel convolutional neural network in S3, train and optimize the network, and save the trained network model. S5: Test the trained model and output the similarity score between trajectory pairs.

2. The trajectory similarity measurement method based on multi-channel feature learning according to claim 1, characterized in that, In step S1, the trajectory is preprocessed by truncating each trajectory into a sequence of trajectory points with the same number of points, represented as follows: in, This indicates the number of points in the trajectory. They represent The first in the trajectory The longitude, latitude, and time of each trajectory point; Then, perform coordinate transformation on the latitude and longitude values ​​of each trajectory to convert them to the Cartesian coordinate system. i y i The value is calculated as follows: Where R represents the Earth's equatorial radius, with a value of 6,371,000.0 meters. , These are the x-coordinate and y-coordinate values ​​of the trajectory points, respectively. The trajectory after coordinate transformation is represented as follows: Data augmentation is performed on the coordinate-transformed trajectories using a trajectory point sampling augmentation method. Each trajectory is augmented twice to obtain augmented trajectory 1 and augmented trajectory 2. Augmented trajectories of the same trajectory are positive sample pairs, while augmented trajectories of different trajectories are negative sample pairs. The set of positive sample pairs... Represented as: in, , Indicates the first Enhanced trajectory pairs of trajectories, The set of negative trajectory pairs represents the number of trajectories in the original dataset. Represented as: in, They represent the first Article and Section Enhanced trajectory 1 of the trajectory They represent the first Article and Section Enhanced trajectory 2 of the trajectory.

3. The trajectory similarity measurement method based on multi-channel feature learning according to claim 1, characterized in that, In step S2, the processing of the multi-channel feature map is as follows: The trajectory space coordinates are divided into an n×n grid, and each trajectory point in the trajectory is... Location mapped to the grid The calculation is as follows: in, , and These are the minimum x-coordinate and y-coordinate values ​​of the trajectory points, respectively. and These are the first in the trajectory The x-coordinate and y-coordinate values ​​of the point, and These are the width and height of the cell grid, respectively, and are calculated as follows: Where n is the grid size, and These are the maximum x-coordinate and y-coordinate values ​​of the trajectory points, respectively. Extract trajectory feature values ​​and generate channel feature maps. The feature calculation for each channel is as follows: First channel characteristics , for size The matrix is ​​calculated as follows: 1) Construction Feature matrix, size ,make Each feature is initialized to 0; 2) Let the number of iterations be... ; 3) Let the trajectory point number ; 4) Statistical Trajectory Points exist Position in the feature matrix The numerical characteristics are calculated as follows: in, yes In the characteristic matrix Location The eigenvalues ​​of the order; when hour, ; 5) Judgment Does it meet the requirements? If yes, proceed to step 6; if no, proceed to step 7. 6) Order , (Return to step 4) 7) The feature matrix obtained in the last iteration Perform min-max normalization to obtain the feature map of the first channel. The normalization method is as follows: in, Represents the characteristic matrix obtained in the last iteration. The first in 1 eigenvalue, ; and These are the feature matrices obtained from the last iteration. The maximum and minimum values ​​of the elements in the set. Representation of feature map The first in One eigenvalue; The second channel features include trajectory segment length features and time features; trajectory points Trajectory segment length features It is a trajectory point adjacent trajectory points and The sum of the distances between them The calculation method is as follows: trajectory points Time characteristics It is a trajectory point Trajectory point at the next moment The time difference between them The calculation method is as follows: For each trajectory, the trajectory segment length feature and time feature are subjected to max-min normalization: the trajectory segment length feature normalization method is as follows: in, It is a trajectory point The normalized trajectory segment length feature, and These are the maximum and minimum values ​​of the trajectory segment length feature of the trajectory points, respectively; The time feature normalization method is as follows: in, It is a trajectory point The normalized time characteristics, and These are the maximum and minimum values ​​of the time characteristics of all trajectory points in the trajectory, respectively; Second channel features , for size A matrix of size Trajectory segment length feature matrix and size are Time feature matrix The result is obtained by addition, and the calculation method is as follows: 1) Construction Feature matrix, size ,make , , Each feature in the matrix is ​​initialized to 0; 2) Let the number of iterations be... ; 3) Let the trajectory point number ; 4) Calculate the trajectory points Trajectory segment length features and update The method for determining the value at the corresponding position in the matrix is ​​as follows: in, yes In the characteristic matrix Location The eigenvalue of the order, when hour, ; 5) Calculate the trajectory points Time characteristics and update The method for determining the value at the corresponding position in the matrix is ​​as follows: in, yes In the characteristic matrix Location The time characteristics of each. hour, ; 6) Fusion of trajectory length features and temporal features as... The characteristics of a matrix are defined by the following method: 7) Judgment Does it meet the requirements? If yes, proceed to step 8; if no, proceed to step 9. 8) Order , (Return to step 4) 9) The feature matrix obtained in the last iteration Perform min-max normalization to obtain the second channel feature map. The normalization method is as follows: in, Represents the characteristic matrix obtained in the last iteration. The first in 1 eigenvalue, ; and These are the feature matrices obtained from the last iteration. The maximum and minimum values ​​of the elements in the set. Representation of feature map The first in One eigenvalue; The third channel feature is the trajectory direction angle feature, trajectory points Directional angle characteristics From this trajectory point With the preceding and following trajectory points , Obtain the vector angle between them, and the direction angle feature. The calculation method is as follows: in, It is a trajectory point With trajectory points The model, Represents the dot product; The angular features of the trajectory points for each trajectory are normalized using a minimum-maximum method, as follows: in, It is a trajectory point The normalized direction angle features, and These are the maximum and minimum values ​​of the directional angle characteristic of the trajectory points, respectively; Third channel characteristics , for size The matrix is ​​calculated as follows: 1) Construction Feature matrix, size ,make Each feature in the matrix is ​​initialized to 0; 2) Let the number of iterations be... ; 3) Let the trajectory point number ; 4) Calculate the trajectory points Time characteristics and update The value at the corresponding position in the feature matrix is ​​represented as: in, yes In the characteristic matrix Location Secondary eigenvalues, hour, ; 5) Judgment Does it meet the requirements? If yes, proceed to step 6; if no, proceed to step 7. 6) Order , (Return to step 4) 7) The feature matrix obtained in the last iteration The min-max normalization process is performed and used as the third channel feature to obtain the third channel feature map. The normalization method is as follows: in, Represents the characteristic matrix obtained in the last iteration. The k-th eigenvalue in ; and These are the feature matrices obtained from the last iteration. The maximum and minimum values ​​of the elements in the set. Representation of feature map The first in One eigenvalue; Will , , Three-channel feature splicing yields a size of [size missing]. Feature maps, where 3 and These are the number of channels and the size of the trajectory feature map, respectively.

4. The trajectory similarity measurement method based on multi-channel feature learning according to claim 1, characterized in that, In step S3, a multi-channel convolutional neural network with an attention mechanism is constructed, consisting of three parts: a convolutional pooling layer, an attention layer, and a fully connected layer. The specific process is as follows: S301: Convolutional Pooling Layer: This layer consists of five modules. The first module performs convolution, regularization, and non-linear activation operations. The second, third, and fourth modules all contain convolution, regularization, non-linear activation, and pooling operations. The fifth module performs convolution, regularization, and non-linear activation operations. In the first module, a multi-channel feature map is input, convolved with m1 h1×h1 dimensional convolutional kernels, and regularized. Then, it passes through a non-linear activation function. Activation yields m1 k1×k1 dimensional feature maps; In the second module, m² h²×h² dimensional convolutional kernels are used for convolution, followed by regularization and a non-linear activation function. Activation yields m2 k2×k2 dimensional feature maps. Then, through a max pooling layer, the k2×k2 dimensional feature maps output by the convolution are divided into k3×k3 sub-regions on an average basis. The maximum value of each sub-region is downsampled to generate m2 k3×k3 dimensional feature maps. In the third module, m³ h³×h³ dimensional convolutional kernels are used for convolution, followed by regularization and a non-linear activation function. Activation yields m3 k4×k4 dimensional feature maps. Then, through a max pooling layer, the k4×k4 dimensional feature maps output by the convolution are divided into k5×k5 sub-regions. The maximum value of each sub-region is downsampled to generate m3 k5×k5 dimensional feature maps. In the fourth module, m4 h4×h4 dimensional convolutional kernels are used to convolve it, followed by regularization and a non-linear activation function. Activation yields m4 k6×k6 dimensional feature maps. Then, through a max pooling layer, the k6×k6 dimensional feature maps output by the convolution are divided into k7×k7 sub-regions on an average basis. The maximum value of each sub-region is downsampled to generate m4 k7×k7 dimensional feature maps. In the fifth module, m5 h5×h5 dimensional convolutional kernels are used for convolution, followed by regularization, and then a non-linear activation function is applied. Activation yields m5 k8×k8 dimensional feature maps; S302: The attention layer includes the channel attention layer and the spatial attention layer; In the channel attention layer, the specific steps are as follows: The first layer performs average pooling and max pooling operations on the input feature map, calculating the mean and maximum values ​​of m5 channels, generating a dimension of... tensor; The second layer is a convolutional layer, which yields... Tensors; third layer added Activation function; the fourth layer is a convolution operation, resulting in a dimension of Tensors; the fifth layer adds Activation function, calculate channel attention; The sixth layer multiplies the channel attention output from the fifth layer with the feature map output from the fifth module of S301 to obtain... The formula for the channel attention layer is as follows: in, These are the input features of the first layer in the channel attention layer. and These represent global average pooling and global max pooling, respectively. and It is a learnable convolutional kernel. and It is a learnable parameter matrix. express function, Indicates a modified linear unit. It is the output of the channel attention layer; In the spatial attention layer, the specific steps are as follows: The first layer contains an average pooling layer and a max pooling layer, which calculate the mean and maximum value of the input along the k8×k8 dimension to obtain the channel dimension. The first layer is a tensor; the second layer is pooling concatenation, which connects the mean feature map and the maximum feature map along the channel dimension to generate... The third layer is a convolutional layer, and the shape of the output tensor is... Add to the fourth layer The activation function is used to calculate spatial attention, resulting in... The tensor; the fifth layer takes the output of the fourth layer. The tensor is multiplied by the input of the first layer, and the output is... The formula for the spatial attention layer is as follows: in, These are the input features of the first layer in the spatial attention layer. and These represent average pooling and max pooling, respectively. It is a learnable convolutional kernel. express function, Indicates a modified linear unit. It is the output of the spatial attention layer; S303: Fully Connected Layer: The first concatenation layer flattens the data dimensions, transforming it into... The tensor, that is, After a second linear transformation, _ neurons are obtained One neuron, third layer nonlinear activation function Add to the fourth layer The fifth linear transformation yields 1 eigenvalue, sixth layer The activation function is used to obtain the trajectory similarity score.

5. The trajectory similarity measurement method based on multi-channel feature learning according to claim 1, characterized in that, In step S4, the network is trained and optimized. The specific steps are as follows: S401: Divide the trajectory data into training and testing sets, convert it into tensor format data, and initialize the model weight parameters; S402: After concatenating the trajectory pairs, input them into the model, extract multi-channel feature maps, calculate the error between the network output value and the actual value, backpropagate according to the method of minimizing the loss function, adjust the weight matrix, and update the parameters; S403: Repeat the iterative training until the model's loss function gradually decreases and stabilizes, and the accuracy and F1 score increase and stabilize. Then stop training and save the model.

6. The trajectory similarity measurement method based on multi-channel feature learning according to claim 5, characterized in that, In step S402, the loss function expression is: in and These are the similarity metric vector and the pseudo-label vector, respectively. Indicates the first A similarity metric value, Indicates the first A pseudo-label, It is a binary cross-entropy loss function that calculates the difference between the similarity score of positive and negative sample pairs and the pseudo-label, backpropagates parameters, and optimizes the model.

Citation Information

Patent Citations

  • Road network pixelation-based Wasserstein generation adversarial flow data interpolation method

    CN115510174A

  • Track repairing method based on sequence similarity and dynamic mask training mechanism

    CN115526225A