PLAUSIBILIZATION OF THE OUTPUT OF AN IMAGE CLASSIFIER HAVING A GENERATOR FOR MODIFIED IMAGES

20210390337 · 2021-12-16

    Inventors

    Cpc classification

    International classification

    Abstract

    A method for plausibilizing the output of an image classifier which assigns an input image to one or more class(es) of a predefined classification. The method includes: an assignment to one or more class(es) is ascertained for the input image using the image classifier; a relevance assessment function is used to ascertain a spatially resolved relevance assessment of the input image, which indicates which components of the input image have contributed to what degree to the assignment; a generator is trained to generate modifications of the input image that are as satisfactory as possible according to a predefined cost function in view of the optimization goals; based on the result of the training, and/or based on the modifications supplied by the trained generator, a quality measure for the spatially resolved relevance assessment, and/or a quality measure for the relevance assessment function is/are ascertained.

    Claims

    1. A method for plausibilizing an output of an image classifier which assigns an input image to one or more classes of a predefined classification, the method comprising the following steps: ascertaining an assignment to one or more classes for the input image using the image classifier; ascertaining, using a relevance assessment function, a spatially resolved relevance assessment of the input image which indicates which components of the input image have contributed to what degree to the assignment to the one or more classes; training a generator to generate modifications of the input image that are as satisfactory as possible according to a specification of a predefined cost function in view of optimization goals according to which: on the one hand, the modifications modify as little as possible a component of the input image classified as less relevant for the class assignment by the relevance assessment function, and on the other hand, the modifications are given a different classification by the image classifier than the input image; based on a result of the training, and/or based on the modifications supplied by the trained generator, ascertaining a quality measure for the spatially resolved relevance assessment and/or a quality measure for the relevance assessment function.

    2. The method as recited in claim 1, wherein the generator translates inputs from an input space into the modifications, and parameters which characterize a behavior of the generator are optimized with regard to the optimization goals for the modifications.

    3. The method as recited in claim 2, wherein the inputs are additionally optimized with regard to the optimization goals for the modifications.

    4. The method as recited in claim 2, wherein further modifications are ascertained starting from optimal parameters in that: the parameters are drawn from a random distribution around an optimum; and/or the optimization of the parameters is repeated starting from different starting values.

    5. The method as recited in claim 1, wherein the optimization goal that the image classifier assign a different classification to the modifications than to the input image versus the optimization goal that the component classified as less relevant for the class assignment be modified as little as possible is weighted just high enough so that the image classifier does actually classify the modifications differently than the input image.

    6. The method as recited in claim 1, wherein in the modifications supplied by the generator, changes in a component of the input image that were classified as less relevant for the class assignment by the relevance assessment function are retroactively suppressed.

    7. The method as recited in claim 1, wherein the generator is trained with regard to an input image starting from a generator already trained for an earlier input image.

    8. The method as recited in claim 1, wherein based on a comparison of the spatially resolved relevance assessment with a predefined threshold, the input image is subdivided in a binary fashion into a less relevant component for the class assignment and into a more relevant component for the class assignment.

    9. The method as recited in claim 8, wherein in response to the generator supplying modifications that are still assigned to the same class(es) as the input image after the training has been concluded: the method is started anew using such the supplied modifications as the input image, and/or the method is started anew using a threshold value for the subdivision of the input image that leads to the classification of a larger component of the input image as more relevant for the class assignment.

    10. The method as recited in claim 1, wherein based on the relevance assessment function, and/or based on the quality measure of the relevance assessment function, and/or based on the spatially resolved relevance assessment, and/or based on the quality measure of the spatially resolved relevance assessment, a plausibility of the output of the image classifier is evaluated.

    11. The method as recited in claim 10, wherein in response to the ascertained plausibility satisfying a predefined criterion, a product to which the input image relates is marked for a manual follow-up, and/or a conveyor device is actuated in order to separate this product from the production process.

    12. The method as recited in claim 1, wherein at least one of the modifications supplied by the generator is used as a further training image for the image classifier.

    13. The method as recited in claim 1, wherein images of mass-produced, nominally identical products are selected as the input images, and the image classifier is trained to assign the input images to one or more of at least two possible classes which represent a quality assessment of the respective product in each case.

    14. A non-transitory machine-readable data carrier on which is stored a computer program for plausibilizing an output of an image classifier which assigns an input image to one or more classes of a predefined classification, the computer program, when executed by one or more computers, causing the one or more computers to perform the following steps: ascertaining an assignment to one or more classes for the input image using the image classifier; ascertaining, using a relevance assessment function, a spatially resolved relevance assessment of the input image which indicates which components of the input image have contributed to what degree to the assignment to the one or more classes; training a generator to generate modifications of the input image that are as satisfactory as possible according to a specification of a predefined cost function in view of optimization goals according to which: on the one hand, the modifications modify as little as possible a component of the input image classified as less relevant for the class assignment by the relevance assessment function, and on the other hand, the modifications are given a different classification by the image classifier than the input image; based on a result of the training, and/or based on the modifications supplied by the trained generator, ascertaining a quality measure for the spatially resolved relevance assessment and/or a quality measure for the relevance assessment function.

    15. A computer configured for plausibilizing an output of an image classifier which assigns an input image to one or more classes of a predefined classification, the computer configured to: ascertain an assignment to one or more classes for the input image using the image classifier; ascertain, using a relevance assessment function, a spatially resolved relevance assessment of the input image which indicates which components of the input image have contributed to what degree to the assignment to the one or more classes; train a generator to generate modifications of the input image that are as satisfactory as possible according to a specification of a predefined cost function in view of optimization goals according to which: on the one hand, the modifications modify as little as possible a component of the input image classified as less relevant for the class assignment by the relevance assessment function, and on the other hand, the modifications are given a different classification by the image classifier than the input image; based on a result of the training, and/or based on the modifications supplied by the trained generator, ascertain a quality measure for the spatially resolved relevance assessment and/or a quality measure for the relevance assessment function.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0051] FIG. 1 shows an exemplary embodiment of method 100 in accordance with an example embodiment of the present invention.

    [0052] FIG. 2 an example of an iterative generation of modifications 7 of an input image 1 until a change in the class assignment has been achieved, in accordance with an example embodiment of the present invention.

    DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

    [0053] FIG. 1 is a schematic flow chart of an exemplary embodiment of method 100 for plausibilizing the output of an image classifier 2, which assigns an input image 1 to one or more class(es) 3a-3c of a predefined classification. For instance, according to step 105, in particular images of mass-produced, nominally identical products are able to be selected as input images 1. Image classifier 2 may then be trainable to subdivide input images 1 into classes 3a-3c of a predefined classification that represent a quality assessment of the respective product.

    [0054] In step 110, an assignment to one or more class(es) 3a-3c is ascertained for input image 1 with the aid of image classifier 2. In step 120, a relevance assessment function 4 is used to ascertain a spatially resolved relevance assessment 1a of input image 1. This relevance assessment 1a indicates which components 1b, 1c of input image 1 have contributed to what degree to the assignment to one or more class(es) 3a-3c.

    [0055] In step 130, a generator 6 is trained to generate modifications 7 of input image 1 which are as satisfactory as possible according to the specification of a predefined cost function in view of two optimization goals. On the one hand, modifications 7 should be changed as little as possible in component 1b of input image 1 classified as less relevant for the class assignment by relevance assessment function 4. On the other hand, modifications 7 should be given a different classification by image classifier 2 than input image 1. According to block 131, in particular, generator 6 can provide a translation of inputs z from an input space 6a into modifications 7.

    [0056] The training of generator 6 includes an optimization of parameters 6b that characterize the behavior of generator 6 so that modifications 7 supplied by generator 6 come as close as possible to the mentioned optimization goals. The result of this training is the fully trained state 6b* of parameters 6b. According to block 131a, in the example shown in FIG. 1, input z is also included in the optimization, and an optimized state z* of input z is created at the end of the training.

    [0057] According to block 132, starting from optimal parameters 6b*, it is possible to generate still further modifications 7 for one and the same input image 1. As described above, a revealing statistic is able to be set up via such an ensemble of modifications 7.

    [0058] The demand that the class assignment be modified may be weighted to precisely such a degree according to block 133 that such a change does actually take place. As previously mentioned, the optimization is thereby not diverted from the further goal of not changing component 1b of input image 1 assessed as less relevant, if possible. Possible changes in this component 1b of input image 1 are able to be retroactively suppressed according to block 134.

    [0059] According to block 135, generator 6 is able to be trained starting from a generator 6′ already trained for an earlier input image 1′. As previously described, it is then possible to save computing time, in particular within the framework of a quality control of mass-produced products in which many nominally similar input images 1 are created.

    [0060] In step 140, based on the result of training 130, and/or based on modifications 7 supplied by trained generator 6, a quality measure 1a* for spatially resolved relevance assessment 1a and/or a quality measure 4* for relevance assessment function 4 is/are ascertained. On that basis, in step 150, plausibility 2* of the output of image classifier 2 in relation to concrete input image 1 is in turn able to be ascertained.

    [0061] In step 190, it is checked whether this plausibility 2* satisfies a predefined criterion. If this is the case (truth value 1), the product to which input image 1 relates is able to be marked for a manual follow-up check in step 191, for example. As an alternative or also in combination therewith, a conveyer device 8 is able to be actuated in step 192 in order to separate this product from the production process.

    [0062] However, training 130, for instance, may also lead to the result that generator 6 still supplies modifications 7 that are still assigned to the same class(es) 3a-3c as input image 1 even after the conclusion of training 130. If this is the case (truth value 1 in respective check 160), then it is possible that a few but not all components 1c of the input image relevant for the class assignments were identified so far. According to block 170, method 100 is then able to be started anew using such a modification 7 as input image 1. Alternatively or also in combination therewith, according to block 180, the method may be started anew using a threshold value for the subdivision of input image 1 that leads to the classification of a larger component 1c of input image 1 as relevant for the class assignment.

    [0063] FIG. 2 shows an exemplary development of an input image 1 in an iterative execution of method 100. Input image 1 shows a screw nut 10 having an inner thread 11 in the center. This screw nut has two defects, more specifically, a tear 12, which extends from the outer circumference of inner thread 11 to the outer edge of screw nut 10, as well as a material accumulation 13. Accordingly, image classifier 2 assigns class 3a to input image 1, which corresponds to quality assessment “not OK” (NOK). Spatially resolved relevance assessment 1a of input image 1 makes it clear that area 1c featuring tear 12 was classified as relevant for the assignment to class 3a, while the rest 1b of input image 1 is considered to be of lesser relevance.

    [0064] Generator 6 is trained toward the goal of making changes in area 1b of input image 1 so that a modification 7 is produced. This modification 7 is to be of such a nature that image classifier 2 assigns it to class 3b, which corresponds to quality assessment “OK”.

    [0065] In the example shown in FIG. 2, tear 12 has indeed disappeared in modification 7, but modification 7 is still assigned to class 3a for “not OK” by image classifier 2. The new, spatially resolved relevance assessment 1a′ reveals the cause for this: Area 1c′ with material accumulation 13 is now decisive for the class assignment.

    [0066] The decision between classes 3a “not OK” and 3b “OK” thus depends on more than only the initially identified tear 12. The hypothesis that area 1c′ with material accumulation 13 is also important in this context is checked with the aid of a second generator 6′ to which modification 7 is supplied as input image 1. Second generator 6′ is trained to make changes in in the most recently identified area 1c′ featuring material accumulation 13, with the goal that the thereby created modification 7′ will be assigned to class 3b for “OK” by image classifier 2.

    [0067] As illustrated in FIG. 2, this is accomplished in that second generator 6′ now also removes material accumulation 13 in new modification 7′.

    [0068] Example embodiments of the present invention are also set forth in the numbered Paragraphs below.

    [0069] Paragraph 1. A method (100) for plausibilizing the output of an image classifier (2) which assigns an input image (1) to one or more class(es) (3a-3c) of a predefined classification, the method having the steps: [0070] An assignment to one or more class(es) (3a-3c) is ascertained (110) for the input image (1) with the aid of the image classifier (2); [0071] A relevance assessment function 4 is used to ascertain (120) a spatially resolved relevance assessment (1a) of the input image (1) which indicates which components (1b, 1c) of the input image have contributed to what degree to the assignment to one or more class(es) (3a-3c); [0072] A generator (6) is trained (130) to generate modifications (7) of the input image (1) that are as satisfactory as possible according to the specification of a predefined coast function in view of the optimization goals according to which [0073] on the one hand, they are changed as little as possible in a component (1b) classified as less relevant for the class assignment by the relevance assessment function (4); and [0074] on the other hand, they are given a different classification by the image classifier (2) than the input image (1); [0075] based on the result of the training (130), and/or based on the modifications (7) supplied by the trained generator (6), a quality measure (1a*) for the spatially resolved relevance assessment (1a) and/or a quality measure (4*) for the relevance assessment function (4) is/are ascertained (140).

    [0076] Paragraph 2. The method as recited in Paragraph 1, wherein a generator (6) is selected (131) which is developed to translate inputs z from an input space (6a) into modifications (7), and parameters (6b) which characterize the behavior of the generator (6) are optimized with regard to the optimization goals for the modifications (7).

    [0077] Paragraph 3. The method (100) as recited in Paragraph 2, wherein the inputs z are additionally optimized (131a) with regard to the optimization goals for the modifications (7).

    [0078] Paragraph 4. The method (100) as recited in one of Paragraphs 2 to 3, wherein further modifications (7) are ascertained (132) starting from optimal parameters (6b*) in that [0079] parameters (6b) are drawn from a random distribution around the optimum (6b*); and/or [0080] the optimization of the parameters (6b) is repeated starting from different starting values.

    [0081] Paragraph 5. The method (100) as recited in one of Paragraphs 1 through 4,

    [0082] wherein the optimization goal that the image classifier (2) assign a different classification to the modifications (7) than to the input image (1) versus the optimization goal that the component (1b) classified as less relevant for the class assignment be modified as little as possible is weighted (133) just high enough so that the image classifier (2) does actually classify the modifications (7) differently than the input image (1)

    [0083] Paragraph 6. The method (100) as recited in one of Paragraphs 1 through 5, wherein in the modification (7) supplied by the generator (6), changes in the component (1b) of the input image (1) that were classified as less relevant for the class assignment by the relevance assessment function (4) are retroactively suppressed (134).

    [0084] Paragraph 7. The method (100) as recited in one of Paragraphs 1 through 6,

    [0085] wherein the generator (6) is trained (135) with regard to an input image (1) starting from a generator (6′) already trained for an earlier input image (1′).

    [0086] Paragraph 8. The method (100) as recited in one of Paragraphs 1 through 7, wherein based on a comparison of the spatially resolved relevance assessment (1a) with a predefined threshold, the input image (1) is subdivided (121) in a binary fashion into a less relevant component (1b) for the class assignment and into a more relevant component (1c) for the class assignment.

    [0087] Paragraph 9. The method (100) as recited in one of Paragraphs 1 through 8, wherein in response to the generator (6) supplying (160) modifications (7) that are still assigned to the same class(es) (3a-3c) as the input image (1) after the training (130) has been concluded, [0088] the method (100) is started anew (170) using such a modification (7) as the input image (1), and/or [0089] the method (100) is started anew (180) using a threshold value for the subdivision of the input image (1) that leads to the classification of a larger component (1c) of the input image (1) as more relevant for the class assignment.

    [0090] Paragraph 10. The method (100) as recited in one of Paragraphs 1 through 9, wherein based on the relevance assessment function (4), and/or based on the quality measure (4*) of this relevance assessment function (4), and/or based on the spatially resolved relevance assessment (1a), and/or based on the quality measure (1a*) of this spatially resolved relevance assessment (1a), a plausibility (2*) of the output of the image classifier (2) is evaluated (150).

    [0091] Paragraph 11. The method (100) as recited in Paragraph 10, wherein in response to the ascertained plausibility (2*) satisfying a predefined criterion (190), a product to which the input image (1) relates is marked for a manual follow-up (191), and/or a conveyor device (8) is actuated (192) in order to separate this product from the production process.

    [0092] Paragraph 12. The method as recited in one of Paragraphs 1 through 11, wherein at least one modification (7) supplied by the generator (6) is used as a further training image for the image classifier (2).

    [0093] Paragraph 13. The method (100) as recited in one of Paragraphs 1 through 12, wherein images of mass-produced, nominally identical products are selected (105) as input images (1), and the image classifier (2) is trained to assign the input images (2a-3c) to one or more of at least two possible class(es) (3a-3c) which represent a quality assessment of the respective product in each case.

    [0094] Paragraph 14. A computer program including machine-readable instructions that, when executed on a computer or multiple computers, induce the computer(s) to execute the method (100) as recited in one of Paragraphs 1 through 13.

    [0095] Paragraph 15. A machine-readable data carrier and/or download product including the computer program as recited in Paragraph 14.

    [0096] Paragraph 16. A computer, equipped with the computer program as recited in Paragraph 14, and/or with the machine-readable data carrier and/or the download product as recited in Paragraph 15.