Vehicle trajectory detection method, system, equipment, medium and product
By using a neural network that combines spatiotemporal characteristics to detect vehicle trajectories, the problem of low detection accuracy caused by the inability to comprehensively consider spatiotemporal factors in the prior art is solved, and high-precision and real-time vehicle trajectory detection is achieved.
Patent Information
- Application Number
- CN202411784798.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-06
AI Technical Summary
The prior art cannot fully consider space-time factors when evaluating vehicle trajectory abnormalities, resulting in low real-time detection accuracy of vehicle trajectory and cannot meet the safety requirements of intelligent transportation systems.
The trained generative adversarial network is used to detect the trajectory sequence of the vehicle to be detected for trajectory anomaly detection. The neural network layers in the generator and discriminator (such as recurrent neural networks, convolutional neural networks or long-term memory networks) are fully considered, and the trajectory anomalies are evaluated in combination with residual loss and identification loss.
It improves the accuracy and real-time performance of vehicle trajectory detection, can more accurately identify trajectory abnormalities, and meets the safety needs of intelligent transportation systems.
Smart Images

Figure CN119272153B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle trajectory detection, and in particular to a vehicle trajectory detection method, system, device, medium and product. Background Art
[0002] In complex traffic scenarios, there are often multiple factors that cause vehicle driving trajectories to be abnormal. The first and most important factor that cannot be ignored is the human factor. Driver fatigue or operational errors may cause trajectory deviations. Secondly, the current electronic and electrical equipment of autonomous vehicles is complex and numerous. The on-board equipment is easily affected by environmental interference or technical failures, resulting in equipment performance deviations, making it difficult for autonomous vehicles to drive according to the predetermined trajectory, increasing the uncertainty of vehicle trajectories. At the same time, with the popularization of intelligent transportation systems, network intrusions, data fraud and other attacks frequently occur during vehicle data sharing. These attacks tamper with or destroy trajectory data, further exacerbating the phenomenon of trajectory abnormalities. In addition, individual drivers' illegal behaviors, such as drunk driving and intentional disruption of traffic order, can also cause significant abnormalities in vehicle driving trajectories.
[0003] In summary, vehicle trajectory anomaly has become a public safety issue that cannot be ignored. It not only significantly increases the incidence of traffic accidents, but also aggravates traffic congestion, posing a serious threat to the safety of life and property of the public. For the problem of vehicle trajectory anomaly detection and risk assessment, most existing studies use algorithms based on rules, classification, distance, historical similarity, and grid generation. However, these methods cannot fully consider the important role of spatiotemporal factors in trajectory data when evaluating trajectory anomalies. There is a problem of low accuracy in real-time vehicle trajectory detection, which cannot meet the safety requirements of intelligent transportation systems. Summary of the invention
[0004] The purpose of this application is to provide a vehicle trajectory detection method, system, device, medium and product, which can perform high-precision real-time detection of vehicle trajectories.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a method for detecting a vehicle trajectory, comprising:
[0007] Obtain the trajectory sequence of the vehicle to be detected;
[0008] Using the trained generative adversarial network to perform trajectory anomaly detection on the to-be-detected vehicle trajectory sequence, and obtaining residual loss and discrimination loss, wherein the generative adversarial network includes a generator and a discriminator; the generator and the discriminator each include an input layer, a neural network layer, a fully connected layer, and an output layer, the neural network layer is composed of a plurality of identical or different neural networks, and the neural network is a recurrent neural network, a convolutional neural network, or a long short-term memory network;
[0009] An abnormal value of the to-be-detected vehicle trajectory sequence is obtained based on the residual loss and the identification loss, and a detection result of the to-be-detected vehicle trajectory sequence is obtained according to the abnormal value.
[0010] Furthermore, the training process of the generative adversarial network includes:
[0011] Construct a data set, which includes multiple normal vehicle trajectory sequences and corresponding labels;
[0012] Obtain a noise sequence, input the noise sequence into a generator, obtain a false trajectory sequence and assign a corresponding label; input the false trajectory sequence into a discriminator, and obtain a first identification result;
[0013] Constructing a loss function of a generator based on the first identification result and the label of the false trajectory sequence, minimizing the loss function of the generator using a back propagation algorithm, and updating the parameters of the generator;
[0014] Inputting the normal vehicle trajectory sequence into an identifier to obtain a second identification result;
[0015] A cross entropy loss function is constructed according to the first identification result and the second identification result, a back propagation algorithm is used to minimize the cross entropy loss function, and the parameters of the discriminator are updated.
[0016] Furthermore, constructing the data set includes:
[0017] Acquire vehicle normal trajectory data, where the vehicle normal trajectory data is the trajectory of various types of vehicles during lane change, lane keeping, normal overtaking, acceleration and deceleration operations during driving on urban roads or highways;
[0018] Performing data cleaning and noise reduction processing on the normal vehicle trajectory data to obtain processed normal vehicle trajectory data;
[0019] Normalizing the processed vehicle normal trajectory data to obtain vehicle normal trajectory data of a preset scale;
[0020] The vehicle normal trajectory data of the preset scale is segmented to obtain a plurality of vehicle normal trajectory data segments, and the vehicle normal trajectory data segments are used as the vehicle normal trajectory sequence.
[0021] Furthermore, the calculation formula of the residual loss is:
[0022] ;
[0023] in, is the residual loss, is the trajectory sequence of the vehicle to be detected, is the sequence of fake trajectories generated by the generator, is a noise sequence.
[0024] Furthermore, the calculation formula of the identification loss is:
[0025] ;
[0026] in, is the identification loss, is the intermediate feature statistics of the discriminator on the trajectory sequence of the vehicle to be detected, is the intermediate layer feature statistics of the discriminator for false trajectory sequences.
[0027] Furthermore, the loss function of the generator is:
[0028] ;
[0029] The cross entropy loss function is:
[0030] ;
[0031] in, is the loss function of the generator, is the discriminator cross entropy loss function, is the sample size, is the identification result output by the discriminator, It's a label. Indicates the data set samples.
[0032] In a second aspect, the present application provides a vehicle trajectory detection system, comprising:
[0033] An acquisition module, used to acquire a trajectory sequence of a vehicle to be detected;
[0034] A detection module, used for performing trajectory anomaly detection on the trajectory sequence of the vehicle to be detected by using the trained generative adversarial network to obtain residual loss and discrimination loss; wherein the generative adversarial network includes a generator and a discriminator; the generator and the discriminator each include an input layer, a neural network layer, a fully connected layer and an output layer, the neural network layer is composed of a plurality of identical or different neural networks, and the neural network is a recurrent neural network, a convolutional neural network or a long short-term memory network;
[0035] A result output module is used to obtain an abnormal value of the to-be-detected vehicle trajectory sequence based on the residual loss and the identification loss, and obtain a detection result of the to-be-detected vehicle trajectory sequence according to the abnormal value.
[0036] In a third aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned vehicle trajectory detection method.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned vehicle trajectory detection method when executed by a processor.
[0038] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned vehicle trajectory detection method when executed by a processor.
[0039] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0040] The present application provides a vehicle trajectory detection method, system, device, medium and product, which uses a trained generative adversarial network to perform trajectory anomaly detection on a vehicle trajectory sequence to be detected. The neural network layers in the generator and the discriminator all use a recurrent neural network or a convolutional neural network or a long short-term memory network. The recurrent neural network or the convolutional neural network or the long short-term memory network can fully consider the temporal and spatial factors in the vehicle trajectory sequence to be detected. On this basis, the vehicle trajectory sequence to be detected is jointly evaluated in combination with the residual loss and the discrimination loss, thereby improving the accuracy and real-time performance of abnormal vehicle trajectory detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1This is an application environment diagram of a vehicle trajectory detection method in one embodiment of the present application;
[0043] Figure 2 A schematic diagram of a flow chart of a vehicle trajectory detection method provided in one embodiment of the present application;
[0044] Figure 3 This is a schematic diagram of the segmentation of the normal trajectory data of the vehicle according to the sliding time window;
[0045] Figure 4 A diagram of a trajectory detection architecture based on a generative adversarial network provided in one embodiment of the present application;
[0046] Figure 5 A schematic diagram of functional modules of a vehicle trajectory detection device provided in one embodiment of the present application;
[0047] Figure 6 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0050] The video tag processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the vehicle trajectory sequence to be detected to the server 104. After the server 104 receives the vehicle trajectory sequence to be detected, for the vehicle trajectory sequence to be detected, the server 104 uses the trained generative adversarial network to perform trajectory anomaly detection on the vehicle trajectory sequence to be detected, and obtains the detection result of the vehicle trajectory sequence to be detected. The server 104 can feed back the detection result of the vehicle trajectory sequence to be detected to the terminal 102. In addition, in some embodiments, the vehicle trajectory detection and processing method can also be implemented by the server 104 or the terminal 102 alone, such as the terminal 102 can directly perform trajectory detection processing on the vehicle trajectory sequence to be detected, or the server 104 can obtain the vehicle trajectory sequence to be detected from the data storage system, and perform trajectory detection processing on the vehicle trajectory sequence to be detected.
[0051] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, and tablet computers. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.
[0052] In an exemplary embodiment, Figure 2 As shown, a vehicle trajectory detection method is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:
[0053] Step 201, obtaining a trajectory sequence of vehicles to be detected.
[0054] Step 202 , using the trained generative adversarial network to perform trajectory anomaly detection on the to-be-detected vehicle trajectory sequence, and obtaining a residual loss and a discrimination loss.
[0055] The generative adversarial network includes a generator and a discriminator; the generator and the discriminator each include an input layer, a neural network layer, a fully connected layer and an output layer, the neural network layer is composed of multiple identical or different neural networks, and the neural network is a recurrent neural network, a convolutional neural network or a long short-term memory network.
[0056] Step 203: obtaining an abnormal value of the to-be-detected vehicle trajectory sequence based on the residual loss and the identification loss, and obtaining a detection result of the to-be-detected vehicle trajectory sequence according to the abnormal value.
[0057] By implementing the above steps 201 to 203, the present application can fully consider the temporal and spatial factors in the vehicle trajectory sequence to be detected, thereby improving the accuracy and real-time performance of vehicle trajectory detection.
[0058] In another exemplary embodiment of the present application, before obtaining the trained generative adversarial network in the above step 202, it also includes constructing a data set of normal vehicle trajectory sequences, and constructing the data set includes the following steps 301 to 304:
[0059] Step 301, obtaining vehicle normal trajectory data, wherein the vehicle normal trajectory data is the trajectory obtained by various types of vehicles performing lane changing, lane keeping, normal overtaking, acceleration and deceleration operations during driving on urban roads or highways.
[0060] Specifically, the normal trajectory data of multiple types of vehicles in multiple scenarios and road environments are collected. The normal trajectory data of vehicles comes from multiple sources such as sensor collection, vehicle network data sharing, and integrated information of other related systems. Each normal trajectory data of a vehicle can be represented as a two-dimensional coordinate data containing a time series:
[0061] (1);
[0062] in, The vehicle at time The spatial position coordinates of is the total sampling time length of the vehicle’s normal trajectory.
[0063] Step 302 : performing data cleaning and noise reduction processing on the normal vehicle trajectory data to obtain processed normal vehicle trajectory data.
[0064] If there are missing values in the normal trajectory data of the vehicle, they can be filled by interpolation. According to the general characteristics of vehicle driving behavior, linear interpolation can be used to fill them.
[0065] (2);
[0066] in, and are the two time points before and after the missing value.
[0067] In the data cleaning process, it is necessary to identify and remove abnormal data. Abnormal data may be caused by sensor failure, data transmission error or other reasons, and may appear as sudden speed changes, unreasonable position jumps, etc. Physical-based methods are used to identify abnormal data, including speed, acceleration checks and position jump detection.
[0068] Speed and acceleration check: Calculate the speed and acceleration of the vehicle between adjacent time points to determine whether they exceed the reasonable range. If the speed or acceleration exceeds the preset value, the data is considered abnormal.
[0069] (3);
[0070] (4);
[0071] in, , are the speeds at time t and time t+1 respectively, is the acceleration at time t, , are the positions at time t and time t+1 respectively.
[0072] Position jump detection: Determine whether the distance between adjacent position points exceeds a reasonable range. If the distance is too large, the data is considered abnormal. The calculation formula is:
[0073] (5);
[0074] Since sensor data is inevitably affected by noise, the data must be smoothed to reduce the impact of noise. The Kalman filter method based on the state space model can be used to effectively process the noisy trajectory time series data and clean and process the normal vehicle trajectory data to make it more accurate and reliable, which is helpful for subsequent analysis and application. The Kalman filter method can be expressed as:
[0075] (6);
[0076] in, is a state variable, is the state transition matrix, is the control matrix, is the control input, is the error covariance matrix, is the process noise covariance matrix, is the Kalman gain, is the observation matrix is the observed value, is the measured voice covariance matrix, is the identity matrix.
[0077] Step 303 , normalizing the processed vehicle normal trajectory data to obtain vehicle normal trajectory data of a preset scale.
[0078] Specifically, the normal trajectory data of the vehicle is standardized so that each feature has the same scale, which is convenient for feature extraction during neural network training. The standardization formula is:
[0079] (7);
[0080] in, Normal vehicle trajectory data of preset scale, is the normal trajectory data of the vehicle, is the mean, is the standard deviation.
[0081] Step 304 : segmenting the vehicle normal trajectory data of the preset scale to obtain a plurality of vehicle normal trajectory data segments, and the vehicle normal trajectory data segments are used as the vehicle normal trajectory sequence.
[0082] According to the spatiotemporal characteristics of vehicle trajectories, the normal trajectory data of vehicles with preset scales are segmented into sliding time windows, such as Figure 3 As shown, the segmented vehicle normal trajectory data fragment is:
[0083] (8);
[0084] in, is the time window length, is the sliding step index.
[0085] In another exemplary embodiment of the present application, the training process of the above-mentioned generative adversarial network includes the following steps 401 to 405. Among them:
[0086] Step 401, constructing a data set, the data set includes multiple normal vehicle trajectory sequences and corresponding labels. The label of the normal vehicle trajectory sequence is a normal trajectory. Specifically, the data set is constructed using the above steps 301 to 304.
[0087] Step 402 , obtaining a noise sequence, inputting the noise sequence into a generator to obtain a false trajectory sequence; inputting the false trajectory sequence into a discriminator to obtain a first identification result.
[0088] Randomly obtain a noise sequence with the same length as the normal trajectory sequence of the vehicle from the space vector. Usually, Gaussian noise is selected. The noise sequence is:
[0089] (9);
[0090] in, is the noise sequence, is the time window length, is the sliding step index.
[0091] Both the generator and the discriminator include an input layer, a neural network layer, a fully connected layer, and an output layer. The neural network layer is usually composed of multiple identical or different neural networks. The neural network can be a recurrent neural network, a convolutional neural network, or a long short-term memory network (LSTM).
[0092] Taking the neural network layer as LSTM as an example, multiple LSTM networks are used to learn trajectory features and trajectory spatiotemporal information to train the generator and discriminator.
[0093] The input layer of the generator inputs a noise sequence with the same format as the normal trajectory sequence of the vehicle. The formula for layer LSTM is:
[0094] (10);
[0095] in, It is The hidden state of the layer at the i-th time step, It is The state of the memory unit of the layer at the i-th time step, is the input data of the ith time step of LSTM, It is The hidden state of the layer at the i-1th time step, It is The state of the memory cells of the layer at the i-th time step.
[0096] The fully connected layer is located after the last LSTM layer and maps the output of LSTM to the desired output space. Assume that the output of the last layer of LSTM is , the formula of the fully connected layer is:
[0097] (11);
[0098] in, is the sequence of fake trajectories generated by the generator, is the weight matrix of the fully connected layer, is the bias vector of the fully connected layer.
[0099] Step 403: construct a loss function of the generator based on the first identification result and the label of the false trajectory sequence, use a back propagation algorithm to minimize the loss function of the generator, and update the parameters of the generator.
[0100] The false trajectory sequence generated by the generator will be assigned a false label "0" and input into the discriminator to obtain the first identification result. The ability of the generator to generate vehicle trajectories is measured by the difference between the identification result of the discriminator and the false label. The difference between the false trajectory sequence and the normal trajectory can be measured by using the mean square error as the loss function. The loss function of the generator is obtained based on the first identification result and the false label. The loss function of the generator is:
[0101] (12);
[0102] in, is the loss function of the generator, is the sample size, is the identification result output by the discriminator, It's a label. Indicates the data set samples.
[0103] The back-propagation algorithm is used to minimize the loss function of the generator, update the parameters of the LSTM layer and the fully connected layer, and optimize the generator. Finally, through optimization, a generator that can generate highly realistic trajectory data is obtained.
[0104] The input of the discriminator consists of two parts: a sequence of fake trajectories generated by the generator And the normal trajectory sequence of the vehicle in the dataset .
[0105] The first The layer length short-term memory network layer formula is expressed as:
[0106] (13);
[0107] in, It is The hidden state of the layer, It is The memory cell state of the layer.
[0108] The formula for the fully connected layer is:
[0109] (14);
[0110] in, is the intermediate layer feature statistics of the discriminator for the input sample, which can be regarded as the probability that the input trajectory is a normal trajectory. is the last layer output of LSTM, is the weight matrix of the fully connected layer, is the bias vector of the fully connected layer. During training, The input trajectory in is a false trajectory sequence or a normal vehicle trajectory sequence. During the detection process, The input trajectory in is the trajectory sequence of the vehicle to be detected.
[0111] The output layer uses the Sigmoid activation function to convert the output of the fully connected layer into a probability value, which is used to determine whether the trajectory is abnormal, expressed as:
[0112] (15);
[0113] in, is the probability that the input trajectory sequence is abnormal, is the Sigmoid activation function. During the training process, The input trajectory sequence in is a false trajectory sequence or a normal vehicle trajectory sequence. During the detection process, The input trajectory sequence in is the trajectory sequence of the vehicle to be detected.
[0114] Step 404: input the false trajectory sequence and the normal vehicle trajectory sequence into a discriminator to obtain a second discrimination result.
[0115] The discriminator is trained using the normal vehicle trajectory sequence in the data set to obtain the second identification result. The label of the false trajectory sequence generated by the generator is "0", and the label of the normal vehicle trajectory sequence in the data set is "1", "1" represents a normal trajectory, and "0" represents a false trajectory.
[0116] Step 405: construct a cross entropy loss function according to the first identification result and the second identification result, use a back propagation algorithm to minimize the cross entropy loss function, and update the parameters of the discriminator.
[0117] The identification performance of the discriminator is measured using the binary cross entropy, and the cross entropy loss function is constructed using the second identification result obtained in step 404. The cross entropy loss function is:
[0118] (16);
[0119] in, is the sample size, is the identification result output by the discriminator, is the actual label corresponding to the input trajectory of the discriminator. If the input is a false trajectory sequence, the label is "0", and if the input is a normal vehicle trajectory sequence, the label is "1".
[0120] The back propagation algorithm is used to minimize the cross entropy loss function and update the parameters of the LSTM layer and the fully connected layer to achieve the optimization of the discriminator type. Finally, through optimization, a discriminator that can identify abnormal trajectories and false trajectory sequences is obtained.
[0121] The generative adversarial network consists of two parts: the generator and the discriminator, which are trained simultaneously through game theory. The generator and discriminator are built using long short-term memory networks, recurrent neural networks, or convolutional neural networks with spatiotemporal characteristics within the generative adversarial network to adapt to the temporal and spatial characteristics of the vehicle trajectory. In order to achieve the effect of game training, the generator and discriminator are strengthened. Taking LSTM as an example, multi-layer LSTM is used in both the generator and the discriminator to ensure their strength balance.
[0122] The generator and discriminator are trained through game theory. The training goal is to achieve Nash equilibrium and obtain powerful generators and discriminators. The optimization goal of the generator is:
[0123] (17);
[0124] in, represents the expected value, represents the output of the discriminator, indicating the probability that the trajectory is classified as a normal trajectory; represents the sequence of fake trajectories generated by the generator; represents a noise sequence sampled from the latent space; express The optimization objective of the discriminator can be expressed as:
[0125] (18);
[0126] in, Represents the normal trajectory sequence of vehicles in the dataset; express The overall optimization goal of the generative adversarial network is:
[0127] (19);
[0128] In the process of vehicle trajectory detection, Figure 4 , the vehicle trajectory sequence to be detected is input into the trained generative adversarial network. The trained generator and discriminator simultaneously participate in the detection of the vehicle trajectory sequence to be detected, and the residual loss and the discrimination loss are obtained. The residual loss and the discrimination loss are used to calculate the outlier value (i.e., the anomaly score) to determine whether the vehicle trajectory sequence to be detected is an adversarial attack trajectory (i.e., an abnormal trajectory), and finally the detection result is output.
[0129] The trained generator has the ability to generate trajectories that are extremely close to normal trajectories. The trajectory sequence of the vehicle to be detected is input into the generative adversarial network. The trained generator generates a false trajectory sequence that is as similar as possible to the trajectory sequence of the vehicle to be detected. By comparing the difference between the false trajectory sequence and the trajectory sequence of the vehicle to be detected, the similarity between the false trajectory sequence and the trajectory sequence of the vehicle to be detected is evaluated, which is called the residual loss. The calculation method of the residual loss is:
[0130] (20);
[0131] in, is the residual loss, is the trajectory sequence of the vehicle to be detected, is a sequence of fake trajectories generated by the generator.
[0132] The trained discriminator has the ability to distinguish between false trajectory sequences and normal trajectories. The discriminator obtains the probability of the trajectory sequence to be detected being a false trajectory or a normal trajectory through identification, and evaluates the possibility that the trajectory sequence to be detected is a normal trajectory. The output of is used to calculate the statistics of the specified input small sequence, which is called the identification loss. The identification loss calculation formula is:
[0133] (twenty one);
[0134] in, is the identification loss, is the probability that the trajectory sequence of the vehicle to be detected is a normal trajectory, is the probability that the false trajectory sequence is a normal trajectory.
[0135] In order to obtain more accurate detection results, the outputs of the generator and the discriminator are considered at the same time to obtain the outliers, which serve as the basis for the final determination of whether the trajectory sequence of the vehicle to be detected is an attack trajectory. The final loss expression is:
[0136] (twenty two);
[0137] Among them, the parameters Determined based on multiple experiments and experience, the outliers in the entire time window are calculated to identify whether the trajectory sequence of the vehicle to be detected is an attack trajectory.
[0138] The vehicle trajectory detection method proposed in this application has the following advantages over the traditional method:
[0139] (1) Using generative adversarial networks for unsupervised learning can take advantage of the powerful data generation capabilities of generative adversarial networks. During the training process, realistic vehicle trajectory sequences are continuously optimized and generated for training the discriminator, which greatly reduces the number of training samples required by the deep learning algorithm. Unsupervised learning does not require data labeling, which improves the efficiency of model training.
[0140] (2) Use generative adversarial networks combined with deep learning neural networks to detect vehicle trajectory anomalies. Utilize LSTM or other neural networks with natural spatiotemporal characteristics to capture long-term dependencies in trajectory sequences, fully consider the spatiotemporal risks of vehicle trajectories, and achieve high-precision real-time detection of vehicle trajectories.
[0141] (3) The method proposed in this application is universal and adopts a flexible data processing and feature extraction mechanism. It does not rely on a specific data set structure or format, but is modeled based on the essential characteristics of trajectory data. Therefore, it has strong adaptability and flexibility and can be applied to different types of trajectory data sets. The detection method has good performance in trajectory anomaly detection of various types of vehicles in urban scenes and high-speed scenes.
[0142] Based on the same inventive concept, the embodiment of the present application also provides a vehicle trajectory detection system for implementing the vehicle trajectory detection method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more vehicle trajectory detection system embodiments provided below can refer to the limitations of the vehicle trajectory detection method above, and will not be repeated here.
[0143] In an exemplary embodiment, Figure 5 As shown, a vehicle trajectory detection system is provided, comprising:
[0144] The acquisition module 31 is used to acquire a trajectory sequence of a vehicle to be detected.
[0145] The detection module 32 is used to use the trained generative adversarial network to perform trajectory anomaly detection on the vehicle trajectory sequence to be detected, and obtain residual loss and discrimination loss; wherein the generative adversarial network includes a generator and a discriminator; the generator and the discriminator both include an input layer, a neural network layer, a fully connected layer and an output layer, and the neural network layer is composed of multiple identical or different neural networks, and the neural network is a recurrent neural network or a convolutional neural network or a long short-term memory network.
[0146] The result output module 33 is used to obtain an abnormal value of the to-be-detected vehicle trajectory sequence based on the residual loss and the identification loss, and obtain a detection result of the to-be-detected vehicle trajectory sequence according to the abnormal value.
[0147] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store normal vehicle trajectory data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a vehicle trajectory detection method is implemented.
[0148] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0149] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0150] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0151] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0152] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0154] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0155] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0156] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for detecting vehicle trajectory, characterized in that: The vehicle trajectory detection method comprises: Obtain the trajectory sequence of the vehicle to be detected; Using the trained generative adversarial network to perform trajectory anomaly detection on the to-be-detected vehicle trajectory sequence, and obtaining residual loss and discrimination loss, wherein the generative adversarial network includes a generator and a discriminator; the generator and the discriminator each include an input layer, a neural network layer, a fully connected layer, and an output layer, the neural network layer is composed of a plurality of identical or different neural networks, and the neural network is a recurrent neural network, a convolutional neural network, or a long short-term memory network; The training process of the generative adversarial network includes: constructing a data set, the data set includes multiple normal vehicle trajectory sequences and corresponding labels; obtaining a noise sequence, inputting the noise sequence into a generator, obtaining a false trajectory sequence and assigning a corresponding label; inputting the false trajectory sequence into a discriminator to obtain a first identification result; constructing a loss function of the generator based on the first identification result and the label of the false trajectory sequence, minimizing the loss function of the generator by using a back propagation algorithm, and updating the parameters of the generator; the loss function of the generator is: ; Input the normal trajectory sequence of the vehicle into the discriminator to obtain a second identification result; construct a cross entropy loss function based on the first identification result and the second identification result, use the back propagation algorithm to minimize the cross entropy loss function, and update the parameters of the discriminator; the cross entropy loss function of the discriminator is: ;in, is the loss function of the generator, is the discriminator cross entropy loss function, is the sample size, is the identification result output by the discriminator, It's a label. Indicates the data set samples; The abnormal value of the to-be-detected vehicle trajectory sequence is obtained based on the residual loss and the identification loss, and the detection result of the to-be-detected vehicle trajectory sequence is obtained according to the abnormal value; the calculation formula of the residual loss is: ;in, is the residual loss, is the trajectory sequence of the vehicle to be detected, is the sequence of fake trajectories generated by the generator, is a noise sequence; the calculation formula of the identification loss is: ;in, is the identification loss, is the intermediate feature statistics of the discriminator on the trajectory sequence of the vehicle to be detected, is the intermediate layer feature statistics of the discriminator for false trajectory sequences.
2. The vehicle trajectory detection method according to claim 1, characterized in that: The constructing of the data set comprises: Acquire vehicle normal trajectory data, where the vehicle normal trajectory data is the trajectory of various types of vehicles during lane change, lane keeping, normal overtaking, acceleration and deceleration operations during driving on urban roads or highways; Performing data cleaning and noise reduction processing on the normal vehicle trajectory data to obtain processed normal vehicle trajectory data; Normalizing the processed vehicle normal trajectory data to obtain vehicle normal trajectory data of a preset scale; The vehicle normal trajectory data of the preset scale is segmented to obtain a plurality of vehicle normal trajectory data segments, and the vehicle normal trajectory data segments are used as the vehicle normal trajectory sequence.
3. A vehicle trajectory detection system, characterized in that: The vehicle trajectory detection system comprises: An acquisition module, used to acquire a trajectory sequence of a vehicle to be detected; A detection module, used for performing trajectory anomaly detection on the trajectory sequence of the vehicle to be detected by using the trained generative adversarial network to obtain residual loss and discrimination loss; wherein the generative adversarial network includes a generator and a discriminator; the generator and the discriminator each include an input layer, a neural network layer, a fully connected layer and an output layer, the neural network layer is composed of a plurality of identical or different neural networks, and the neural network is a recurrent neural network, a convolutional neural network or a long short-term memory network; The training module is used to train the generative adversarial network, including: a construction module, used to construct a data set, the data set includes multiple normal vehicle trajectory sequences and corresponding labels; a first identification module, used to obtain a noise sequence, input the noise sequence into the generator, obtain a false trajectory sequence and assign a corresponding label; input the false trajectory sequence into the discriminator to obtain a first identification result; a generator update module, used to construct a loss function of the generator based on the first identification result and the label of the false trajectory sequence, use a back propagation algorithm to minimize the loss function of the generator, and update the parameters of the generator; the loss function of the generator is: ; A second identification module is used to input the normal trajectory sequence of the vehicle into the discriminator to obtain a second identification result; a discriminator update module is used to construct a cross entropy loss function according to the first identification result and the second identification result, and use a back propagation algorithm to minimize the cross entropy loss function and update the parameters of the discriminator; the discriminator cross entropy loss function is: ;in, is the loss function of the generator, is the discriminator cross entropy loss function, is the sample size, is the identification result output by the discriminator, It's a label. Indicates the data set samples; The result output module is used to obtain the abnormal value of the vehicle trajectory sequence to be detected based on the residual loss and the identification loss, and obtain the detection result of the vehicle trajectory sequence to be detected according to the abnormal value; the calculation formula of the residual loss is: ;in, is the residual loss, is the trajectory sequence of the vehicle to be detected, is the sequence of fake trajectories generated by the generator, is a noise sequence; The calculation formula of the identification loss is: ;in, is the identification loss, is the intermediate feature statistics of the discriminator on the trajectory sequence of the vehicle to be detected, is the intermediate layer feature statistics of the discriminator for false trajectory sequences.
4. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vehicle trajectory detection method according to any one of claims 1 to 2.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the vehicle trajectory detection method described in any one of claims 1 to 2 is implemented.
6. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the vehicle trajectory detection method described in any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Generative adversarial network model and vehicle trajectory prediction method using same
CN111931902A
Abnormal vehicle track anomaly detection method and system based on deep learning
CN116415200A