A peer vehicle discovery method based on natural semantic processing
By applying natural semantic processing technology in the field of intelligent transportation, time, space and semantic features are extracted from trajectory data, and the GRU model is used to discover peer vehicle groups, solving the problem of inefficient discovery of peer vehicles in the existing technology, and achieving more accurate and efficient vehicle behavior analysis.
Patent Information
- Application Number
- CN202111347252.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-11-15
AI Technical Summary
In the field of intelligent transportation, it is difficult for the prior art to effectively extract semantic information from trajectory data, resulting in inefficient discovery of peer vehicles.
Using a method based on natural semantic processing, trajectory data features are extracted from three dimensions of time, space and semantics, and a GRU model is used to establish a peer vehicle discovery model and train to discover peer vehicle groups.
It has achieved more accurate and efficient peer vehicle discovery, able to analyze vehicle behavior patterns and social evolution laws, and applied to public transportation safety, logistics planning and trajectory prediction and other fields.
Smart Images

Figure CN114186582B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of intelligent transportation and relates to a method for discovering traveling vehicles based on natural semantic processing. Background Art
[0002] Trajectory refers to the route that an object takes according to a certain law. In the era of big data, the popularization of mobile Internet and various sensor terminals has generated a huge amount of trajectory data. Trajectory data contains rich spatiotemporal feature information. Through various trajectory analysis techniques, we can mine information such as the laws and behavioral characteristics of human activities, urban vehicle movement patterns, and urban development scale levels. In intelligent transportation, trajectory mainly refers to vehicle trajectory or pedestrian trajectory, so massive trajectory data also potentially exposes privacy information such as the interests and social habits of mobile objects. Therefore, the study of trajectory data can be applied to areas such as taxi route planning, ships, and tourist route recommendations. Clustering analysis of trajectories can also mine behavioral portraits of mobile objects, which can solve various social problems implicit in the laws of social development.
[0003] Trajectory data has permeated our lives. Various mobile communication devices used every day record locations all the time. In the road network, there are also a large number of surveillance cameras recording the trajectories of various moving objects. In intelligent transportation, trajectory data can be divided into two categories. One is GPS data, which is data generated by a high-precision radio navigation and positioning system based on artificial satellites. On the other hand, with the rapid development of image recognition technology, images can be measured non-destructively, and ANPR (Automatic Number Plate Recognition) data has also become popular. In traditional trajectory data analysis, most of them use data mining methods, such as frequent pattern mining algorithms. Such algorithms often only focus on the spatiotemporal feature information in the trajectory, but ignore the rich text information in the trajectory. Therefore, the research on trajectory data analysis models based on deep learning can better mine the implicit trajectory patterns in trajectory data, which is of great significance to the guidance and construction of intelligent transportation.
[0004] In recent years, many scholars have conducted a lot of research in the field of peer vehicle detection. Most of them achieve the purpose of detecting peer vehicles by calculating the similarity between trajectories, mainly based on dynamic programming models, machine learning algorithm models, and deep learning algorithm models. The algorithms based on dynamic programming models are mainly the following: LCSS longest common subsequence algorithm, DTW dynamic time planning algorithm, EDR edit distance algorithm. The main purpose of machine learning algorithms is to discover peer vehicle groups by mining frequent patterns. The main purpose of deep learning models is to extract spatiotemporal feature information from trajectory data, perform feature extraction, and express feature vectors, converting the similarity problem between peer vehicle trajectories into a problem of comparing the similarity between two vectors. This type of algorithm has the advantage of processing complex high-dimensional data and is suitable for processing trajectory data analysis problems in complex road network environments.
[0005] It is found that trajectory data is time series data, which is quite similar to natural language processing. Therefore, the trajectory can be compared to a sentence, and the goal of calculating the similarity between trajectories can be achieved by calculating the similarity between sentences.
[0006] Although many scholars have conducted extensive research on peer vehicle discovery models and achieved quite good results, there are still some challenges:
[0007] 1. Trajectory semantic representation. Trajectory sequences have similar contextual relationships as text sequences, so trajectories can be compared to texts, and the similarity between trajectories can be calculated by calculating the similarity between different "texts", but how to semantically quantify trajectory data is an unknown area.
[0008] 2. Trajectory semantic understanding. A group of vehicles traveling together through several traffic monitoring checkpoints within a period of time. Existing methods all study a single vehicle, ignoring the impact between vehicles, which makes it impossible to efficiently discover vehicles traveling together.
[0009] 3. Trajectory semantics discovery. The meaning of a word can vary greatly depending on the context, so trajectory semantics also faces the same problem. There are many factors that affect trajectory semantics, such as traffic volume, road shape, etc. How to find the main feature factors becomes a challenge. Summary of the invention
[0010] In view of the above challenges, the present invention proposes a peer vehicle discovery method based on natural semantic processing, which specifically includes the following steps:
[0011] S1. Obtain the vehicle's driving trajectory. The vehicle's trajectory is represented by T = {(l1, t1, m1), (l2, t2, m2), ..., (l n ,t n ,m n)}, where l n Indicates the location information of the nth trajectory point, t n Indicates the time information of the nth trajectory point, m n Represents the text information of the point of interest of the nth trajectory point;
[0012] S2, extract features from trajectory data from three dimensions: time, space, and semantics, and perform weighted fusion on the features according to their importance to obtain a vectorized representation of the trajectory;
[0013] S3, after the extracted three-dimensional features are quantized and fused, a trajectory corpus is formed by dividing the trajectory pair data set into trajectories and sub-trajectories, wherein the sub-trajectory is a sampling sequence obtained by sampling the trajectory;
[0014] S4. Use the GRU model to build a peer vehicle detection model. During training, the sub-trajectories in the trajectory corpus are used as input and the source trajectory is used as the target output;
[0015] S5. Taking the hidden vector of the peer vehicle discovery model as the actual expression of each trajectory, calculating the similarity of all trajectories, and defining the vehicle group whose similarity is greater than a specified threshold as the peer vehicle group.
[0016] Furthermore, feature extraction is performed on the trajectory data from the spatial dimension, that is, the distance between two trajectories is extracted from the spatial dimension, including:
[0017]
[0018] Among them, DTW(T1,T2) represents the DTW spatial similarity of two trajectories; head(T1) represents the first position in the trajectory; head(T2) represents the second position in the trajectory; Rest(T1) represents the trajectory after removing the first position point; Rest(T2) represents the trajectory after removing the second position point; n and m are the lengths of trajectory T1 and trajectory T2, respectively, that is, the number of positioning points therein.
[0019] Furthermore, feature extraction is performed on the trajectory data from the time dimension, and a time threshold is set. When the difference between two moments falls within the given threshold, the two moments are considered similar; if the difference does not fall within the given threshold, they are considered dissimilar; or the intersection and union of two trajectory time segments are extracted, and the ratio of the intersection to the union is calculated. The closer the ratio is to 1, the higher the similarity of the time segments.
[0020] Furthermore, feature extraction of trajectory data from a semantic dimension includes the following steps:
[0021] Classify the facilities in public places and construct a vector expression of access points based on the attributes of each type;
[0022] The GloVe word vector algorithm is used to extract semantic features in trajectories and perform low-dimensional vectorization;
[0023] The expression of the semantic feature vector is optimized, and the cost function in the optimization process is expressed as:
[0024]
[0025] Where J is the loss function of the GloVe word vector model in the process of optimizing the expression of semantic feature vectors; k is other words that appear in the context of word i; w k is the vector representation of word k; b i and b k is the hyperparameter of the Glove word vector model; X ik It represents the number of times word i and word k appear in the same sliding window in the entire corpus.
[0026] Furthermore, the similar process of building a peer vehicle discovery model to calculate two trajectories includes:
[0027] Assume a trajectory T with n access points, that is, the trajectory can be expressed as T = {v1, v2…vn}, vi is the fusion vector of the three-dimensional features of the i-th access point in time, space, and semantics, vi = (l i ,t i ,m i );
[0028] Input the trajectory T into the bidirectional GRU model and extract the hidden layer state;
[0029] Use the hidden state as the input of the attention mechanism and calculate the weights of the elements in the hidden state;
[0030] The obtained weight is weighted and summed with the hidden layer state to obtain the vector expression of the semantic trajectory;
[0031] When calculating the similarity of two trajectories, the cosine distance between the vector expressions of the two trajectories is calculated. If the cosine distance between the vector expressions of the two trajectories is less than the set threshold, the two trajectories are judged to be similar.
[0032] Furthermore, the attention mechanism gives higher weights to turning points in the trajectory. If the sum of the turning angles between a point and its upstream and downstream nodes in the sliding window is greater than a set threshold, the point is considered an inflection point.
[0033] Furthermore, the process of obtaining the vector expression of the semantic trajectory includes:
[0034] When the trajectory is input into the bidirectional GRU model to extract the hidden state, a hidden state vector with a dimension of 2a is obtained. The hidden state vectors of n access points form a 2a*n matrix S. The weight vector is obtained through the attention mechanism, and the obtained weight vector is multiplied with the matrix to obtain the vector expression of the semantic trajectory of a trajectory. The weight vector is expressed as:
[0035] u=softmax(w2tanh(w1S))
[0036] Among them, w1 is the b*2a weight matrix, w2 is the parameter vector of dimension b, and b is a hyperparameter that can be set arbitrarily; the bidirectional GRU model includes two GRUs, forward and backward, and a is the dimension of a single GRU hidden layer state vector.
[0037] Furthermore, w2 is expanded according to the attributes of the trajectory access points. If q access points are extracted from a trajectory, w2 is expanded into a q*b matrix, and the selected q access points are the access points in the trajectory whose weights are greater than the set threshold.
[0038] By analyzing the movement paths of various types of vehicles, the present invention can discover the implicit behavioral patterns and dig out the laws of social evolution. For example, when many special vehicles are performing special activities, they drive in coordination, take turns, and provide cover when passing through traffic checkpoints. The special vehicles present a peer-to-peer accompanying mode. Therefore, this model can be applied to public transportation safety, logistics planning, trajectory clustering, trajectory prediction and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of an algorithm of a peer vehicle discovery method based on natural semantic processing of the present invention;
[0040] Figure 2 This is an example of a group of vehicles traveling together in the present invention;
[0041] Figure 3 It is the mechanism for quantifying trajectory characteristics in the present invention;
[0042] Figure 4 It is an example of an important trajectory factor of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] The present invention proposes a method for discovering a peer vehicle based on natural semantic processing, which specifically includes the following steps:
[0045] S1. Obtain the vehicle's driving trajectory. The vehicle's trajectory is represented by T = {(l1, t1, m1), (l2, t2, m2), ..., (l n ,t n ,m n )}, where l n Indicates the location information of the nth trajectory point, t n Indicates the time information of the nth trajectory point, m n Represents the text information of the point of interest of the nth trajectory point;
[0046] S2, extract features from trajectory data from three dimensions: time, space, and semantics, and perform weighted fusion on the features according to their importance to obtain a vectorized representation of the trajectory;
[0047] S3, after the extracted three-dimensional features are quantized and fused, a trajectory corpus is formed by dividing the trajectory pair data set into trajectories and sub-trajectories, wherein the sub-trajectory is a sampling sequence obtained by sampling the trajectory;
[0048] S4. Use the GRU model to build a peer vehicle detection model. During training, the sub-trajectories in the trajectory corpus are used as input and the source trajectory is used as the target output;
[0049] S5. Taking the hidden vector of the peer vehicle discovery model as the actual expression of each trajectory, calculating the similarity of all trajectories, and defining the vehicle group whose similarity is greater than a specified threshold as the peer vehicle group.
[0050] In the present invention, a sub-trajectory is a sampling sequence of trajectories. Trajectories are divided into three levels. The first-level trajectory is an ideal trajectory, which is represented by a continuous curve and can accurately represent the moving route of an object. This type of trajectory is difficult to obtain; the second-level trajectory is the trajectory collected by the device, which is a real trajectory, such as GPS positioning data and ANPR automatic license plate recognition data. It is represented by a discrete sequence and can roughly represent the moving path of an object. It may be affected by equipment aging, positioning drift, insufficient accuracy and other problems. This level of trajectory is also the type of trajectory collected by the present invention; the third-level trajectory is a sampling trajectory, that is, a sub-trajectory, which is represented by a discrete sequence and is a sampling sequence of the real trajectory.
[0051] Example
[0052] In this embodiment, the present invention mainly includes three steps:
[0053] S1: Get data online. The way to get data is from public data websites, or cooperate with the transportation department to get the original data. The data that needs to be obtained here is the vehicle's driving record, including license plate number, vehicle location, checkpoint location, longitude and latitude, etc., and the original trajectory is enriched through POI data.
[0054] S2: Extract trajectory features. Based on the acquired data, extract the time features, spatial features, and semantic features of the vehicle at each moment, and use the CLOVE word vector algorithm to quantify the three, replacing the CONCAT operation commonly used in deep learning with weighted feature vector fusion.
[0055] S3: Build the model. First, through different time slice lengths and different sampling, we get a set of trajectories-subtrajectories, and get a low-dimensional vectorized expression of the trajectory based on different features, which is finally saved as a corpus. We use the subtrajectory as the input of the model and the source trajectory as the output of the model to get the hidden vector. Then, when actually discovering, we input two trajectories, convert them through the hidden vector, and get a low-dimensional vector expression of the trajectory. We calculate the similarity of the trajectories to discover the group rental of peer vehicles in the trajectory data.
[0056] The above step S1 obtains the data source, which is mainly divided into the following three steps.
[0057] S11: Get the original data. The original data can be obtained through the intelligent transportation data platform or the public data website.
[0058] S12: Simple data cleaning. The raw data usually obtained are unstructured and cannot be used directly for data analysis. Simple data cleaning can make most of the unstructured data structured, so that abnormal values or null values no longer appear, reducing the inconvenience caused by subsequent calculations.
[0059] S13: Data storage. The data after simple data clarification needs to be stored in a database. Because the amount of trajectory data is very large, the data is further standardized through the table structure, and the database can also greatly improve the data retrieval efficiency and the mapping of relationships between tables.
[0060] The above step S2 extracts trajectory features, which is mainly divided into the following three steps.
[0061] In the road network, the formation of a group of vehicles traveling together is affected by multiple factors such as driving time, driving location, and traffic volume. This paper also uses POI data to enrich trajectory data and extract text information from it. In summary, this paper extracts and expresses features of trajectory data from three dimensions: time, space, and semantics. The details are as follows:
[0062] S21: Extract spatial features T space
[0063] Spatial features are the most primitive features in trajectory data. The spatial similarity of different trajectories is usually calculated based on the coordinates of the position points on the trajectory to calculate their spatial distance or the shape of the object's motion trajectory. If the spatial distances between different trajectories are very close or the shapes are very similar, it can be determined that these trajectories are similar, and thus it can be determined that these vehicles are most likely traveling together. A commonly used strategy in spatial data analysis is to divide the entire area into many cells of equal size, so that each point can be represented by a unique label value. There are many algorithms for calculating spatial similarity, such as LSD algorithm, DTW algorithm, LCSS algorithm, EDR algorithm, ERP algorithm, etc. This paper uses the DTW algorithm to measure the similarity between trajectories. If trajectory T1 = {p 1,1 ,p 1,2 ,…p 1,n},T2={p 2,1 ,p 2,2 ,…p 2,n}, then the DTW distance between T1 and T2 is calculated by the following formula:
[0064]
[0065] Among them, DTW(T1,T2) represents the DTW spatial similarity of two trajectories. The first position in the trajectory is represented by head(T1), and the trajectory after removing the first position point is represented by Rest(T1). n and m are the lengths of the two trajectories, that is, the number of positioning points in them. The DTW algorithm can calculate the similarity between two trajectories of unequal lengths.
[0066] S22: Extracting time features T time
[0067] In the time similarity measurement, time is divided into two types of time, one is the exact moment and the other is the time segment. When it is expressed as an exact moment, there are two ways to determine its similarity:
[0068] 1. Compare the two moments to see if they are exactly the same. If they are the same, they are considered similar; if they are different, they are not similar. This method is too harsh and is generally not used.
[0069] Second, set a time threshold. When the difference between two moments falls within the given threshold, the two moments are considered similar; if the difference does not fall within the given threshold, they are considered dissimilar. For the similarity measurement of time segments, the intersection and union of these time segments are usually taken, and the ratio of the intersection to the union is calculated. The closer the ratio is to 1, the higher the similarity of the time segment.
[0070]
[0071]
[0072]
[0073] S23: Extracting semantic features T sem
[0074] There is a lot of text information hidden in the trajectory, which can be used to accurately locate the trajectory and improve the accuracy of the trajectory vector representation, which is incomparable to the spatiotemporal features. In the commonly used spatial gridding algorithm, the trajectory will be expressed differently due to the influence of the grid unit size. For example, when the spatial grid size is 1X1, the trajectory expression may be (1,3,5), but when the spatial grid is 10X10, the trajectory expression is (1). The original three trajectory points are merged into one trajectory point, resulting in a very vague trajectory expression. It is impossible to accurately represent a trajectory, but as long as a very small amount of key text information is added, this point can be located. For example, the above position, plus the key information-Bank of China, then within this range, the point can basically be uniquely determined.
[0075] By investigating the types and distribution of public places in real life, a total of 28 access point types are summarized, including stadiums, residences, supermarkets, hotels, furniture malls, hospitals, parking lots, cinemas, parks, scenic spots, bus stops, teahouses, banks, libraries, bookstores, restaurants, schools, airports, factories, amusement parks, Internet cafes, markets, convenience stores, auto malls, government agencies, entertainment venues, public places, private places, etc. Those skilled in the art can customize these places according to actual conditions. The present invention only provides this list of specific access point types. There are generally two expressions for the vector expression of access point types, one-hot and distributed expression, among which one-hot is a simple and direct way. In this problem, the access point type can be encoded as a mutually independent vector, that is, the two access point types have only two relationships: the same and different. This is not a good expression for similarity calculation, while the distributed expression can avoid this situation. Therefore, in order to more accurately calculate the similarity between semantics, the distributed expression is selected. According to people's activities at different types of access points in real life, 10 attributes of access points are summarized, namely public places, consumption, entertainment, learning, sightseeing, sports, health, transportation, office, and stay time. These 10 attributes correspond to the 10 dimensions of the semantic feature vector. For each access point, scoring the above 10 attributes will get a 10-dimensional vector, which is the semantic feature vector of this type of access point.
[0076] In summary, using text information to measure the similarity between two trajectories is efficient and accurate. The GloVe word vector algorithm is used to extract the semantic features in the trajectory and perform low-dimensional vectorization. The expression of its semantic feature vector is optimized by minimizing the following cost function:
[0077]
[0078] Where X ik The meaning of is the number of times word i and word k appear in the same sliding window in the entire corpus, b i and b k is a hyperparameter of the model.
[0079] The above step S3 establishes a model, which is mainly divided into the following steps.
[0080] This model is mainly divided into several stages: trajectory semantic representation, trajectory semantic understanding, and trajectory semantic discovery, such as Figure 1 As shown in the figure. In the first stage, starting from the multi-dimensional features in the trajectory, the Ts2Vec algorithm is proposed. Based on deep learning, the time, space, and semantic features are vectorized into low-dimensional densities. In the second stage, the internal and external factors that affect the similarity of trajectories in the formation of peer vehicle groups are comprehensively considered, and different state factors are quantified. In the third stage, a peer vehicle discovery model based on the bidirectional GRU model is established.
[0081] S31: Trajectory feature extraction and feature fusion
[0082] Based on the research motivation mentioned above, the research method is to compare the trajectory to a sentence. The research goal is to achieve a deep understanding of trajectory semantics, that is, given a trajectory, find a set of trajectories similar to the trajectory. After completing the above different trajectory feature representations, in order to more comprehensively represent the vector of a trajectory, the commonly used method in deep learning is the CONCAT operation to fuse different features, that is, to form the final representation vector by splicing different feature vectors. However, the input and output of the model by splicing is undoubtedly very naive and one-sided, so the following research ideas are proposed.
[0083] In real life, there is a real trajectory Tbase, and a sampling rate R is set to sample it, forming a sampled trajectory Tsampling. For Tbase and Tsampling, both can reflect some properties of the ideal trajectory Tideal, but it is obvious that the real trajectory Tbase is closer to Tideal. In this way, the research goal becomes to use the sampled trajectory Tsampling as the input of the encoder and the real trajectory Tbase as the output of the decoder to perform trajectory point filling and complete the mapping from sampling to real trajectory. By analogy, in actual discovery, a real trajectory Tbase is input to discover other similar real trajectories Tbase. Track point filling is actually the process of selecting reasonable points to fill in the missing trajectory segments from the sampled trajectory to the actual trajectory, and the actual trajectory to the ideal trajectory. If the semantic and spatiotemporal feature information is considered at the same time to measure the degree of proximity, if the final input is generated by splicing, it will lead to the default of the three features having the same importance in the process of track point filling, but experiments have found that the main features for track point filling are different in different situations. For stable spatial features, rich semantic features are needed to fill in the points. For trajectories with little spatial position change, their spatial characteristics are much more distinct than flat trajectories. Therefore, in the trajectory filling algorithm, spatial characteristics need to be given more weight. In summary, different trajectory features contribute differently to trajectory filling. The concatenation method is naive and should be represented by a weighted vector. The final representation vector is:
[0084] T={αT1 sem +βT1 time +γT1 space ,…,αT n sem +βT n time +γT n space}
[0085] Where T sem ,T time ,T space are the corresponding time, space, and semantic feature vectors, α, β, γ are the corresponding weight parameters, and α+β+γ=1.
[0086] S32: Quantify the status factor of the peer vehicle
[0087] In the above process, the task of completing the trajectory points is mainly improved by combining the rich semantic information in the vehicle activity trajectory, thereby training the deep learning model to learn to generate the trajectory representation vector. However, there is a shortcoming: due to the limitation of the number of hidden layer nodes, the model has a weak learning ability for long trajectory input. In the process of solving peer vehicles, the trajectory is usually long. Therefore, it is necessary to distinguish the complicated positioning points inside the long trajectory and separate those with strong influence. As shown in Figure X, P2 and P3, these points often determine the direction of the trajectory, while P1 and P4 will not change their original direction. P2 and P3 are called inflection points. Therefore, when calculating the trajectory similarity, P2 and P3 should be given higher weights, and those ordinary points should be skipped. Only in this way can the trained vector capture the dominant features and information in the long trajectory. According to the above, the three trajectory feature vectors extracted are matrices with the same dimension size (D x T), where T refers to the number of recorded points in the trajectory and the length of the trajectory, and D refers to the dimension of the potential feature factor. By concatenating the three feature matrices by column, the trajectory input can be expressed as, in order to simplify the expression, N is used to represent 3d, d is any dimension of time, space or semantics, therefore, the final input of the model is expressed as a matrix of N rows (N features) and T columns (T recording points), and the union is taken to generate the trajectory matrix E. Assume that the j-th column of the matrix E can be used as the representation of the j-th trajectory point, denoted as E(·,j). In order to further optimize the trajectory matrix, a layer of attention mechanism is first added in the encoding stage. At time slice t, the implementation method is to use the hidden state h of the previous layer and the state value q of the memory unit to calculate the weights, so as to perform weighted processing for each trajectory point. After completing the weight calculation, the attention weights are normalized by the softmax function:
[0088]
[0089]
[0090] in, W (2) =R N*N ,b1 and v1 refer to the parameter matrix of the neural network. Stochastic gradient descent and back propagation are used to optimize the learning of parameters. Finally, the processed trajectory embedding matrix is obtained based on the attention score and the original trajectory sequence. The following lists the process of the weighted operation of the nth row:
[0091] E p (n,.)={E(n,1)α n1 ,E(n,2)α n2 ...E(n,T)α nT}
[0092] According to the nth row, the trajectory matrix after the attention mechanism can be further written as:
[0093] E p ={E(1, ·)...E(N, ·)}
[0094] The above q is a part of the access points extracted from the trajectory. This part of the access points has a larger weight in the trajectory. This type of point is generally an inflection point or other point. Those skilled in the art can extract and expand it according to the vehicle's stay time at a certain access point or an inflection point with a large directional change to obtain a matrix parameter related to the hyperparameter.
[0095] S33: Building the model
[0096] The proposed model is composed of two bidirectional GRUs that share weights and introduces a self-attention mechanism. The two parts obtain low-dimensional vector expressions of two trajectories for calculating trajectory similarity. Trajectory pairs with trajectory similarity higher than a threshold are traveling together. The attention mechanism is introduced in the bidirectional GRU, which provides a set of weight vectors for the hidden state of the GRU. These weight vectors are dot-multiplied with the hidden state of the GRU and then summed up. The weighted GRU hidden state obtained is the low-dimensional vector expression of the trajectory.
[0097] Suppose there is a trajectory T with n access points, that is, T = {v1, v2…vn}, where vi is the k-dimensional access point time, space, and semantic feature fusion vector obtained in the previous section. Therefore, T is a sequence of n k-dimensional vectors, that is, a two-dimensional matrix of n*k.
[0098] Now take T as the rabbit of the bidirectional GRU model and obtain the dependencies between the vector access points in the trajectory, we can get:
[0099]
[0100]
[0101] Each and Connect to get a hidden vector S t , let the hidden state vector of each unidirectional GRU be a dimension, and all n S t Let S be the matrix of size 2a*n. S = (s1, s2, s3…sn). The goal is to encode a variable-length trajectory into a fixed-size vector, which is achieved by the linear combination of the n GRU hidden state vectors in S. The weight of the linear combination is obtained by the self-attention mechanism, which takes the entire GRU hidden state S as input and outputs the weight vector u:
[0102] u=softmax(w2tanh(w1S))
[0103] Where w1 is a b*2a weight matrix, w2 is a parameter vector of dimension b, where b is a hyperparameter that can be set arbitrarily, and softmax ensures that the sum of all calculated weights is 1. The GRU hidden layer state S is weighted and summed according to the weights provided by u to obtain the vector representation m of the input semantic trajectory.
[0104] The information represented by this vector is concentrated on a specific part of the trajectory, such as a set of trajectory points associated with the access point type or spatially adjacent trajectory points. It can reflect the local information in a trajectory. Therefore, in order to represent the complete semantic trajectory information, a multi-angle attention mechanism is designed to focus on different parts of the trajectory. Assuming that q different parts are extracted from the trajectory, w2 needs to be expanded into a q*b matrix to obtain the weight matrix U.
[0105] Multiply the weight matrix U and the GRU hidden layer state S to obtain a low-dimensional vector representation of the complete trajectory. The vector representation m of the trajectory becomes a q*2a matrix M: M=US. Similarly, the other part uses the same strategy to obtain the low-dimensional expression matrix of its trajectory, and then calculates the trajectory similarity of the two trajectories through cosine similarity.
[0106]
[0107] As long as the similarity value is greater than the input threshold ε, the two trajectories are similar, that is, the two trajectories are trajectories of the same vehicle.
[0108] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for discovering peer vehicles based on natural semantic processing, characterized in that: The specific steps include: S1. Obtain the vehicle's driving trajectory. The vehicle's trajectory is represented by T = {(l1, t1, m1), (l2, t2, m2), ..., (l n ,t n ,m n )}, where l n Indicates the location information of the nth trajectory point, t n Indicates the time information of the nth trajectory point, m n Represents the text information of the point of interest of the nth trajectory point; S2, extract features from trajectory data from three dimensions: time, space, and semantics, and perform weighted fusion on the features according to their importance to obtain a vectorized representation of the trajectory; S3, after the extracted three-dimensional features are quantized and fused, a trajectory corpus is formed by dividing the trajectory pair data set into trajectories and sub-trajectories, wherein the sub-trajectory is a sampling sequence obtained by sampling the trajectory; S4. Use the GRU model to build a peer vehicle detection model. During training, the sub-trajectories in the trajectory corpus are used as input and the source trajectory is used as the target output; S5, taking the hidden vector of the peer vehicle discovery model as the actual expression of each trajectory, calculating the similarity of all trajectories, and defining the vehicle group with a similarity greater than a specified threshold as the peer vehicle group; The similar process of building a peer vehicle discovery model to calculate two trajectories includes: Assume a trajectory T with n access points, that is, the trajectory is represented by T = {v1, v2…vn}, vi is the fusion vector of the three-dimensional features of the i-th access point in time, space, and semantics, vi = (l i ,t i ,m i ); Input the trajectory T into the bidirectional GRU model and extract the hidden layer state; Use the hidden state as the input of the attention mechanism and calculate the weights of the elements in the hidden state; The obtained weight is weighted and summed with the hidden layer state to obtain the vector expression of the semantic trajectory; When calculating the similarity of two trajectories, the cosine distance between the vector expressions of the two trajectories is calculated. If the cosine distance between the vector expressions of the two trajectories is less than the set threshold, the two trajectories are judged to be similar.
2. The method for discovering peer vehicles based on natural semantic processing according to claim 1, characterized in that: Feature extraction of trajectory data from the spatial dimension, that is, extracting the distance between two trajectories from the spatial dimension, including: Among them, DTW(T1,T2) represents the DTW spatial similarity of two trajectories; head(T1) represents the first position in the trajectory; head(T2) represents the second position in the trajectory; Rest(T1) represents the trajectory after removing the first position point; Rest(T2) represents the trajectory after removing the second position point; n and m are the lengths of trajectory T1 and trajectory T2, respectively, that is, the number of positioning points therein.
3. The method for discovering peer vehicles based on natural semantic processing according to claim 1, characterized in that: Feature extraction is performed on trajectory data from the time dimension. A time threshold is set. When the difference between two moments falls within the given threshold, the two moments are considered similar. If the difference does not fall within the given threshold, they are considered dissimilar. Alternatively, the intersection and union of two trajectory time segments are extracted, and the ratio of the intersection to the union is calculated. The closer the ratio is to 1, the higher the similarity of the time segments.
4. The method for discovering peer vehicles based on natural semantic processing according to claim 1, characterized in that: Feature extraction of trajectory data from the semantic dimension includes the following steps: Classify the facilities in public places and construct a vector expression of access points based on the attributes of each type; The GloVe word vector algorithm is used to extract semantic features in trajectories and perform low-dimensional vectorization; The expression of the semantic feature vector is optimized, and the cost function in the optimization process is expressed as: Where J is the loss function of the GloVe word vector model in the process of optimizing the expression of semantic feature vectors; k is other words that appear in the context of word i; w k is the vector representation of word k; b i and b k is the hyperparameter of the Glove word vector model; X ik It represents the number of times word i and word k appear in the same sliding window in the entire corpus.
5. The method for discovering peer vehicles based on natural semantic processing according to claim 1, characterized in that: The attention mechanism gives higher weight to the turning points in the trajectory. If the sum of the turning angles between a point and its upstream and downstream nodes in the sliding window is greater than the set threshold, the point is considered an inflection point.
6. The method for discovering peer vehicles based on natural semantic processing according to claim 1, characterized in that: The process of obtaining the vector expression of the semantic trajectory includes: When the trajectory is input into the bidirectional GRU model to extract the hidden state, a hidden state vector with a dimension of 2a is obtained. The hidden state vectors of n access points form a 2a*n matrix S. The weight vector is obtained through the attention mechanism, and the obtained weight vector is multiplied with the matrix to obtain the vector expression of the semantic trajectory of a trajectory. The weight vector is expressed as: u=softmax(w2tanh(w1S)) Among them, w1 is the b*2a weight matrix, w2 is the parameter vector of dimension b, and b is an arbitrarily set hyperparameter; the bidirectional GRU model includes two GRUs, forward and backward, and a is the dimension of a single GRU hidden layer state vector.
7. The method for discovering traveling vehicles based on natural semantic processing according to claim 6 is characterized in that: According to the attributes of the trajectory access points, w2 is expanded. If q access points are extracted from a trajectory, w2 is expanded into a q*b matrix, and the selected q access points are the access points in the trajectory whose weights are greater than the set threshold.