Method and apparatus for the detection of anomalies in two-dimensional digital images of products
20230334652 · 2023-10-19
Assignee
Inventors
Cpc classification
International classification
Abstract
A method for detecting anomalies in digital images of products, wherein a region of a digital image is detected as a maximum anomaly if the value of a property of the region is greater than a predetermined maximum threshold, and/or wherein a region is detected as a minimum anomaly if the value of the property of the region is less than a predetermined minimum threshold. The maximum threshold value and/or the minimum threshold value are determined in a learning process using relatively few digital images based on a statistical distribution of the largest or smallest values of a specific quantity used for the detection of anomalies in digital images to be examined.
Claims
1-17. (canceled)
18. A method of detecting anomalies in digital images of products, each digital image being formed by a plurality of pixels, each pixel representing an associated location within the respective digital image and having a value characterising the associated location, each digital image defining one or more regions with each region including one pixel or multiple adjacent pixels, and wherein for each region a region value is determined, the region value comprising a value for at least one property of the respective region or a combined value for multiple properties of the respective region, the method comprising: (a) one or both of (i) detecting a respective region defined by a respective one of the digital images as a maximum anomaly when the region value of the respective region is greater than a predetermined maximum threshold value or a secondary maximum threshold value derived from the predetermined maximum threshold value and (ii) detecting the respective region defined by a respective one of the digital images as a minimum anomaly when the region value is less than a predetermined minimum threshold value or a secondary minimum threshold value derived from the predetermined minimum threshold value; and (b) wherein the predetermined maximum threshold value and the predetermined minimum threshold value are determined by, (i) for each of a number of learning digital images of good products or of good process products, specifying the one or more regions and determining the respective region value of each region and determining the maximum value of these respective region values as the maximum sample value of a maximum value sample or determining the minimum value of these respective region values as the minimum sample value of a minimum value sample; and (ii) using a statistical estimation method, determining estimates for all free, non-specified parameters of a probability density function specified to describe the maximum value sample using the maximum sample values or determining estimates for all free, non-specified parameters of a probability density function specified to describe the minimum value sample using the minimum sample values; and (iii) (I) setting a first rate at which a maximum anomaly is incorrectly detected in images to be examined or a second rate at which a maximum anomaly is correctly not detected in images to be examined, or (II) setting a third rate at which a minimum anomaly is incorrectly detected in images to be examined or a fourth rate at which a minimum anomaly is correctly not detected in an image to be examined; and one or both of, (A) determining the maximum threshold value using the probability density function parameterised according to (b)(ii) or a distribution function corresponding thereto such that the probability of occurrence of a maximum value greater than or equal to the maximum threshold value corresponds to the first rate or such that the probability of occurrence of a maximum value less than or equal to the maximum threshold value corresponds to the second rate, and (B) determining the minimum threshold value using the probability density function parameterised in accordance with (b)(ii) or a distribution function corresponding thereto such that the probability of occurrence of a minimum value less than or equal to the minimum threshold value is equal to the third rate or such that the probability of occurrence of a minimum value greater than or equal to the minimum threshold value is equal to the fourth rate.
19. The method according to claim 18 wherein one of: (a) the one or more regions are determined using a base threshold value, wherein each isolated pixel and each group of adjacent pixels whose pixel value is greater than the base threshold value are each assigned to a region of a first group of regions, or wherein each isolated pixel and each group of adjacent pixels whose pixel value is less than or equal to the base threshold value are each assigned to a region of a second group of regions, and (b) the one or more regions are defined using a geometric mask, in particular a fixed mask or a mask generated from the respective image by means of image processing.
20. The method according to claim 18 wherein a geometric property determined from location information of the pixels of a respective region, in particular the area, the circumference or the diameter, or a pixel value property determined from the values of the pixels of the respective region is used as a property of the respective region, wherein the pixel value property comprises one of the maximum value, the minimum value, the mean value, or the variance or standard deviation of all pixels of the region.
21. The method according to claim 18 wherein the number of learning digital images of good products, good process products, bad products, or bad process products is determined using at least one termination criterion, a current number of learning digital images being increased until the at least one termination criterion is fulfilled.
22. The method according to claim 21 wherein the at least one termination criterion is formed by or derived from a confidence interval for at least one parameter of the respective probability density function.
23. The method according to claim 21 wherein the at least one termination criterion is formed by a threshold confidence interval for the minimum threshold value or the maximum threshold value, the threshold confidence interval being determined by determining a confidence interval for each parameter and determining an effect of these confidence intervals on the threshold confidence interval using the method of Gaussian error propagation.
24. The method according to claim 21 wherein the at least one termination criterion is formed by a threshold confidence interval for the minimum threshold value or maximum threshold value, the threshold confidence interval being determined by means of a statistical method comprising the bootstrapping method.
25. The method according to claim 18 wherein using the respective probability density function and the respective parameters, for each detected maximum sample value or minimum sample value the probability is determined with which values occur that are smaller than or equal to the respective detected maximum sample value or minimum sample value, and the probability with which values occur that are larger than or equal to the respective detected maximum sample value or minimum sample value, and in that the parameters for the probability density function are redetermined if, for at least one of the detected maximum sample values or minimum sample values, one of the two respective probabilities determined in this way is smaller than a predetermined outlier limit, these maximum sample values or minimum sample values remaining unconsidered in the redetermination.
26. The method according to claim 18 wherein a statistical test is carried out which provides a statement as to whether the respective predetermined probability density function, using the estimated values for the parameters determined for this purpose, describes the empirical distribution in the form of the respective detected maximum sample values or minimum sample values sufficiently accurately.
27. The method according to claim 26 wherein the estimation of the parameters, after detecting a predetermined minimum number of maximum sample values or minimum sample values, is carried out for a plurality of predetermined different probability density functions, in that for each of the thus determined probability density functions the statistical test is carried out and in that for the further method that probability density function is used as predetermined probability density function for which the statistical test gives the most appropriate result.
28. The method according to claim 23 wherein a confidence interval or an error limit for the respective predetermined rate is determined from the limits of the confidence interval for the maximum threshold value or the minimum threshold value.
29. The method according to claim 28 wherein the confidence interval or the error limit for the respective predetermined rate are output for monitoring or controlling devices or an entire production line used for manufacturing, processing or testing the products.
30. The method according to claim 18 wherein a secondary maximum threshold is determined, the secondary maximum threshold being selected within the limits of a confidence interval determined for the maximum threshold or equal to a limit of the confidence interval, or the secondary minimum threshold being selected within the limits of a confidence interval determined for the minimum threshold or equal to a limit of the confidence interval.
31. The method according to claim 18 wherein the predetermined probability distribution is the generalised extreme value distribution comprising the Gumbel distribution, the Weibull distribution, or the Fréchet distribution.
32. An apparatus for detecting anomalies in digital images of products, comprising data processing means adapted to obtain and process digital image data of digital images of products, wherein that the data processing means is adapted to carry out the method according to claim 18.
33. A computer program product for detecting anomalies in digital images of products, the computer program product comprising non-transitory computer readable media storing instructions which, when executed by a data processing device, cause the device to perform the method of claim 18.
34. A method of detecting anomalies in digital images of products, each digital image being formed by a plurality of pixels, each pixel representing an associated location within the respective digital image and having a value characterising the associated location, each digital image defining one or more regions with each region including one pixel or multiple adjacent pixels, and wherein for each region a region value is determined, the region value comprising a value for at least one property of the respective region or a combined value for multiple properties of the respective region, the method comprising: (a) one or both of (i) detecting a respective region defined by a respective one of the digital images as a maximum anomaly when the region value of the respective region is greater than a predetermined maximum threshold value or a secondary maximum threshold value derived from the predetermined maximum threshold value and (ii) detecting the respective region defined by a respective one of the digital images as a minimum anomaly when the region value is less than a predetermined minimum threshold value or a secondary minimum threshold value derived from the predetermined minimum threshold value; and (b) wherein the predetermined maximum threshold value and the predetermined minimum threshold value are determined by, (i) for each of a number of learning digital images of bad products or of bad process products, specifying the one or more regions and determining the respective region value of each region and determining the maximum value of these respective region values as the maximum sample value of a maximum value sample or determining the minimum value of these respective region values as the minimum sample value of a minimum value sample; and (ii) using a statistical estimation method, determining estimates for all free, non-specified parameters of a probability density function specified to describe the maximum value sample using the maximum sample values and/or determining estimates for all free, non-specified parameters of a probability density function specified to describe the minimum value sample using the minimum sample values; and (iii) (I) setting a first rate at which a maximum anomaly is correctly detected in images to be examined or a second rate at which no maximum anomaly is incorrectly detected in images to be examined, or (II) setting a third rate at which a minimum anomaly is correctly detected in images to be examined or a fourth rate at which no minimum anomaly is incorrectly detected in images to be examined; and one or both of, (A) determining the maximum threshold value using the probability density function parameterised according to (b)(ii) or a distribution function corresponding thereto such that the probability of occurrence of a maximum value less than or equal to the maximum threshold value corresponds to the second rate or such that the probability of occurrence of a maximum value greater than or equal to the maximum threshold value corresponds to the first rate, and (B) determining the minimum threshold value using the probability density function parameterised in accordance with (b)(ii) or a distribution function corresponding thereto such that the probability of occurrence of a minimum value greater than or equal to the minimum threshold value is equal to the fourth rate or such that the probability of occurrence of a minimum value less than or equal to the minimum threshold value is equal to the third rate.
35. The method according to claim 34 wherein one of: (a) the one or more regions are determined using a base threshold value, wherein each isolated pixel and each group of adjacent pixels whose pixel value is greater than the base threshold value are each assigned to a region of a first group of regions, or wherein each isolated pixel and each group of adjacent pixels whose pixel value is less than or equal to the base threshold value are each assigned to a region of a second group of regions, and (b) the one or more regions are defined using a geometric mask, in particular a fixed mask or a mask generated from the respective image by means of image processing.
36. The method according to claim 34 wherein a geometric property determined from location information of the pixels of a respective region, in particular the area, the circumference or the diameter, or a pixel value property determined from the values of the pixels of the respective region is used as a property of the respective region, wherein the pixel value property comprises one of the maximum value, the minimum value, the mean value, or the variance or standard deviation of all pixels of the region.
37. The method according to claim 34 wherein the number of learning digital images of good products, good process products, bad products, or bad process products is determined using at least one termination criterion, a current number of learning digital images being increased until the at least one termination criterion is fulfilled.
38. The method according to claim 37 wherein the at least one termination criterion is formed by or derived from a confidence interval for at least one parameter of the respective probability density function.
39. The method according to claim 37 wherein the at least one termination criterion is formed by a threshold confidence interval for the minimum threshold value or the maximum threshold value, the threshold confidence interval being determined by determining a confidence interval for each parameter and determining the effect of these confidence intervals on the threshold confidence interval using the method of Gaussian error propagation.
40. The method according to claim 37 wherein the at least one termination criterion is formed by a threshold confidence interval for the minimum threshold value or maximum threshold value, the threshold confidence interval being determined by means of a statistical method comprising the bootstrapping method.
41. The method according to claim 34 wherein using the respective probability density function and the respective parameters, for each detected maximum sample value or minimum sample value the probability is determined with which values occur that are smaller than or equal to the respective detected maximum sample value or minimum sample value, and the probability with which values occur that are larger than or equal to the respective detected maximum sample value or minimum sample value, and in that the parameters for the probability density function are redetermined if, for at least one of the detected maximum sample values or minimum sample values, one of the two respective probabilities determined in this way is smaller than a predetermined outlier limit, these maximum sample values or minimum sample values remaining unconsidered in the redetermination.
42. The method according to claim 34 wherein a statistical test is carried out which provides a statement as to whether the respective predetermined probability density function, using the estimated values for the parameters determined for this purpose, describes the empirical distribution in the form of the respective detected maximum sample values or minimum sample values sufficiently accurately.
43. The method according to claim 42 wherein the estimation of the parameters, after detecting a predetermined minimum number of maximum sample values or minimum sample values, is carried out for a plurality of predetermined different probability density functions, in that for each of the thus determined probability density functions the statistical test is carried out and in that for the further method that probability density function is used as predetermined probability density function for which the statistical test gives the most appropriate result.
44. The method according to claim 38 wherein a confidence interval or an error limit for the respective predetermined rate is determined from the limits of the confidence interval for the maximum threshold value or the minimum threshold value.
45. The method according to claim 44 wherein the confidence interval or the error limit for the respective predetermined rate are output for monitoring or controlling devices or an entire production line used for manufacturing, processing or testing the products.
46. The method according to claim 34 wherein a secondary maximum threshold is determined, the secondary maximum threshold being selected within the limits of a confidence interval determined for the maximum threshold or equal to a limit of the confidence interval, or the secondary minimum threshold being selected within the limits of a confidence interval determined for the minimum threshold or equal to a limit of the confidence interval.
47. The method according to claim 34 wherein the predetermined probability distribution is the generalised extreme value distribution comprising the Gumbel distribution, the Weibull distribution, or the Fréchet distribution.
48. An apparatus for detecting anomalies in digital images of products, comprising data processing means adapted to obtain and process digital image data of digital images of products, wherein that the data processing means is adapted to carry out the method according to claim 34.
49. A computer program product for detecting anomalies in digital images of products, the computer program product comprising non-transitory computer readable media storing instructions which, when executed by a data processing device, cause the device to perform the method of claim 34.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
1 DESCRIPTION OF REPRESENTATIVE EMBODIMENTS
[0077]
[0078] As stated above, the digital images will typically represent products which in turn may have the anomalies to be detected. In the case of the X-ray inspection device shown in
[0079] In the X-ray inspection device 100 shown in
[0080] The anomaly detection device 102 comprises an image processing unit 122 to which the signal from the X-ray detector 120 is fed. The image processing unit 122 can be designed as a conventional computer unit with one or more processors, a main memory and, if necessary, a hard disk memory or SSD memory as well as suitable interfaces for feeding the signal of the X-ray detector 120 and for feeding or receiving and sending or receiving further data. Furthermore, the device 102 may have a display unit 124 on which information generated by or fed to the image processing unit 122 can be displayed.
[0081] As shown schematically in
[0082] As explained at the beginning, for detecting anomalies it is known to use a threshold value for the pixel values. In this case, the presence of an anomaly is detected when a pixel value or a group of neighbouring pixels with a predetermined minimum number of pixels exceeds a threshold value. If one or more anomalies are detected in a digital image, this information can be used to trigger an action in relation to the associated product, for example to reject the product from a stream of products. Instead or in addition, the product in question can also be marked physically or virtually, i.e. by assigning corresponding data.
[0083] The display unit 124 can be used to display desired information, such as the digital images to be examined with any anomalies detected therein, the threshold value used in each case, the type of probability density function selected and the associated parameters, the quality of the fit of the probability density function to the sample, confidence intervals for the threshold values, the parameters or the rates (in particular the false rejection rate) and the like. The output can of course be in the form of data (numerical values) and/or graphics. When performing the detection in the normal working mode of the device, a graph identical or similar to
[0084] The image processing unit 122 may also be supplied with one or more starting threshold values already determined by the method described below for a type of product currently being examined, or with further information necessary for carrying out the method described below, for example information concerning the type of predetermined probability density function(s) to be used or information concerning the manner in which regions are defined in a digital image to be examined (see below).
[0085] As explained above, the method described below for detecting anomalies in digital images is not limited to checking whether one or more pixel values exceed a predetermined maximum threshold value or fall below a predetermined minimum threshold value. Rather, the method described below for determining a maximum threshold value or minimum threshold value can be generalised to the effect that a maximum threshold value and/or a minimum threshold value is determined for any properties of previously defined regions in the digital images to be examined.
[0086] For this purpose, the regions to which the value of a given property can be assigned must first be defined in a digital image to be examined. The regions can be defined, for example, by using a threshold value, wherein all pixel values that are equal to or exceed the threshold value form a first group of regions and the remaining pixel values form a second group of regions. Depending on the property to be investigated, it may be sufficient that only the first or only the second group is processed. This is the case, for example, if only the maximum or minimum pixel value or the average pixel value of the regions is evaluated for the detection of an anomaly.
[0087] However, it is possible to assign one or more properties to the regions that cannot only be described by individual pixel values. For example, geometric properties such as area, circumference, diameter (in the case of at least approximately circular regions) or the deviation from the circular shape can be assigned to a region. In such a case, an anomaly is detected when the value of the property in question exceeds a maximum threshold value predefined for this purpose or falls below a predefined minimum threshold value. In this general case, too, the minimum and maximum threshold values required for this can be determined using the method explained below.
[0088] Another way of determining the regions in a digital image to be examined is to use a predefined geometric mask that is placed over the image. This can be, for example, a mask comprising equally sized neighbouring squares of a given size.
[0089] Here, too, one or more properties can be assigned to each region defined in this way, for example the variance or standard deviation of the pixel values encompassed by the regions, the relevant average value or the maximum or minimum value contained therein.
[0090] Combined values for each region can also be determined from two or more values for different properties. For example, a value for the variance or standard deviation of the pixel values and an average value can be combined into a combined value, especially by an arithmetic operation, e.g. (weighted) addition, which in this particular case represents a kind of confidence interval if the pixel values in this region are reasonably normally distributed. Another example of a combined value or combination of properties of the regions is the use of a difference between the maximum and minimum pixel value contained in each. To be more stable against outliers, quantiles can also be used, for example 90% and 10% quantiles instead of the maximum and minimum value.
[0091] In the following, it is described how a corresponding maximum threshold value or minimum threshold value can be determined with a small number of digital images. As mentioned above, such a learning process can be carried out with good products or good process products as well as with bad products or bad process products. The learning process can be carried out, for example, during the commissioning of a plant for the production or processing of products, which comprises such an inspection device. It will generally be necessary to determine the threshold values for each product type.
[0092] Of course, the threshold values for specific product types can be saved so that the learning process does not have to be repeated every time a change is made to the type of product being tested.
[0093] It is also possible to carry out the learning process during the ongoing operation of a plant, at least if it can be assumed that the plant produces good process products, i.e. products that are predominantly good products (which do not contain an anomaly). In this case, as explained below, the bad products contained in the good process products can be sorted out as outliers when creating the required sample.
[0094] An essential feature of the method for determining the threshold values according to the invention described below is that, in the case of using good products, a rate is specified at which a maximum anomaly is to be falsely detected in an image to be examined (hereinafter also referred to as the false positive rate) or at which no maximum anomaly is correctly detected in an image to be examined (hereinafter also referred to as the correct negative rate) and/or that, in the case of using bad products, a rate is specified, with which a maximum anomaly is correctly detected in an image to be examined (hereinafter also referred to as the true-positive rate) or with which no maximum anomaly is incorrectly detected in an image to be examined (hereinafter also referred to as the false-negative rate). Thus, it is no longer necessary to determine a threshold value in a first step and to check in a second step whether a corresponding acceptable rate results when using the threshold value in question.
[0095] The methods according to the invention ensure that a threshold value can be determined with a relatively small number of digital images.
[0096] The required number of digital images, i.e. the number of good products or good process products, can be determined from the outset, although such a number must then be chosen high enough to determine a threshold value with the desired reliability. However, it is also possible to determine the required number of digital images in the course of the learning process (regardless of whether the images are generated during the learning process or are already available before the start of the learning process). It is a good idea to start with a minimum number of digital images and to increase this minimum number step by step by one or more digital images until the respective threshold value is sufficiently reliable, i.e. the specified rate is maintained with sufficient reliability. This can be checked by determining a confidence interval.
[0097] In a next step, as with the detection of anomalies in a normal operating mode (i.e. outside the learning process), the regions are determined for each of the digital images and the value of at least one property respectively assigned to the regions is determined for each region. For each digital image, the maximum value and/or the minimum value of the property or properties in question, or the combined value for several properties, is then determined and assigned to a corresponding sample. This can be done, for example, by storing all minimum values in a minimum value list and all maximum values in a maximum value list. It should be mentioned that of course not both alternatives of the method have to be used at the same time. If only maximum anomalies are to be detected in normal operation, i.e. anomalies that are recognised as such when a maximum threshold value is exceeded, then of course only a maximum threshold value must be determined. The same applies if only minimum anomalies are to be detected.
[0098] If a sufficient number of sample elements (maximum or minimum values for the at least one property or combined property) has been determined, a probability density function specified for the maximum value list or minimum value list can be parameterised in a further step using a statistical estimation method. This corresponds to fitting the probability density function to the empirical frequency distribution of the sample in question.
[0099] For this purpose, the sample can be binned, i.e. the sample elements are each assigned to equally wide, neighbouring intervals of the associated value range. The relevant predetermined probability density function can then be fitted to this empirical (relative) frequency distribution, for example by using the least squares method. Usually, however, a more advantageous statistical estimation function is used, for example the maximum likelihood method or the method of moments.
[0100] The probability density function specified for carrying out the method should be of a type that can be assumed to describe the sample well when the parameterisation is carried out. Since in the present case extreme values are selected for the property in question and form the respective sample, one will often choose a type of the generalised extreme value distribution or the generalised extreme value distribution (with its three parameters), which combines the Gumbel distribution, the Weibull distribution and the Fréchet distribution. The frequently used Gumbel distribution has the form:
[0101] Here f denotes the value of the probability density as a function of the random variable x. In this case, the value x of the respective random variable denotes the value of the property in question or the combined value. The parameters μ and β are determined by the chosen statistical method.
[0102]
[0103] With the probability density function parameterised in this way, the desired threshold value (for the specified rate at which a maximum anomaly is falsely detected in images to be examined or at which no maximum anomaly is correctly detected in images to be examined) can be determined in a further step. For this purpose, the threshold value is set in such a way that the area under the parameterised probability density function above the threshold value is equal to the specified rate at which a maximum anomaly is falsely detected in images to be examined, or the area under the parameterised probability density function below the threshold value is equal to the specified rate at which no maximum anomaly is correctly detected in images to be examined. This is because this area corresponds to the probability of the occurrence of a maximum value of the property in question in a digital image that is greater than or equal to the threshold value. The threshold value can be obtained by rearranging the equation from the inverse function of the distribution function associated with the parameterising probability density function, if a closed-form solution for the inverse function exists. Otherwise, the threshold value can be calculated using known and suitable numerical methods.
[0104] In
[0105] If the correct negative rate is specified instead of the desired false positive rate, the area under the probability density function below the upper threshold value X.sub.so must be used accordingly for the calculation of the maximum threshold value.
[0106]
[0107] In the case of the parameterised probability density functions according to
[0108] Furthermore,
[0109]
[0110] In this case, the two threshold values are designated as Y.sub.su and Y.sub.so for differentiation. The minimum threshold value Y.sub.su must be chosen so that the area under the probability density function above the minimum threshold value Y.sub.su corresponds to the desired false negative rate (or the area under the probability density function below the minimum threshold value Y.sub.su corresponds to the desired true positive rate). Similarly, the maximum threshold value Y.sub.so must be chosen so that the area under the probability density function below the maximum threshold value Y.sub.so corresponds to the desired false negative rate (or the area under the probability density function above the maximum threshold value Y.sub.so corresponds to the desired true positive rate). Accordingly, pursuant to the graph in
[0111] As stated above, the number of digital images for determining the threshold value(s) (maximum or minimum threshold value) can be fixed. This number would be chosen large enough to determine a sufficiently reliable threshold value.
[0112] However, according to further embodiments, the number of digital images required can also be determined during the learning process. For this purpose, at least one termination criterion is defined. Starting from a predetermined minimum number of digital images, a loop of the learning process is run through until the at least one termination criterion is fulfilled. After each loop, the number of digital images can be increased by one or more images. The loop is executed until the termination criterion is fulfilled or a predefined maximum number of digital images is reached.
[0113] As a termination criterion, for example, a confidence interval can be defined for one or more of the parameters of the probability density function that are determined during parameterisation. For a meaningful application of this possibility, however, it would be a prerequisite that sufficient experience is available as to how errors or uncertainties of these parameters affect the threshold value to be determined.
[0114] It is more advantageous to determine a confidence interval for the threshold value in question. For this purpose, a confidence interval can be determined for each parameter and then the effect of this uncertainty on the threshold value. For this purpose, the effect of the error in the determination of the parameters (using the upper and lower limits of the confidence interval for the threshold values) on the calculation of the threshold value concerned can be determined, for example, by means of a method for determining error propagations, for example the method of Gaussian error propagation.
[0115] Instead of an error propagation method, another suitable statistical method can be used to determine a confidence interval for the threshold value in question or also to determine a confidence interval for the given rate. An example of this is the bootstrapping method. However, since these are well-known mathematical methods, they will not be described in more detail.
[0116] It has already been mentioned above that when using good process products for creating the required digital images, it is advantageous if those images that are based on bad products contained in the good process products, i.e. represent bad products, are not taken into account when determining the threshold value(s). This can be done by examining the extreme values of a sample for their probability of occurrence. For this purpose, the parameterised probability density function —initially using all extreme values of a sample—can be used, wherein for each sample value of the sample concerned, the probability is determined with which values occur that are smaller than or equal to the detected sample value concerned along with the probability with which values occur that are greater than or equal to the detected sample value concerned. If one of the probabilities determined for a sample value in this way is smaller than a predefined outlier limit, this sample value is recognised as an outlier.
[0117] Subsequently, a new parameterisation of the probability density function in question can be carried out, wherein sample values detected as outliers are not taken into account (e.g. deleted from the list in question).
[0118] This method can also be carried out iteratively, wherein the number of passes can be limited to a maximum number.
[0119] The same applies, of course, when using bad process products to determine the threshold value(s). However, in practice this method will play a minor role, as bad products are usually produced on purpose, and it is therefore unlikely that there is a good product among the bad products that should be sorted out as an outlier.
[0120] Finally, a statistical test can be carried out which provides a statement on how well the given (parameterised) probability density function describes the empirical distribution of the sample value in question. Examples of possible statistical tests are the Chi-square adjustment test, the Kolmogorov-Smirnov adjustment test, the Anderson-Darling adjustment test, the Jarque-Bera adjustment test or the Lilliefors adjustment test. If the test does not provide a satisfactory result for the parameterised probability density function determined in each case, i.e. if a value describing the quality of the test lies outside a specified permissibility range, an error message can be generated.
[0121] It is also possible to specify several (different types of) probability density functions and perform the statistical test with two or more specified and parameterised probability density functions. The probability density function for which the statistical test gives the best result can then be used to determine the final threshold value.
[0122] The basic method for determining the threshold value is briefly explained again below using the simplified flow chart shown in
[0123] Then it is checked whether the number of extreme values determined in this way (per type, i.e. minimum or maximum value), which corresponds to the number of digital images, is sufficient. For example, this test can be done to see if a given minimum number of maximum values has been reached.
[0124] Then, in a further step, the parameters of the probability density function are determined in one of the ways described above. From the probability density function parameterised in this way or the associated distribution function, the relevant threshold value (for the maximum and/or minimum values) can then be determined in the prescribed manner, using a predetermined rate for this purpose, for example a false ejection rate. The threshold value is thus determined in such a way that the predetermined rate, for example the false ejection rate, is observed when applying the method for detecting anomalies using the threshold value to be determined.
[0125] Once it has been determined, the threshold value can be applied when carrying out the method. Of course, it can also be stored, output or used in any other way.
[0126] After the step of determining the parameters of the probability density function, a test can also be made, as explained above, as to whether the quality of the fit of the probability density function to the sample of extreme or maximum values is sufficient. If not, the number of maximum values (of the digital images) can be increased and/or another type of probability density function can be chosen.
[0127] Furthermore, in the step of determining the threshold value (or subsequently), a confidence interval for the threshold value can be determined in the prescribed manner and tested regarding whether the width of the confidence interval is sufficiently small. If not, the number of sample values (maximum values or extreme value) can be increased further.
[0128]
[0129]
[0130]
[0131] This information could also be interpreted to mean that the production quality has improved in comparison to the time when it was learned. One could repeat the learning with an identical false positive rate and get a better sensitivity while at the same time maintaining (but no longer clearly falling short of) the specified false positive rate.
[0132] The invention thus provides methods for the detection of anomalies using a threshold value, wherein, for the determination of the threshold value, a rate can be specified at which a maximum or minimum anomaly is to be incorrectly detected in images to be examined, or a rate at which no maximum or minimum anomaly is to be correctly detected in images to be examined (case of threshold value determination using images of good products or good process products) or a rate at which a maximum or minimum anomaly is to be correctly detected in images to be examined, or a rate at which no maximum or minimum anomaly is to be incorrectly detected in images to be examined (case of threshold determination using images of bad products or bad process products).
[0133] The methods within the scope of the invention are suitable for detecting anomalies in images of products which can be generated in any way and which represent any characteristics of the products. In particular, the method is suitable for analysing images obtained by means of inspection devices that use X-rays or terahertz radiation and can thus generate information about the interior of a product. In particular, the method can be implemented by software in an inspection device. The result of the detection process can be used to control further devices, for example a sorting device.
[0134] The rate to be preset can be fixed (e.g. in the software) or preset by a user of the method or a device in which the method is implemented.
[0135] The same applies to the probability density function and the associated distribution function. In a corresponding software, several of these functions can also be integrated for selection by a user.
[0136] The respective rate can not only be specified for a specific machine or system, but also, for example, for several machines or systems. For example, it can be specified that a rate is to apply as a total rate for several similar (or also dissimilar) machines. The value of the rate specified for a machine or system can also be determined from a specification of the number of images/products detected in a time unit according to the specification, wherein the throughput (total number of images/products per time unit) must also be known.
[0137] This value of images/products detected per time unit according to the specification (e.g. number of false ejections per hour) can in turn result from practical conditions. For example, two people can be provided to check ejected products, rework them if necessary and then reintroduce them into the process downstream of the detection. If each of these processes (checking and, if necessary, reworking) takes five minutes, a maximum of 24 products may be detected and ejected per hour according to the relevant specification. At a throughput of e.g., 1200/h, the current ejection rate should therefore not exceed 2%. The specified false ejection rate must therefore never be greater than 2% so that inspection and reworking can take place without the products to be rein-spected and, if necessary, reworked piling up.
[0138] Furthermore, it is possible to compare the current ejection rate between two similar detection devices or systems that are fed from the same source. If the current ejection rates differ sig-nificantly, this indicates an error in the detection.
[0139] Finally, it should be mentioned that the two methods according to which the respective threshold values X.sub.su and/or X.sub.so or Y.sub.su and/or Y.sub.so are determined can also be applied simultane-ously, for example in order to check whether the rate specified in each case for determining the threshold values provides an acceptable threshold value.
[0140] One such verification method is explained below with reference to
[0141] Normally, the two threshold values X.sub.so and Y.sub.so will not be identical. If, as shown in
[0142] When considering the situation for the minimum anomalies, an analogous (but reversed) picture emerges: If the threshold value X.sub.su is smaller than the threshold value Y.sub.su, this would mean that using the threshold value X.sub.su from the respective other probability density function would result in a false detection rate (i.e. a value of the integral over the probability density function for the minimum anomalies determined by means of bad products from X.sub.su to plus infinity) that is higher than the false detection rate specified for determining the threshold value Y.sub.su. Similarly, if the threshold value Y.sub.su is used to calculate the false rejection rate, the false rejection rate resulting from the other probability density function for the bad products would be greater than the predetermined false rejection rate.
[0143] In such a contradictory case, it would ultimately have to be decided, taking into account economic conditions, whether the higher false detection rate (i.e. the probability with which a product with a maximum anomaly is not detected as a bad product) is of higher importance or the false rejection rate (i.e. the probability with which a good product is detected as a bad product). In response to such a contradiction, the relevant predefined rate, which is classified as less important, would then be changed in such a way that an associated threshold value results which is no longer classified as contradictory.
[0144]
[0145] In such a case, one or both of the preset rates can be varied so that the resulting threshold values are closer together or, in extreme cases, even identical.
[0146] As used herein, whether in the above description or the following claims, the terms “comprising,” “including,” “carrying,” “having,” “containing,” “involving,” and the like are to be understood to be open-ended, that is, to mean including but not limited to. Also, it should be understood that the terms “about,” “substantially,” and like terms used herein when referring to a dimension or characteristic of a component indicate that the described dimension/characteristic is not a strict boundary or parameter and does not exclude variations therefrom that are functionally similar. At a minimum, such references that include a numerical parameter would include variations that, using mathematical and industrial principles accepted in the art (e.g., rounding, meas-urement or other systematic errors, manufacturing tolerances, etc.), would not vary the least sig-nificant digit.
[0147] Any use of ordinal terms such as “first,” “second,” “third,” etc., in the following claims to modify a claim element does not by itself connote any priority, precedence, or order of one claim element over another, or the temporal order in which acts of a method are performed. Rather, unless specifically stated otherwise, such ordinal terms are used merely as labels to distinguish one claim element having a certain name from another element having a same name (but for use of the ordinal term). Rather than using an ordinal term to distinguish between commonly named elements, a particular one of a number of elements may be called out in the following claims as a “respective one” of the elements and thereafter referred to as “that respective one” of the elements.
[0148] The term “each” may be used in the following claims for convenience in describing characteristics or features of multiple elements, and any such use of the term “each” is in the inclu-sive sense unless specifically stated otherwise. For example, if a claim defines two or more elements as “each” having a characteristic or feature, the use of the term “each” is not intended to exclude from the claim scope a situation having a third one of the elements which does not have the defined characteristic or feature.
[0149] The above-described preferred embodiments are intended to illustrate the principles of the invention, but not to limit the scope of the invention. Various other embodiments and modifica-tions to these preferred embodiments may be made by those skilled in the art without departing from the scope of the present invention. For example, in some instances, one or more features disclosed in connection with one embodiment can be used alone or in combination with one or more features of one or more other embodiments. More generally, the various features described herein may be used in any working combination.
REFERENCE LIST
[0150] 100 X-ray inspection device [0151] 102 Anomaly detection device [0152] 104 Product [0153] Conveyor [0154] 108 Conveyor belt [0155] 110 Conveyor belt [0156] 112 Conveyor belt [0157] 114 Conveyor belt [0158] Shielding enclosure [0159] 118 X-ray source [0160] 120 X-ray detector [0161] 121 X-ray beam [0162] 122 Image processing unit [0163] 124 Display unit [0164] F Conveying direction [0165] X.sub.su Lower threshold value (determination of the threshold value by means of good products or good process products) [0166] Y.sub.su Lower threshold value (determination of the threshold value by means of bad products or bad process products) [0167] X.sub.so Upper threshold value (determination of the threshold value by means of good products or good process products) [0168] Y.sub.so Upper threshold (determination of the threshold value by means of bad products or bad process products) [0169] ΔX.sub.so Width of the confidence interval for the maximum threshold value [0170] ΔX.sub.su Width of the confidence interval for the minimum threshold value [0171] R.sub.fp False positive rate [0172] R.sub.m True negative rate [0173] R.sub.rp True positive rate [0174] R.sub.fn False negative rate