Weighing method for training data set of machine learning model
By calculating the proximity of data points in the feature space and assigning weighted values, the problem of uneven data distribution in the training data group is solved, and the training efficiency and prediction quality of machine learning models are improved.
Patent Information
- Application Number
- CN202411262961.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-12
- Filing Date
- 2024-09-10
- Publication Date
- 2025-03-14
AI Technical Summary
In the data group where the machine learning model is trained, there are multiple identical or extremely similar data points, resulting in uneven data distribution and limiting the learning ability of the machine learning model.
By finding out where the data points are in the feature space of another machine learning model, the proximity to the surrounding data points is calculated, and the weighted value of each data point is determined based on the proximity, to consider the data points more balancedly during the training process.
This method effectively reduces the imbalance of data groups, improves the training speed and performance of machine learning models, and reduces computing requirements and energy consumption.
Smart Images

Figure CN119623664A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for weighting a data set for training a machine learning model. The invention also relates to a computer program, a device and a storage medium for this purpose. Background Art
[0002] In the data set used to train the machine learning model, there may usually be multiple identical or very similar data points and / or an unbalanced distribution of data points in the individual classes used to train the machine learning model. For example, in the prior art, identical points are therefore removed or the classes are balanced by different weights. As another measure, other data may be collected or the machine learning model architecture may be modified to balance the data set and improve the machine learning model performance.
[0003] But within a class, data is often unevenly distributed in the feature space of a machine learning model. This unequal weighting can cause problems even when using unlabeled data. In particular, imbalance within a class can limit the learning ability of a machine learning model. Summary of the invention
[0004] The object of the present invention is to provide a method, a computer program, a device and a computer-readable storage medium. Further features and details of the invention are derived from the dependent claims, the description and the drawings. In this regard, the features and details described in conjunction with the method of the invention are obviously also applicable to the computer program of the invention, the device of the invention and the computer-readable storage medium of the invention, and vice versa, so that individual aspects of the invention are always referred to or can be referred to one another.
[0005] The object of the present invention is in particular a method for weighting a data set for training a machine learning model, comprising the following steps:
[0006] - find out the position of each data point of the dataset in the feature space of another machine learning model,
[0007] - based on the ascertained location of the data point, ascertaining a respective proximity of the data point to at least one surrounding data point in a feature space of another machine learning model,
[0008] - determining a weighted value for each data point based on the ascertained proximity to at least one surrounding data point,
[0009] - Using the determined weighted values of the data points when training the machine learning model, whereby the determined weighted values are used for the degree of consideration of the corresponding data points in the training.
[0010] The machine learning model is trained in particular for classification and / or object detection. Therefore, the trained machine learning model can be trained and used for classification and / or object detection. For example, it can be specified to be used and therefore inferred in a vehicle. The data points of the data set can, for example, be image data pixels or based on image data pixels, so as to classify the data points and / or detect objects based on pixels. By weighting, the data set can advantageously make the machine learning model training more balanced and thus improved. For example, the computational requirements for training the machine learning model can be reduced, thereby improving the prediction quality of the machine learning model. The data set can include sensor data measured from at least one sensor. In this case, the sensor data can be in digital form and can be obtained, for example, using analog-to-digital conversion. The weighting (also called weighting value) especially indicates the extent to which the machine learning model takes or should take into account the respective data points during training. The feature vector is especially an n-dimensional vector representing the numerical value of the object. For example, the feature vector representation of the image can be retrieved from the intermediate layer or the last layer output of the machine learning model. The feature space is preferably a vector space including many feature vectors. Through the feature vector, each data is assigned a position in the feature space. In other words, the feature space can describe a multidimensional coordinate system, each coordinate axis of which corresponds to a feature. Another machine learning model can be a model that is more powerful than the model being trained and is used to weight the data points. For example, the other machine learning model can be a base model or a bootstrap model. The base model is in particular a neural network with multiple parameters. The base models are preferably pre-trained on a massive data set and can then be adapted to new tasks by further training with a smaller specific data set, or they can even be used directly without adjustment. In particular, the bootstrap model has the same architecture as the model being trained, but it can be trained on the original unweighted data set or on another data set. Imbalances may occur, especially in large data sets, and their impact on the training of machine learning models can be advantageously mitigated using the weighting according to the present invention. Simply put, the weighting values can be determined in such a way that lower weighting values are assigned to data points that are close to each other, while higher weighting values are assigned to data points that are relatively far away from other data points.
[0011] It is also advantageous if the method further comprises the following steps:
[0012] - extracting a feature vector based on the feature space by another machine learning model so as to provide a reduced feature space by the feature vector.
[0013] In particular, feature vectors typically summarize the parameterizable properties of a pattern in a vector manner. The various different characteristic features of a pattern can form the various different dimensions of this vector. The feature space can be effectively reduced by various different feature extraction methods. One example would be feature selection, where the most relevant features are selected and less relevant or redundant features are ignored. As a result, the feature space can be reduced without changing the actual data. Another option would be feature projection, which creates new features that are combinations of the original features. These new features preferably retain important information, but in a more compact format. Techniques such as principal component analysis (PCA) or t-distributed stochastic neighbor embedding (t-SNE) are examples of feature projection.
[0014] The position of each data point in the data set can then be determined in the provided reduced feature space. By reducing the feature space, the computational effort can be advantageously reduced when determining the proximity of the data point to surrounding data points and determining the weighted value of the data point.
[0015] The invention also provides that the weighting values are determined by taking into account at least one weighting condition so that variability is provided by the at least one weighting condition when determining the weighting value for each data point. The weighting can thus advantageously be individually influenced and adapted, for example, to different types of data sets.
[0016] Optionally, it may be provided that the at least one weighting condition is selected from the following:
[0017] - assigning to two corresponding identical data points a weighting of half the value in each case, in particular a weighting of 0.5 in each case,
[0018] - assigning a full weighting value, in particular a weighting value of 1, to the respective data point if the proximity to at least one surrounding data point is greater than a defined threshold,
[0019] - If there are N identical data points, a weighted value of 1 / N is assigned to the corresponding data point.
[0020] In other words, at least one of the previous weighting conditions can be respectively applied or taken into account when determining the weighting value. The weighting condition can be supplemented by additional weighting conditions as required.
[0021] It is also optionally conceivable that determining the proximity of the data point to at least one surrounding data point further comprises the following steps:
[0022] -Limit the maximum distance,
[0023] - starting from the respective data point within the maximum distance, searching for the at least one surrounding data point.
[0024] Stated in simple terms and explained with reference to a circle, at least one other data point may be searched for each data point within a circle having a maximum radius as a maximum distance. If at least one other data point exists within the circle, a weighted value for the data point may be determined based on the distance between the data point and the corresponding at least one other data point. By defining a maximum distance, the computational workload may be advantageously reduced, since at least one other data point does not need to be searched for for each data point within the entire feature space, and the weighted distance must be considered. The maximum distance may be established empirically.
[0025] It may also be provided that the machine learning model training is supervised training and the data set contains at least two specified classes of supervised training, and the method further comprises the following steps:
[0026] - making respective total weight values of at least two classes equal, whereby the respective total weight values are determined by a plurality of data points of the respective class and the respective weight of each data point.
[0027] The term "equal" is used in particular to mean that the respective total weight values of the at least two classes are set to the same value. For example, if class A has 100 points and a net weight of 50, and class B has 200 points and a net weight of 150, tripling the weight of class A may advantageously lead to better results. By adding weights to the classes, the data set may be further balanced, and as a result, the training of the machine learning model may be improved.
[0028] It may also be advantageous for the data set to include sensor data and / or image data. In this case, the data set may include image data in order to train a machine learning model for a predetermined task at a data point in the form of image data pixels. The sensor data and / or image data may come from the acquisition of at least one sensor and / or may be synthetic data that can replicate actual data from a sensor. More generally, the sensor data may be exclusive to sensor acquisition, i.e., (for example) directly from the acquisition of the real world and / or has been synthesized. The sensor may be, for example, a radar sensor, an ultrasonic sensor, a lidar, a camera, or a thermal imaging camera. Therefore, the sensor data and / or image data may be or include a video image and / or a radar image and / or an ultrasonic image and / or distance information and / or a thermal image.
[0029] The machine learning model can be trained using the data set, preferably according to a predetermined task, in order to detect and / or classify identification features in the sensor data and / or image data. The predetermined task may be a classification task. The classification task includes, for example, object detection and / or semantic segmentation in the sensor data and / or image data. In addition, the predetermined task may also include downstream tasks such as at least partially automated driving. Thus, control of at least partially automated vehicles can be provided based on classification and / or image classification. The detected features may be objects such as traffic signs, traffic lights, pedestrians or similar features.
[0030] The determined weighting values can advantageously be used to more consistently consider the feature space during training for a predetermined task, since underrepresented regions in the feature space are particularly more strongly weighted and therefore more strongly considered. As a result, the machine learning model can better detect and / or classify the recognition features.
[0031] The sensor data may optionally include image data, which may be derived from the acquisition of a camera sensor. Alternatively or additionally, the image data may include component data. In this case, the pixel values (preferably pixels) of the image data may represent the environment and / or traffic scene. Objects such as the environment and / or traffic scene can optionally be detected by classification (preferably image classification) based on these values. In this case, classification and / or image classification can also be performed in the form of semantic segmentation (i.e., pixel classification or region classification) and / or object detection. The image data can also be in the form of radar images and / or ultrasound images and / or thermal images and / or lidar images.
[0032] The at least one sensor may be arranged in a vehicle. It is therefore possible that the method of the invention is used in a vehicle. The vehicle may be designed, for example, as a motor vehicle, a car and / or an autonomous vehicle. The vehicle may include a vehicle device for, for example, providing an autonomous driving function and / or a driver assistance system. The vehicle device may be designed to at least partially automatically control the vehicle and / or accelerate and / or brake and / or steer the vehicle.
[0033] Another aspect of the invention is a computer program, in particular a computer program product comprising instructions which, when the computer program is run by a computer, cause the computer to perform the method of the invention. The computer program of the invention thus provides the same advantages as those described in detail with respect to the method of the invention.
[0034] Another aspect of the invention is a data processing device configured to perform the method according to the invention. For example, a computer can be provided as the device, which executes the computer program according to the invention. The computer can include at least one processor for running the computer program. A non-volatile data memory can also be provided, in which the computer program is stored and from which the processor can read the computer program for running.
[0035] Another aspect of the present invention is a computer-readable storage medium, which contains a computer program according to the present invention and / or commands, which, when executed by a computer, cause the computer to perform the method according to the present invention. The storage medium is designed, for example, as a data storage such as a hard disk and / or a non-volatile memory and / or a memory card. The storage medium can be integrated into a computer, for example.
[0036] The method according to the invention can also be designed as a computer-implemented method. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Other advantages, features and details of the invention are derived from the following description of embodiments of the invention described in detail with reference to the drawings. In this regard, each of the features mentioned in the description may be important to the invention either by itself or in any combination, among which:
[0038] Figure 1 A schematic diagram showing a method, a device, a storage medium and a computer program according to an embodiment of the present invention is shown.
[0039] Figure 2 A schematic diagram showing a vehicle and a sensor according to an embodiment of the present invention is shown,
[0040] Figure 3 A schematic diagram showing the data points in the feature space without weighting, and
[0041] Figure 4 A schematic diagram showing data points in a feature space under weighting according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] Figure 1 A method 100 , an apparatus 10 , a storage medium 15 and a computer program 20 according to an embodiment of the present invention are schematically shown.
[0043] Figure 1 In particular, a weighting method 100 for a data set for training a machine learning model is shown. In a first step 101, the position of each data point 1 of the data set is preferably determined in a feature space 2 of another machine learning model. In a second step 102, the respective proximity of the data point 1 to at least one surrounding data point 1' in the feature space 2 of another machine learning model can be determined based on the determined data point position. In a third step 103, a weighted value for each data point 1 can be determined based on the determined proximity to at least one surrounding data point 1'. In a fourth step, the determined weighted value of the data point 1 can be used when training the machine learning model, whereby the determined weighted value is used to determine the degree of consideration of the respective data point 1 in the training.
[0044] Figure 2 A vehicle 3 is schematically shown comprising a sensor 4. The sensor 4 may collect sensor data in order to provide a data set for training a machine learning model.
[0045] Figure 3 A feature space 2 of two parameters P1 and P2 is shown, and a plurality of data points 1 are also shown in the feature space 2. In this case, Figure 2The data point 1 in is not weighted, which is indicated by all data points 1 having the same size. In addition to the data point, there are also respective surrounding data points 1 '.
[0046] Figure 4 Shown and used for Figure 3 The same feature space 2 with parameters P1 and P2 in FIG. 1 includes a data point 1 that has been weighted according to an embodiment of the present invention. In addition to this data point, the corresponding surrounding data points 1' can also be seen, where the proximity of each data point 1 to the surrounding data points 1' for the corresponding data point 1 has been taken into account for weighting the corresponding data point 1. In this case, the weighting is indicated by the different sizes used for the data points 1.
[0047] In particular, the invention provides a method in which a so-called diversified score assignment can be performed, for which specific weighting values are preferably assigned to data points 1. In particular, the positions of data points 1 in feature space 2 are weighted differently in order to balance the training data by weighting.
[0048] By reducing data set imbalance, the present invention can be advantageously applied to allow faster learning, better performance and less distortion in machine learning models. In particular, energy consumption can be reduced by training machine learning models more quickly.
[0049] Intra-class imbalance particularly hinders the ability of machine learning models to learn the most from a data set. Repeated exposure to redundant information can facilitate learning of specific scenarios, but it can also reduce the ability of the machine learning model to generalize about less common samples. The present invention, among other things, creates a diversity-based mechanism for reducing this redundant load during training. Methods for reducing data set imbalance can result in faster learning, better performance, and less distortion. Faster training can reduce energy consumption resulting from, for example, GPU applications when training some of the largest machine learning models. The reduction in distortion is sometimes difficult to measure, but it is particularly valuable for base models trained on huge unlabeled data sets (such as from the Internet).
[0050] The present invention can be an upstream part of a machine learning tool chain. One aspect of the present invention is particularly to use the diversity score distribution by the position of the data point in the feature space 2 to weight the training data. Then, this weighting can be used as unweighted data (such as removing data points by subsampling), weighted data (such as using weighted values during training), or weighted sampling (such as applying fewer or more unique images or weighted images in an under-sampling or over-sampling manner during training).
[0051] For weighting, the data can be weighted by initially including feature vectors from another machine learning model, such as a base model (such as CLIP), a supervised training model (such as ResNet trained on ImageNet), or a bootstrapped model (i.e., the target model architecture, but trained on the unweighted original data set). The diversity evaluation or rather the weighting then results from, for example, searching for other neighboring data points 1 in this (reduced) feature space 2 and their weighting according to proximity.
[0052] Additionally, the following conditions can be stated when constructing a weighted metric: If two data points 1 are identical, then they should each have half the weight. If a data point 1 has no similar points in the data set, then its weight should be approximately 1. If there are N very similar points, then they should be weighted approximately 1 / N. Points that are adjacent to each other but do not overlap should have a lower contribution, but not completely (i.e., the sum of these N points should be greater than 1).
[0053] An example of a metric that could generate this behavior is as follows:
[0054]
[0055] where d ij Preferably, it is the distance between feature vectors, where d ii =0, so the final weighted value results in 1. c It is preferably an empirically determined distance, also called the critical distance. Although in principle this sum can be formed for all objects, it may be computationally more practical to consider only contributions within multiples of the critical distance, e.g. r c =kd c , where k=5.
[0056] The critical distance value can be varied to achieve different goals. In particular, smaller values result in a reduced weighting of effectively identical images. Given a larger value, points that are further away will preferably influence the weighting of the point. Although the weighting metric explicitly described above satisfies this condition (for example), there are many possible variations that can be considered in various scenarios, such as changing the exponential value to a Gaussian value or using d c (x i ) is used for adaptive weighting. In addition, the kernel density method can be used to replace the previous proximity method.
[0057] In the case of supervised learning, if additional class weighting is added after weighting according to proximity, the performance can be improved.
[0058] The above explanation of the embodiments only describes the present invention by way of example. As long as it is technically advantageous, the specific features of the embodiments can obviously be combined with each other at will without exceeding the scope of the present invention.
Claims
1. A method (100) for weighting a data set for training a machine learning model, the method comprising the following steps: - finding (101) the position of each data point (1) of the data set in a feature space (2) of another machine learning model, - based on the ascertained position of the data point (1), ascertaining (102) the respective proximity of the data point (1) to at least one surrounding data point (1') in the feature space (2) of the further machine learning model, - determining (103) a weighted value for each data point (1) based on the ascertained proximity to the at least one surrounding data point (1'), - Using (104) the determined weighted values of the data points (1) when training the machine learning model, wherein the determined weighted values are used to determine the degree of consideration given to the respective data points (1) in the training.
2. The method (100) according to claim 1, characterized in that: The method further comprises the following steps: - extracting a feature vector based on the feature space (2) by means of the further machine learning model so as to provide a reduced feature space by means of the feature vector, Therein, the position of each data point (1) of the data set is determined (101) in the reduced feature space provided.
3. The method (100) according to any one of the preceding claims, characterized in that The determination (103) of the weighting values is performed by taking into account at least one weighting condition so as to provide variability in the determination (103) of the weighting values for each data point (1) by means of the at least one weighting condition.
4. The method (100) according to claim 3, characterized in that: The at least one weighting condition is selected from: - assigning to two corresponding identical data points (1) a corresponding half weighting value, in particular a weighting value of 0.5 in each case, - assigning a full weighting value, in particular a weighting value of 1, to the corresponding data point (1) if the proximity to the at least one surrounding data point (1') is greater than a defined threshold value, - If there are N identical data points (1), a weight value of 1 / N is assigned to the corresponding data point (1).
5. The method (100) according to any one of the preceding claims, characterized in that Ascertaining (102) the proximity of the data point (1) to the at least one surrounding data point (1') further comprises the following steps: -Limit the maximum distance, - starting from the corresponding data point (1) within the maximum distance, searching for the at least one surrounding data point (1').
6. The method (100) according to any one of the preceding claims, characterized in that The training of the machine learning model is supervised training and the data set includes at least two specified classes for the supervised training, and the method further includes the following steps: - making the respective total weighted values of the at least two classes equal, wherein the respective total weighted values are determined by a plurality of data points (1) of the respective class and the respective weight of each data point (1).
7. The method (100) according to any one of the preceding claims, characterized in that The data set comprises image data, which is used to train the machine learning model in the data points in the form of pixels of the image data for a predetermined task, and in particular is used to train the machine learning model through the data set in order to classify identification features in the image data, wherein the feature space (2) is more consistently considered by the determined weighting values when training for the predetermined task.
8. A computer program (20) comprising instructions which, when the computer program (20) is run by a computer (10), cause the computer to perform the method (100) according to any one of the preceding claims.
9. A data processing device (10) configured to execute the method (100) according to any one of claims 1 to 7.
10. A computer-readable storage medium (15) comprising instructions which, when executed by a computer (10), cause the computer to perform the method (100) according to any one of claims 1 to 7.