An automatic driving edge dangerous scene searching method, system, device and medium
By constructing a search model for edge-hazardous scenarios and combining MiniRocket with anomaly detection, the problems of accuracy and sample requirements for searching rare scenarios in autonomous driving are solved, achieving efficient and interpretable search for edge-hazardous scenarios.
Patent Information
- Application Number
- CN202311164815.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-09-11
AI Technical Summary
Existing technologies struggle to effectively detect rare, edge-hazardous scenarios in autonomous driving scenario searches, and traditional time-series data anomaly detection has low accuracy and requires large sample sizes, resulting in reduced test scenario coverage.
By employing a semi-supervised approach that combines MiniRocket and anomaly detection, a search model for edge-hazardous scenarios is constructed. Convolutional network feature extraction and cluster analysis are used to design a machine learning algorithm that balances overall clustering loss and labeled data association loss, thereby achieving efficient search for edge-hazardous scenarios.
It improves the accuracy and efficiency of edge-hazard scene search, reduces sample requirements and training time, and enhances the interpretability of scene search.
Smart Images

Figure CN117173659B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous driving, and in particular to a method, system, device, and medium for searching dangerous scenarios at the edge of autonomous driving. Background Technology
[0002] With the advancement of artificial intelligence technology, autonomous driving can make transportation safer and more efficient. However, autonomous driving systems (ADs) require thorough testing and evaluation in various scenarios to ensure their safety. Due to the complexity of driving environments, the scenarios that ADs may encounter are virtually limitless. To quickly identify safety-related hazardous scenarios, current research often focuses on the hazard level of the scenario as the search direction to discover hazardous scenarios for autonomous driving testing. Chen et al. used collisions of the tested vehicle as a hazard indicator and employed a reinforcement learning-based search method to search for hazardous scenarios. Feng et al. used the speed difference between adjacent vehicles as a hazard indicator and trained an importance sampling model to search for hazardous scenarios. However, using only hazard level as the search direction can easily overlook marginal hazardous scenarios that are rarer than common hazardous scenarios. This may lead to homogenization of the discovered hazardous scenarios, reducing the coverage of test scenarios. Therefore, discovering marginal hazardous scenarios that are rarer than common hazardous scenarios is of great significance for realizing scenario-based testing of autonomous driving systems.
[0003] However, many dynamic scene elements are high-dimensional and temporal, such as vehicle behavior. This makes it difficult to define scene rarity as easily as hazard level, thus hindering search efforts. Some literature attempts to compress temporal high-dimensional dynamic scenes into low-dimensional features using Singular Value Decomposition (SVD) or autoencoders. These low-dimensional features can be used to evaluate scene rarity, thereby identifying even rarer scenes. However, the feature extraction and rarity evaluation processes in these methods are independent, making it difficult to guarantee that the extracted low-dimensional features are the key features representing scene rarity.
[0004] Another feasible approach is to treat rare scenes as anomalous samples that are unique compared to common scenes, equating rarity with anomaly. Anomaly detection methods can then be used in high-dimensional, time-series scene datasets to identify rare and dangerous scene samples. To address the anomaly detection task in high-dimensional, time-series data, Zong et al. proposed a clustering-based anomaly detection method called DeepAutoencoding Gaussian Mixture Model (DAGMM). This method designs an overall loss that includes feature extraction loss and evaluation model loss, making the feature extraction process and scene rarity evaluation process interconnected. This ensures that the feature extraction process for high-dimensional time-series data aligns with the goal of discovering rare scenes. However, this method is a self-supervised process, and the feature extraction and anomaly evaluation lack interpretability. This means that the anomaly evaluation for a scene may not be calculated based on the relatively common scene types, reducing the accuracy of discovering rare and dangerous scenes. Furthermore, this method uses deep networks, which increases the requirement for a large initial dangerous dataset and the time cost of training. Dempster et al. proposed the Minimally Random Convolutional Kernel Transform (MiniRocket) method, which uses a large number of relatively fixed convolutional kernels to form a single-layer feature extraction network instead of a deep network, enabling feature extraction with a small number of training samples. However, the feature extraction process of this method is independent of the scene anomaly evaluation process. Summary of the Invention
[0005] The purpose of this invention is to provide a method, system, device, and medium for searching dangerous scenarios at the edge of autonomous driving, in order to solve the problems of low accuracy and large sample requirements in traditional time-series data anomaly detection, and to achieve efficient searching of dangerous scenarios at the edge.
[0006] To achieve the above objectives, the present invention provides the following solution:
[0007] A method for searching dangerous edge scenarios in autonomous driving includes:
[0008] Obtain a hazardous scenario dataset; the hazardous scenario dataset includes: an unlabeled time-series dataset and a labeled time-series dataset;
[0009] A search model for edge-hazardous scenarios is constructed. This model comprises a feature extraction network and a clustering network connected in sequence. The feature extraction network includes convolutional layers and a feature compression module connected in sequence. The feature compression module includes a linear classifier and a fully connected layer connected in sequence. The clustering network includes a probability density estimation module and a parameter and outlier estimation module connected in sequence. The probability density estimation module includes four fully connected layers and an activation function connected in sequence. The parameter and outlier estimation module is constructed based on a Gaussian mixture model.
[0010] The dangerous scene dataset is input into the edge dangerous scene search model for training, and the outlier value of each dangerous scene sample is calculated using the trained edge dangerous scene search model; the outlier value represents the probability that the dangerous scene sample is an edge dangerous scene, and the larger the outlier value, the greater the probability that the dangerous scene sample is an edge dangerous scene.
[0011] Based on the magnitude of outliers in all hazardous scene samples, a marginal hazardous scene dataset is determined from the hazardous scene dataset.
[0012] Optionally, a dataset of hazardous scenarios can be obtained, specifically including:
[0013] Obtain an autonomous driving dataset; the autonomous driving dataset includes scene data of several master vehicles during the autonomous driving process;
[0014] Scene data with collision time less than a first set value or headway less than a second set value are selected from the autonomous driving dataset as dangerous scene samples to obtain an unlabeled time series dataset.
[0015] Several logical judgment criteria for dangerous scene categories are constructed, and category labels are added to some dangerous scene samples in the unlabeled time series dataset according to the logical judgment criteria to form a labeled time series dataset.
[0016] Optionally, the hazardous scene dataset is input into the edge hazardous scene search model for training, and the trained edge hazardous scene search model is used to calculate the outliers of each hazardous scene sample, specifically including:
[0017] The dangerous scene dataset is input into the feature extraction network for training to obtain a trained feature extraction network; the trained feature extraction network is used to output low-dimensional features of each dangerous scene sample.
[0018] An association matrix is constructed based on the low-dimensional features of each hazardous scenario sample in the labeled time-series dataset;
[0019] The low-dimensional features of all dangerous scene samples in the dangerous scene dataset and the correlation matrix are input into the clustering network for training to obtain a trained clustering network; the trained clustering network is used to output the outliers of each dangerous scene sample.
[0020] The outlier values of each dangerous scene sample are calculated using a pre-trained edge danger scene search model; the pre-trained edge danger scene search model includes: the pre-trained feature extraction network and the pre-trained clustering network.
[0021] Optionally, the dangerous scene dataset is input into the feature extraction network for training to obtain a trained feature extraction network, specifically including:
[0022] The unlabeled time series dataset is input into the convolutional layer of the feature extraction network for training, resulting in a trained convolutional layer.
[0023] The labeled time-series dataset is input into the feature compression module of the feature extraction network for training to obtain a trained feature compression module; the trained feature extraction network includes: the trained convolutional layer and the trained feature compression module.
[0024] Optionally, the low-dimensional features of all dangerous scene samples in the dangerous scene dataset and the correlation matrix are input into the clustering network for training to obtain a trained clustering network, specifically including:
[0025] The low-dimensional features of all dangerous scene samples in the dangerous scene dataset are input into the clustering network for calculation to obtain the outlier values of each dangerous scene sample.
[0026] The clustering loss for all samples is determined based on the weighted average of outliers and covariance penalty of all hazardous scene samples in the hazardous scene dataset.
[0027] The association loss of the labeled samples is determined based on the Euclidean distance of the low-dimensional features of each hazardous scene sample in the labeled time series dataset and the association matrix.
[0028] The final loss is determined based on the clustering loss and the association loss.
[0029] With the goal of the final loss being less than a set loss value, the parameters of the clustering network are updated to obtain a trained clustering network.
[0030] Optionally, the low-dimensional features of all hazardous scene samples in the hazardous scene dataset are input into the clustering network for calculation to obtain the outliers of each hazardous scene sample, specifically including:
[0031] The low-dimensional features of all dangerous scene samples in the dangerous scene dataset are input into the probability density estimation module of the clustering network for calculation to obtain the probability density corresponding to each dangerous scene sample; the probability density represents the probability that the dangerous scene sample belongs to each dangerous scene category;
[0032] The low-dimensional features and corresponding probability densities of all hazardous scene samples in the hazardous scene dataset are input into the parameter and outlier estimation module of the clustering network for calculation to obtain the outlier values of each hazardous scene sample.
[0033] Optionally, a marginal hazardous scene dataset is determined from the hazardous scene dataset based on the magnitude of outliers in all hazardous scene samples, specifically including:
[0034] The outliers of all dangerous scene samples in the dangerous scene dataset are sorted in descending order, and dangerous scene samples with outliers in the top set proportion are identified as edge dangerous scene datasets.
[0035] An autonomous driving edge-hazard scene search system includes:
[0036] A hazardous scenario dataset acquisition module is used to acquire hazardous scenario datasets; the hazardous scenario datasets include: unlabeled time series datasets and labeled time series datasets;
[0037] A module for constructing a search model for edge-hazardous scenarios is included. This model comprises a feature extraction network and a clustering network connected in sequence. The feature extraction network includes convolutional layers and a feature compression module connected in sequence. The feature compression module includes a linear classifier and a fully connected layer connected in sequence. The clustering network includes a probability density estimation module and a parameter and outlier estimation module connected in sequence. The probability density estimation module includes four fully connected layers and an activation function connected in sequence. The parameter and outlier estimation module is constructed based on a Gaussian mixture model.
[0038] The dangerous scene sample outlier calculation module is used to input the dangerous scene dataset into the edge dangerous scene search model for training, and use the trained edge dangerous scene search model to calculate the outlier of each dangerous scene sample; the outlier represents the probability that the dangerous scene sample is an edge dangerous scene, and the larger the outlier, the greater the probability that the dangerous scene sample is an edge dangerous scene.
[0039] The edge danger scene determination module is used to determine the edge danger scene dataset from the danger scene dataset based on the magnitude of the outliers of all danger scene samples.
[0040] An electronic device includes a memory and a processor, the memory storing a computer program, and the processor running the computer program to enable the electronic device to perform the above-described method for searching for dangerous autonomous driving scenarios.
[0041] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for searching dangerous edge scenarios in autonomous driving.
[0042] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0043] The autonomous driving edge hazard scene search method provided by this invention constructs an edge hazard scene search model, inputs a hazard scene dataset into the edge hazard scene search model for training, calculates outliers for each hazard scene sample using the trained edge hazard scene search model, and finally determines the edge hazard scene dataset from the hazard scene dataset based on the magnitude of the outliers. By combining MiniRocket with an anomaly detection scheme, without using deep networks, it greatly improves the accuracy of anomaly detection and reduces the number of hazard scene samples and training time required for network training, enabling efficient search of edge hazard scenes. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 A flowchart of the autonomous driving edge danger scene search method provided by the present invention;
[0046] Figure 2 This is a structural framework diagram of the edge danger scene search model provided by the present invention;
[0047] Figure 3 The flowchart shows the training algorithm for the edge danger scene search model provided by this invention. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] The purpose of this invention is to provide a method, system, device, and medium for searching dangerous scenarios at the edge of autonomous driving, in order to solve the problems of low accuracy and large sample requirements in traditional time-series data anomaly detection, and to achieve efficient searching of dangerous scenarios at the edge.
[0050] To address the issues of accuracy in finding rare, edge-hazardous scenes and the large number of samples required to train deep networks, this invention proposes a fast semi-supervised anomaly detection method for high-dimensional time-series data. This method combines the advantages of MiniRocket and anomaly detection using a semi-supervised approach to achieve efficient searching of edge-hazardous scenes.
[0051] Specifically, this invention treats the search for edge-hazardous scenarios in autonomous driving as a temporal data anomaly detection problem. Through feature extraction using convolutional networks, high-dimensional temporal data is compressed into low-dimensional features, and cluster analysis is used to filter edge-hazardous scenarios suitable for autonomous driving testing. By combining MiniRocket with clustering-based anomaly detection methods, this invention solves the problems of low accuracy and large sample requirements in traditional temporal data anomaly detection. Furthermore, this invention designs a method that considers the overall clustering loss. gmm Loss associated with labeled data rel The machine learning algorithm enables semi-supervised training of the SRG framework, improving the interpretability of scene search.
[0052] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] Example 1
[0054] This invention provides a method for searching for dangerous edge scenarios in autonomous driving. For example... Figure 1 As shown, the method includes:
[0055] Step S1: Obtain the hazardous scene dataset; the hazardous scene dataset includes: unlabeled time series dataset and labeled time series dataset.
[0056] This step specifically includes: acquiring an autonomous driving dataset; the autonomous driving dataset includes scene data of several master vehicles during autonomous driving; selecting scene data with collision time less than a first set value or headway less than a second set value from the autonomous driving dataset as dangerous scene samples to obtain an unlabeled time series dataset; constructing logical judgment criteria for several dangerous scene categories, and adding category labels to some dangerous scene samples in the unlabeled time series dataset according to the logical judgment criteria to obtain a labeled time series dataset.
[0057] In one specific implementation, a natural or autonomous driving dataset is input, and a dataset of hazardous scenarios is first extracted. Two parameters are used to determine whether a scenario is hazardous: the time to collision (TTC) and the time headway (THW). Where TTC = L / v ref THW = L / v ego_y L represents the longitudinal position difference between the driver vehicle and the vehicle in front, v ref The difference in longitudinal speed between the main vehicle and the vehicle in front is represented by v. ego_y This represents the longitudinal velocity of the main vehicle. TTC<2 or THW<1 is selected as the criterion for judging hazardous scenarios, and datasets of hazardous scenarios meeting the requirements are filtered out. Each scenario sample is described as 4*6=24 dimensions of time-series data (lateral and longitudinal acceleration, lateral and longitudinal velocity, and lateral and longitudinal position) of the main vehicle, the preceding vehicle, the accompanying vehicle in the adjacent lane, and the preceding vehicle in the adjacent lane before and after TTC<2 or THW<1, within a certain time interval. The time interval varies depending on the driving dataset. This step outputs an unlabeled time-series dataset. unlabeled .
[0058] Then, based on expert knowledge and manual verification, logical judgment criteria for K common hazardous scenario categories are constructed, and based on these criteria, data is processed. unlabeled The process involves filtering to select a small number of common and standard hazardous scenario samples, which are then labeled to produce a final labeled time-series dataset. labeled .
[0059] Step S2: Construct an edge-hazard scene search model; the edge-hazard scene search model includes a feature extraction network and a clustering network connected in sequence; the feature extraction network includes a convolutional layer and a feature compression module connected in sequence; the convolutional layer includes several single-layer convolutional kernels; the feature compression module includes a linear classifier and a fully connected layer connected in sequence; the clustering network includes a probability density estimation module and a parameter and outlier estimation module connected in sequence; the probability density estimation module includes four fully connected layers and an activation function connected in sequence; the parameter and outlier estimation module is constructed based on a Gaussian mixture model.
[0060] In one specific implementation, the structure of the edge danger scene search model is as follows: Figure 2 As shown, it consists of two parts: a feature extraction network and a clustering network. The structure and function of the clustering network will be explained in detail below.
[0061] 1. Construction of Feature Extraction Network
[0062] The feature extraction network consists of two parts: a single-layer convolutional layer composed of a large number of small convolutional kernels, and a feature compression module composed of a linear classifier and a fully connected layer.
[0063] First, 9996 small convolutional kernels are set in the convolutional layer to extract short-term features (PPV, or Proportion of Positive Values) from the time-series data. PPV represents the proportion of positive values in the matrix Z output after one convolutional kernel operation, and its formula is: Where z i This represents an element in matrix Z. The combination of 9996 PPV features can effectively determine the scene category to which the time-series data belongs. Other parameter settings are shown in Table 1.
[0064] Table 1. Parameters of Convolutional Layers
[0065]
[0066]
[0067] Since the convolution kernel length is 9, the 9 weight parameters w (i.e., the kernel weights) are composed of 3 random 2s and 6 random -1s. The bias is a random value that is selected from all convolution kernel W values. b and the data output in step S1 unlabeled W obtained by convolution calculation b *data unlabeled Choose any one from the [0.25, 0.5, 0.75] quantiles. The dilation coefficient is set to a fixed value of 2. max The maximum value is shown in the following formula: max = log2(l input -1) / (l kernel -1), where l input Represents the sample length, l kernel This represents the length of the convolution kernel.
[0068] Since the short-term feature dimension of a single convolutional layer is 9996*1, to further reduce the feature dimension of the output to the clustering network, this invention uses a linear classifier for further feature extraction. The output vector dimension is the number of categories, and it is pre-trained using labeled common hazardous scene samples obtained in step S1. To link the feature extraction process with outlier evaluation, this invention adds a fully connected layer after the linear classifier. This allows the feature extraction network to optimize its parameters during training based on the loss function, ensuring that the feature extraction network can extract low-dimensional features that achieve the overall goal of searching for edge-hazardous scenes. The dimension of this feature extraction layer is input, set according to the number of common scene categories K, typically input = K + 2. Additionally, the fully connected layer uses 50% dropout to avoid overfitting. This step ultimately forms the feature extraction network.
[0069] 2. Construction of Clustering Networks
[0070] The clustering network consists of a probability density estimation module and a parameter and outlier estimation module, which forms the initial clustering network. The probability density estimation module mainly estimates the probability density of a sample belonging to various common hazardous scenarios based on the low-dimensional features output by the feature extraction network. The parameter and outlier estimation module further estimates the Gaussian mixture model parameters for each common scenario based on the probability density of each sample calculated by the probability density estimation module.
[0071] 2.1 Constructing the probability density estimation module
[0072] The probability density estimation module consists of four fully connected layers and a softmax activation function. The four neurons in the fully connected layers have the following numbers: [input, 2*input, 2*K, K], which further transforms the low-dimensional feature dimension of the feature network output into the number of common hazardous scene categories, K. The softmax activation function calculates the probability that the sample belongs to each common hazardous scene category based on the output of the fully connected layers. The network's initial parameters are initialized randomly.
[0073] 2.2 Constructing the Parameter and Outlier Evaluation Module
[0074] The parametric model of a typical Gaussian Mixture Model (GMM) is constructed as shown in the following equation:
[0075]
[0076] It is a combination of K Gaussian models (i.e., there are K common dangerous scenario models), where z i p(z) represents the low-dimensional feature output by the feature extraction network for the i-th sample. i ) for z iThe probability density in this Gaussian mixture model. γ ik Let p(k) be the probability density of the i-th sample in the k-th Gaussian model, which can be expressed by p(k) and p(z). i p(k) is obtained by multiplying by |k). k It is the weight of the k-th Gaussian model, i.e., the prior probability of the k-th Gaussian model, and satisfies... It is the probability density function of the k-th Gaussian model, that is, after selecting the k-th model, z i The posterior probability. μ k and Σ k Let represent the mean and covariance of the k-th class in the Gaussian Model (GMM), respectively. The parameters of the GMM, including the weights φ of the k-th Gaussian model, are estimated using the following formula. k Mean μ k Covariance Σ k :
[0077]
[0078]
[0079]
[0080] in, Represents φ k The estimated value, Indicates γ ik The estimated value, μ k The estimated value, Represents Σ k The estimated value is given by the superscript T, which indicates transpose, and N, which indicates the total number of samples.
[0081] Define the outlier value for each sample as E(z). i )=-log(p(z i When a sample has a lower probability of appearing in each common hazardous scenario model, its outlier is larger, and it is more likely to be a marginal hazardous scenario. Where p(z) i This can be rewritten as... The parameterized Gaussian mixture model is shown in the following equation:
[0082]
[0083] Step S3: Input the dangerous scene dataset into the edge dangerous scene search model for training, and use the trained edge dangerous scene search model to calculate the outlier value of each dangerous scene sample; the outlier value represents the probability that the dangerous scene sample is an edge dangerous scene, and the larger the outlier value, the greater the probability that the dangerous scene sample is an edge dangerous scene.
[0084] This step specifically includes:
[0085] Step S31: Input the dangerous scene dataset into the feature extraction network for training to obtain a trained feature extraction network; the trained feature extraction network is used to output the low-dimensional features of each dangerous scene sample.
[0086] Specifically, the unlabeled time-series dataset is input into the convolutional layer of the feature extraction network for training to obtain a trained convolutional layer; the labeled time-series dataset is input into the feature compression module of the feature extraction network for training to obtain a trained feature compression module; the trained feature extraction network includes the trained convolutional layer and the trained feature compression module.
[0087] Step S32: Construct an association matrix based on the low-dimensional features of each hazardous scene sample in the labeled time-series dataset.
[0088] Step S33: Input the low-dimensional features of all dangerous scene samples in the dangerous scene dataset and the correlation matrix into the clustering network for training to obtain a trained clustering network; the trained clustering network is used to output the outliers of each dangerous scene sample.
[0089] This step specifically includes:
[0090] Step S331: Input the low-dimensional features of all dangerous scene samples in the dangerous scene dataset into the clustering network for calculation to obtain the outlier values of each dangerous scene sample.
[0091] Specifically, the low-dimensional features of all dangerous scene samples in the dangerous scene dataset are input into the probability density estimation module of the clustering network for calculation to obtain the probability density corresponding to each dangerous scene sample; the probability density represents the probability that the dangerous scene sample belongs to each dangerous scene category; the low-dimensional features and corresponding probability densities of all dangerous scene samples in the dangerous scene dataset are input into the parameter and outlier estimation module of the clustering network for calculation to obtain the outliers of each dangerous scene sample.
[0092] Step S332: Determine the clustering loss of all samples based on the weighted average of outliers and covariance penalty of all dangerous scene samples in the dangerous scene dataset.
[0093] Step S333: Determine the association loss of the labeled samples based on the Euclidean distance of the low-dimensional features of each hazardous scene sample in the labeled time series dataset and the association matrix.
[0094] Step S334: Determine the final loss based on the clustering loss and the association loss.
[0095] Step S335: Update the parameters of the clustering network with the goal of the final loss being less than the set loss value, and obtain the trained clustering network.
[0096] Step S34: Calculate the outliers of each dangerous scene sample using the trained edge dangerous scene search model; the trained edge dangerous scene search model includes: the trained feature extraction network and the trained clustering network.
[0097] In one specific implementation, such as Figure 3 As shown, a semi-supervised training algorithm is used, based on the data extracted in step S1. unlabeled and data labeled Different modules of the edge danger scene search model are trained separately, and the specific process is as follows.
[0098] The inputs to the algorithm are the unlabeled time series dataset data from step S1. unlabeled and labeled time series datasets labeled Specifically, first based on the data unlabeled Convolutional layers of the feature extraction network are constructed. Then, data is used. labeled The linear classifier and fully connected layers in the feature extraction network are pre-trained. The feature extraction network outputs the low-dimensional features z of each sample. i Then z i Used for formal training. And based on the data. labeled Construct an association matrix P, where
[0099] The update of the clustering network parameters θ is determined by the loss function Loss, which is... Where *learn* is the learning rate. In this invention, the loss function *Loss* comprises two parts: the clustering loss for all samples. gmm Association loss with labeled samples rel Its expression is shown in the following formula:
[0100] Loss = Loss gmm +λLoss rel
[0101] Where λ is a hyperparameter used to balance the weights of the two. gmm The aim is to optimize network parameters from the perspective of overall clustering of all samples. To ensure that clustering conforms to the maximum likelihood principle, a clustering loss, Loss, is designed. gmm The expression is shown in the following formula:
[0102]
[0103] It consists of the outliers E(z) of all samples. i Weighted average and covariance penalty Composition. Where ξ i Let λ be the weight of the i-th sample. λ1 is a hyperparameter used to balance the outliers E(z) of the samples. i Weighted average and covariance penalty The weights of the labeled common scenes need to be increased during parameter optimization to ensure that the clusters formed by the Gaussian mixture model correspond to common scene categories. This makes the resulting probability density model more biased towards labeled data. Therefore, ξ is designed... i as follows:
[0104]
[0105] Here, ξ is a hyperparameter, and ξ>1.
[0106] the latter The aim is to avoid the covariance matrix being non-invertible, and its formula is shown below:
[0107]
[0108] in, This represents the covariance matrix of the k-th Gaussian model. The parameters in the j-th row and j-th column.
[0109] Association loss of labeled samples rel Then optimize the network parameters from the perspective of d labeled data. Loss rel Designed as a low-dimensional feature z of any two labeled samples m ,z n Euclidean distance and a mn The average of the products is shown in the following formula:
[0110]
[0111] Where d is the total number of labeled samples, a mn Let z be a coefficient, as shown in the following formula. m and z n When they are of the same type, a mn Positive values are assigned to samples of the same class, while negative values are assigned to samples of different classes. This design allows the feature extraction network to bring low-dimensional features of samples of the same class closer together, while keeping low-dimensional features of samples of different classes further apart, resulting in significant differences in the feature space distribution of labeled samples of different classes. This further facilitates the one-to-one correspondence between various Gaussian mixture models and common scene categories, thus aligning the training objective of the feature extraction network with the overall objective of discovering rare scenes.
[0112]
[0113] Here, η is the proportion of the class to which the m-th sample belongs out of all samples. This design can prevent classes with a small number of samples from being ignored during training.
[0114] By continuously training the network parameters, the final overall network that meets the loss requirements is obtained, and the outlier value of each dangerous scenario sample is calculated.
[0115] Step S4: Determine the edge danger scene dataset from the danger scene dataset based on the magnitude of outliers in all danger scene samples.
[0116] Specifically, outliers in all hazardous scene samples in the hazardous scene dataset are sorted in descending order, and hazardous scene samples with outliers in the top set proportion are identified as edge hazardous scene datasets.
[0117] Preferably, the set ratio is 5%. That is, in this embodiment, dangerous scene samples with outliers in the top 5% are selected as the searched edge dangerous scene dataset. may , and output.
[0118] Example 2
[0119] In order to execute the method corresponding to Embodiment 1 above and achieve the corresponding functions and technical effects, an autonomous driving edge hazard scene search system is provided below, including:
[0120] The hazardous scene dataset acquisition module is used to acquire hazardous scene datasets; the hazardous scene datasets include: unlabeled time series datasets and labeled time series datasets.
[0121] A module for constructing a search model for edge-hazardous scenarios is included. This model comprises a feature extraction network and a clustering network connected in sequence. The feature extraction network includes convolutional layers and a feature compression module connected in sequence. The convolutional layers include several single-layer convolutional kernels. The feature compression module includes a linear classifier and a fully connected layer connected in sequence. The clustering network includes a probability density estimation module and a parameter and outlier estimation module connected in sequence. The probability density estimation module includes four fully connected layers and an activation function connected in sequence. The parameter and outlier estimation module is constructed based on a Gaussian mixture model.
[0122] The dangerous scene sample outlier calculation module is used to input the dangerous scene dataset into the edge dangerous scene search model for training, and use the trained edge dangerous scene search model to calculate the outlier of each dangerous scene sample; the outlier represents the probability that the dangerous scene sample is an edge dangerous scene, and the larger the outlier, the greater the probability that the dangerous scene sample is an edge dangerous scene.
[0123] The edge danger scene determination module is used to determine the edge danger scene dataset from the danger scene dataset based on the magnitude of the outliers of all danger scene samples.
[0124] Example 3
[0125] This invention also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor runs the computer program to enable the electronic device to perform the autonomous driving edge hazard scene search method of Embodiment 1. The electronic device may be a server.
[0126] In addition, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the autonomous driving edge danger scene search method in Embodiment 1.
[0127] In summary, the present invention has the following advantages:
[0128] 1. Traditional deep learning-based anomaly detection schemes for time-series data require a large number of network parameters for training, resulting in a high demand for hazardous scene samples, long training time, and low anomaly detection accuracy when samples are insufficient. This invention combines MiniRocket with an anomaly detection scheme, eliminating the need for deep networks, significantly improving anomaly detection accuracy, and reducing the number of hazardous scene samples and training time required for network training.
[0129] 2. Traditional unsupervised or self-supervised deep learning training methods can lead to a lack of interpretability in the search for edge-hazardous scenarios in autonomous driving. This invention employs a training algorithm that considers both clustering loss for all samples and association loss for labeled samples. This ensures that the clusters formed correspond one-to-one with common hazardous scenario types. Consequently, the anomaly evaluation of each scenario sample is calculated based on the difference between that sample and common hazardous scenarios, thereby significantly improving the interpretability of edge-hazardous scenario mining.
[0130] 3. The entire process only uses manual verification in the last step, which greatly reduces labor costs and helps improve the efficiency of searching for edge dangerous scenarios in high-dimensional time-series driving datasets.
[0131] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.
[0132] Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. Furthermore, those skilled in the art will recognize that, based on the ideas of this invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. An automatic driving edge danger scene search method, characterized in that, The method comprises the following steps: obtaining a dangerous scene dataset; the dangerous scene dataset comprises an unlabeled time series dataset and a labeled time series dataset; constructing an edge dangerous scene search model; the edge dangerous scene search model comprises a feature extraction network and a clustering network connected in sequence; the feature extraction network comprises a convolution layer and a feature compression module connected in sequence; the feature compression module comprises a linear classifier and a fully connected layer connected in sequence; the clustering network comprises a probability density estimation module and a parameter and outlier estimation module connected in sequence; the probability density estimation module comprises four fully connected layers and an activation function connected in sequence; the parameter and outlier estimation module is constructed based on a Gaussian mixture model; inputting the dangerous scene dataset into the edge dangerous scene search model for training, and calculating the outlier of each dangerous scene sample by using the trained edge dangerous scene search model; the outlier represents the possibility that the dangerous scene sample is an edge dangerous scene, and the larger the outlier is, the greater the possibility that the dangerous scene sample is an edge dangerous scene; determining an edge dangerous scene dataset from the dangerous scene dataset according to the size of the outlier of all dangerous scene samples; inputting the dangerous scene dataset into the edge dangerous scene search model for training, and calculating the outlier of each dangerous scene sample by using the trained edge dangerous scene search model, specifically comprising: inputting the dangerous scene dataset into the feature extraction network for training to obtain a trained feature extraction network; the trained feature extraction network is used to output the low-dimensional features of each dangerous scene sample; constructing a correlation matrix according to the low-dimensional features of each dangerous scene sample in the labeled time series dataset; inputting the low-dimensional features of all dangerous scene samples in the dangerous scene dataset and the correlation matrix into the clustering network for training to obtain a trained clustering network; the trained clustering network is used to output the outlier of each dangerous scene sample; calculating the outlier of each dangerous scene sample by using the trained edge dangerous scene search model; the trained edge dangerous scene search model comprises the trained feature extraction network and the trained clustering network.
2. The method of claim 1, wherein, obtaining a dangerous scene dataset, specifically comprising: obtaining an automatic driving dataset; the automatic driving dataset comprises scene data of a host vehicle in an automatic driving process; selecting scene data with a collision time less than a first set value or a headway less than a second set value from the automatic driving dataset as dangerous scene samples to obtain an unlabeled time series dataset; constructing logical judgment criteria of a plurality of dangerous scene categories, and adding category labels to part of the dangerous scene samples in the unlabeled time series dataset as a labeled time series dataset according to the logical judgment criteria.
3. The method of claim 1, wherein, inputting the dangerous scene dataset into the feature extraction network for training to obtain a trained feature extraction network, specifically comprising: inputting the unlabeled time series dataset into the convolution layer of the feature extraction network for training to obtain a trained convolution layer; inputting the labeled time series dataset into a feature compression module of the feature extraction network for training, to obtain a trained feature compression module; the trained feature extraction network comprises the trained convolutional layer and the trained feature compression module.
4. The method of claim 1, wherein, inputting the low-dimensional features of all the dangerous scene samples in the dangerous scene dataset and the correlation matrix into the clustering network for training, to obtain a trained clustering network, specifically comprising: inputting the low-dimensional features of all the dangerous scene samples in the dangerous scene dataset into the clustering network for calculation, to obtain the anomaly values of the dangerous scene samples; determining the clustering loss of all the samples according to the weighted average value of the anomaly values of all the dangerous scene samples in the dangerous scene dataset and the covariance penalty; determining the correlation loss of the labeled samples according to the Euclidean distance of the low-dimensional features of the dangerous scene samples in the labeled time series dataset and the correlation matrix; determining the final loss according to the clustering loss and the correlation loss; updating the parameters of the clustering network to obtain a trained clustering network, with the goal of the final loss being less than a set loss value.
5. The method of claim 4, wherein, inputting the low-dimensional features of all the dangerous scene samples in the dangerous scene dataset into the clustering network for calculation, to obtain the anomaly values of the dangerous scene samples, specifically comprising: inputting the low-dimensional features of all the dangerous scene samples in the dangerous scene dataset into a probability density estimation module of the clustering network for calculation, to obtain the probability densities corresponding to the dangerous scene samples; the probability density represents the probability that the dangerous scene sample belongs to each dangerous scene category; inputting the low-dimensional features of all the dangerous scene samples in the dangerous scene dataset and the corresponding probability densities into a parameter and anomaly value estimation module of the clustering network for calculation, to obtain the anomaly values of the dangerous scene samples.
6. The method of claim 1, wherein, determining an edge dangerous scene dataset from the dangerous scene dataset according to the sizes of the anomaly values of all the dangerous scene samples, specifically comprising: sorting the anomaly values of all the dangerous scene samples in the dangerous scene dataset in descending order, and determining the dangerous scene samples with anomaly values in the front set proportion as the edge dangerous scene dataset.
7. An automatic driving edge danger scene search system characterized by comprising: comprising: a dangerous scene dataset acquisition module, configured to acquire a dangerous scene dataset; the dangerous scene dataset comprises a unlabeled time series dataset and a labeled time series dataset; an edge dangerous scene search model construction module, configured to construct an edge dangerous scene search model; the edge dangerous scene search model comprises a feature extraction network and a clustering network connected in sequence; the feature extraction network comprises a convolutional layer and a feature compression module connected in sequence; the feature compression module comprises a linear classifier and a fully connected layer connected in sequence; the clustering network comprises a probability density estimation module and a parameter and anomaly value estimation module connected in sequence; the probability density estimation module comprises four fully connected layers and an activation function connected in sequence; the parameter and anomaly value estimation module is constructed based on a Gaussian mixture model; The dangerous scene sample anomaly value calculation module is configured to input the dangerous scene dataset into the edge dangerous scene search model for training, and calculate anomaly values of each dangerous scene sample by using the trained edge dangerous scene search model; the anomaly value represents a possibility that the dangerous scene sample is an edge dangerous scene, and the greater the anomaly value, the greater the possibility that the dangerous scene sample is an edge dangerous scene; The dangerous scene dataset is input into the edge dangerous scene search model for training, and anomaly values of each dangerous scene sample are calculated by using the trained edge dangerous scene search model, specifically including: The dangerous scene dataset is input into the feature extraction network for training, and a trained feature extraction network is obtained; the trained feature extraction network is configured to output low-dimensional features of each dangerous scene sample; An association matrix is constructed according to the low-dimensional features of each dangerous scene sample in the labeled time series dataset; The low-dimensional features of all dangerous scene samples in the dangerous scene dataset and the association matrix are input into the clustering network for training, and a trained clustering network is obtained; the trained clustering network is configured to output anomaly values of each dangerous scene sample; the trained edge dangerous scene search model is used to calculate the anomaly values of each dangerous scene sample; the trained edge dangerous scene search model includes the trained feature extraction network and the trained clustering network The edge dangerous scene determination module is configured to determine an edge dangerous scene dataset from the dangerous scene dataset according to the sizes of the anomaly values of all dangerous scene samples.
8. An electronic device, comprising: The electronic device includes a memory and a processor, the memory is configured to store a computer program, and the processor is configured to run the computer program to enable the electronic device to perform the automatic driving edge dangerous scene search method in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer program is stored in the memory and is executed by the processor to implement the automatic driving edge dangerous scene search method in any one of claims 1 to 6.
Citation Information
Patent Citations
A dangerous scene library construction method based on natural driving data
CN109948217A
Driving style analysis method based on big data dangerous scene
CN114971156A