Highway traffic incident detection method, system and device based on small sample learning
Through small sample learning and twin network architecture, combined with time series clustering and sample pairing technology, the problem of sample imbalance and overfitting in traditional traffic event detection is solved, and the accuracy and safety of traffic event detection are improved.
Patent Information
- Application Number
- CN202410734145.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-07
AI Technical Summary
Traditional traffic incident detection technology has a small number of event samples, which makes the model insensitive to minority class samples and has a high false negative rate. Moreover, training can easily fall into overfitting, resulting in insufficient model generalization capabilities.
Using a method based on small sample learning, non-event samples were extracted through case-control studies to build a traffic incident detection model with a twin network architecture. Time series clustering and sample pairing technology were used to downsample and standardize the sample data to improve the generalization of the model. ability.
It effectively alleviates the problem of data imbalance, improves the accuracy of the model and traffic event detection, reduces the false negative rate, and enhances traffic safety monitoring capabilities.
Smart Images

Figure CN118312837B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of highway traffic safety research, and relates to a highway traffic incident detection method, system and equipment, and in particular to a highway traffic incident detection method, system and equipment based on small sample learning. Background Art
[0002] Traffic incident detection technology can monitor and identify the occurrence of traffic incidents in real time by collecting and analyzing traffic flow data, including information such as vehicle speed, density, and flow. At the same time, the development of machine learning and data analysis technology has also provided strong support for the use of traffic flow data for traffic incident detection. By analyzing and modeling a large amount of historical data, accurate traffic incident detection models can be trained. These models can identify abnormal situations that do not conform to normal traffic flow patterns and issue alarms or take corresponding measures in a timely manner. By detecting traffic incidents in real time, it can help traffic management departments better understand and respond to traffic incidents and improve traffic operation efficiency and safety. At the same time, this technology also provides important support for the development of intelligent transportation systems.
[0003] Traditional event detection technology is mainly based on the changes in traffic flow parameters of upstream and downstream detectors, and is implemented by manually setting thresholds. This threshold setting is often too subjective and the event recognition rate is not high. With the development of big data and artificial intelligence technology, many technologies that use deep learning to detect traffic events have emerged in recent years. However, most methods have the following two problems: 1. Event samples are far less than non-event samples, resulting in the model being insensitive to minority samples and a high false negative rate; 2. The total sample size is limited, and training is prone to overfitting, resulting in insufficient generalization of the model. Summary of the invention
[0004] In response to the above problems, the present invention provides a highway traffic incident detection method, system and device based on small sample learning. The present invention helps to accurately detect accidental traffic incidents, provides support for avoiding secondary accidents and improving traffic safety levels.
[0005] The technical solution adopted by the present invention is as follows:
[0006] A highway traffic incident detection method based on small sample learning includes the following steps:
[0007] S1. Collect traffic incident samples and extract non-incident samples using case-control study methods to obtain original data;
[0008] S2. Calculate traffic flow data based on the original data, extract the spatiotemporal state characteristics of the traffic flow, obtain an event sample feature set and a non-event sample feature set, and divide the event sample feature set and the non-event sample feature set into a training set and a test set, respectively, to obtain a training sample set and a test sample set;
[0009] S3, pairing the samples in the training sample set to obtain sample pairs, and assigning a label to each sample pair to obtain a training sample pair set;
[0010] S4. Adopt the twin network architecture in small sample learning to build a traffic incident detection model, and use the training sample pair set to train the traffic incident detection model;
[0011] S5. Pair the samples in the test sample set to obtain a test sample pair set, and use the test sample pair set to perform performance evaluation on the trained traffic event detection model;
[0012] S6. Perform traffic incident detection using the trained traffic incident detection model.
[0013] Furthermore, the traffic event sample data includes the location and time of the traffic event; the non-event sample must meet the following conditions:
[0014] a. Non-event samples and event samples come from the same traffic detector and are collected in the same time period;
[0015] b. If the event occurs on a working day, the non-event sample is extracted from all other working days in the same month except the day on which the event occurs; if the event occurs on a non-working day, the non-event sample is extracted from all other non-working days in the same month except the day on which the event occurs;
[0016] c. The non-event sample should be extracted 0.5 hours before the occurrence of any event sample, or 0.5 hours after the end of the event duration.
[0017] Furthermore, in step S1, the detectors corresponding to the event samples and non-event samples are both the upstream and downstream detectors of the nearest neighbors of their occurrence locations, and the raw data extracted by the detectors include:
[0018] The total number of vehicles N that pass through the detector within a certain period of time T;
[0019] The speed of each vehicle at the detector within a certain period of time T ;
[0020] The time it takes for each vehicle to pass through the detector within a certain period of time T .
[0021] Furthermore, in step S2, the traffic flow data includes flow, speed and occupancy; the traffic flow spatiotemporal state characteristics include upstream flow, speed, occupancy time series data, downstream flow, speed, occupancy time series data and upstream and downstream flow, speed, occupancy difference time series data.
[0022] Further, in step S3, the event sample feature set and the non-event sample feature set are divided into a training set and a test set respectively to obtain a training sample set and a test sample set, specifically:
[0023] The event sample feature set and the non-event sample feature set are subjected to standard deviation Z-score normalization, a certain proportion of samples are randomly selected from the event sample feature set as the event sample training set, and the remaining samples are used as the event sample test set; the same proportion of samples are randomly selected from the non-event sample feature set as the non-event sample training set, and the remaining samples are used as the non-event sample test set; the non-event sample training set is downsampled, and the event sample training set and the downsampled non-event sample training set form a training sample set, and the event sample test set and the non-event sample test set form a test sample set. Furthermore, the downsampling of the non-event sample training set is specifically as follows:
[0024] The K-shape time series clustering method is used to cluster the non-event sample training set, and the clusters, based on the number of samples in the event sample training set , randomly selected from each cluster representative samples to obtain the downsampled non-event sample training set.
[0025] Furthermore, in step S3, the samples in the training sample set are paired to obtain sample pairs, and labels are assigned to each sample pair, specifically:
[0026] Each sample in the training sample set is paired with all other samples in the training sample set except itself to obtain several sample pairs; if both samples in the sample pair are event samples or non-event samples, a positive label is assigned; if the two samples in the sample pair are event samples and non-event samples respectively, a negative label is assigned.
[0027] Furthermore, in step S4, the structures of the two sub-networks in the twin network architecture are long short-term memory network LSTM-attention mechanism-fully connected layer FC, and the two sub-networks share the same weights and parameters; the loss function used in the training model is the contrast loss function.
[0028] Step S5 is specifically as follows: the samples in the test sample set are paired one by one with the samples in the training sample set to obtain a test sample pair set; the test sample pairs are input into the trained traffic detection model, and the model outputs the distance between the two samples. For a certain sample in the test sample set, the minimum distance output after pairing with all the samples in the training sample set is used, and the test sample is classified into the same category as the minimum distance paired sample, thereby evaluating the performance of the traffic event detection model.
[0029] A highway traffic incident detection system based on small sample learning, comprising:
[0030] A data collection module is used to collect traffic event samples and extract non-event samples using a case-control study method to obtain raw data;
[0031] A feature extraction module is used to calculate traffic flow data based on raw data, extract spatiotemporal state features of traffic flow, obtain event sample feature sets and non-event sample feature sets, and divide the event sample feature sets and non-event sample feature sets into training sets and test sets, respectively, to obtain training sample sets and test sample sets;
[0032] A training sample pairing module is used to pair samples in the training sample set to obtain sample pairs, and assign a label to each sample pair to obtain a training sample pair set;
[0033] The model training module uses the twin network architecture in small sample learning to build and train the traffic incident detection model, and uses the training sample pair set for training;
[0034] A performance evaluation module is used to pair samples in the test sample set to obtain a test sample pair set, and use the test sample pair set to perform performance evaluation on the trained traffic event detection model;
[0035] The event detection module is used to perform traffic event detection using the trained traffic event detection model.
[0036] A computer device, comprising:
[0037] one or more processors;
[0038] A memory for storing one or more programs;
[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned tunnel driving risk level assessment method based on vehicle bus data.
[0040] The present invention has the following beneficial effects:
[0041] First, the present invention adopts time series clustering to downsample non-event samples. Compared with other sampling methods, the clustered samples can not only fully represent the original samples, but also retain the distribution of the original samples to the maximum extent, so that the distribution of the downsampled samples is highly similar to the original samples.
[0042] Second, the present invention uses paired samples to detect traffic incidents based on small sample learning. Sample pairing can not only effectively alleviate the problem of data imbalance, but also greatly enrich the sample data, making the model training more sufficient.
[0043] Third, the twin network architecture adopted by the present invention is easier to distinguish the feature expressions of samples of different categories in high-dimensional space compared to the single network architecture, and has the advantage of high-precision event detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flow chart of a highway traffic incident detection method based on small sample learning in an embodiment of the present invention.
[0045] Figure 2 It is an architectural diagram of the model adopted in the embodiment of the present invention.
[0046] Figure 3 It is a schematic diagram of the upstream and downstream traffic time series data of a certain sample in an embodiment of the present invention.
[0047] Figure 4 It is a schematic diagram of upstream and downstream speed time series data of a certain sample in an embodiment of the present invention.
[0048] Figure 5 It is a schematic diagram of the time series data of the upstream and downstream occupancy rates of a certain sample in an embodiment of the present invention.
[0049] Figure 6 It is a schematic diagram of the time series data of the difference between the upstream and downstream flow rates of a certain sample in an embodiment of the present invention.
[0050] Figure 7 It is a schematic diagram of time series data of the difference between upstream and downstream speeds of a certain sample in an embodiment of the present invention.
[0051] Figure 8 It is a schematic diagram of the time series data of the difference between the upstream and downstream occupancy rates of a certain sample in an embodiment of the present invention.
[0052] Fig. 9 It is a distribution diagram of the distances between sample pairs of features during the first cycle of model training in an embodiment of the present invention.
[0053] Fig.10 It is a distribution diagram of the distances between sample pairs of features during the 10th cycle of model training in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The technical solution of the present invention is described in detail below with reference to the accompanying drawings and specific examples.
[0055] Example 1
[0056] like Figure 1 As shown, a highway traffic incident detection method based on small sample learning includes the following steps:
[0057] S1. Collect traffic incident samples and extract non-incident samples using case-control study methods to obtain original data;
[0058] S2. Calculate traffic flow data based on the original data, extract the spatiotemporal state characteristics of traffic flow, obtain the event sample feature set ESFS and the non-event sample feature set NESFS, and divide the event sample feature set and the non-event sample feature set into a training set and a test set, respectively, to obtain a training sample set and test sample set ;
[0059] S3, training sample set Pair the samples in to get sample pairs, and assign labels to each sample pair to get the training sample pair set ;
[0060] S4. Use the twin network architecture in small sample learning to build a traffic incident detection model and use the training samples to Train traffic incident detection models;
[0061] S5. Pair the samples in the test sample set to obtain a test sample pair set. , using the test sample pair set Evaluate the performance of the trained traffic incident detection model;
[0062] S6. Perform traffic incident detection using the trained traffic incident detection model.
[0063] In the above technical solution, the traffic event sample data includes the location and time of the traffic event; the non-event sample must meet the following conditions:
[0064] a. Non-event samples and event samples come from the same traffic detector and are collected in the same time period;
[0065] b. If the event occurs on a working day, the non-event sample is extracted from all other working days in the same month except the day on which the event occurs; if the event occurs on a non-working day, the non-event sample is extracted from all other non-working days in the same month except the day on which the event occurs;
[0066] c. The non-event sample should be extracted 0.5 hours before the occurrence of any event sample, or 0.5 hours after the end of the event duration.
[0067] In step S1, the detectors corresponding to the event samples and non-event samples are the upstream and downstream detectors that are the nearest neighbors of their occurrence locations, and the raw data extracted by the detectors include:
[0068] The total number of vehicles N that pass through the detector within a certain period of time T;
[0069] The speed of the i-th vehicle passing through the detector within a certain period of time T ;
[0070] The time taken by the i-th vehicle to pass the detector within a certain time period T .
[0071] In step S2, the traffic flow data includes flow rate, speed and occupancy rate, and the calculation method is:
[0072] flow ;
[0073] speed ;
[0074] Occupancy ;
[0075] The spatiotemporal state characteristics of traffic flow include upstream characteristics, i.e., upstream flow, speed, and occupancy time series data, downstream characteristics, i.e., downstream flow, speed, and occupancy time series data, and upstream and downstream difference characteristics, which are obtained by calculating the difference in flow, speed, and occupancy between the upstream and downstream at the same time step t, and the formula is:
[0076]
[0077] in, is the difference, and are the corresponding parameter values of the downstream and upstream at time step t, respectively.
[0078] The mathematical representation of a single sample is as follows:
[0079]
[0080] Among them, X is the sample, is the feature vector of time step t, N is the total number of time steps, and d is the feature vector of each time step The number of features in .
[0081] In step S3, the event sample feature set and the non-event sample feature set are divided into a training set and a test set respectively to obtain a training sample set and a test sample set, specifically:
[0082] For event sample feature set and non-event sample feature set The standard deviation Z-score is normalized and the calculation formula is as follows:
[0083]
[0084] in, is the jth data of the i-th feature dimension, is the standardized data, μ is the mean of the i-th feature dimension data of all samples, and σ is the standard deviation of the i-th feature dimension data of all samples.
[0085] Randomly select a% (the value of a can be 70, 80, etc.) of samples from the event sample feature set as the event sample training set , the remaining samples are used as event sample test set , randomly select a% of samples from the non-event sample feature set as the non-event sample training set , the remaining samples are used as non-event sample test set ; For non-event sample training set Downsample to obtain the downsampled non-event sample training set , the event sample training set And the non-event sample training set after downsampling Composition of training sample set ( ), the event sample test set and non-event sample test set Composition of test sample set ( ).
[0086] The non-event sample training set Downsampling is performed, specifically:
[0087] The K-shape time series clustering method is used to cluster the non-event sample training set Perform clustering to obtain clusters , cluster Included Clusters, based on event sample training set The number of samples in , randomly selected from each cluster Representative samples are obtained to obtain the downsampled non-event sample training set .
[0088] In step S3, the training sample set Pair the samples in to get sample pairs, and assign labels to each sample pair, specifically:
[0089] The training sample set For each sample in the training sample set, pair it with all other samples except itself in the training sample set to obtain the training sample pair set ; The labeling rules after sample pairing are as follows:
[0090]
[0091] in, is the paired sample pair, , is the i-th sample participating in pairing. The labeling rules are:
[0092] If both samples in a sample pair belong to event samples or non-event samples, a positive label 1 is assigned; if both samples in a sample pair belong to event samples and non-event samples respectively, a negative label 0 is assigned.
[0093] In step S4, the structures of the two sub-networks in the twin network architecture are long short-term memory network LSTM-attention mechanism-fully connected layer FC. The two sub-networks share the same weights and parameters. The model architecture used is as follows: Figure 2 As shown. The sample features are first embedded using LSTM, which outputs a hidden state vector at each time step t and a memory unit , the calculation formula is as follows:
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100] in, are the output vectors of the input gate, forget gate, and output gate at time step t, respectively. For candidate status, refers to the hidden state vector at time step t-1, is the Sigmoid activation function, is the weight matrix, is the bias vector.
[0101] The attention mechanism is used to calculate the hidden state at each time step The importance score of , and then the weighted summation is used to get the final vector, which is calculated as follows:
[0102]
[0103]
[0104]
[0105] in, is a weight vector, and is the weight matrix and bias vector, t and k represent the time step, , are the attention scores at time step t and time step k, respectively. is the attention weight at time step t, N is the total number of time steps, is the feature vector.
[0106] Then z is passed through the fully connected layer to get the final feature vector, which is calculated as follows:
[0107]
[0108] in, is the feature vector output by a single sample through the sub-network, and are the weight matrix and bias vector.
[0109] The loss function used in the training model is the contrast loss function, which is calculated as follows:
[0110]
[0111] Where N is the number of samples, is the label of the sample pair, is the Euclidean distance between features extracted by the model, and d is a fixed parameter with a value of 2. The purpose is to make the distance between features extracted from the same sample through the network close and the distance between different samples far apart.
[0112] Step S5 specifically includes: The samples in the training sample set Pair the samples in one by one to get the test sample pair set ; Input the test sample pair into the trained traffic detection model, obtain the high-dimensional features of the two samples in the model output, and calculate the Euclidean distance between the two high-dimensional features; for a sample in the test sample set, the minimum distance output after pairing with all samples in the training sample set, classify the test sample into the same category as the minimum distance paired sample, and determine whether the test sample is an event sample based on the category judgment, and then evaluate the performance of the traffic event detection model.
[0113] Example 2
[0114] A highway traffic incident detection system based on small sample learning, comprising:
[0115] A data collection module is used to collect traffic event samples and extract non-event samples using a case-control study method to obtain raw data;
[0116] A feature extraction module is used to calculate traffic flow data based on raw data, extract spatiotemporal state features of traffic flow, obtain event sample feature sets and non-event sample feature sets, and divide the event sample feature sets and non-event sample feature sets into training sets and test sets, respectively, to obtain training sample sets and test sample sets;
[0117] A training sample pairing module is used to pair samples in the training sample set to obtain sample pairs, and assign a label to each sample pair to obtain a training sample pair set;
[0118] The model training module uses the twin network architecture in small sample learning to build and train the traffic incident detection model, and uses the training sample pair set for training;
[0119] A performance evaluation module is used to pair samples in the test sample set to obtain a test sample pair set, and use the test sample pair set to perform performance evaluation on the trained traffic event detection model;
[0120] The event detection module is used to perform traffic event detection using the trained traffic event detection model.
[0121] Example 3
[0122] Taking the event information recorded on a certain highway within 28 days (September 1, 2021 - September 28, 2021) as an example, traffic event detection is performed as follows:
[0123] 1. Construction of event and non-event sample feature sets
[0124] The number of event samples recorded within 28 days is 211, and the number of non-event samples obtained by the case-control method is 3267. The minimum time period T recorded by the detector is 30s. Referring to existing research, the data of the first 5 minutes and the first 30s after the traffic event are selected. The traffic flow data is calculated through the original data and the spatiotemporal state characteristics of the traffic flow are extracted to construct the feature set of events and non-events. The schematic diagram of the upstream and downstream flow, speed and occupancy of a sample is shown in the figure below. Figure 3 , 4, 5, the schematic diagram of the difference between upstream and downstream flow, speed and occupancy is as follows Figure 6 , as shown in Figures 7 and 8.
[0125] 2. Construction of training and testing sample pairs
[0126] 80% of the samples are randomly selected from the event and non-event samples as the training set, and the remaining 20% of the samples are used as the test set. Then the non-event sample training set is downsampled. The number of samples before and after downsampling is shown in the following table:
[0127]
[0128] The training sample set is obtained by combining the downsampled non-event sample training set with the event sample training set. The samples in the training sample set are paired. The number of samples after pairing and the ratio of sample categories before downsampling and pairing are shown in the following table:
[0129]
[0130] After sample pairing, the total number and proportion of samples have been improved, which not only avoids the impact of the imbalance in the number of categories, but also enables the model to have sufficient data for training. Combined with the number of samples before downsampling, if the training sets of non-event samples and event samples are directly paired, the number of identical sample pairs and different sample pairs will be approximately 3.429 million and 439,000, respectively. The number is extremely large, and the risk of overfitting during training is high. In addition, the number of categories is still unbalanced, which further illustrates the necessity of downsampling the training set of non-event samples to select representative samples.
[0131] 3. Model training and performance evaluation
[0132] The model is trained using training sample pairs. The distribution of the distance between the sample pairs in period 1 and period 10 during model training is shown in the figure below: Fig. 9 , 10 shown.
[0133] The model performance is evaluated using the test sample pairs. The confusion matrix of the model evaluation results is shown in the following table:
[0134]
[0135] The model achieved a precision of 82.22%, a recall of 86.05%, and an F1 score of 0.841, which can effectively realize traffic incident detection.
[0136] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0137] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 Process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0138] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0140] The above is only a preferred embodiment of the present invention. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present invention by using the above disclosed methods and technical contents without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
Claims
1. A highway traffic incident detection method based on small sample learning, characterized in that: The following steps are involved: S1. Collect traffic incident samples and extract non-incident samples using case-control study methods to obtain original data; S2. Calculate traffic flow data based on the original data, extract the spatiotemporal state characteristics of the traffic flow, obtain an event sample feature set and a non-event sample feature set, and divide the event sample feature set and the non-event sample feature set into a training set and a test set, respectively, to obtain a training sample set and a test sample set; S3, pairing the samples in the training sample set to obtain sample pairs, and assigning labels to each sample pair to obtain a training sample pair set; specifically: pairing each sample in the training sample set with all other samples in the training sample set except itself to obtain several sample pairs; if both samples in the sample pair are event samples or non-event samples, assigning a positive label; if both samples in the sample pair are event samples and non-event samples respectively, assigning a negative label; S4. Use the twin network architecture in small sample learning to build a traffic incident detection model, and use the training sample pair set to train the traffic incident detection model; S5. Pair the samples in the test sample set to obtain a test sample pair set, and use the test sample pair set to perform performance evaluation on the trained traffic event detection model; Specifically, the samples in the test sample set are paired with the samples in the training sample set one by one to obtain a test sample pair set; the test sample pairs are input into the trained traffic detection model, and the model outputs the distance between the two samples. For a sample in the test sample set, the minimum distance output after pairing with all samples in the training sample set is used to classify the test sample into the same category as the paired sample with the minimum distance, thereby evaluating the performance of the traffic event detection model; S6. Perform traffic incident detection using the trained traffic incident detection model.
2. The highway traffic incident detection method based on small sample learning according to claim 1 is characterized in that: The traffic event sample data includes the location and time of the traffic event; the non-event samples must meet the following conditions: a. Non-event samples and event samples come from the same traffic detector and are collected in the same time period; b. If the event occurs on a working day, the non-event sample is extracted from all other working days in the same month except the day on which the event occurs; if the event occurs on a non-working day, the non-event sample is extracted from all other non-working days in the same month except the day on which the event occurs; c. The non-event sample should be extracted 0.5 hours before the occurrence of any event sample, or 0.5 hours after the end of the event duration.
3. The highway traffic incident detection method based on small sample learning according to claim 1 is characterized in that: In step S1, the detectors corresponding to the event samples and non-event samples are the upstream and downstream detectors that are the nearest neighbors of their occurrence locations, and the raw data extracted by the detectors include: The total number of vehicles passing through the detector within a certain period of time T N ; The speed of each vehicle at the detector during a certain period of time T; The time taken by each vehicle to pass the detector within a certain period of time T.
4. The highway traffic incident detection method based on small sample learning according to claim 1 is characterized in that: In step S3, the event sample feature set and the non-event sample feature set are divided into a training set and a test set respectively to obtain a training sample set and a test sample set, specifically: The event sample feature set and the non-event sample feature set are standardized by standard deviation Z-score. A certain proportion of samples are randomly selected from the event sample feature set as the event sample training set, and the remaining samples are used as the event sample test set. The same proportion of samples are randomly selected from the non-event sample feature set as the non-event sample training set, and the remaining samples are used as the non-event sample test set. The non-event sample training set is downsampled, and the event sample training set and the downsampled non-event sample training set form a training sample set, and the event sample test set and the non-event sample test set form a test sample set.
5. The highway traffic incident detection method based on small sample learning according to claim 4 is characterized in that: The downsampling of the non-event sample training set is specifically as follows: The K-shape time series clustering method is used to cluster the non-event sample training set to obtain clusters. According to the number of samples in the event sample training set, representative samples are randomly selected from each cluster to obtain the downsampled non-event sample training set.
6. The highway traffic incident detection method based on small sample learning according to claim 1 is characterized in that: In step S4, the structures of the two sub-networks in the twin network architecture are long short-term memory network LSTM-attention mechanism-fully connected layer FC, and the two sub-networks share the same weights and parameters; the loss function used in the training model is the contrast loss function.
7. A highway traffic incident detection system based on small sample learning, characterized in that: include: A data collection module is used to collect traffic event samples and extract non-event samples using a case-control study method to obtain raw data; A feature extraction module is used to calculate traffic flow data based on raw data, extract spatiotemporal state features of traffic flow, obtain event sample feature sets and non-event sample feature sets, and divide the event sample feature sets and non-event sample feature sets into training sets and test sets, respectively, to obtain training sample sets and test sample sets; The training sample pairing module is used to pair the samples in the training sample set to obtain sample pairs, and assign labels to each sample pair to obtain a training sample pair set; specifically, each sample in the training sample set is paired with all other samples in the training sample set except itself to obtain a number of sample pairs; if both samples in the sample pair are event samples or non-event samples, a positive label is assigned; if both samples in the sample pair are event samples and non-event samples respectively, a negative label is assigned; The model training module uses the twin network architecture in small sample learning to build and train the traffic incident detection model, and uses the training sample pair set for training; A performance evaluation module is used to pair samples in the test sample set to obtain a test sample pair set, and use the test sample pair set to perform performance evaluation on the trained traffic event detection model; Specifically, the samples in the test sample set are paired with the samples in the training sample set one by one to obtain a test sample pair set; the test sample pairs are input into the trained traffic detection model, and the model outputs the distance between the two samples. For a sample in the test sample set, the minimum distance output after pairing with all samples in the training sample set is used to classify the test sample into the same category as the paired sample with the minimum distance, thereby evaluating the performance of the traffic event detection model; The event detection module is used to perform traffic event detection using the trained traffic event detection model.
8. A computer device, characterized in that: The computer device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the highway traffic incident detection method based on small sample learning as described in any one of claims 1-6.
Citation Information
Patent Citations
An anomaly detection method of traffic surveillance video
CN109284705A
Expressway interleaving area traffic safety state prediction method
CN112990545A
Artificial intelligence-based traffic accident prediction method, apparatus and device, and medium
CN115082868A
Method and system for automatically classifying environmental sanitation events based on multi-source information fusion
CN116109857A
Training method and identification method of traffic accident identification model, and electronic equipment
CN116628500A
