Method for obtaining similarity of autonomous driving scene data samples
By employing a dual-coordinate system cosine calculation method in autonomous driving scenarios, the problem of artifacts in sample similarity judgment under a single coordinate system is solved, thereby improving the accuracy and consistency of sample clustering.
Patent Information
- Application Number
- CN202111198782.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-14
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-10-14
AI Technical Summary
In autonomous driving scenarios, existing technologies, based on the cosine of the included angle calculation method in a single coordinate system, can lead to spurious results in sample similarity judgment, resulting in biased clustering results.
A dual-coordinate system method is adopted. Through normalization and the construction of a new coordinate system, the cosine of the angle between the original and new coordinate systems is calculated and fused to obtain the target cosine value, so as to evaluate the sample similarity.
This effectively avoids false similarity caused by samples being collinear with the origin of the coordinate system, thus improving the accuracy and consistency of sample clustering.
Smart Images

Figure CN113902022B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of autonomous driving technology, and in particular to a method for obtaining similarity of autonomous driving scene data samples. Background Art
[0002] At present, the core of data cluster analysis of collected autonomous driving scene samples is similarity. Samples are classified according to their similarity, and the size of the similarity directly affects the results of sample clustering. By using cluster analysis, the similarity between samples can be objectively judged from a mathematical perspective, which can avoid the influence of human subjective factors when classifying samples, and at the same time, it can discover special cases that are not easily detected by humans.
[0003] In order to determine the similarity between two scene samples, it is necessary to calculate the similarity between the two samples. Common methods for calculating the similarity between samples include Minkowski distance, correlation coefficient, sample angle cosine, etc. The present invention mainly improves the angle cosine method, which is to determine the similarity by calculating the angle cosine of the two samples. The calculated angle cosine value ranges from 0 to 1. If the angle cosine value of the two samples is closer to 1, the similarity of the two samples is higher, otherwise the similarity is lower.
[0004] At present, when the cosine of the angle is used to calculate the similarity between samples of autonomous driving scenes, it is only based on the same coordinate system. If the positions of two samples in space are almost collinear with the three points of the coordinate system origin, but the two samples are far apart in the collinear direction in space, it will create an illusion of similarity, and thus there will be a large deviation when judging whether the two samples are similar or not. Summary of the invention
[0005] In view of the above, the present invention aims to provide a method for obtaining similarity of autonomous driving scene data samples to solve the problem of similarity illusion.
[0006] The technical solution adopted by the present invention is as follows:
[0007] A method for obtaining similarity of autonomous driving scene data samples, comprising:
[0008] Collect data samples for autonomous driving scenarios;
[0009] Performing normalization processing on the data samples;
[0010] Determine the spatial expression of the normalized data sample in the newly constructed coordinate system;
[0011] Calculate the angle cosine of data samples in different scenes based on the original coordinate system and the new coordinate system respectively;
[0012] The cosine of the angle obtained in different coordinate systems is integrated as the target cosine value;
[0013] Determine the similarity of data samples in the autonomous driving scenario based on the target cosine value.
[0014] In at least one possible implementation, the normalization process is performed according to the following formula:
[0015]
[0016] Among them, x j is the jth parameter of the data sample of the current autonomous driving scenario, x j_min is the minimum value of all data samples of autonomous driving scenarios, x j_max is the maximum value of the data samples of all autonomous driving scenarios, X' j is the normalized value.
[0017] In at least one possible implementation manner, the new coordinate system is constructed in a manner including: determining a moving direction and a moving distance of the new coordinate system based on the original coordinate system.
[0018] In at least one possible implementation manner, determining the moving direction and moving distance of the new coordinate system based on the original coordinate system includes:
[0019] Calculate the difference between the data samples of the same category in the scene to be compared;
[0020] Based on the original coordinate system, obtain the coordinates of the midpoints between the data samples of the same category in the scene to be compared;
[0021] Based on the coordinates of the midpoint, calculating the distance between the midpoint and the coordinate axis of the original coordinate system;
[0022] Determine the moving direction of the new coordinate system relative to the original coordinate system according to the difference and the distance;
[0023] Construct a triangle from the pairwise data samples to be compared and the undetermined origin of the new coordinate system;
[0024] The moving distance is obtained by using the maximum value of the angle of the triangle; wherein the angle is the angle between two data samples relative to the undetermined origin.
[0025] In at least one possible implementation manner, the fusing the angle cosines obtained in different coordinate systems as the target cosine value includes: summing the angle cosines obtained in the fusing of different coordinate systems to obtain the target cosine value.
[0026] In at least one possible implementation manner, the method further includes: before normalization, deconstructing and discretizing the collected sample data.
[0027] The main design concept of the present invention is to improve the existing method of judging the similarity of autonomous driving scene data by only a single coordinate system to obtain similarity based on two coordinate systems, that is, to calculate the trade-off from one dimension to two dimensions, and to fuse the similarities in the two coordinate systems, and use the newly constructed similarity index to weigh the similarity of scene data samples. The idea of sample comparison similarity provided by the present invention for autonomous driving scenes can effectively avoid the deviation caused by false similarity.
[0028] Furthermore, when constructing a new coordinate system, the new coordinate system is determined by the larger parameter difference in the scene parameters and the distance from the midpoint to the coordinate axis. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described below with reference to the accompanying drawings, in which:
[0030] Figure 1 A schematic diagram of the existing method for judging the similarity of autonomous driving scene samples based on the cosine of the angle;
[0031] Figure 2 A flowchart of a method for obtaining similarity of autonomous driving scene data samples provided by an embodiment of the present invention;
[0032] Figure 3 Schematic diagram of the angle law of data samples in the coordinate system (I);
[0033] Figure 4 Schematic diagram of the angle law of data samples in the coordinate system (II);
[0034] Figure 5 A schematic diagram of determining a new coordinate system space provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0036] Before developing the specific technical solution of the present invention, the technical context of the present invention is first introduced: when judging the similarity between two samples based on the original angle cosine, if the two samples are collinear with the origin of the coordinate system, but the two samples are far apart along the line, false similarity will occur. In order to avoid false similarity, it is necessary to improve the method of using the original angle cosine to judge the similarity of two samples. The actual autonomous driving scene samples have many spatial dimensions. In order to facilitate the description, the scene samples are simplified into two-dimensional space, as shown below. Figure 1 In the figure, if the similarity between sample A and sample B is measured from a coordinate system, it can be seen from the figure that the angle between sample A and sample B is obviously smaller than the angle between sample A and sample C. From the perspective of the cosine of the angle, the similarity between sample A and sample B is higher than the similarity between sample A and sample C. However, it can be seen from the figure that sample A and sample C are more suitable to be clustered into one category. Therefore, in order to cope with this situation, the present invention proposes that the traditional method of calculating the similarity between samples based on the cosine of the angle needs to be improved.
[0037] Therefore, the present invention provides an embodiment of a method for obtaining similarity of autonomous driving scene data samples. Specifically, Figure 2 shown, including:
[0038] Step S1, collecting data samples of autonomous driving scenarios;
[0039] Step S2, normalizing the data samples;
[0040] Specifically, after the collected scene sample data is deconstructed and discretized, the parameter types of the scene samples are different, and the range of parameter value changes varies greatly. If no processing is done, there will be a large deviation in the coordinate positions of the scene parameters in the coordinate system. For example, the value range of parameter A is [0,1] and the value range of parameter B is [0,10000]. The difference between the A-type parameters and the B-type parameters in the coordinates is often very different. In order to make the difference evaluation between the various parameters more accurate, the original data samples need to be normalized to divide the range of each parameter value in the scene into intervals of the same level. The specific implementation method of normalization can be seen as follows:
[0041]
[0042] Among them, x j is the jth parameter of the data sample of the current autonomous driving scenario, x j_min is the minimum value of all data samples of autonomous driving scenarios, x j_max is the maximum value of the data samples of all autonomous driving scenarios, X' j is the normalized value.
[0043] Step S3, determining the spatial expression of the normalized data sample in the newly constructed coordinate system;
[0044] In actual operation, the key to this step is to determine the moving direction and distance of the new coordinate system based on the original coordinate system.
[0045] Specifically, we can assume that the number of parameters in the data sample is n, and there are currently two data samples of autonomous driving scenes, A and B, and each scene has a coordinate point in the original space. First, calculate the difference between all parameters in the two scenes Δ = (Δ 1 ,Δ 2 ,Δ 3 ...Δ j ) T , and the midpoint coordinate x between all similar parameters of the two scenes mean =(x mean_1 ,x mean_2 ,x mean_3 …x mean_j ) T
[0046] Δ j With x mean_j The calculation method can be referred to as follows:
[0047] Δ j =|(x A_j -x B_j )|(j=1,2,...,n)
[0048]
[0049] In order to make the angle between the origin of the new coordinate system and the positions of the two scene data samples in the new space as large as possible, the following two strategies can be considered:
[0050] (1) Figure 3 As shown, the greater the difference in space between a preset category parameter in two scenes, the greater the angle.
[0051] (2) Figure 4 As shown, for a preset category parameter in two scenes, the smaller the distance between the midpoint of the two coordinate points and the coordinate axis of the coordinate system, the larger the angle. The distance formula between the midpoint of the two coordinates and the coordinate axis j of the coordinate system is as follows:
[0052]
[0053] Therefore, the present invention believes that the direction and position of the coordinate system movement can be determined from the above two aspects. Specifically, in order to maximize the angle between the origin of the new coordinate system and the coordinate points of the two scene data samples, the difference Δ between the above parametersj As large as possible, and D j The value of is as small as possible, so the present invention designs the following evaluation mechanism to determine the best moving direction, as shown below:
[0054] Y j =Δ j / D j
[0055] When Y j When the maximum value is taken, the corresponding current j value represents the direction of translation of the newly constructed coordinate system along the original j axis. For example, by calculating when j = K, Y j The maximum value can be obtained, that is, the moving coordinate is the K axis.
[0056] Next, calculate the moving distance, assuming that the coordinates of the origin of the new coordinate system in the original coordinate system are:
[0057] O'(0,0,...,k,...,0,0)
[0058] Then, points A, B, and O' form a triangle in space, and the expression for the length of each side of the triangle is:
[0059]
[0060]
[0061]
[0062] The expression of the angle is:
[0063]
[0064] In order to maximize the value of the angle, the value of k needs to be determined. Since it is difficult to directly solve the value of k, preferably, the maximum value of the angle can be obtained by traversal, where the value range of k is (x A_K x B_K ), divide the values in this interval according to the actual required accuracy, and substitute the selected K value into the aforementioned angle expression. In this way, when the angle takes the maximum value, the current k value is the target value. Figure 5 As shown, the origin O' of the new coordinate system is translated by a distance k along the original horizontal axis.
[0065] From the above, we can obtain the spatial relationship between different scene data samples in the new coordinate system.
[0066] Step S4, calculating the angle cosine of data samples of different scenes based on the original coordinate system and the new coordinate system respectively;
[0067] Specifically, the cosine of the angle in the original coordinate system can be calculated according to the following formula:
[0068]
[0069] The angle cosine formula in the new coordinate system can be calculated as follows:
[0070] S' AB =cos∠AO'B
[0071] Among them, ∠AO'B is the maximum angle calculated.
[0072] Step S5, integrating the angle cosines obtained in different coordinate systems as the target cosine value;
[0073] Combined with the above, the target cosine value S can be fused as follows:
[0074] S=S AB +S′ AB
[0075] Step S6: Determine the similarity of data samples in the autonomous driving scenario according to the target cosine value.
[0076] Specifically, by performing similarity evaluation through S, false similarity between samples caused by the sample points and the origin of the coordinate system being on the same straight line can be avoided.
[0077] In summary, the main design concept of the present invention is to improve the existing method of judging the similarity of autonomous driving scene data by only a single coordinate system to obtain similarity based on two coordinate systems, that is, to calculate the trade-off from one dimension to two dimensions, and to fuse the similarities in the two coordinate systems, and use the newly constructed similarity index to weigh the similarity of scene data samples. The idea of sample comparison similarity provided by the present invention for autonomous driving scenes can effectively avoid the deviation caused by false similarity.
[0078] In the embodiments of the present invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. A and B may be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c may be single or multiple.
[0079] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings, but the above is only a preferred embodiment of the present invention. It should be noted that the technical features involved in the above embodiments and their preferred methods can be reasonably combined and matched into a variety of equivalent schemes by those skilled in the art without departing from or changing the design ideas and technical effects of the present invention; therefore, the present invention is not limited to the scope of implementation shown in the drawings, and all changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the specification and drawings, should be within the protection scope of the present invention.
Claims
1. A method for obtaining similarity of autonomous driving scene data samples, characterized in that: include: Collect data samples for autonomous driving scenarios; Performing normalization processing on the data samples; Determine the spatial expression of the normalized data sample in the newly constructed coordinate system; wherein the construction method of the new coordinate system includes determining the moving direction and moving distance of the new coordinate system based on the original coordinate system: calculating the difference between the data samples of the same category in the scene to be compared; based on the original coordinate system, obtain the coordinates of the midpoints between the data samples of the same category in the scene to be compared; based on the coordinates of the midpoints, calculate the distance between the midpoints and the coordinate axes of the original coordinate system; determine the moving direction of the new coordinate system relative to the original coordinate system according to the difference and the distance; construct a triangle from the data samples to be compared and the undetermined origin of the new coordinate system; use the maximum value of the angle of the triangle to solve and obtain the moving distance; wherein the angle is the angle between the two data samples relative to the undetermined origin; Calculate the angle cosine of data samples in different scenes based on the original coordinate system and the new coordinate system respectively; The cosine of the angle obtained in different coordinate systems is integrated as the target cosine value; Determine the similarity of data samples in the autonomous driving scenario based on the target cosine value.
2. The method for obtaining similarity of autonomous driving scene data samples according to claim 1, characterized in that: The normalization process is performed according to the following formula: Among them, x j is the jth parameter of the data sample of the current autonomous driving scenario, x j_min is the minimum value of all data samples of autonomous driving scenarios, x j_max is the maximum value of the data samples of all autonomous driving scenarios, X' j is the normalized value.
3. The method for obtaining similarity of autonomous driving scene data samples according to claim 1, characterized in that: The fusing the angle cosines obtained in different coordinate systems as the target cosine value includes: summing the angle cosines obtained in different coordinate systems to obtain the target cosine value.
4. The method for obtaining similarity of autonomous driving scene data samples according to any one of claims 1 to 3, characterized in that: The method further includes: before normalization, deconstructing and discretizing the collected sample data.
Citation Information
Patent Citations
Linear discriminant analysis dimension reduction method based on cosine similarity weighting
CN107273926A
Model training method, driving data processing method and device, medium and equipment
CN112541515A
Online fusion positioning method based on monitoring video and PDR
CN113114850A
