Machine learning device and computer-implemented method
By determining the input category and its position in the data distribution in the machine learning system, the reliable classification problem when the input distribution is offset is solved, and effective relief for out-of-distribution detection is achieved.
Patent Information
- Application Number
- CN202411207378.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-08-31
- Filing Date
- 2024-08-30
- Publication Date
- 2025-02-28
AI Technical Summary
Machine learning systems have difficulty providing reliable classification when input distributions are offset, especially during the inference phase.
By providing input for the model, the model is used to determine the category of the input and its position in the data distribution, and then determine whether the input is in-distribution data or out-distribution data, and classification and output decisions are made based on this.
Reliable external distribution detection of machine learning systems is realized, ensuring that problems can be effectively alleviated when the input distribution is offset and providing more reliable classification results.
Smart Images

Figure CN119538020A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to apparatus and computer-implemented methods for machine learning. Background Art
[0002] For machine learning systems, it is desirable to provide reliable classification of inputs, particularly when the distribution of inputs presented to the classifier during inference is shifted compared to the distribution of inputs presented to the classifier during training. Summary of the invention
[0003] The device and computer implemented method according to the independent claims provide reliable machine learning.
[0004] A method for machine learning includes providing an input to a model; determining, using the model, a first classification indicating a class for the input; determining, using the model, a likelihood that an expert determined a correct classification for the input in accordance with the input; determining, using the model, a likelihood that the input is in-distribution data or out-of-distribution data relative to the data distribution on which the model was trained in accordance with the input; determining, in accordance with the first classification and in accordance with the likelihood, a second classification indicating whether the input is considered in-distribution data or out-of-distribution data relative to the data distribution on which the model was trained; determining an output of the model in accordance with the first classification and the second classification; and outputting the output. This provides reliable out-of-distribution detection for a machine learning system. The resulting machine learning system uses output based on out-of-distribution input for mitigation.
[0005] According to some embodiments, the output comprises a control signal for a technical system, in particular a physical system, preferably a robot, a vehicle, a household appliance, a power tool, a personal assistant system, an access control system, a medical imaging device.
[0006] According to some embodiments, the input comprises a sensor signal, in particular audio data or a digital image, preferably from a camera, a radar sensor, a lidar sensor, an infrared sensor, an ultrasound sensor or a motion sensor.
[0007] Determining the output may include determining that the second classification indicates that the input is considered to be data in a distribution, wherein if the second classification indicates that the input is considered to be data in a distribution, the output is determined according to the first classification. This means that when an output is considered to be data in a distribution, it is used.
[0008] Determining the output may include determining that the second classification indicates that the input is considered out-of-distribution data; and rejecting the first classification. This means that when the output is considered out-of-distribution data, it is not used.
[0009] Determining the output may include providing the input and / or the first classification to an expert, in particular to a classifier outside the model or to a human via a human-machine interface; and if the second classification indicates that the input is considered out-of-distribution data, determining the output in accordance with a response from the expert to the input and / or the first classification. This means that when the input is considered out-of-distribution data, it is delegated to (defer to) an expert. The expert may be another machine learning system. This provides a hybrid machine learning system. The expert may be a human. This provides a hybrid intelligence system that combines human and machine intelligence.
[0010] The device for machine learning comprises at least one processor and at least one memory, wherein the at least one processor is configured to execute instructions that, when executed by the at least one processor, cause the device to perform the method, wherein the at least one memory is configured to store the instructions.
[0011] A computer program comprises instructions which, when executed by a computer, cause the computer to perform the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Further advantageous embodiments emerge from the following description and the accompanying drawings. In the drawings: Figure 1 schematically depicting parts of a device used for machine learning, Figure 2 Schematically depicts the parts of a model used for machine learning, Figure 3 A flowchart having steps for a computer-implemented method for machine learning is depicted. DETAILED DESCRIPTION
[0013] Figure 1 Schematically depicted is a device 100 for machine learning. The device 100 is configured to receive an input 101. The device 100 comprises at least one processor 102 and at least one memory 103. The at least one processor 102 and the at least one memory 103 are in communication via a data connection 104.
[0014] Device 100 is configured to output output 105 to technical system 106. Device 100 is configured to receive input 101 from technical system 106. Technical system 106 is a physical system. Technical system 106 may be a robot, a vehicle, a household appliance, a power tool, a personal assistant system, an access control system, a medical imaging device. Technical system 106 may include device 100.
[0015] The technical system 106 includes a sensor 107 for monitoring the technical system 106, which is configured to determine the input 101. The sensor 107 may be a camera, a radar sensor, a lidar sensor, an infrared sensor, an ultrasonic sensor, or a motion sensor. The device 100 is configured to receive input from the sensor 107. The device 100 may include the sensor 107.
[0016] The technical system 106 comprises an actuator 108 which is configured to actuate the technical system 106 in accordance with the output 105 . The device 100 is configured to control the actuator 108 in accordance with the output 105 .
[0017] The actuator 108 may be configured to move the technical system 106 or a portion thereof. The actuator 108 may include a human-machine interface configured to output the output 105 to a human. The device 100 may include the actuator 108.
[0018] The at least one processor 102 is configured to execute instructions that, when executed by the at least one processor 102, cause the device 100 to perform a method for determining a classification. The at least one memory 103 is configured to store instructions.
[0019] The device 100 may be a computer. The computer program may include instructions. The computer may be configured to execute the instructions so that the computer performs the method.
[0020] Figure 2 Parts of a model 200 for machine learning are schematically depicted. The model 200 is configured to determine an output 105 in accordance with an input 101 .
[0021] According to an example, the model 200 includes a feature space X and an output space Y, wherein the output space Y includes K classes. The input 101 may be a dataset Sampled, where x n Mark input 101 and y n Label the output, for example, a classification.
[0022] Model 200 includes classifier 201. Model 200 includes rejector 202. Model 200 includes estimator 203. Model 200 includes interface 204 for experts. Experts can be expert systems or human experts. Model 200 can include expert systems. Interface 204 can be a human-machine interface. According to an example, the expert provides a classification m from space M. n , where M=Y.
[0023] The classifier 201 is configured to determine, in accordance with the input 101, a first classification indicating a class for the input 101. According to an example, the classifier 201 comprises a function h:X→Y.
[0024] Estimator 203 is configured to determine from input 101 the likelihood that an expert determined a correct classification for input 101. Estimator 203 is configured to determine from input 101 the likelihood that input 101 is in-distribution data or out-of-distribution data relative to the data distribution on which model 200 was trained.
[0025] The rejector 202 is configured to determine a second classification according to the input 101 and according to the likelihood, the second classification indicating whether the input 101 is considered as in-distribution data or out-of-distribution data relative to the data distribution on which the model 200 was trained. According to an example, the rejector 202 includes a function r: X→{0,1}.
[0026] According to an example, the model 200 is configured to: delegate the classification to an expert when r(x)=0, and output the first classification when r(x)=1. This means that r acts as a filter on which the classification is used as output 105.
[0027] Interface 204 is configured to prompt the expert for classification of input 101 and receive classification from the expert. Model 200 may be configured to prompt the expert for classification only if the second classification indicates that input 101 is considered out-of-distribution data relative to the distribution on which model 200 was trained.
[0028] The model 200 is configured to output the output 105. The model 200 is configured to output the classification of the classifier 201 or the expert according to the second classification. The model 200 is configured to output the classification of the classifier when the second classification indicates that the input 101 is considered as in-distribution data relative to the distribution on which the model 200 is trained. The model 200 is configured to output the classification of the expert when the second classification indicates that the input 101 is considered as out-of-distribution data relative to the distribution on which the model 200 is trained.
[0029] The model 200 may be configured to reject the classifier's classification without prompting the expert for classification or without outputting the expert's classification when the second classification indicates that the input 101 is considered out-of-distribution data relative to the distribution on which the model 200 was trained.
[0030] The model 200 may be configured to determine control signals for the technical system 106 according to the classification.
[0031] Figure 3 A flow chart with steps for a method for machine learning is depicted. The method in the example is a computer-implemented method. The model used in the method is trained on a distribution of data D.
[0032] According to an example, training includes fitting functions h and r. For example, when r(x)=0, a loss l(h(x), y) is induced, and when r(x)=1, a loss l is induced. exp (m,y). In this example, both losses are regularized 0-1 misclassification losses. The goal is to learn to minimize the following objective function: L 0-1 (h, r) = E x,y,m [(1-r(x))I[h(x)≠y]+r(x)(I[m≠y]+c)] where E is the expected value, and I[·] is 1 if the content of I[·] is true or 0 otherwise, and where c is the cost incurred by asking the expert.
[0033] However, the above objective function cannot be minimized directly. In this example, K+1 parameterized alternative loss functions and function g ⊥ :X→[0,1] is defined to minimize the following substitution loss: Where c=0.
[0034] Function g k The output of (x) is an example for the first classification.
[0035] Function g ⊥ The output of (x) is an example for the possibility that the expert correctly determines whether the input x is in-distribution or out-of-distribution data relative to the data distribution on which the model 200 was trained.
[0036] Learning consists of minimizing this alternative loss to obtain and g ⊥ .
[0037] According to the example, the functions r(x) and h(x) are: The function α in the example has the range [0,1], and the function is the SoftMax function.
[0038] The function α(x) is chosen to be close to 0 for inputs x far outside the distribution and close to 1 for inputs x similar to data in the training distribution. Any function α(x) that satisfies these two conditions can be used.
[0039] For example, the function α(x)=p θ (x) is provided as: in Z(Θ)=∫ x -E Θ (x) consider E Θ (x, y) = -g y (x) And then marginalize x to get p Θ (x)∝∑ y∈Y exp(g y (x)), that is, p Θ (x) and ∑ y∈Y exp{g y (x)}.
[0040] For example, the function α(x) is provided by an additional generative model (e.g., a normalizing flow) that models the density p(x) of the training distribution: α(x)=p(x).
[0041] For example, the density p(x) is given by and the function n:z→[0,1], which maps z to the desired range [0,1]. An example for n(z) is: in is a hyperparameter.
[0042] According to the example, a validation set is provided And provides a collection The empirical cumulative distribution function F. For a new test sample x n , which means: α(x n )=F(x n ).
[0043] In the example, c is a given constant parameter for the cost associated with delegating to an expert. The constant parameter c can be selected in the range [0,1] according to whether there is no cost anyway (c=0) or whether the expert's advice is expensive (c=1). Subject to the conditions of the application, typical values for the constant parameter c are between 0 and 1.
[0044] According to an example, the output of the function α(x) is determined for an input x. This means determining the likelihood that the input x is in-distribution or out-of-distribution with respect to the data distribution on which the model 200 is trained.
[0045] In the example, α(x) ranges from [0, 1], where ideally, for out-of-distribution data, it is 0, and ideally, for in-distribution data, it is 1. The product cα(x) has the effect of reducing the overall cost of rejection, resulting in increased rejection when exposed to severely out-of-distribution data.
[0046] According to the example, the function g is determined for the input x ⊥ This means determining the likelihood that the expert will provide a correct prediction for input x as being in-distribution or out-of-distribution relative to the data distribution on which the model 200 was trained.
[0047] According to the example, according to the output of the function α(x) and the function g ⊥ (x) to determine the output of the function r(x) for the input x. This means that: according to the first classification g k (x) and according to the probability (for example, the function α(x), g ⊥ Based on the first classification g k The output of (x) adjusts the output of the second classification to allow for distributional properties, i.e., if the input is unfamiliar to the trained model, the likelihood that it is rejected and passed on to the expert increases.
[0048] Determine the output of the function h(x) based on the input x. The output of the function h(x) is the classification of the input x.
[0049] In inference, the input 101 of the model 200 can be within the data distribution (ie, in-distribution) or outside the data distribution (ie, out-of-distribution).
[0050] The model 200 in the example comprises a neural network trained with input 101 from a data distribution. The input 101 may be a sensor signal, in particular audio data or a digital image. During training, the input 101 may be provided with a true class. The model 200 is, for example, trained to determine the classification of the input 101 indicating the true class.
[0051] The method includes step 302 .
[0052] Step 302 includes providing input 101 to the model 200 .
[0053] The method includes step 304 .
[0054] Step 304 includes determining, using model 200 , a first classification indicating a class for input 101 .
[0055] The method includes step 306 .
[0056] Step 306 includes determining, using model 200 , based on input 101 , the likelihood that the expert determined a correct classification for input 101 .
[0057] The method includes step 308 .
[0058] Step 308 includes determining, using model 200 , based on input 101 , the likelihood that input 101 is in-distribution data or out-of-distribution data relative to the data distribution on which model 200 was trained.
[0059] The method includes step 308 .
[0060] Step 308 includes determining a second classification indicating whether the input 101 is considered in-distribution data or out-of-distribution data relative to the data distribution on which the model 200 was trained.
[0061] The second category is determined according to the first category and according to the likelihood.
[0062] This is an example for determining the second classification.
[0063] The method includes step 312 .
[0064] Step 312 includes determining the output 105 of the model 200 according to the first classification and the second classification.
[0065] According to an example, the output 105 comprises a control signal for the technical system 106. The control signal may be determined according to the classification by the model 200. According to an example, the output 105 comprises the classification.
[0066] Determining the output 105 includes, for example, determining whether the second classification indicates that the input 101 is considered in-distribution data or out-of-distribution data.
[0067] In an example, if the second classification indicates that the input 101 is considered in-distribution data, the output 105 includes the classification of the input 101 determined according to the first classification or includes a control signal determined according to the first classification. In an example, otherwise the first classification is rejected.
[0068] According to an example, if the second classification indicates that the input 101 is considered out-of-distribution data, the output 105 includes the classification provided by the expert or a control signal determined in accordance with the classification provided by the expert.
[0069] The input 101 and / or the first classification may be provided to an expert in order to receive a classification from the expert.
[0070] The expert may be a classifier external to the model 200 that provides the expert's classification. The human expert may be prompted for classification via a human-machine interface.
[0071] The classification may be provided by the expert in response to the input 101 and / or the first classification. According to an example, the expert is prompted for a response only if the second classification indicates that the input 101 is considered out-of-distribution data.
[0072] The method includes step 314 .
[0073] Step 314 includes: outputting the output 105 .
[0074] Outputting the output 105 may result in outputting a classification, for example via a human-machine interface or to an actuator 108 for actuating the technical system 106 in accordance with the classification. Outputting the output 105 may result in outputting a control signal to the actuator 108 for actuating the technical system 106 in accordance with the classification.
[0075] In the example of a movable technical system 106, the first classification may include: a first class indicating that the movement of the technical system 106 should stop; and a second class indicating that the movement of the technical system 106 may continue. In the example of a movable technical system 106, the input 101 may be a digital image of the environment of the technical system 106. The method may include: when the first class is determined by the first classification or the expert, actuating the actuator 108 to stop the technical system 108. The method may include: when the second class is determined by the first classification or the expert, actuating the actuator 108 to continue moving the technical system 108. Instead of using the first class for stopping, the first class may be used to change the movement trajectory of the technical system 106. The digital image may include objects present in the environment. Stopping or changing the movement may be used to avoid collision of the technical system 106 or a portion thereof with an object in the environment.
Claims
1. A computer-implemented method for machine learning, characterized in that: Providing (302) an input (101) to a model (200); determining (304) using the model (200) a first classification indicating a class for the input (101); determining (306) a probability that an expert determined the correct classification for the input (101) based on the input (101); determining (308) using the model (200) based on the input (101) a probability that the input (101) is in-distribution data or out-of-distribution data relative to the data distribution on which the model (200) was trained; determining (310) a second classification based on the first classification and based on the probability, the second classification indicating whether the input (101) is considered in-distribution data or out-of-distribution data relative to the data distribution on which the model (200) was trained; determining (312) an output (105) of the model (200) based on the first classification and the second classification; and outputting (314) the output (105).
2. The method according to claim 1, characterized in that: The output (105) comprises (312) a control signal for a technical system (106), in particular a physical system, preferably a robot, a vehicle, a household appliance, a power tool, a personal assistant system, an access control system, a medical imaging device.
3. The method according to any one of the preceding claims, characterized in that: The input (101) comprises (302) sensor signals, in particular audio data or digital images.
4. The method according to any one of the preceding claims, characterized in that: Determining (312) the output (105) includes determining that the second classification indicates that the input (101) is considered to be data in a distribution, wherein if the second classification indicates that the input (101) is considered to be data in a distribution, then the output (105) includes a classification of the input determined according to the first classification.
5. The method according to any one of the preceding claims, characterized in that: Determining (312) the output (105) includes: determining that the second classification indicates that the input (101) is considered out-of-distribution data; and rejecting the first classification.
6. The method according to any one of the preceding claims, characterized in that: Determining (312) the output (105) includes: providing the input (101) and / or the first classification to an expert, in particular to a classifier outside the model (200) or to a human via a human-machine interface; and if the second classification indicates that the input (101) is regarded as out-of-distribution data, determining the output (105) according to a response from the expert to the input (101) and / or the first classification.
7. A device (100) for machine learning, characterized in that At least one processor (102) and at least one memory (103), wherein the at least one processor (102) is configured to execute instructions that, when executed by the at least one processor (102), cause the device (100) to perform a method according to one of claims 1 to 6, wherein the at least one memory (103) is configured to store the instructions.
8. The device (100) according to claim 7, characterized in that: The device (100) is configured to receive an input (101) from a sensor (107) for monitoring a technical system (106), preferably from a camera, a radar sensor, a lidar sensor, an infrared sensor, an ultrasound sensor or a motion sensor; or the device (100) is configured to control an actuator (108) of the technical system (106) in accordance with the output (105).
9. A computer program, characterized in that: The computer program comprises instructions which, when executed by a computer, cause the computer to perform the method according to one of claims 1 to 6.