Method and apparatus for detecting anomalies in two-dimensional digital images of products

By dividing digital images into areas and using statistical estimation to set thresholds based on probability density functions, the method addresses the inefficiencies of existing anomaly detection methods, optimizing detection and rejection rates for cost-effective and reliable anomaly recognition.

JP7751019B2Active Publication Date: 2025-10-07WIPOTEC GMBH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024065986
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2023-05-04
Filing Date
2024-04-16
Publication Date
2025-10-07
Estimated Expiration
2044-04-16

AI Technical Summary

Technical Problem

Existing methods for detecting anomalies in digital images of products require a costly learning process to determine thresholds, which involves producing a large number of acceptable products, leading to production time loss and uncertainty in defining a reliable threshold value.

Method used

A method that divides digital images into areas, determines characteristic values for each area, and uses statistical estimation to set thresholds based on a probability density function, allowing for the determination of detection and false rejection rates, even with a smaller number of images, including the use of known anomalies to estimate detection rates.

Benefits of technology

Enables efficient and cost-effective threshold determination for anomaly detection, balancing economic and reliability requirements by setting thresholds that optimize detection and rejection rates, reducing production downtime and improving accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007751019000002
    Figure 0007751019000002
  • Figure 0007751019000003
    Figure 0007751019000003
  • Figure 0007751019000004
    Figure 0007751019000004
Patent Text Reader

Abstract

To provide a method, an apparatus and a program for detecting an abnormality in digital images of a product.SOLUTION: In an inspection process by an X-ray inspection device, plural digital rejected images of a real or virtual rejected product respectively having at least one known abnormality are created. Each rejected image is divided into sections. A maximum value of applicable characteristics in each section is determined as a maximum random sample value of a maximum value random sample and / or a minimum value is determined as a minimum random sample value of a minimum value random sample, and a detection rate about at least one known abnormality is determined from the created random sample. Each digital image is divided into the sections and one section is detected as a maximum abnormality when at least one characteristic value is higher than a set maximum threshold, and one section is detected as a minimum abnormality when at least one characteristic value is lower than a set minimum threshold.SELECTED DRAWING: None
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a method for detecting anomalies in two-dimensional digital images of a product, comprising the features of the preamble of claim 1. Furthermore, the invention relates to an apparatus for implementing this method as well as to a computer program product. [Background technology]

[0002] During product manufacturing, it is often desirable or necessary to continuously check the manufactured product for defects, foreign bodies, and other anomalies. For example, in the food industry, when producing yogurt or cheese, the challenge can be to continuously inspect the finished product for unwanted foreign bodies or other undesirable material regions within the product. To solve this problem, inspection devices are used in practice to transilluminate the product with electromagnetic radiation, particularly radiation in the X-ray spectrum. In this way, a digital image of the product is generated that contains information about the product's external geometric dimensions or surface, as well as information about the product's interior. Depending on its attenuation, anomalies to be detected can result in image areas that, when transilluminated, have a "gray value" or pixel value that is higher or lower than anomaly-free image areas (hereinafter referred to as "pass areas"). In this description, the term "gray value" refers to information generated by a detector depending on the radiation power or corresponding radiation energy striking each pixel during a reference exposure time, regardless of the color or format in which pixel values ​​can be displayed in the corresponding digital image.

[0003] For the inspection of these types of products, devices or methods are also known in which the product to be inspected is not completely trans-illuminated (i.e., the radiation source and detector are located on opposite sides of the product), but rather the radiation penetrates deep enough into the product to be inspected that it is "reflected" within the product, the "reflection" being caused physically by scattering of the radiation penetrating the volume or by the generation of fluorescent radiation within the volume. In these types of inspection devices, the radiation source and detector may be on the same side of the product to be inspected.

[0004] The products to be inspected can then be present in the form of any type of individual item or in bulk, which are conveyed through the inspection device by a conveying device.

[0005] As detectors for radiation, line detectors are often used in production lines, where the products to be inspected move along a transport path, with one or more detector lines, each containing a predetermined number of pixels. The products then move, usually at a constant speed, through this type of scanning device, and the detected lines are combined to form a digital image. However, it is also possible to use area scanners instead of line scanners. In this case, the digital image of the product to be inspected can be detected in a single detection process (i.e., a single "exposure process").

[0006] The digital image thus generated is then inspected, usually automatically, for internal defects in the product. The image generated by the scanning process can then be processed or pre-processed directly prior to such inspection. For this purpose, the original image can be digitally filtered, for example, and the filters used for this purpose can result in improved contrast.

[0007] It is also possible to take measures to improve contrast when generating the images, particularly with a view to detecting anomalies: for example, a dual-energy method can be employed, in which both spectra are selected so that overlapping the corresponding partial images results in improved contrast.

[0008] Furthermore, it is possible to use a spectrally resolved detector that generates multiple images, each consisting of pixels whose gray values ​​correspond to the radiation energy of a specific spectral portion of the detected radiation. For anomaly detection, images can be used that are generated from all or selected partial images of such a spectrally resolved detector, for example by weighted addition of the corresponding pixel values. However, each partial image can also be examined separately for the presence of anomalies.

[0009] Methods are known in which a threshold is defined for the automated inspection of digital images of products, and an anomaly is present if the gray value of at least one pixel is greater than the threshold. To this end, a predefined number of acceptable products (i.e., products without anomalies) of the same product type are typically scanned during a learning process to obtain information about the maximum gray value typically occurring in such acceptable products. Depending on this, a threshold is defined so that a predefined value for the rejection rate (e.g., percentage or parts per thousand) is observed. The rejection rate here is the probability that an acceptable product will be recognized as a "rejected product." This (theoretical) rejection rate can be checked by determining the empirical frequency with which acceptable products are identified as rejected. To this end, digital images of a sufficient number of acceptable products can be generated and checked using the defined threshold, and the empirical rejection rate is determined as the quotient of the acceptable products recognized as rejected divided by the total number of acceptable products.

[0010] That is, determining such a threshold value requires a costly learning process in which a relatively large number of digital images of acceptable products must be generated. However, this is a disadvantage because the relevant production line must first produce such a large number of acceptable products, which means that a corresponding amount of production time is lost. Moreover, it is virtually impossible to predict how large the number of acceptable products required for the learning process must be in order to be able to reliably define a threshold value that will comply with the desired rejection rate.

[0011] Unpublished Patent Document 1 describes a method for detecting anomalies in digital images, which allows an automated process for defining thresholds even when using a small number of digital images. In this method, thresholds for detecting anomalies in product digital images are determined reliably through a learning process. An assumption is made regarding the statistical distribution of the maximum or minimum values ​​(hereinafter referred to as extreme values) of a characteristic quantity used to recognize anomalies in the digital image to be inspected. The distribution of such extreme values ​​is sufficiently well described by a predetermined probability density function to be parameterized (the term "parameterize" in this specification means determining or defining values ​​for parameters of the probability density function that are not already defined). In other words, it is assumed that the elements of a random sample of the respective set probability density function (i.e., a set of the respective maximum or minimum values) are sufficient, or that the occurrence probability can be well described by this probability density function. Using the elements of the random sample, estimates are determined for all parameters of the probability density function to be determined (i.e., all parameters that are not already set, as the case may be). As a probability density function to be parameterized, this method makes use of a generalized extreme value distribution, for example certain of its variants, namely the Weibull, Fréchet or Gumbel distribution, in order to describe the distribution of the maximum or minimum values ​​of a characteristic quantity.

[0012] This method is not limited to the case described at the beginning, in which pixel values, in particular each individual pixel value, in relation to a threshold value for pixel values, are used to determine whether the digital image to be examined contains an anomaly.

[0013] Rather, the present invention generalizes the principles underlying such a scheme. The image to be inspected is divided into one or more areas, and each area is assigned at least one identical characteristic or multiple identical characteristics. Each area contains exactly one or multiple pixels, and multiple pixels are assigned to the same area only if they are adjacent (i.e., each pixel of the area has at least one pixel of the same area directly adjacent to it). A pixel of interest can be considered adjacent to each pixel that is adjacent to one of its sides (i.e., pixels above, below, left, and right of the pixel of interest) or each pixel that is adjacent to one of its corners (i.e., pixels diagonally adjacent to the pixel of interest). For each characteristic of the predefined areas, a value representing the respective characteristic is determined. Where multiple characteristics are assigned to each area, a separate value may be defined for each characteristic, or the values ​​of two or more characteristics may be combined into a single value, for example by a mathematical operation (e.g., multiplication or division or weighted addition).

[0014] Under this generalization, anomaly detection is performed by determining a threshold for each characteristic or for each combination of characteristics.

[0015] In an extreme case, the entire image can be defined as a region, but if the pixel value of each pixel is examined as an inherent quantity for detecting anomalies, with respect to whether it is above or below a threshold value established for the pixel value, this leads to the same results as if each pixel were defined as a region containing just one pixel. In this case, the generalization described above, utilizing predefined regions and assigned arbitrary properties, leads to the conventional approach of examining each individual pixel with respect to its pixel value, with respect to whether it is above or below a threshold value for the pixel value.

[0016] According to the invention, the determination of the threshold value for a characteristic or for a combination of characteristics is carried out in a learning process, where the images required for the threshold determination can already be generated in a sufficient predetermined number or can be generated as needed, i.e., one or more new digital images are generated successively until a sufficient number is reached.

[0017] In this known method, a learning process or an automated process for determining a threshold value for at least one characteristic is carried out using digital images of acceptable products that are free from anomalies. As already mentioned above, images that may be the direct result of a scanning process can first be processed or preprocessed for the detection method. A suitable portion of the entire determined image can then be generated, which includes the product as a whole or a set subregion. This portion or the entire detected digital image can be digitally filtered, for example, to improve contrast in order to more strongly highlight anomalies. If endlessly produced or bulk products are to be inspected for anomalies, digital images of fragments of such products can be generated and processed for inspection in the same way as images of individual products (or portions of such types of products) can be used.

[0018] It should be noted here that it is not necessary for the automated process to be run using only acceptable products. Rather, the automated process can be run using images of products produced on the production line without guaranteeing that none of the products are unacceptable. Instead of acceptable products, products referred to as "acceptable process products" can be used, with the majority of the acceptable process products consisting of acceptable products and only a minority consisting of unacceptable products. In practice, the proportion of unacceptable products in the acceptable process products is expected to be low, particularly below 25%, preferably below 10%, and most preferably below 5%.

[0019] Within the framework of the automated process, a fixed number of digital images, or a number of images to be determined in the course of the automated process, are generated or utilized for the accepted product or accepted process product.

[0020] One or more areas are defined for each digital image, and for each area, the value of at least one property or a combination of properties is determined, the largest of these values ​​being determined as the maximum random sample value of the maximum random sample and / or the smallest of these values ​​being determined as the minimum random sample value of the minimum random sample.

[0021] In this case, it is possible to exclude implausible extreme values ​​or extreme values ​​that clearly indicate an error. For example, when determining the extreme values, pixel values ​​having the absolute maximum or minimum value of the gray value scale used can be excluded, since a corresponding minimum value, for example a value of 0, may indicate a pixel with a detector malfunction, and a maximum value may indicate a pixel with a detector overshoot.

[0022] The extreme values ​​thus determined are the random samples mentioned above and can be stored, for example, as a list (possibly separately for minimum and maximum values).

[0023] Subsequently, estimates can be determined for all undetermined parameters of the probability density function configured to represent the maximum random sample using the maximum random sample value and / or for all undetermined parameters of the probability density function configured to represent the minimum random sample using the minimum random sample value, using statistical estimation methods.

[0024] In particular, statistical estimation methods that utilize estimation functions (also called statistical estimators) can only expect meaningful results if the random sample contains a minimum number of values, so such a minimum number is usually set, which in turn results in a corresponding minimum number of digital images.

[0025] One key feature of this known method is that the rate at which the largest anomaly is erroneously detected in the image to be examined (when the threshold method is implemented) is set, or the rate at which the largest anomaly is not correctly detected in the image to be examined (when the threshold method is implemented) is set, and / or the rate at which the smallest anomaly is erroneously detected in the image to be examined (when the threshold method is implemented) is set, or the rate at which the smallest anomaly is not correctly detected in the image to be examined (when the threshold method is implemented), i.e. the maximum or minimum threshold to be determined can be determined so that the set rates are respected.

[0026] The concept of rate is understood here as the quotient of the number of acceptable products that meet the corresponding rate criterion when the test is applied and the set total number of acceptable or process products. Accordingly, the rate at which the largest or smallest anomaly is erroneously detected in the images to be inspected corresponds to the concept of "false reject rate" that is often used in practice. The rate at which the largest or smallest anomaly is erroneously detected in the images to be inspected and the rate at which the largest or smallest anomaly is not correctly recognized in the images to be inspected each sum to 1. These rates can also be determined during system operation as floating values, i.e., for example, via the most recently checked number N of products.

[0027] If the set probability density function is parameterized by an estimation method, the maximum threshold value can be determined using the previously parameterized probability density function or a corresponding distribution function such that the probability of the occurrence of a maximum value greater than or equal to the maximum threshold value corresponds to the set percentage of erroneous detection of the largest anomaly in the image to be examined, or the probability of the occurrence of a maximum value less than or equal to the maximum threshold value corresponds to the set percentage of incorrect recognition of the largest anomaly in the image to be examined. In other words, the maximum threshold value can be determined such that the area under the probability density function above the maximum threshold value or the area under the probability density function below the maximum threshold value corresponds to the set percentage.

[0028] Accordingly, the minimum threshold value can be determined using a previously parameterized probability density function or a corresponding distribution function such that the probability of the occurrence of a minimum value less than or equal to the minimum threshold value corresponds to a corresponding set percentage of erroneous detection of the smallest anomaly in the image to be inspected, or the probability of the occurrence of a minimum value greater than or equal to the minimum threshold value corresponds to a corresponding set percentage of incorrect recognition of the smallest anomaly in a non-acceptable product. In other words, the minimum threshold value can be determined such that the area under the corresponding probability density function below the minimum threshold value or the area under the probability density function below the minimum threshold value corresponds to a corresponding set percentage.

[0029] To determine these areas, it is of course also possible to use the integral of the probability density function, which integral is formed from a corresponding threshold value to the upper limit of the definition interval of the probability density function (for example infinity or a set upper limit above which the value of the integral, i.e. the area, varies less than a set error boundary) or from the lower limit of the definition interval (for example minus infinity or a set lower limit below which the value of the integral, i.e. the area, varies less than a set error boundary) to the threshold value.

[0030] Of course, instead of calculating the integral as explained above, it is also possible to use the distribution function of the corresponding probability density function, since the distribution function represents the value of the integral of the probability density function from minus infinity or from the lower limit of the defined interval of the probability density function to the corresponding threshold value. Thus, the main area under the probability density function, i.e., the value of the integral or the value of the distribution function, corresponds to the (theoretical) probability that the maximum or minimum value of the characteristic of each area of ​​the image of the acceptable product is less than or equal to the corresponding threshold value. To calculate the probability that the maximum or minimum value is greater than or equal to the threshold value, it is sufficient to subtract the probability calculated in this way from 1.

[0031] For this calculation, the values ​​of the area, integral or distribution function are set, and the corresponding inverse functions must be used. Such calculations can be carried out analytically or by numerical methods.

[0032] In this known method, each area can be defined by a base threshold value, with adjacent pixels having pixel values ​​greater than (or equal to) the base threshold value forming a first group of areas, and adjacent pixels having pixel values ​​less than the base threshold value forming a second group of areas. The first and second groups of areas can also be combined into a single group. Another way to define each area is to use a predefined (geometric) mask. For example, a matrix mask can be used, which overlays a square grid (i.e., a checkerboard-like grid) on the digital image, with all pixels inside the square forming an area. Of course, the mask can also lead to other subdivisions, and the entire image does not have to be divided into areas.

[0033] Each area is assigned a property that can be represented by a value, which may in particular be a geometric property such as the area, circumference or diameter of each area (if each area is at least approximately circular), or a pixel value property that is represented by a value resulting from the pixel values ​​of the area, such as the maximum or minimum value, the average value or the variance of the pixel values ​​of a area.

[0034] Several characteristics can also be combined and represented by a combined value. For example, the mean and standard deviation can be added, and this information becomes a kind of confidence interval for the pixel value. The difference between the maximum and minimum values ​​can also be used as a combined value that represents the brightness difference of the area. Because this measure is sensitive to outliers, quantiles can be used instead, for example, the 10% and 90% quantiles as substitutes for the maximum and minimum. Furthermore, the quotient of the circumference and the area can be used to estimate how well an area is circular or how significantly it deviates from circularity. Alternatively, geometric characteristics can be combined with pixel characteristics.

[0035] This known method thus offers the possibility of setting a rate, in particular the false rejection rate (or the corresponding complementary rate, i.e. the rate at which the image is correctly recognized as error-free), and depending on this determining the threshold for the recognition of the smallest or largest anomalies.

[0036] However, in actual work, it is often desirable or necessary to know the actual detection rate, or at least its predicted value, in addition to the rejection rate. While the actual rejection rate can be relatively easily determined in actual work by human individual inspection of the products that are actually rejected, even if this involves high costs, such individual inspection is nearly impossible for the detection rate. For this purpose, it is known, for example, to inspect images of actual rejected products to determine whether anomalies contained therein are recognized with sufficient certainty or probability by a known threshold, i.e., with a sufficiently high detection rate. Summary of the Invention

[0037] Based on the above prior art, it is an object of the present invention to provide a method for detecting anomalies in digital images of products, which allows for a simple and inexpensive determination of at least one threshold for the detection rate of anomaly recognition, and also to provide an apparatus and a computer program product for implementing this method.

[0038] The present invention solves this problem by the features of claims 1 to 14 and 15. Further preferred embodiments of the invention become apparent from the dependent claims.

[0039] The present invention is premised on the discovery that by creating digital images of multiple products of the same type (or a single product of the same type in the case of products produced in series, e.g., bulk products) containing at least one known anomaly caused by a known (physical or virtual) contaminant, it is possible to obtain information about, or determine an estimate of, the expected detection rate under active operation of the inspection equipment.

[0040] "Homogenous products" here are understood to mean products that are produced in series, such as yogurt dispensed into cups or cheese packaged in bags or rigid cartons. When inspecting these types of products, it must be determined whether they contain undesirable contaminants, such as dirt, metal chips, pebbles, bone fragments, etc. The inspection device typically creates a digital image of the product, which is then examined by suitable automated evaluation for the presence of anomalies caused by the undesirable contaminants.

[0041] For this purpose, the digital image is perceived as a single area or subdivided into multiple areas, each of which consists of one or more adjacent pixels. For each such area, a value for at least one characteristic or a combined value for multiple characteristics of the area is determined. For example, an average brightness value (gray value) can be determined for the area. The presence of an anomaly is recognized if the value of the corresponding characteristic is greater than a set maximum threshold or a set minimum threshold.

[0042] As already mentioned above, the maximum or minimum threshold can be set directly or determined from a set value for the false rejection rate (or a complementary rate) based on the method described in Patent Document 1.

[0043] According to the present invention, the following steps are performed in the inspection process:

[0044] ■ generating a plurality of digital reject images of real or virtual rejected products, each having at least one known anomaly;

[0045] For each failed image, one area or multiple areas are defined, and the value of at least one characteristic or the combined value of multiple characteristics of each area is determined, and the maximum of these values ​​is determined as the maximum random sample value of the maximum random sample, or the minimum of these values ​​is determined as the minimum random sample value of the minimum random sample;

[0046] ■ The detection rate is determined for at least one known anomaly, which is

[0047] All open parameters of the probability density function that describes the maximum or minimum random sample are estimated (parameterized) using the maximum or minimum random sample value and using statistical estimation methods; and

[0048] by integrating a parameterized probability density function using set maximum or minimum thresholds as integration limits, or

[0049] ■ the detection rate is determined as the ratio of the number of values ​​in the maximum or minimum random samples that are greater than or equal to a set maximum threshold or less than or equal to a set minimum threshold to the total number of values ​​in the maximum or minimum random samples; and

[0050] ■ At least one known anomaly is assigned a detection rate.

[0051] The assignment of the detection rate determined in this manner to at least one known anomaly has the advantage that the operator of the inspection device, e.g., an X-ray inspection device, in which this method is implemented, can immediately recognize the effect that a pre-established threshold, or the false rejection rate (as a set quantity) on which this threshold is based, has on the detection rate.

[0052] In this way, the threshold or false reject rate can be selected so that the detection rate of known anomalies in images of acceptable products that are actually to be inspected by the inspection device for the presence of unknown anomalies during actual operation satisfies as much as possible both economic and reliability requirements, since both of these parameters must often be considered reciprocally. Naturally, a 0% false reject rate and a 100% detection rate are desirable, but this is rarely or never feasible in practice. From an economic point of view, the lowest possible false reject rate is desirable. This is achieved by setting the highest possible threshold for the recognition of the largest anomaly, which in turn reduces the detection rate or the probability of validly detecting the largest anomaly. If the contaminants to be detected are dangerous objects, such as metal or bone fragments in food, the detection rate must be correspondingly high, for example, 99% or higher, in order to avoid as much as possible compensation claims from end consumers who are injured while eating or drinking food contaminated with such contaminants. On the other hand, a too high rejection rate can be extremely economically disadvantageous to the product manufacturer if the cost of manually re-inspecting the incorrectly rejected test products becomes high and therefore cost-intensive.

[0053] The present invention allows the false rejection rate, on the one hand, and the detection rate, on the other hand, to be easily and quickly determined by setting only one parameter, i.e., the respective maximum or minimum threshold or false rejection rate (or a complementary rate) directly, so that it meets the requirements related to economy and / or reliability.

[0054] Naturally, in practice, this method will produce more valid results the better the known anomalies match the anomalies that actually appear, or the better the known (physical or virtual) contaminants match the contaminants that actually appear.

[0055] In an embodiment of the present invention, the maximum and minimum thresholds are determined in a learning process, which involves performing the following steps:

[0056] multiple digital images of a passing product that does not contain anomalies, or a passing process product that is largely free of anomalies, are generated or utilized, the number of images being set or determined during the learning process;

[0057] - for each digital image, one area or several areas are defined, the value of at least one characteristic or the combined value of several characteristics of each area is determined, and the maximum of these values ​​is determined as the maximum random sample value of the maximum random sample and / or the minimum of these values ​​is determined as the minimum random sample value of the minimum random sample,

[0058] Using statistical estimation methods, estimates are determined for all open parameters for which a probability density function is not set to represent the maximum random sample value, using the maximum random sample value, and / or estimates are determined for all open parameters for which a probability density function is not set to represent the minimum random sample value, using the minimum random sample value;

[0059] a first rate at which the largest anomaly is erroneously detected in the image to be inspected or a second rate at which the largest anomaly is not correctly recognized in the image to be inspected is set, and / or a third rate at which the smallest anomaly is erroneously detected in the image to be inspected or a fourth rate at which the smallest anomaly is not correctly recognized in the image to be inspected is set;

[0060] the maximum threshold is determined using a parameterized probability density function or a corresponding distribution function, whereby the probability of the occurrence of a maximum value greater than or equal to the maximum threshold corresponds to a set first rate, or the probability of the occurrence of a maximum value less than or equal to the maximum threshold corresponds to a set second rate, and / or

[0061] The minimum threshold is determined using a parameterized probability density function or a corresponding distribution function, such that the probability of the occurrence of a minimum value less than or equal to the minimum threshold corresponds to a set third rate, or the probability of the occurrence of a minimum value greater than or equal to the minimum threshold corresponds to a set fourth rate.

[0062] This is essentially the method described in Patent Document 1, where a false rejection rate or a rate complementary thereto is set. The advantage of this method compared to the direct setting of a threshold can naturally be seen in the fact that here one of the quantities that is important in practice, namely the false rejection rate, is set, and not an arbitrary threshold whose influence on both the false rejection rate and the detection rate is not easily predicted.

[0063] In an embodiment of the present invention, the characteristics of the area may be geometrical characteristics determined from the positional information of the pixels of the area, in particular the area, circumference or diameter, or pixel value characteristics determined from the values ​​of the pixels of the area, in particular the maximum or minimum value, mean value, variance or standard deviation of all pixels of the area.

[0064] In actual operation, the quantity used as the characteristic of the area is the quantity that, when used during actual operation of the inspection device or during actual application of the method of the present invention, will most reliably detect the (unknown) impurity to be detected or the (unknown) abnormality caused by it.

[0065] If the maximum or minimum threshold is not set directly but is determined from a set mis-rejection rate, the required probability distribution to be set for this purpose can be selected or used from the generalized extreme value distribution, in particular its special cases, the Gumbel distribution, the Weibull distribution, or the Fréchet distribution, since the generalized extreme value distribution is particularly suitable for representing the probability distribution of extreme values ​​that actually occur.

[0066] In an embodiment of the present invention, the digital fail image required for the inspection process is generated such that there is at least one predetermined anomaly at a predetermined location within the fail image, and this information, and optionally also the geometry of the contaminant causing the at least one predetermined anomaly, can then be used to determine a maximum or minimum random sample value representing the predetermined anomaly.

[0067] For example, the impurity generating the at least one specified anomaly can be positioned on or in the acceptable product to be inspected so that it is located—in an image plane perpendicular to the transmission illumination direction—in the upper right quarter of the corresponding digital image (this acceptable product becomes a rejected product after the impurity is applied to the surface or interior). In this way, the detection of the respective maximum or minimum random sample value can be limited, for example, to this upper right quarter. This reduces the probability of determining random sample values ​​in areas outside the specified anomaly in the digital image that are greater or smaller than the maximum or minimum random sample value actually caused by the anomaly or the corresponding impurity.

[0068] The area or the image portion actually used for the image evaluation can also be determined using a base threshold value. For example, all areas of the image with pixel values ​​greater than or equal to a set base threshold value can be determined. It can then be checked whether there is a sufficiently large overlap between the determined area and the known geometrical dimensions of the relevant impurity (or its geometrical dimensions in projection onto the image plane). For example, it can be checked whether the impurity is located within the determined area with its entire projection surface or with a percentage that exceeds a predetermined overlap threshold.

[0069] As already mentioned above, embodiments of the present invention may utilize a pass product that does not contain anomalies to generate a reject image, and at least one contaminant may be provided on or within the pass product, thereby resulting in a reject product having at least one known contaminant from the pass product. Additionally, the at least one contaminant may be provided on or within a support attached to or disposed within the product.

[0070] In another embodiment of the invention, digital image data of a pass product can be used to generate a fail image, and the pass product's digital image data is digitally converted to account for at least one specified impurity using known material and geometric characteristics of the impurity. In other words, the known anomaly is "accounted in" or "faded in" into the pass product's digital image. This embodiment is particularly suitable when the impurity consists of a single material and has a simple geometric structure, such as a sphere, a rectangular parallelepiped, or a cube. The "accounting in" can be performed in an inspection device that transmits light through the product to be inspected, using the known material-dependent intrinsic attenuation of the radiation used for inspection to determine an additional attenuation that is taken into account in addition to the attenuation represented by the pass image data. This can be done by simple addition when a logarithmic scale for attenuation is used.

[0071] The support for at least one impurity may be in the form of a plate or a card. A plurality of impurities having the same material properties, in particular made of a single material, and having the same geometry, but each having different sizes, may be arranged in or on the support. In this way, a reject image with a plurality of known anomalies can be generated. The evaluation can then be carried out in such a way that only one determined area (as described above) or a specific portion of the reject image is used to determine the corresponding maximum or minimum threshold value.

[0072] In embodiments of the present invention, the detection rate may be output to a display device as a numerical value or as a quantity or identifier associated therewith.

[0073] The detection rate can then be assigned to the graphic representation of at least one contaminant and / or assigned to the corresponding failed image and displayed. For example, if known anomalies caused by spheres of different sizes made of the same material are utilized (whether these anomalies are generated by physical contaminants or by "counting"), the corresponding value of the detection rate can be displayed for each representation of the sphere labeled with the appropriate material. As an alternative or in addition to displaying the contaminant, a passing image or the portion of the image containing the anomaly can also be displayed.

[0074] In another embodiment of the invention, the maximum or minimum threshold for recognition of the maximum or minimum anomaly or the false rejection rate (or the complementary rate) may be modifiable by input means, for example a keyboard, or by adjustment means, for example a slider or rotary knob (embodied physically or digitally). Furthermore, the latest value of the detection rate can be displayed on the display device for each latest value of the maximum or minimum threshold, or of the rate, as applicable.

[0075] This approach allows the operator to develop a sense of how and with what certainty a known contaminant or known anomaly is recognized.

[0076] Instead of displaying the detection rate as a number, it is also possible to use, for example, a color code, which is then evaluated by a classifier: for example, red can be selected for a detection rate that is too low (e.g., below 50%, depending on the respective situation), yellow for a detection rate that is still acceptable (e.g., between 50% and 90%), and green for a high detection rate that ensures sufficiently reliable detection of anomalies (e.g., >90%).

[0077] A data processing device suitable for the apparatus according to the invention can have a processor with appropriate input / output interfaces in the usual way. The processor can be configured as a dedicated processor for industrial image processing, for example. Of course, the processor can also be embodied as a combination of a conventional processor and a dedicated image processor. The entire data processing device can be embodied as an independent CPU unit with corresponding interfaces or as a slot CPU.

[0078] It should be pointed out here that all the features of the method or device according to the above-described patent application WO 02 / 04494 can also be applied in the context of the present invention.

[0079] The invention will now be described in more detail with reference to an embodiment shown in the drawings, in which: [Brief explanation of the drawings]

[0080] [Figure 1] 1 is a schematic diagram of an X-ray examination apparatus comprising a device for carrying out the method according to the invention; [Figure 2] 1 is a graph showing the empirical frequency distribution of a random sample of maximum values ​​of a property in a predetermined area of ​​a digital image of a pass product, as well as a probability density function fitted thereto. [Figure 3] 10A and 10B are graphs showing probability density functions for minimum and maximum values ​​of a characteristic, respectively, determined using digital images of a passing product (or a passing process product). [Figure 4] 1 is a graph showing a probability density function (curve (a)) for the maximum value of a characteristic determined using digital images of a passing product (or passing process product), and a second probability density function (curve (b)) for the maximum value of the characteristic determined using digital images of failing products each having a known anomaly. [Figure 5]Graphs similar to FIG. 4, but curves (a) and (b) have larger spacing on the horizontal axis, allowing for a higher detection rate with a simultaneously lower false reject rate. [Figure 6] This is a diagram showing the display on the display device, which displays six identical impurities of different sizes for three different materials, and assigns a detection rate value to each impurity. [Figure 7] FIG. 7 shows a display similar to that of FIG. 6, in which each contaminant is assigned a smiley face symbol representing its detection rate. [Figure 8] FIG. 7 shows a display similar to that of FIG. 6, in which only the contaminant sizes that are detectable with a detection rate of greater than 95% are displayed for three different materials, respectively. [Figure 9] 7 shows a display similar to that of FIG. 6, with an additional adjustment for the false rejection rate in the form of a digital slider. DETAILED DESCRIPTION OF THE INVENTION

[0081] 1 shows a schematic representation of an X-ray inspection apparatus 100 having a device 102 for detecting anomalies in a digital image, configured for carrying out the method described below. X-ray inspection apparatus 100 is only one possible example of how digital images that may contain anomalies can arise. The method according to the invention can be applied to any digital image that is to be inspected for the presence of anomalies.

[0082] As already explained above, the digital image typically represents a product having an anomaly to be detected. In the case of the X-ray inspection apparatus shown in Figure 1, a product 104 in the form of an individual item is inspected by way of example. However, it is equally possible to generate digital images of any other product, such as, for example, a bulk product. In such cases, it is preferred that digital images each represent an area of ​​the bulk product.

[0083] In the X-ray inspection apparatus 100 shown in Figure 1, a product 104 to be inspected is transported by a transport device 106 along a set transport path (indicated by arrow F). Here, the transport device 106 comprises a number of conveyor belts 108, 110, 112, and 114. The conveyor belt 108 serves to transport the product 104 in, and the conveyor belt 114 serves to transport the product out. The inspection apparatus 100 comprises a shielded housing 116 in which the conveyor belts 110 and 112 are arranged, as well as an X-ray radiation source 118 and an X-ray radiation detector 120. The X-ray radiation source 118 generates an X-ray beam 121 that has a fan-shaped shape perpendicular to the plane of the paper and a small width in the transport direction. The X-ray beam 121 passes through the gap or free space between the opposing end faces of the conveyor belts 110 and 112 before impinging on an X-ray radiation detector 120, which is positioned below the conveyor belts 110, 112 in the embodiment of the X-ray inspection apparatus 100 shown in FIG. 1. The X-ray radiation detector 120 has a width, perpendicular to the plane of the paper, that corresponds to the maximum width of the products to be inspected. Typically, the width of the X-ray radiation detector is selected to be approximately the same as the width of the conveyor belts 110, 112. The X-ray radiation detector 120 may be configured as a line detector having one or more detector lines, perpendicular to the plane of the paper, each detector line having a set number of pixels.

[0084] The device 102 for detecting anomalies comprises an image processing unit 122 to which the signals of the X-ray radiation detector 120 are supplied. The image processing unit 122 may be configured as a conventional computer unit having one or more processors, a working memory, possibly a hard disk memory or an SSD memory, and suitable interfaces for the supply of the signals of the X-ray radiation detector 120 and for the supply or reception and transmission of other data. Furthermore, the device 102 comprises a display unit 124 capable of displaying information generated by or supplied to the image processing unit 122.

[0085] As shown diagrammatically in FIG. 1 , the product 104 to be inspected moves through a fan-shaped X-ray beam 121, whereby the X-ray radiation detector 120, configured as a line detector, generates a corresponding digital image signal, which is supplied to an image processing unit 122. The image processing unit 122 can be configured so that, in the case of individual items, a digital image is first generated from the image signal, which includes the entire product 104 or at least one selected portion. This portion can be selected by conventional image processing or pattern recognition techniques. From the digital image thus generated, the image processing unit 122 can also subject the final digital image to be inspected for the presence of anomalies in the manner described below to further image processing, such as digital filtering, which is selected so that the anomalies to be detected are more recognizable, in particular so that they stand out more clearly relative to the rest of the image. This type of image preprocessing can also include any other image processing steps, such as noise suppression. At the end of this type of image preprocessing (which is not necessarily required), a digital image is generated that is then to be inspected for the presence of anomalies.

[0086] As explained at the beginning, it is known to use thresholds for pixel values ​​to detect anomalies. In this case, the presence of an anomaly is detected if the value of a pixel or a group of adjacent pixels containing a set minimum number of pixels exceeds the threshold. If one or more anomalies are detected in a digital image, this information can be used to take action regarding the corresponding products, for example, to remove them from the product stream. Alternatively or additionally, the products can be marked physically or virtually, i.e., by assigning them appropriate data.

[0087] The display unit 124 can be used to display desired information, such as the digital image to be inspected and any anomalies detected therein, the applied threshold value in each case, the type of probability density function selected, the corresponding parameters, the quality of the fitting of the probability density function to the random sample, the confidence interval for the threshold value, the parameters or rates (in particular the false rejection rate). The output can, of course, be in the form of data (numerical values) and / or graphics. When the detection is performed in the normal operating mode of the device, a graph showing the evolution of the latest rejection rate over time during the (normal) operating operation of the device 102 (or during the learning process) can also be displayed, as can a set rate (e.g., the false rejection rate) and a confidence interval for the set rate. Furthermore, a list containing random sample values ​​and / or a graphic similar to that shown in FIG. 2 can also be displayed. Furthermore, displays such as those shown in FIGS. 6 to 9 can also be displayed, i.e., information on the set detection rate of anomalies generated by physical or virtual impurities. The corresponding data can, of course, be output to a higher-level unit and / or saved.

[0088] The image processing unit 122 can be supplied with one or more start thresholds that have already been determined for the product type to be subsequently inspected by the method described below, or it can be supplied with other information that is necessary for the implementation of the method described below, such as information regarding the type of probability density function that is set and information regarding how each area is defined in the digital image to be inspected (see below).

[0089] As explained above, the methods described below for detecting anomalies in a digital image are not limited to checking whether one or more pixel values ​​are above a set maximum threshold or below a set minimum threshold. Rather, the methods described below can be generalized to determine maximum and / or minimum threshold values ​​for any characteristic of each predefined area in the digital image to be inspected in order to define or determine the maximum or minimum threshold.

[0090] To this end, areas must first be defined in the digital image to be examined, to which values ​​of the specified characteristics can be assigned. The areas can be defined, for example, by using a base threshold value, where all pixel values ​​equal to or exceeding the threshold value form a first group of areas, and the remaining pixel values ​​form a second group of areas. Depending on the characteristic to be examined, it may be sufficient to further process only the first or second group in each case. This is the case, for example, when only the maximum or minimum pixel value or the average pixel value of the area is evaluated as a characteristic of the area to detect anomalies.

[0091] However, it is also possible to assign one or more characteristics to each area that are not only represented by individual pixel values. For example, a geometric characteristic can be assigned to a area, such as area, circumference, diameter (at least in the case of approximately circular areas), or deviation from a circular shape. In such cases, an anomaly is recognized if the value of the corresponding characteristic exceeds a set maximum threshold or falls below a set minimum threshold. In such general cases, the required maximum or minimum threshold can be determined using the method described below.

[0092] Another option for determining the area in the digital image to be examined is to use a set geometric mask that is superimposed on the image, which can be, for example, a mask of set dimensions consisting of adjacent squares of the same size.

[0093] Again, each of the areas thus defined can be assigned one or more properties, such as the variance or standard deviation of the pixel values ​​contained within the area, a corresponding mean value, or the maximum or minimum values ​​contained therein.

[0094] It is also possible to determine a combined value for each area, determined from two or more values ​​for different characteristics. For example, values ​​for the variance and standard deviation of the pixel values ​​and the mean value can be combined, especially by arithmetic operations, for example by (weighted) addition, to form a combined value, which in this special case represents a kind of confidence interval, if the pixel values ​​of the area are to some extent normally distributed. Another example of a combined value or a combination of characteristics for each area is the difference between the maximum and minimum pixel values ​​contained therein. In order to be more robust against outliers, quantiles, for example the 10% and 90% quantiles, can also be used as an alternative to the maximum and minimum values.

[0095] In the following, it will be explained how the corresponding maximum or minimum threshold value can be determined with a smaller number of digital images. As mentioned above, such a learning process can be carried out using acceptable products or acceptable process products. The learning process can be carried out, for example, at the start-up of a facility for manufacturing or processing products, which includes such an inspection device. In this case, it is generally necessary to determine the threshold value for each product type.

[0096] Of course, threshold values ​​for a particular product type can be saved, so that the learning process does not have to be run anew each time unless a change in the type of product being inspected has occurred.

[0097] Furthermore, it is possible to carry out the learning process during ongoing equipment operation, at least if it can be assumed that this equipment will produce acceptable process products, i.e. products that are predominantly acceptable (without anomalies), since in such cases, as explained above, any unacceptable products among the acceptable process products will be excluded as outliers when creating the required random samples.

[0098] The key feature of the method for determining the threshold described below is that it determines the rate at which the maximum anomaly is incorrectly detected in the image to be inspected (hereinafter also referred to as the false positive rate or false reject rate) or the rate at which the maximum anomaly is not correctly recognized in the image to be inspected (hereinafter also referred to as the true negative rate) when acceptable products (containing unknown anomaly information) are used. This eliminates the need to determine the threshold in a first step and then check in a second step whether the use of the threshold results in an acceptable rate. However, for the determination of the detection rate described below for known anomalies, it is also possible, in principle, to directly specify the false reject rate (false positive rate) or its complementary true negative rate. However, in this case, a significantly larger number of digital images of acceptable products would be required to select a threshold that achieves the desired false reject rate.

[0099] The required number of digital images, i.e., the number of acceptable products or acceptable process products, can be predetermined, but must be selected large enough so that the threshold can be determined with the desired degree of confidence. However, it is also possible to determine the required number of digital images during the training process (whether the images are generated during the training process or are already available before the training process begins). In this case, it is preferable to start with a minimum number of digital images and increase this minimum number stepwise by one or more digital images each time until the determined threshold is sufficiently reliable, i.e., until the set rate is sufficiently reliably adhered to. This can be checked by determining a confidence interval.

[0100] In the next step, as in the detection of anomalies in normal operating mode (i.e., outside the learning process), areas are defined for each digital image, and for each area, the value of at least one characteristic is determined, which is assigned to that area. The maximum and / or minimum values ​​of each characteristic or of the corresponding characteristics are then determined for each digital image, or the combined values ​​of the characteristics are determined, and assigned to the corresponding random sample. This can be done, for example, by storing all minimum values ​​in a minimum list and all maximum values ​​in a maximum list. It should be noted here that both options of the method do not necessarily have to be applied at the same time. When maximum anomalies are detected during normal operating mode, i.e., when anomalies that are recognized as anomalies when the maximum threshold is exceeded, only the maximum threshold needs to be determined. The same applies to cases where only minimum anomalies are to be detected.

[0101] Once a sufficient number of random sample elements (maximum or minimum values ​​for at least one characteristic or combination of characteristics) has been determined, the next step is to parameterize the probability density function for the respective maximum or minimum value list using statistical estimation methods, which corresponds to fitting the probability density function to the empirical frequency distribution of the corresponding random sample.

[0102] For this purpose, the random sample can be binned, i.e., the random sample elements are assigned to adjacent intervals of equal width in the corresponding value range. A corresponding set probability density function can then be fitted to this empirical (relative) frequency distribution, for example by using the least squares method. However, more suitable statistical estimation functions can usually be used for this purpose, such as the maximum likelihood method or the method of moments.

[0103] The probability density function that must be set for the implementation of this method should be of a type that is assumed to be able to adequately represent the random samples when parameterized. In this example case, extreme values ​​for the relevant characteristic are selected to form the respective random samples, so a type of generalized extreme value distribution or a generalized extreme value distribution (including its three parameters) that brings together the Gumbel, Weibull, and Frechet distributions is often selected. The frequently used Gumbel distribution has the following form:

number

[0104] where f represents the value of the probability density as a function of the random quantity x. Each value of the random quantity x represents, in this case, the value or combination of values ​​of the corresponding characteristic. The parameters μ and β are determined by the selected statistical method.

[0105] Figure 2 shows a graph that schematically illustrates the fitting of a probability density function f(x) to the relative empirical frequency distribution of maximum pixel values, where x represents the pixel value. The horizontal axis plots pixel values, and the vertical axis plots probability density values ​​or relative frequencies.

[0106] The parameterized probability density function can then be used to determine the desired threshold value (for the rate at which the largest anomaly is erroneously detected in the image to be examined or the rate at which the largest anomaly is not correctly recognized in the image to be examined) in a further step. To this end, the threshold value is defined such that the area under the parameterized probability density function above the threshold value is equal to the set rate at which the largest anomaly is erroneously detected in the image to be examined, or the area under the parameterized probability density function below the threshold value is equal to the set rate at which the largest anomaly is not correctly recognized in the image to be examined. This area corresponds to the probability that a maximum value of the corresponding characteristic greater than or equal to the threshold value occurs in the digital image. The threshold value can be determined by converting the formula from the inverse of the distribution function belonging to the parameterized probability density function, if a closed-form solution exists for the inverse function. Otherwise, the threshold value can be calculated using any known numerical method.

[0107] Figure 2 shows the X values ​​corresponding to false rejection rates (false positive rates) of 1.0%, 0.6%, and 0.1%. so,1 ,X so,2 and X so,3 is shown, i.e., the area under the probability density function to the right of these thresholds yields thresholds of 0.01, 0.006, and 0.001.

[0108] When a true negative rate is set instead of a desired false positive rate, the upper threshold X so The area under the probability density function below should be utilized for the calculation of the maximum threshold in a similar manner.

[0109] In Figure 3, a graph similar to Figure 2 is shown, but only the evolution of the already fitted probability density function is shown. In this example, the maximum threshold X so and the minimum threshold X su are both determined with reference to a parameterized probability density function. Then, in both cases, i.e., for determining the maximum threshold and for determining the minimum threshold, the same false positive rate R fp is set, and the minimum threshold X su The false positive rate R fp is the minimum threshold X su It is equal to the area under the probability density function below the true negative rate R rn is the minimum threshold X su The minimum anomaly is detected when the value of the characteristic or combination of characteristics is above a minimum threshold X. su This is because it is smaller than

[0110] In the case of the parameterized probability density function shown in FIG. 3, a digital image is detected as containing an anomaly if, for at least one zone, a value of the property of interest, or a combination of values ​​of the properties in question, occurs that is outside the pass region between the minimum and maximum thresholds (or in other words, if the value in question is greater than or equal to the minimum threshold X su is less than or equal to the maximum threshold X so is greater than or equal to.

[0111] Furthermore, Figure 3 shows the maximum threshold X so The confidence intervals for are plotted, where for simplicity we use the limit X so -ΔX so and X so +ΔX so In order to reduce the false rejection rate to a desired set value with a higher degree of certainty, when an anomaly is detected, the determined threshold X so From ΔX soIn a similar manner, a secondary maximum threshold value larger by X can be used. su Therefore, the lower threshold X su The width of the confidence interval for ΔX su In other words, the secondary maximum threshold corresponds to the upper limit of the confidence interval for the maximum threshold, and the secondary minimum threshold corresponds to the lower limit of the confidence interval for the minimum threshold.

[0112] As explained above, the number of digital images for determining one or more thresholds (maximum or minimum threshold) may be fixed, but this number must be selected to be large enough to determine a sufficiently reliable threshold.

[0113] The method is suitable for detecting anomalies in images of a product, which may be generated in any manner and which represent any characteristic of the product. In particular, the method is suitable for analyzing images obtained by an inspection device, which images are generated using X-ray or terahertz radiation and thus can generate information about the product's interior. The method can be implemented in the inspection device, in particular through software. The results of the detection method can be used to control other devices, such as sorting devices.

[0114] Once the desired maximum or minimum threshold value has been determined in the manner described above, another method, described below, is followed, which is performed in a separate inspection process, which may be performed, in particular, prior to the start of production operation of a facility that includes X-ray inspection apparatus 100 (or any configured inspection apparatus).

[0115] It should be noted again explicitly that determining one or more desired threshold values ​​in the manner described above is not a necessary prerequisite for carrying out the inspection process described below, but rather the desired threshold values ​​can be set directly, for example by an operator or by retrieving the threshold values ​​from a memory device in which desired maximum and / or minimum threshold values ​​assigned to a product type are stored.

[0116] The inspection process includes the following steps:

[0117] First, a plurality of digital reject images, each having at least one known anomaly, are generated. The digital reject images can be generated using one or more physical rejected products, each containing one or more known contaminants, which generate corresponding known anomalies in the corresponding digital image of the rejected product (the reject image). These types of rejected products are created from accepted products, and one or more known contaminants are inserted into each of them, preferably at specific positions in the accepted products. In the reject images generated from the rejected products, the maximum and minimum extreme values ​​caused by the known anomalies, which are used as the maximum and minimum random sample values ​​for determining the detection rate using the method described below, can be found only in appropriately defined areas of the digital image containing the known anomaly or where the contaminant is located (regardless of whether the contaminant generates a detectable anomaly in the digital reject image).

[0118] The definition of the area to be considered in the digital image can be done in various ways: for example, the geometric shape of the area (square, circle, etc.) can be defined, and then the size can be selected so that the contamination or the anomaly caused by it is completely inside the area.

[0119] Alternatively, a base threshold value can be used (as already described above) to determine all areas of the rejected image where the pixel value for determining the maximum anomaly is greater than (or greater than or equal to) the corresponding base threshold value or the pixel value for determining the minimum anomaly is less than (or less than or equal to) this base threshold value. Among these areas, areas containing a contaminant or a known anomaly caused by the contaminant can be used. Using information about the location within the rejected product or within the corresponding rejected image and information about the geometry of the contaminant, it can be additionally checked whether the contaminant or known anomaly is sufficiently contained within the determined area. Compliance with this requirement can be confirmed if the geometric areas of the contaminant in the rejected image or the respective faces of the known anomaly caused by the contaminant sufficiently overlap, for example, with an overlap degree of more than 50% or more than 80%. Here, the overlap degree can be the ratio between the area of ​​the contaminant or the known anomaly caused by the contaminant in the digital rejected image and the area of ​​the previously determined corresponding area.

[0120] However, the generation of the rejection images can also be performed using at least one previously generated pass image, i.e., at least one digital image of a pass product, preferably of the same type as the product to be inspected in the production area of ​​the respective inspection device 100. In practice, it is preferable to use multiple pass images instead of a single pass image in order to take into account information about the statistical distribution of the characteristics of the pass images. Such pass images can already be generated during the learning process described above (where the threshold is determined under the setting of the false rejection rate) and used to create the "artificial" rejection images. Of course, one or more pass images can be stored in a storage device for this purpose.

[0121] To generate such an "artificial" reject image, a virtual impurity can first be defined, and its predetermined material and geometry are specified. Simple geometries, such as spheres, cubes, or rectangular parallelepipeds, can be used as the geometry. The material of the impurity can be taken into account by taking into account the intrinsic attenuation of the material, especially in the case of inspection methods involving transillumination of the relevant product. For X-ray inspection, data banks or tables containing the intrinsic attenuation of numerous materials are available for this purpose. Intrinsic attenuation here is understood to mean the attenuation experienced per length unit (viewed in the transillumination direction) when the relevant radiation is transilluminated through the material. In this way, such additional attenuation can be easily incorporated at the relevant location into the existing image data of the pass image used to generate the "artificial" reject image. If the image data of the pass image is on a logarithmic scale, the inclusion of the additional attenuation, also present on the logarithmic scale, can be achieved by addition.

[0122] Regardless of whether physical or virtual contaminants are used to generate the digital rejection image, the location of the contaminant relative to the direction of transmitted illumination of the product to be inspected (or generally relative to the direction of observation of the product), with the exception of the spherical case, must also be specified. To account for the additional attenuation generated by each contaminant, the contaminant (more precisely, its projection in a plane perpendicular to the direction of transmitted illumination) is divided into pixels (preferably the pixel division corresponds to the existing pixel division of the pass image). In this way, the additional attenuation can be accounted for for each individual pixel (i.e., pixel by pixel). The "artificial" rejection images generated in this way can then be processed in the same way as rejection images generated by physical contaminants.

[0123] As already alluded to above, for a sufficient number of failed images thus generated, the corresponding maximum or minimum random sample value for each of the set anomalies contained in the failed images (depending on whether it is the maximum or minimum anomaly) is determined, in a manner similar to that described above for determining the maximum or minimum threshold value.

[0124] The detection rate can then be determined from the maximum and minimum random samples thus generated. To this end, in a first embodiment, a probability density function can be established, which has at least one undetermined parameter that is not set. This parameter can then be determined in a suitable manner, in particular using statistical estimation methods, so that the parameterized probability density function best describes each random sample. This parameterization can be performed in a manner similar to that described above in connection with determining the maximum and minimum thresholds.

[0125] Figure 4 shows a graph with two curves representing probability density functions parameterized as described above using the generalized extreme value function. Curve (a) shows the parameterized probability density function selected to determine the maximum threshold using the accepted product (or accepted process product) in the manner described above. From this curve, the false reject rate or false positive rate R fp Under the setting of the value of, the corresponding threshold X so is determined.

[0126] The threshold value X thus determined is so Using this, an estimate of the detection rate that would be obtained from the second curve (b) when the inspection system 100 is run in production and inspecting the same type of product can be determined. As noted above, this estimate will be more valid the closer the contaminants that appear in production match the known contaminants that were used to determine the corresponding maximum and minimum random samples.

[0127] Curve (b) of Figure 4 shows the probability density function of the maximum random sample of known anomalies, selected and parameterized in the manner described above. From this probability density function, the probability of detection of the corresponding known anomaly that will appear when inspecting a product of the same type can be determined. To do this, the probability density function is adjusted to a predetermined maximum threshold X so One need only integrate from 0 to infinity (or up to a very large value, e.g., up to the maximum possible pixel value provided by the radiation detector). This integral corresponds to the true positive rate, or detection rate, for detecting the known anomaly in question.

[0128] The detection rate thus known can be evaluated manually or automatically as to whether the corresponding value is acceptable for practical use, especially taking into account the consequences of non-detection of contaminants. For example, if food products such as yogurt, cheese, chocolate, or cookies are inspected and undetected metal or bone fragments are found in them, this could result in life-threatening injuries to the end consumer who consumes the contaminated food. In such cases, the detection rate must meet correspondingly strict settings, for example, higher than 99%. In other cases, where non-detection has less serious consequences, the detection rate can be adjusted to significantly lower values ​​of 80% or 90%.

[0129] Because the detection rate and the false reject rate or the set maximum or minimum threshold are interdependent, in many cases it is not possible to simultaneously achieve a desired low false reject rate and an equally desired high detection rate. Such a case is shown in Figure 4. As is clear from this graph, a high maximum threshold X so or a low false rejection rate R fp inevitably leads to a dramatically reduced detection rate R rp leads to.

[0130] In contrast, Figure 5 shows another case where the largest known anomaly is clearly better revealed in the failed image. Here, curve (b) is clearly shifted to the right, i.e., towards larger pixel values, compared to curve (b) in Figure 4. Accordingly, the same maximum threshold X so or the same error discard rate R fp In the case shown in Figure 5, the detection rate R rp leads to.

[0131] Both cases shown in Figures 4 and 5 can occur for known anomalies caused by contaminants of the same size but made of different materials, for example, as well as when the contaminants are made of the same material, but the contaminant in the case of Figure 4 is significantly smaller than the contaminant in the case of Figure 5.

[0132] Instead of using a probability density function to describe the maximum or minimum random sample to determine the detection rate, the random sample values ​​themselves can also be used. In this case, the detection rate can be determined by determining the number of random sample values ​​that are greater than or equal to a predetermined threshold. The detection rate is then calculated by dividing the number of random sample values ​​thus determined by the total number of random sample values.

[0133] In such a case, it is not necessary to determine the corresponding threshold from a preset false discard rate, but rather it is equally possible to set the threshold directly.

[0134] FIG. 6 shows a display on display unit 124 of X-ray inspection apparatus 100 showing the results of the inspection process carried out as described above.

[0135] As can be seen from this figure, the detection rates for spherical impurities with different diameters, i.e., 0.5 mm, 1.0 mm, 1.5 mm, 2.0 mm, 2.5 mm, and 3.0 mm, have been determined for three different materials: aluminum, ceramic, and glass. A numerical value for the detection rate is assigned to the corresponding schematic representation of each impurity. This representation provides the operator with a direct estimate of the detection rate for various materials and sizes of impurities. As can be seen from Figure 6, for example, a spherical aluminum impurity with a diameter of 0.5 mm is still detected with a detection rate of 13%, while correspondingly sized impurities made of ceramic or glass are no longer detected. Aluminum or ceramic impurities with diameters of 2.5 to 3.0 mm are still detected with a detection rate of 100%, while corresponding glass impurities can only be detected with a detection rate of 76% to 93%.

[0136] Figure 7 shows another embodiment of a display that is generally consistent with the diagram of Figure 6. However, instead of numerical values ​​for the detection rate, classifiers are used, with detection rates below 80% being classified as poor, detection rates between 80% and 90% (including the borderline values) still being acceptable, and detection rates >90% being good. The three different classifier values ​​are represented by smiley faces. Similarly, color codes could be used, e.g., green for "good" and yellow for "acceptable" and red for "poor." Such classifiers allow the operator to more quickly interpret the display or results of the inspection process.

[0137] 8 shows yet another embodiment of the display unit 124, in which the sizes of spherical impurities made of different materials are displayed, making the detection rate of these with good classification even clearer. In the illustrated case, a good detection probability is still obtained for spherical impurities made of aluminum when the sphere diameter is greater than or equal to 2.5 mm, for ceramics when it is greater than or equal to 2.0 mm, and for glass when it is greater than or equal to 3.0 mm, again assuming a gradation of the sizes of impurities made of the same material in steps of 0.5 mm during the inspection process.

[0138] 9 shows yet another embodiment of a display on the display unit 124, which corresponds substantially to the display shown in FIG. 6. Here, the threshold value X so The adjustment means is configured as a slider 124a in the illustrated embodiment, which can be realized in a simple manner by utilizing a touch display for the display unit 124.

[0139] In the initial state, the slide member 124b of the slider 124a is in the initial position, where the initial threshold X so,0 is preset. In this initial state, the detection rate can be determined and displayed for each size and material of the impurity. If the operator determines that the detection rate is too low for a particular size and / or material, the operator can slide the slider toward a higher threshold value. In this case, a new detection rate can be calculated and displayed immediately after changing the position of the sliding member 124b. In this way, the operator can easily and quickly change the threshold value so that the detection rate is optimized for each case.

[0140] Of course, instead of the threshold value, the false rejection rate can also be adjusted or changed by an adjustment means, in which case the operator has direct information about the possibly strong dependency between the false rejection rate and the detection rate and can adjust the false rejection rate, for example, so that a (still) satisfactory detection rate is obtained. [Explanation of symbols]

[0141] 100 X-ray inspection equipment 102 Abnormality detection device 104 products 106 Transport Device 108 Conveyor Belt 110 Conveyor Belt 112 Conveyor Belt 114 Conveyor Belt 116 Shielded Housing 118 X-ray radiation source 120 X-ray radiation detector 121 X-ray beam 122 Image Processing Unit 124 display unit 124a slider 124b Slide member F Conveying direction X su Lower threshold (determining threshold using a qualified product or qualified process product) Y su Lower threshold (determining threshold using rejected product or rejected process product) X so Upper threshold (determining the threshold using a qualified product or qualified process product) Y so Upper threshold (determining threshold using rejected product or rejected process product) ΔX so The width of the confidence interval for the maximum threshold ΔX su Width of the confidence interval for the minimum threshold R fp false positive rate R rn true negative rate R rpTrue positive rate R fn False negative rate

Claims

1. 1. A method of detecting anomalies in digital images of a product, each said digital image being formed by a number of pixels represented by image data, each pixel representing an assigned location of said digital image and having a value characterizing said assigned location; (a) each said digital image to be inspected is perceived as a single area or is subdivided into two or more areas, each of said areas being comprised of one or more adjacent pixels; (b) for each said area, a value representative of at least one characteristic of said area or a combined value representative of each of a plurality of characteristics of said area is determined; (c) one of the areas is detected as most abnormal when the value for the at least one characteristic or the combined value for the plurality of characteristics is greater than a set maximum threshold, or one of the areas is detected as least abnormal when the value for the at least one characteristic or the combined value for the plurality of characteristics is less than a set minimum threshold; In the method, (d) the inspection process performs the following steps: (i) generating a plurality of digital reject images of rejected physical or virtual products, each having at least one known anomaly; (ii) for each of the digital reject images, a zone or zones are defined, and for each of the zones, a value representative of the at least one characteristic or a combined value representative of each of a plurality of characteristics of the zone is determined, and the maximum value of the value for the at least one characteristic or the combined values ​​of the plurality of characteristics is determined as the maximum random sample value of the maximum random sample, or the minimum value of the value for the at least one characteristic or the combined values ​​of the plurality of characteristics is determined as the minimum random sample value of the minimum random sample; (iii) determining a detection rate for the at least one known anomaly, (1) for all undetermined parameters of the probability density function to be set to describe the maximum or minimum random sample, using the maximum or minimum random sample value and using a statistical estimation method, estimates of the parameters are determined, thereby parameterizing the probability density function; and (2) the parameterized probability density function is integrated using the set maximum or minimum threshold as an integration limit, or (iv) determining a detection rate for the at least one known anomaly as the ratio of the number of values ​​in the maximum or minimum random samples that are greater than or equal to the established maximum threshold or less than or equal to the established minimum threshold to the total number of values ​​in the maximum or minimum random samples; and (v) assigning the detection rate to the at least one known anomaly.

2. The maximum threshold and / or the minimum threshold are determined by a learning process, in which the following steps are performed: (a) generating or utilizing a plurality of digital images of acceptable products that do not contain anomalies, or of acceptable process products that are a majority of the total number of acceptable products that do not contain anomalies, the number of digital images being set or determined during the learning process; (b) defining an area or areas for each of said digital images, determining for each of said areas a value representative of at least one characteristic of said area or a combined value representative of each of a plurality of characteristics of said area, and determining the maximum value of said at least one characteristic or the combined values ​​of said plurality of characteristics as the maximum random sample value of the maximum random sample and / or determining the minimum value of said at least one characteristic or the combined values ​​of said plurality of characteristics as the minimum random sample value of the minimum random sample, (c) using a statistical estimation method, estimates of all pending parameters for which a probability density function is not set to represent the maximum random sample are determined using the maximum random sample value, and / or estimates of all pending parameters for which a probability density function is not set to represent the minimum random sample are determined using the minimum random sample value; (d) setting a first rate at which the largest anomaly is erroneously detected in the image to be inspected or a second rate at which the largest anomaly is not correctly recognized in the image to be inspected, and / or setting a third rate at which the smallest anomaly is erroneously detected in the image to be inspected or a fourth rate at which the smallest anomaly is not correctly recognized in the image to be inspected; (e) the maximum threshold is determined using the probability density function or a corresponding distribution function parameterized according to the estimated value of (c), such that the probability of occurrence of a maximum value greater than or equal to the maximum threshold corresponds to the set first rate, or the probability of occurrence of a maximum value less than or equal to the maximum threshold corresponds to the set second rate; and / or (f) the minimum threshold is determined using the probability density function or a corresponding distribution function parameterized according to the estimated value of (c), such that the probability of occurrence of a minimum value less than or equal to the minimum threshold corresponds to the set third rate, or the probability of occurrence of a minimum value greater than or equal to the minimum threshold corresponds to the set fourth rate.

2. The method of claim 1.

3. (a) the definition of one or more of the areas is performed using a base threshold value, and each isolated pixel and each group of adjacent pixels, whose pixel values ​​are greater than the base threshold value, form a first group of the areas, and / or each isolated pixel and each group of adjacent pixels, whose pixel values ​​are less than or equal to the base threshold value, form a second group of the areas, or (b) defining one or more of said areas using a geometric mask; 3. The method according to claim 1 or 2.

4. 3. The method according to claim 1, wherein the characteristics of the area are geometric characteristics determined from position information of the pixels of the area, or pixel value characteristics determined from values ​​of the pixels of the area.

5. 2. The method of claim 1, wherein the probability density function is a probability density function of a generalized extreme value distribution.

6. 2. The method of claim 1, wherein the at least one known anomaly is located at a predetermined position in the digital failure image, and information about the at least one known anomaly, and optionally also the geometry of a contaminant causing the at least one known anomaly, is utilized to determine a maximum or minimum random sample value representing the at least one known anomaly.

7. (a) to generate the digital rejection image, a pass product containing no anomalies is utilized, and the pass product is provided with at least one contaminant on or within it, or a support having at least one contaminant disposed thereon, that generates the at least one known anomaly in the digital rejection image; or 10. The method of claim 1, wherein (b) digital image data of a passing product is utilized to generate the digital rejection image, and the digital image data of the passing product is digitally transformed to account for at least one determined contaminant using known material and geometric characteristics of the at least one determined contaminant.

8. 8. The method according to claim 7, characterized in that the support for the at least one impurity is configured in the form of a plate or card, and a plurality of the impurities having the same material properties and the same type of geometry but different sizes are arranged inside or on the surface of the support.

9. 9. The method according to claim 7 or 8, characterized in that said at least one contaminant is a sphere of a predetermined material.

10. 2. The method of claim 1, wherein the detection rate is output to a display device as a numerical value or a quantity or identifier associated therewith.

11. 9. The method according to claim 7 or 8, characterized in that the detection rate is assigned to a graphical representation of the at least one contaminant and / or assigned to the corresponding digital reject image and displayed.

12. 3. The method of claim 2, wherein the maximum threshold or the minimum threshold, or the first rate, the second rate, the third rate or the fourth rate, is changeable by an adjustment means, and the latest value for the detection rate is displayed on a display device for each latest value for the maximum threshold or the minimum threshold, or the first rate, the second rate, the third rate or the fourth rate.

13. The method of claim 11 , wherein the detection rate is evaluated by a classifier.

14. 3. An apparatus for detecting anomalies in digital images of products, the apparatus having a data processing device configured for acquiring and processing digital image data of the digital images of the products, characterized in that the data processing device is configured to perform the method according to claim 1 or 2.

15. A computer program for causing a data processing device to carry out the method according to claim 1 or 2.

16. 5. The method of claim 4, wherein the geometric characteristic is an area, a circumference, or a diameter, and the pixel value characteristic is a maximum or minimum value, a mean value, a variance, or a standard deviation of all pixels in the area.

17. The method of claim 4 , wherein the pixel value characteristic is used as the characteristic of the area, and the maximum or minimum value, the mean value, the variance, or the standard deviation of all pixels in the area is used as the pixel value characteristic.

Citation Information

Patent Citations

  • Program, method for creating learned model, information processing method and information processing device

    JP2021140739A

  • Surface anomaly detection system and method

    US20070098245A1