A vehicle frequent trajectory recognition method and device based on LSTM autoencoder
Through LSTM auto-encoding technology and G-means clustering algorithm, the problem of high computational complexity in vehicle trajectory data processing is solved, frequent routes are identified, data processing efficiency is improved and valuable information support is provided for intelligent transportation.
Patent Information
- Application Number
- CN202010698289.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-20
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-07-20
AI Technical Summary
When the existing technology processes vehicle trajectory data, the calculation time complexity is high and it is not suitable for trajectories in different areas and sampling rates, making it difficult to effectively identify frequent routes.
LSTM autoencoding technology is used to preprocess and encode vehicle trajectories to generate fixed-length latent vectors, and clustering algorithms are used to identify frequent trajectory clusters, and G-means clustering algorithms are used to group and filter out frequent routes.
It improves the efficiency of trajectory data processing, can effectively identify frequent routes, and provides valuable information support for autonomous driving and traffic management.
Smart Images

Figure CN112085048B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle trajectory big data processing, and in particular to a vehicle frequent trajectory recognition method and device based on LSTM autoencoding. Background Art
[0002] The popularity of the Internet of Vehicles has brought a large amount of vehicle spatiotemporal trajectory data to the present invention. Trajectory clustering has always been one of the topics of interest to the automotive academic and industrial communities. It can help vehicle operators discover frequent driving routes and can also help infer users' travel intentions. It has great research value for OEMs, transportation authorities, and operators. Among them, the usual practice for discovering frequent routes is to use certain metrics to quantify trajectory similarity, then apply classic clustering algorithms (such as k-means, DBSCAN, spectral clustering), and filter the clustering results to obtain frequent patterns that meet the requirements. Commonly used trajectory similarity metrics include DTW (dynamic time warping), EDR (edit distance on real number sequences), and LCS (longest common subsequence). These measurement methods do not require two trajectories to have the same sequence length, and can also group similar trajectories in a fixed geographical area and time period, but the computational time complexity is high, and it is not suitable for trajectories distributed in different areas and with different sampling rates. Summary of the invention
[0003] In view of the technical defects and technical drawbacks in the prior art, the embodiments of the present invention provide a vehicle frequent trajectory identification method and device based on LSTM autoencoder to overcome the above problems or at least partially solve the above problems. The specific scheme is as follows:
[0004] As a first aspect of the present invention, a vehicle frequent trajectory recognition method based on LSTM autoencoder is provided, the method comprising:
[0005] Step 1, obtain the historical trajectory sequence of each vehicle, cut the historical trajectory sequence of each vehicle according to different trips, divide a historical trajectory sequence into multiple sub-trajectory sequences and obtain a sub-trajectory sequence set, each sub-trajectory sequence corresponds to a trip, and each sub-trajectory sequence is reduced by a preset reduction strategy to obtain a reduced trajectory sequence;
[0006] Step 2: Train the reduced trajectory sequence based on the LSTM autoencoder technology to obtain the trained LSTM encoder and LSTM decoder, and use the trained LSTM encoder and LSTM decoder to output the reduced trajectory sequences of all vehicles into a fixed dimensional space representation to obtain a fixed-length sub-trajectory sequence latent vector;
[0007] Step 3: Perform cluster analysis on all latent vectors of fixed-length sub-trajectory sequences obtained, group the latent vectors of fixed-length sub-trajectory sequences according to similarity, and obtain different trajectory clusters. Then filter the clusters obtained by clustering, filter out the clusters containing sub-trajectory sequence latent vectors exceeding the preset number, and take the mean vectors of these clusters. The trajectory after decoding by the LSTM decoder is the frequent trajectory.
[0008] Furthermore, in step 1, the historical trajectory sequence of each vehicle is obtained as follows:
[0009] Let any trajectory point of a vehicle o be p i , then p i = <o,timestamp i ,latitude i ,longitude i >; where timestamp i Indicates the timestamp of vehicle o, latitude i and longitude i Respectively represent vehicle o at the corresponding timestamp timestamp i latitude and longitude;
[0010] The point set that sorts the trajectory points in time sequence constitutes a historical trajectory sequence TRo, TRo=(p 1 , p 2 ,…,p m );where p 1 , p 2 ,…,p m They are timestamp 1 , timestamp 2 , …, timestamp m The corresponding trajectory points;
[0011] The historical trajectory sequence of each vehicle is cut according to different trips, and a historical trajectory sequence is divided into multiple sub-trajectory sequences and the sub-trajectory sequence set is obtained as follows:
[0012] Since the time of the trajectory points in the same trip is continuous, the historical trajectory sequence is divided into segments of sub-trajectory sequences trip= based on whether the time interval between adjacent trajectory points in the historical trajectory sequence is greater than the preset time interval or the trajectory point data of the sub-trajectory sequence does not exceed the maximum allowed number. <p 1 ,p 2 ,...,p k >, that is, a sequence of trips, p 1 ,p 2 ,...,p krepresents all trajectory points from the beginning to the end of the corresponding journey, where p 1 represents the first trajectory point of the corresponding journey, p k represents the last trajectory point of the corresponding trip. Based on each sub-trajectory sequence, the sub-trajectory sequence set Ψ=(trip 1 , trip 2 ,…,trip n ), where trip 1 , trip 2 ,…,trip n They are the sub-trajectory sequences obtained by segmenting the historical trajectory sequence, trip 1 Indicates the first sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the first trip, trip n Indicates the last sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the last trip.
[0013] Furthermore, each sub-trajectory sequence is reduced to obtain the reduced trajectory sequence:
[0014] Preprocess each sub-trajectory sequence: based on the latitude and longitude coordinates not exceeding the range of [-90,90] and [-180,180] respectively, filter out the trajectory points beyond this range, and according to the preset trajectory length threshold, filter out the sub-trajectory sequences below the trajectory length threshold;
[0015] Each sub-trajectory sequence obtained based on preprocessing is sorted according to different trips and timestamps, and a time window is applied to each sub-trajectory sequence to reduce the trajectory points of the sub-trajectory sequence into different time windows. The trajectory points of each time window are reduced to a single value through a preset reduction strategy, thereby obtaining the optimized sub-trajectory sequence, namely the reduced trajectory sequence.
[0016] Furthermore, step 2 is specifically as follows:
[0017] The LSTM autoencoder includes an LSTM encoder and an LSTM decoder. Let a given reduced trajectory sequence be B tripi =(b 1 , b 2 , …, b t ), where b 1 , b 2 , …, b t is the trajectory point of the reduced trajectory sequence, i∈(1,n); the input of the model is a sequence B tripi , the LSTM encoder reads the input sequence in order and updates the hidden state ht accordingly. The LSTM encoder updates as follows:
[0018] h t=f LSTM (h t-1 ,b t ), where f is the activation function;
[0019] At the last trajectory point b t After being processed, the hidden state h t Used as the specification trajectory sequence B tripi The low-dimensional implicit representation of is used as a fixed-length vector z. The LSTM decoder first generates the output c using z as the initial hidden state of the LSTM decoder. 1 , and then further generate (c 2 , c 3 , …, c T ), LSTM decoder update method:
[0020] h d t =f LSTM (h d t-1 ,c t-1 ,h t );
[0021] The goal of the decoder is to reconstruct the input sequence B tripi =(b 1 , b 2 , …, b t ), the LSTM encoder and LSTM decoder are trained together to reduce the trajectory sequence by minimizing the reconstruction error. The entire input sequence is reconstructed by the LSTM decoder vector z to obtain a fixed-length sub-trajectory sequence hidden vector z tripi , and obtain the sub-trajectory sequence hidden vector set z of all sub-trajectory sequences Ψ ={z trip1 , z trip2 , …, z tripn}.
[0022] Furthermore, in step 4, all the obtained fixed-length trip vectors are grouped by using a G-means clustering algorithm.
[0023] As a second aspect of the present invention, a vehicle frequent trajectory identification device based on LSTM autoencoder is provided, the device comprising: a data processing module, an autoencoder module, and a clustering module;
[0024] The data processing module is used to obtain the historical trajectory sequence of each vehicle, cut the historical trajectory sequence of each vehicle according to different trips, divide a historical trajectory sequence into multiple sub-trajectory sequences and obtain a sub-trajectory sequence set, each sub-trajectory sequence corresponds to a trip, and perform reduction processing on each sub-trajectory sequence according to a preset reduction strategy to obtain a reduced trajectory sequence;
[0025] The autoencoder module is used to train the reduced trajectory sequence based on the LSTM autoencoder technology to obtain the trained LSTM encoder and LSTM decoder, and use the trained LSTM encoder to output the reduced trajectory sequences of all vehicles into a fixed dimensional space representation to obtain a fixed-length sub-trajectory sequence latent vector;
[0026] The clustering module is used to perform cluster analysis on all the latent vectors of the sub-trajectory sequences of fixed length, group the latent vectors of the sub-trajectory sequences of fixed length according to similarity, so as to obtain different trajectory clusters, filter the clusters obtained by clustering, filter out the clusters containing the number of latent vectors of the sub-trajectory sequences exceeding the preset number, and take the mean vectors of these clusters. The trajectory after decoding by the LSTM decoder is the frequent trajectory.
[0027] Furthermore, the historical trajectory sequence of each vehicle is obtained as follows:
[0028] Let any trajectory point of a vehicle o be p i , then p i = <o,timestamp i ,latitude i ,longitude i >; where timestamp i Indicates the timestamp of vehicle o, latitude i and longitude i Respectively represent vehicle o at the corresponding timestamp timestamp i latitude and longitude;
[0029] The point set that sorts the trajectory points in time sequence constitutes a historical trajectory sequence TRo, TRo=(p 1 , p 2 ,…,p m );where p 1 , p 2 ,…,p m They are timestamp 1 , timestamp 2 , …, timestamp m The corresponding trajectory points;
[0030] The historical trajectory sequence of each vehicle is cut according to different trips, and a historical trajectory sequence is divided into multiple sub-trajectory sequences and the sub-trajectory sequence set is obtained as follows:
[0031] Since the time of the trajectory points in the same trip is continuous, the historical trajectory sequence is divided into segments of sub-trajectory sequences trip= based on whether the time interval between adjacent trajectory points in the historical trajectory sequence is greater than the preset time interval or the trajectory point data of the sub-trajectory sequence does not exceed the maximum allowed number. <p 1 ,p 2 ,...,p k >, that is, a sequence of trips, p 1 ,p 2 ,...,p k represents all trajectory points from the beginning to the end of the corresponding journey, where p 1 represents the first trajectory point of the corresponding journey, p k represents the last trajectory point of the corresponding trip. Based on each sub-trajectory sequence, the sub-trajectory sequence set Ψ=(trip 1 , trip 2 ,…,trip n ), where trip 1 , trip 2 ,…,trip n They are the sub-trajectory sequences obtained by segmenting the historical trajectory sequence, trip 1 Indicates the first sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the first trip, trip n Indicates the last sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the last trip.
[0032] Furthermore, each sub-trajectory sequence is reduced to obtain the reduced trajectory sequence:
[0033] Preprocess each sub-trajectory sequence: based on the latitude and longitude coordinates not exceeding the range of [-90,90] and [-180,180] respectively, filter out the trajectory points beyond this range, and according to the preset trajectory length threshold, filter out the sub-trajectory sequences below the trajectory length threshold;
[0034] Each sub-trajectory sequence obtained based on preprocessing is sorted according to different trips and timestamps, and a time window is applied to each sub-trajectory sequence to reduce the trajectory points of the sub-trajectory sequence into different time windows. The trajectory points of each time window are reduced to a single value through a preset reduction strategy, thereby obtaining the optimized sub-trajectory sequence, namely the reduced trajectory sequence.
[0035] Furthermore, the self-encoding module is specifically used for:
[0036] The LSTM autoencoder includes an LSTM encoder and an LSTM decoder. Let a given reduced trajectory sequence be B tripi =(b1 , b 2 , …, b t ), where b 1 , b 2 , …, b t is the trajectory point of the reduced trajectory sequence, i∈(1,n); the input of the model is a sequence B tripi , the LSTM encoder reads the input sequence in order and updates the hidden state ht accordingly. The LSTM encoder updates as follows:
[0037] h t =f LSTM (h t-1 ,b t ), where f is the activation function;
[0038] At the last trajectory point b t After being processed, the hidden state h t Used as the specification trajectory sequence B tripi The low-dimensional implicit representation of is used as a fixed-length vector z. The LSTM decoder first generates the output c using z as the initial hidden state of the LSTM decoder. 1 , and then further generate (c 2 , c 3 , …, c T ), LSTM decoder update method:
[0039] h d t =f LSTM (h d t-1 ,c t-1 ,h t );
[0040] The goal of the decoder is to reconstruct the input sequence B tripi =(b 1 , b 2 , …, b t ), the LSTM encoder and LSTM decoder are trained together to reduce the trajectory sequence by minimizing the reconstruction error. The entire input sequence is reconstructed by the LSTM decoder vector z to obtain a fixed-length sub-trajectory sequence hidden vector z tripi , and obtain the sub-trajectory sequence hidden vector set z of all sub-trajectory sequences Ψ ={z trip1 , z trip2 , …, z tripn}.
[0041] Furthermore, the clustering module specifically groups all the obtained fixed-length trip vectors by using a G-means clustering algorithm.
[0042] The present invention has the following beneficial effects:
[0043] 1. This paper proposes a vehicle frequent trajectory recognition method and device based on LSTM autoencoder, which includes a three-layer framework. The first layer performs distributed preprocessing on the original GPS trajectory to obtain a stable sequence after smoothing and reduction. Then, a sequence-to-sequence autoencoder is used to generate a deep representation of the stable sequence, solving the problem of inconsistent sequence length (high dimension). Finally, it is applied to actual scenarios, and by visualizing the clustering effect on real data sets, it is proved that it can obtain useful frequent trajectory clusters, that is, frequent routes.
[0044] 2. This invention provides guidance for the exploratory research and application of big data + artificial intelligence in the field of intelligent networking. It uses cutting-edge big data frameworks and deep learning algorithms to process trajectory data, making it a feasible value-added service for Internet of Vehicles ecosystem data, which has good commercial value, such as assisting autonomous driving. Through the mining of trajectory data by the networked platform, congested routes and risk areas are discovered, and global information is provided to autonomous driving vehicles to guide them to drive economically, efficiently and safely;
[0045] 3. Promote business models, discover high-demand routes for taxi and online car-hailing newbies, and reduce the empty running rate; and provide users with functions such as route time estimation to support traffic decision-making. Through the analysis of frequent trajectories, data support can be provided for traffic control departments to guide vehicles and adjust traffic lights. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flow chart of a vehicle frequent trajectory recognition method based on LSTM autoencoding provided in an embodiment of the present invention.
[0047] Figure 2 A schematic diagram of a sliding window reduction strategy for an original sub-trajectory sequence provided by an embodiment of the present invention;
[0048] Figure 3 A schematic diagram of the network structure of the LSTM autoencoder provided in an embodiment of the present invention;
[0049] Figure 4 A schematic diagram of clustering output of a specific network structure diagram provided by an embodiment of the present invention;
[0050] Figure 5-6 A schematic diagram of some frequent vehicle routes provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] 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 present invention, not all 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.
[0052] like Figure 1 As shown, as a first embodiment of the present invention, a vehicle frequent trajectory recognition method based on LSTM autoencoder is provided, and the method includes:
[0053] Step 1, obtain the historical trajectory sequence of each vehicle, cut the historical trajectory sequence of each vehicle according to different trips, divide a historical trajectory sequence into multiple sub-trajectory sequences and obtain a sub-trajectory sequence set, each sub-trajectory sequence corresponds to a trip, and each sub-trajectory sequence is reduced by a preset reduction strategy to obtain a reduced trajectory sequence;
[0054] Step 2: Train the reduced trajectory sequence based on the LSTM autoencoding technology to obtain the trained LSTM encoder and LSTM decoder. The LSTM encoder is used to encode the longitude and latitude of trajectories of different lengths into a latent vector of fixed dimension. The LSTM decoder is responsible for restoring the latent vector to the original longitude and latitude of the trajectory. The trained LSTM encoder and LSTM decoder are used to output the reduced trajectory sequences of all vehicles into a fixed dimensional space representation to obtain a latent vector of a sub-trajectory sequence of fixed length.
[0055] Step 3: Perform cluster analysis on all latent vectors of fixed-length sub-trajectory sequences obtained, group the latent vectors of fixed-length sub-trajectory sequences according to similarity, and obtain different trajectory clusters. Then filter the clusters obtained by clustering, filter out the clusters containing sub-trajectory sequence latent vectors exceeding the preset number, and take the mean vectors of these clusters. The trajectory after decoding by the LSTM decoder is the frequent trajectory.
[0056] For example, there are 5 latent vectors: [1,2,3], [4,5,6], [7,8,9], [1,1,1], [3,3,3]. After grouping and clustering them using Gmeans, two trajectory clusters are obtained, where cluster 1 contains: [1,2,3], [4,5,6], [7,8,9], and cluster 2 contains: [1,1,1], [3,3,3]. For each cluster, Gmeans will automatically calculate the mean vector of each cluster, which is [4,5,6] and [2,2,2] respectively. Bringing these two mean vectors into the LSTM decoder will obtain two trajectories.
[0057] Preferably, in step 1, the historical trajectory sequence of each vehicle is obtained as follows:
[0058] Let any trajectory point of a vehicle o be p i , then p i = <o,timestamp i ,latitude i ,longitude i >; where timestamp i Indicates the timestamp of vehicle o, latitude i and longitude i Respectively represent vehicle o at the corresponding timestamp timestamp i latitude and longitude;
[0059] The point set that sorts the trajectory points in time sequence constitutes a historical trajectory sequence TRo, TRo=(p 1 , p 2 ,…,p m );where p 1 , p 2 ,…,p m They are timestamp 1 , timestamp 2 , …, timestamp m The corresponding trajectory points;
[0060] The historical trajectory sequence of each vehicle is cut according to different trips, and a historical trajectory sequence is divided into multiple sub-trajectory sequences and the sub-trajectory sequence set is obtained as follows:
[0061] Since the time of the trajectory points in the same trip is continuous, for example, if the time difference between two adjacent trajectory points is greater than 10 minutes, it is considered that the two trajectory points are in different trips. The first trajectory point is the end point of the previous trip, and the second trajectory point is the starting point of the next trip. In addition, LSTM needs to set a maximum sequence length, that is, the number of trajectory points, such as 3600, which is calculated based on 1 hour and one point per minute. If the time interval between the trajectory points and adjacent trajectory points of a sub-trajectory is less than the preset time interval, but exceeds 3600, it will be split. The first 3600 points constitute a sub-trajectory, and the latter constitutes another sub-trajectory. Based on this, based on whether the time interval between adjacent trajectory points in the historical trajectory sequence is greater than the preset time interval or the trajectory point data of the sub-trajectory sequence does not exceed the maximum allowed number, the historical trajectory sequence is divided into segments of sub-trajectory sequences trip= <p 1 ,p 2 ,...,p k >, that is, a sequence of trips, p 1 ,p 2 ,...,pk represents all trajectory points from the beginning to the end of the corresponding journey, where p 1 represents the first trajectory point of the corresponding journey, p k represents the last trajectory point of the corresponding trip. Based on each sub-trajectory sequence, the sub-trajectory sequence set Ψ=(trip 1 , trip 2 ,…,trip n ), where trip 1 , trip 2 ,…,trip n They are the sub-trajectory sequences obtained by segmenting the historical trajectory sequence, trip 1 Indicates the first sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the first trip, trip n Indicates the last sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the last trip;
[0062] Preferably, each sub-trajectory sequence is reduced to obtain a reduced trajectory sequence:
[0063] Preprocess each sub-trajectory sequence: based on the latitude and longitude coordinates not exceeding the range of [-90,90] and [-180,180] respectively, filter out the trajectory points beyond this range, and according to the preset trajectory length threshold, filter out the sub-trajectory sequences below the trajectory length threshold;
[0064] For each sub-trajectory sequence obtained based on preprocessing, it is sorted according to different trips and timestamps, and a time window is applied to each sub-trajectory sequence to reduce it, and each trajectory point of the sub-trajectory sequence is divided into different time windows. The trajectory points of each time window are reduced to a single value through a preset reduction strategy. For example, the trajectory points within each minute are represented by a central point, and the sub-trajectory sequence is further compressed (also called reduction) by a time window function, so as to obtain the optimized sub-trajectory sequence, that is, the reduced trajectory sequence, such as Figure 2 shown.
[0065] Due to the different properties and sampling frequencies of given trajectories, it is very important to directly apply RNN to the input sub-trajectory sequence to obtain quality representation. Experiments have found that treating each trajectory as a series of three-dimensional records (time, latitude, longitude) will lead to violent oscillation and non-convergence of parameters during the optimization process of RNN. To address the above problems, the present invention first performs trajectory preprocessing and reduces the trajectory using a time window function. After preprocessing, the present invention converts each trajectory into a feature sequence to describe the movement of the object, and uses a sequence-to-sequence autoencoder to learn a fixed-length deep representation of the trip. The learned low-dimensional representation strongly encodes the different motion characteristics of the vehicle, which is conducive to generating high-quality clusters without the need for complex clustering algorithms.
[0066] Preferably, step 3 is specifically:
[0067] Step 2 is as follows:
[0068] The LSTM autoencoder includes an LSTM encoder and an LSTM decoder. Let a given reduced trajectory sequence be B tripi =(b 1 , b 2 , …, b t ), where b 1 , b 2 , …, b t is the trajectory point of the reduced trajectory sequence, i∈(1,n); the input of the model is a sequence B tripi , the LSTM encoder reads the input sequence in order and updates the hidden state ht accordingly. The LSTM encoder updates as follows:
[0069] h t =f LSTM (h t-1 ,b t ), where f is the activation function;
[0070] At the last trajectory point b t After being processed, the hidden state h t Used as the specification trajectory sequence B tripi The low-dimensional implicit representation of is used as a fixed-length vector z. The LSTM decoder first generates the output c using z as the initial hidden state of the LSTM decoder. 1 , and then further generate (c 2 , c 3 , …, c T ), LSTM decoder update method:
[0071] h d t =f LSTM (hd t-1 ,c t-1 ,h t );
[0072] The goal of the decoder is to reconstruct the input sequence B tripi =(b 1 , b 2 , …, b t ), the LSTM encoder and LSTM decoder minimize (b 1 , b 2 , …, b t ) and (c 1 , c 2 , c 3 , …, c t ) together with the reconstruction error to train the reduced trajectory sequence. The entire input sequence is reconstructed by the LSTM decoder vector z to obtain a fixed-length sub-trajectory sequence hidden vector z tripi , and obtain the sub-trajectory sequence hidden vector set z of all sub-trajectory sequences Ψ ={z trip1 , z trip2 , …, z tripn}.
[0073] The network structure of LSTM autoencoder is as follows Figure 3 As shown in Figure 2, it can be seen that the encoder and decoder are symmetrical, and the encoder compresses the original longitude and latitude sequence into a 3D space representation.
[0074] Preferably, in step 4, all the obtained fixed-length trip vectors are grouped by using a G-means clustering algorithm.
[0075] Through cluster analysis, we hope to use all available vehicle trajectory data to group similar trajectories together. Because it is difficult to know in advance how many unique route groups exist in a city, clustering algorithms like k-means are useless. This is where the G-means clustering algorithm has some practicality. There are other non-K-means analysis methods, but after experiments, it was found that G-means is more suitable for the needs. means will repeatedly test a group of Gaussian patterns. If the group tests positive, then it will split the group. This process is iterated until these groups no longer appear Gaussian positive.
[0076] In order to further verify the effect of the present invention, a real data set was used for testing. The real data set came from the trajectories of 628 pure electric online-hailing vehicles in Wuhan from March 1 to March 15, 2019.
[0077] First, the present invention cuts the data and divides the vehicle historical trajectory sequence into valid trip sequences. The division standard is that if the time difference between two consecutive trajectory points in the ordered historical trajectory sequence is greater than 10 minutes, the first trajectory point is the end point of the previous trip, and the second trajectory point is the starting point of the next trip. At the same time, short trips less than 3 kilometers are filtered out, and finally a total of 25,579 valid trips are obtained.
[0078] Next, the time period for reducing the trajectory data is set to 1 minute, that is, each trajectory point within 1 minute is represented by a central point. Based on a large amount of previous testing work, the specific network structure parameters are obtained as follows: Figure 4 As shown;
[0079] After training the encoding model, the 25579 trip sequences are encoded in turn to obtain a 25579×48 latent feature matrix, which is the input of Gmeans. The distance calculation formula uses the Euclidean distance with lower complexity. The maximum number of clusters to be found is 500, that is, the clustering process is stopped when the k value reaches 500, and the results of these 500 clusters are output. The final output result is to add a label to the above trip sequence, with a total of 500 label values.
[0080] In order to further explain and verify the effect of this framework, the present invention selects a part of frequent routes and displays them on the map. Figure 5-6 It can be clearly seen that the cross-river bridge is a "shared" key path for frequent routes, which is obvious.
[0081] Specifically, Figure 5 It mainly includes a route between Qingshan and Hanyang (Wuhan Railway Station), and a route between Hankou and Wuchang; Figure 6 It includes a top airport line, a route between Hanyang and Wuchang, and a route between Caidian and Optics Valley.
[0082] As a second embodiment of the present invention, a vehicle frequent trajectory identification device based on LSTM autoencoder is provided, the device comprising: a data processing module, an autoencoder module, and a clustering module;
[0083] The data processing module is used to obtain the historical trajectory sequence of each vehicle, cut the historical trajectory sequence of each vehicle according to different trips, divide a historical trajectory sequence into multiple sub-trajectory sequences and obtain a sub-trajectory sequence set, each sub-trajectory sequence corresponds to a trip, and perform reduction processing on each sub-trajectory sequence according to a preset reduction strategy to obtain a reduced trajectory sequence;
[0084] The autoencoder module is used to train the reduced trajectory sequence based on the LSTM autoencoder technology to obtain the trained LSTM encoder and LSTM decoder, and use the trained LSTM encoder to output the reduced trajectory sequences of all vehicles into a fixed dimensional space representation to obtain a fixed-length sub-trajectory sequence latent vector;
[0085] The clustering module is used to perform cluster analysis on all the latent vectors of the sub-trajectory sequences of fixed length, group the latent vectors of the sub-trajectory sequences of fixed length according to similarity, so as to obtain different trajectory clusters, filter the clusters obtained by clustering, filter out the clusters containing the number of latent vectors of the sub-trajectory sequences exceeding the preset number, and take the mean vectors of these clusters. The trajectory after decoding by the LSTM decoder is the frequent trajectory.
[0086] Preferably, the historical trajectory sequence of each vehicle is obtained as follows:
[0087] Let any trajectory point of a vehicle o be p i , then p i = <o,timestamp i ,latitude i ,longitude i >; where timestamp i Indicates the timestamp of vehicle o, latitude i and longitude i Respectively represent vehicle o at the corresponding timestamp timestamp i latitude and longitude;
[0088] The point set that sorts the trajectory points in time sequence constitutes a historical trajectory sequence TRo, TRo=(p 1 , p 2 ,…,p m );where p 1 , p 2 ,…,p m They are timestamp 1 , timestamp 2 , …, timestamp m The corresponding trajectory points;
[0089] The historical trajectory sequence of each vehicle is cut according to different trips, and a historical trajectory sequence is divided into multiple sub-trajectory sequences and the sub-trajectory sequence set is obtained as follows:
[0090] Since the time of the trajectory points in the same trip is continuous, the historical trajectory sequence is divided into segments of sub-trajectory sequences trip= based on whether the time interval between adjacent trajectory points in the historical trajectory sequence is greater than the preset time interval or the trajectory point data of the sub-trajectory sequence does not exceed the maximum allowed number. <p 1 ,p 2 ,...,p k >, that is, a sequence of trips, p 1 ,p 2 ,...,p k represents all trajectory points from the beginning to the end of the corresponding journey, where p 1 represents the first trajectory point of the corresponding journey, p k represents the last trajectory point of the corresponding trip. Based on each sub-trajectory sequence, the sub-trajectory sequence set Ψ=(trip 1 , trip 2 ,…,trip n ), where trip 1 , trip 2 ,…,trip n They are the sub-trajectory sequences obtained by segmenting the historical trajectory sequence, trip 1 Indicates the first sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the first trip, trip n Indicates the last sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the last trip.
[0091] Preferably, each sub-trajectory sequence is reduced to obtain a reduced trajectory sequence:
[0092] Preprocess each sub-trajectory sequence: based on the latitude and longitude coordinates not exceeding the range of [-90,90] and [-180,180] respectively, filter out the trajectory points beyond this range, and according to the preset trajectory length threshold, filter out the sub-trajectory sequences below the trajectory length threshold;
[0093] Each sub-trajectory sequence obtained based on preprocessing is sorted according to different trips and timestamps, and a time window is applied to each sub-trajectory sequence to reduce the trajectory points of the sub-trajectory sequence into different time windows. The trajectory points of each time window are reduced to a single value through a preset reduction strategy, thereby obtaining the optimized sub-trajectory sequence, namely the reduced trajectory sequence.
[0094] Preferably, the self-encoding module is specifically used for:
[0095] The LSTM autoencoder includes an LSTM encoder and an LSTM decoder. Let a given reduced trajectory sequence be B tripi =(b 1, b 2 , …, b t ), where b 1 , b 2 , …, b t is the trajectory point of the reduced trajectory sequence, i∈(1,n); the input of the model is a sequence B tripi , the LSTM encoder reads the input sequence in order and updates the hidden state ht accordingly. The LSTM encoder updates as follows:
[0096] h t =f LSTM (h t-1 ,b t ), where f is the activation function;
[0097] At the last trajectory point b t After being processed, the hidden state h t Used as the specification trajectory sequence B tripi The low-dimensional implicit representation of is used as a fixed-length vector z. The LSTM decoder first generates the output c using z as the initial hidden state of the LSTM decoder. 1 , and then further generate (c 2 , c 3 , …, c T ), LSTM decoder update method:
[0098] h d t =f LSTM (h d t-1 ,c t-1 ,h t );
[0099] The goal of the decoder is to reconstruct the input sequence B tripi =(b 1 , b 2 , …, b t ), the LSTM encoder and LSTM decoder are trained together to reduce the trajectory sequence by minimizing the reconstruction error. The entire input sequence is reconstructed by the LSTM decoder vector z to obtain a fixed-length sub-trajectory sequence hidden vector z tripi , and obtain the sub-trajectory sequence hidden vector set z of all sub-trajectory sequences Ψ ={z trip1 , z trip2 , …, z tripn}.
[0100] Preferably, the clustering module groups all the obtained fixed-length trip vectors specifically by using a G-means clustering algorithm.
[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A vehicle frequent trajectory recognition method based on LSTM autoencoder, It is characterized in that The method comprises: Step 1, obtain the historical trajectory sequence of each vehicle, cut the historical trajectory sequence of each vehicle according to different trips, divide a historical trajectory sequence into multiple sub-trajectory sequences and obtain a sub-trajectory sequence set, each sub-trajectory sequence corresponds to a trip, and each sub-trajectory sequence is reduced by a preset reduction strategy to obtain a reduced trajectory sequence; Step 2: Train the reduced trajectory sequence based on the LSTM autoencoder technology to obtain a trained LSTM encoder and LSTM decoder, and use the trained LSTM encoder to output the reduced trajectory sequences of all vehicles into a fixed dimensional space representation to obtain a fixed-length sub-trajectory sequence latent vector; Step 3: Perform cluster analysis on all latent vectors of sub-trajectory sequences of fixed length, group the latent vectors of sub-trajectory sequences of fixed length according to their similarity, and obtain different trajectory clusters. Then filter the clusters obtained by clustering, filter out the clusters containing sub-trajectory sequence latent vectors exceeding the preset number, and take the mean vectors of these clusters. The trajectory after decoding by the LSTM decoder is the frequent trajectory. In step 1, the historical trajectory sequence of each vehicle is obtained as follows: Let any trajectory point of a vehicle o be p i , then p i = <o,timestamp i ,latitude i ,longitude i >; where timestamp i Indicates the timestamp of vehicle o, latitude i and longitude i Respectively represent vehicle o at the corresponding timestamp timestamp i latitude and longitude; The point set that sorts the trajectory points in time sequence constitutes a historical trajectory sequence TRo, TRo=(p 1 , p 2 ,…,p m );where p 1 , p 2 ,…,p m They are timestamp 1 , timestamp 2 , …, timestamp m The corresponding trajectory points; The historical trajectory sequence of each vehicle is cut according to different trips, and a historical trajectory sequence is divided into multiple sub-trajectory sequences and the sub-trajectory sequence set is obtained as follows: Since the time of the trajectory points in the same trip is continuous, the historical trajectory sequence is divided into segments of sub-trajectory sequences trip= based on whether the time interval between adjacent trajectory points in the historical trajectory sequence is greater than the preset time interval or the trajectory point data of the sub-trajectory sequence does not exceed the maximum allowed number. <p 1 ,p 2 ,...,p k >, that is, a sequence of trips, p 1 ,p 2 ,...,p k represents all trajectory points from the beginning to the end of the corresponding journey, where p 1 represents the first trajectory point of the corresponding journey, p k represents the last trajectory point of the corresponding trip. Based on each sub-trajectory sequence, the sub-trajectory sequence set Ψ=(trip 1 , trip 2 ,…,trip n ), where trip 1 , trip 2 ,…,trip n They are the sub-trajectory sequences obtained by segmenting the historical trajectory sequence, trip 1 Indicates the first sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the first trip, trip n Indicates the last sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the last trip; Among them, each sub-trajectory sequence is reduced to obtain the reduced trajectory sequence as follows: Preprocess each sub-trajectory sequence: based on the latitude and longitude coordinates not exceeding the range of [-90,90] and [-180,180] respectively, filter out the trajectory points beyond this range, and according to the preset trajectory length threshold, filter out the sub-trajectory sequences below the trajectory length threshold; Each sub-trajectory sequence obtained based on preprocessing is sorted according to different trips and timestamps, and a time window is applied to each sub-trajectory sequence to reduce the trajectory points of the sub-trajectory sequence into different time windows. The trajectory points of each time window are reduced to a single value through a preset reduction strategy, thereby obtaining the optimized sub-trajectory sequence, namely the reduced trajectory sequence.
2. The vehicle frequent trajectory recognition method based on LSTM autoencoder according to claim 1, It is characterized in that Step 2 is as follows: The LSTM autoencoder includes an LSTM encoder and an LSTM decoder. Let a given reduced trajectory sequence be B tripi =(b 1 , b 2 , …, b t ), where b 1 , b 2 , …, b t is the trajectory point of the reduced trajectory sequence, i∈(1,n); the input of the model is a sequence B tripi , the LSTM encoder reads the input sequence in sequence and updates the hidden state h accordingly t , LSTM encoder update method: h t =f LSTM (h t-1 ,b t ), where f is the activation function; At the last trajectory point b t After being processed, the hidden state h t Used as the specification trajectory sequence B tripi The low-dimensional implicit representation of is used as a fixed-length implicit vector z. The LSTM decoder first uses z as the initial hidden state to generate the output c 1 , and then further generate (c 2 , c 3 , …, c t ), LSTM decoder update method: h d t =f LSTM (h d t-1 ,c t-1 ,h t ); The goal of the decoder is to reconstruct the input sequence B tripi =(b 1 , b 2 , …, b t ), the LSTM encoder and LSTM decoder minimize (b 1 , b 2 , …, b t ) and (c 1 , c 2 , c 3 , …, c t ) together with the reconstruction error to train the reduced trajectory sequence. The entire input sequence is reconstructed by the LSTM decoder vector z to obtain a fixed-length sub-trajectory sequence hidden vector z tripi , and obtain the sub-trajectory sequence hidden vector set z of all sub-trajectory sequences Ψ ={z trip1 , z trip2 , …, z tripn }.
3. The vehicle frequent trajectory recognition method based on LSTM autoencoder according to claim 1, It is characterized in that In step 4, all the fixed-length trip vectors obtained are grouped using the G-means clustering algorithm.
4. A vehicle frequent trajectory recognition device based on LSTM autoencoder, It is characterized in that The device comprises: a data processing module, an autoencoding module, and a clustering module; The data processing module is used to obtain the historical trajectory sequence of each vehicle, cut the historical trajectory sequence of each vehicle according to different trips, divide a historical trajectory sequence into multiple sub-trajectory sequences and obtain a sub-trajectory sequence set, each sub-trajectory sequence corresponds to a trip, and perform reduction processing on each sub-trajectory sequence according to a preset reduction strategy to obtain a reduced trajectory sequence; The autoencoder module is used to train the reduced trajectory sequence based on the LSTM autoencoder technology to obtain the trained LSTM encoder and LSTM decoder, and use the trained LSTM encoder to output the reduced trajectory sequences of all vehicles into a fixed dimensional space representation to obtain a fixed-length sub-trajectory sequence latent vector; The clustering module is used to perform cluster analysis on all the latent vectors of the sub-trajectory sequences of fixed length, group the latent vectors of the sub-trajectory sequences of fixed length according to similarity, so as to obtain different trajectory clusters, filter the clusters obtained by clustering, filter out the clusters containing the number of latent vectors of the sub-trajectory sequences exceeding the preset number, and take the mean vectors of these clusters, and the trajectory after decoding by the LSTM decoder is the frequent trajectory; The historical trajectory sequence of each vehicle is obtained as follows: Let any trajectory point of a vehicle o be p i , then p i = <o,timestamp i ,latitude i ,longitude i >; where timestamp i Indicates the timestamp of vehicle o, latitude i and longitude i Respectively represent vehicle o at the corresponding timestamp timestamp i latitude and longitude; The point set that sorts the trajectory points in time sequence constitutes a historical trajectory sequence TRo, TRo=(p 1 , p 2 ,…,p m );where p 1 , p 2 ,…,p m They are timestamp 1 , timestamp 2 , …, timestamp m The corresponding trajectory points; The historical trajectory sequence of each vehicle is cut according to different trips, and a historical trajectory sequence is divided into multiple sub-trajectory sequences and the sub-trajectory sequence set is obtained as follows: Since the time of the trajectory points in the same trip is continuous, the historical trajectory sequence is divided into segments of sub-trajectory sequences trip= based on whether the time interval between adjacent trajectory points in the historical trajectory sequence is greater than the preset time interval or the trajectory point data of the sub-trajectory sequence does not exceed the maximum allowed number. <p 1 ,p 2 ,...,p k >, that is, a sequence of trips, p 1 ,p 2 ,...,p k represents all trajectory points from the beginning to the end of the corresponding journey, where p 1 represents the first trajectory point of the corresponding journey, p k represents the last trajectory point of the corresponding trip. Based on each sub-trajectory sequence, the sub-trajectory sequence set Ψ=(trip 1 , trip 2 ,…,trip n ), where trip 1 , trip 2 ,…,trip n They are the sub-trajectory sequences obtained by segmenting the historical trajectory sequence, trip 1 Indicates the first sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the first trip, trip n Indicates the last sub-trajectory sequence corresponding to the historical trajectory sequence, that is, the last trip; Among them, each sub-trajectory sequence is reduced to obtain the reduced trajectory sequence as follows: Preprocess each sub-trajectory sequence: based on the latitude and longitude coordinates not exceeding the range of [-90,90] and [-180,180] respectively, filter out the trajectory points beyond this range, and according to the preset trajectory length threshold, filter out the sub-trajectory sequences below the trajectory length threshold; Each sub-trajectory sequence obtained based on preprocessing is sorted according to different trips and timestamps, and a time window is applied to each sub-trajectory sequence to reduce the trajectory points of the sub-trajectory sequence into different time windows. The trajectory points of each time window are reduced to a single value through a preset reduction strategy, thereby obtaining the optimized sub-trajectory sequence, namely the reduced trajectory sequence.
5. The vehicle frequent trajectory identification device based on LSTM autoencoder according to claim 4, It is characterized in that The self-encoding module is specifically used for: The LSTM autoencoder includes an LSTM encoder and an LSTM decoder. Let a given reduced trajectory sequence be B tripi =(b 1 , b 2 , …, b t ), where b 1 , b 2 , …, b t is the trajectory point of the reduced trajectory sequence, i∈(1,n); the input of the model is a sequence B tripi , the LSTM encoder reads the input sequence in sequence and updates the hidden state h accordingly t , LSTM encoder update method: h t =f LSTM (h t-1 ,b t ), where f is the activation function; At the last trajectory point b t After being processed, the hidden state h t Used as the specification trajectory sequence B tripi The low-dimensional implicit representation of is used as a fixed-length vector z. The LSTM decoder first generates the output c using z as the initial hidden state of the LSTM decoder. 1 , and then further generate (c 2 , c 3 , …, c t ), LSTM decoder update method: h d t =f LSTM (h d t-1 ,c t-1 ,h t ); The goal of the decoder is to reconstruct the input sequence B tripi =(b 1 , b 2 , …, b t ), the LSTM encoder and LSTM decoder are trained together to reduce the trajectory sequence by minimizing the reconstruction error. The entire input sequence is reconstructed by the LSTM decoder vector z to obtain a fixed-length sub-trajectory sequence hidden vector z tripi , and obtain the sub-trajectory sequence hidden vector set z of all sub-trajectory sequences Ψ ={z trip1 , z trip2 , …, z tripn }.
6. The vehicle frequent trajectory identification device based on LSTM autoencoder according to claim 4, It is characterized in that The clustering module specifically groups all the obtained fixed-length trip vectors by using a G-means clustering algorithm.
