Defect inspection device, defect inspection method and storage medium

By using pre-learned recognizers to extract features and generate binary images in a factory automation environment, combined with user adjustments, the problem of defect detection accuracy under the influence of noise is solved, the determination parameter settings are simplified, and detection efficiency and accuracy are improved. sex.

CN112567229BActive Publication Date: 2024-10-29OMRON CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201980053565.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-13
Publication Date
2024-10-29
Estimated Expiration
2039-11-13

AI Technical Summary

Technical Problem

In a factory automation environment, when using a pre-learned recognizer to detect workpiece defects, the influence of noise causes inaccurate output results. The judgment parameters need to be adjusted to distinguish noise from defects. However, this process is cumbersome and leads to a decrease in productivity.

Method used

By acquiring an image of the inspection object, a pre-learned recognizer is used to extract features to generate a feature extraction image, and the defective area is determined based on the binary image. The parameters for determination are adjusted according to the user, and are set automatically or manually to reduce misjudgments.

Benefits of technology

It is possible to simplify the setting of judgment parameters, reduce the impact of noise, reduce misjudgments, and improve the accuracy and efficiency of defect detection when using a pre-learned recognizer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112567229B_ABST
    Figure CN112567229B_ABST
Patent Text Reader

Abstract

The present invention provides a defect inspection device, a defect inspection method and a storage medium that can easily set the determination parameters for determining the presence or absence of defects. The defect inspection device includes: an acquisition unit; an image generation unit that generates one or more feature extraction images by applying a learned identifier that has been learned in advance to the inspection image; an inspection unit that determines the area corresponding to the defect based on one or more determination parameters for determining whether there is a detection object part in the inspection object and a binary image generated from the feature extraction image; and a setting unit that, when determining the area corresponding to the defect based on the features that have been learned in advance, temporarily sets the determination parameters based on the post-adjustment from the user when the number of learning image data corresponding to the features is less than a threshold value, and when determining the area corresponding to the defect based on features other than the features that have been learned in advance, sets the determination parameters based on the designation from the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a defect inspection device, a defect inspection method, and a storage medium capable of performing a defect detection process using an identifier generated by machine learning. Background Art

[0002] In the field of factory automation (FA), automatic control using image measurement processing has been widely put into practical use. For example, the following process is implemented: an inspection object such as a workpiece is photographed and the quality of the workpiece is inspected based on the feature quantity extracted from the photographed image.

[0003] For example, Patent Document 1 discloses a device for determining whether an inspection object has defects based on the output result of a recognizer that has been learned by using images of the inspection object photographed under multiple shooting conditions as learning data. Specifically, the device described in Patent Document 1 includes: a learning extraction unit that extracts feature quantities of the image from at least two images based on images photographed under at least two different shooting conditions, for an object whose appearance is known to be good or bad; a selection unit that selects feature quantities for determining the quality of the object from feature quantities that span the feature quantities extracted from the at least two images by the learning extraction unit; and a generation unit that generates a recognizer for determining the quality of the object based on the feature quantities selected by the selection unit.

[0004] Prior art literature

[0005] Patent Literature

[0006] Patent Document 1: Japanese Patent Application Publication No. 2017-49974 Summary of the invention

[0007] Problems to be solved by the invention

[0008] Previous identifiers such as those described in Patent Document 1 learn to detect the presence or absence of defects based on feature quantities of an image. However, the types of workpieces flowing on a production line or inspection conditions such as photographic conditions vary depending on the production line and may not be consistent with the conditions during learning. Therefore, when a previously learned identifier is actually used on a production line, the output result of the identifier is sometimes affected by noise and the like. Noise is, for example, an unnecessary feature quantity that is mixed into an image due to reflection of light or shadows. Therefore, in order to determine the presence or absence of defects based on the output result of the identifier, it is preferable to adjust the parameters used for determination so as to separate noise from defects. On the other hand, since the adjustment requires time, there is a possibility that productivity is reduced.

[0009] The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a technique for appropriately and simply setting determination parameters for determining the presence or absence of defects in an inspection device that inspects the presence or absence of defects using the results output by a previously learned identifier.

[0010] Technical means of solving problems

[0011] In order to solve the above-mentioned problems, the present invention adopts the following configuration.

[0012] The defect inspection device of one aspect of the present invention includes: an acquisition unit that acquires an inspection image of an inspection object; an image generation unit that generates one or more feature extraction images by applying a learned identifier that has been previously learned in a manner of extracting one or more features using learning image data to the inspection image; an inspection unit that determines an area corresponding to a defect based on one or more determination parameters for determining whether there is a detection object part in the inspection object and a binary image generated from the feature extraction image; and a setting unit that, in the case of determining an area corresponding to a defect based on a feature that has been previously learned, temporarily sets the determination parameters based on post-adjustment from a user when the number of learning image data corresponding to the feature is less than a threshold value, and in the case of determining an area corresponding to a defect based on a feature other than the feature that has been previously learned, sets the determination parameters based on a designation from a user. Thus, the determination parameters for determining the presence or absence of a defect can be appropriately and simply set, and erroneous determination of defect detection can be suppressed.

[0013] When the area corresponding to the defect is determined based on the features learned in advance, the setting unit can automatically set the determination parameters when the number of learning image data corresponding to the features is greater than the threshold value. In this way, the determination parameters for determining the presence or absence of defects can be appropriately and simply set.

[0014] The setting unit may calculate an image score based on the color density of pixels of the setting image using a binary image that determines the area corresponding to the defect, and update the determination parameter in such a way that the difference between the image score inside the area and the image score outside the area becomes relatively large. The feature extraction image refers to an image in which a predetermined feature is extracted from an image input to the defect inspection device. The binary image refers to an image generated based on the feature extraction image and determined by the inspection unit whether there is a defect or not.

[0015] In the above structure, in a defect inspection device that uses the output result of the previously learned identifier to inspect the presence or absence of defects, the determination parameters for determining the presence or absence of defects can be appropriately and simply set. Since the determination parameters can be appropriately set, false determinations are reduced. In particular, since noise can be reduced, false detections of non-defective items that are identified as defects are reduced. Furthermore, since the determination parameters can be easily set, the setting man-hours and startup man-hours of the defect inspection device can be reduced.

[0016] In the defect inspection device of the first aspect, the binary image may include white pixels and black pixels, and concentration values ​​are respectively corresponding to the white pixels and the black pixels. The setting unit calculates the total value of the concentration values ​​of the colors for the multiple pixels included in the area as the first image score, and calculates the total value of the concentration values ​​of the colors for the multiple pixels included outside the area as the second image score, and updates the determination parameters in a manner that maximizes the difference between the first image score and the second image score. According to this aspect, the defect inspection device can search for appropriate determination parameters by calculating and comparing the image scores.

[0017] Furthermore, the determination parameters may include a binarization level for generating a binarized image. Furthermore, the determination parameters may include one or more determination items for determining a binarized image and a determination threshold value set for each of the determination items. According to this aspect, the threshold value for generating a binarized image as an object for determining the presence or absence of defects by the inspection unit can be appropriately and simply set. This can further reduce erroneous determinations.

[0018] Furthermore, in the defect inspection device of the one aspect, it can also be configured that: one or more determination items for determining defects include at least one of the area of ​​a specified area represented by a pixel block of the same color in a binary image, the width and / or height of a circumscribed rectangle, the perimeter, the aspect ratio, and the circularity, and the determination threshold includes an upper limit value and / or a lower limit value set for each of these determination items. According to this form, the defect inspection device can set the determination threshold value according to the determination item. In this way, more appropriate determination parameters can be set.

[0019] Furthermore, the determination items and the determination thresholds may also be determined based on the feature quantities of defects contained in the learning image data used in the learning of the image generation unit or the inspection unit. According to this aspect, the defect inspection device can set determination conditions corresponding to the shape distribution of defects in the learning images contained in the learning data set, and can extract defects having the same shape as the defects contained in the learning data set.

[0020] Furthermore, the defect inspection device of the one aspect may also be configured to further include a display unit, wherein the display unit accepts the designation of an area, the inspection unit determines the area to be determined as a defect based on predetermined judgment parameters, and outputs the determined area together with the inspection image to the display unit, and the setting unit generates a setting image based on the designation of the area accepted via the display unit. According to this form, the user can adjust the predetermined judgment parameters afterwards, thereby being able to more appropriately and easily adjust the defect inspection system of the inspection unit. As a result, the load associated with the user's adjustment of the accuracy of the defect detection of the inspection unit can be further reduced.

[0021] Furthermore, in the defect inspection device of the one aspect, it can also be configured as follows: the inspection unit determines the area in the binary image to be judged as a defect based on the judgment threshold set for each of the one or more feature quantities used to judge the defect, and prompts the determined area to the user, and the setting unit accepts the designation from the user of an area that is judged as a defect by the inspection unit but should not be judged as a defect, and / or an area that is not judged as a defect by the inspection unit but should be judged as a defect, and updates the judgment threshold based on the designation. Furthermore, the one or more judgment items and judgment thresholds used to judge the defect can also be determined based on the user's designation. According to this form, the user can adjust the predetermined judgment parameters afterwards, so that the defect inspection system of the inspection unit can be adjusted more appropriately and easily.

[0022] Furthermore, a defect inspection method according to one aspect of the present invention is a step of executing the following steps by a computer: a step of acquiring an inspection image of an inspection object; a step of generating one or more feature extraction images by applying a learned identifier that has been previously learned to the inspection image in a manner that extracts one or more features using learning image data; a step of determining an area corresponding to a defect based on one or more determination parameters for determining whether or not there is a detection object portion in the inspection object and a binary image generated from the feature extraction image; and a step of temporarily setting the determination parameters based on post-adjustment from the user when the number of learning image data corresponding to the feature is less than a threshold value when the area corresponding to the defect is determined based on the previously learned feature, and setting the determination parameters based on a designation from the user when the area corresponding to the defect is determined based on features other than the previously learned features. Thus, the determination parameters for determining the presence or absence of a defect can be appropriately and simply set, and erroneous determination of defect detection can be suppressed.

[0023] Furthermore, a storage medium according to one aspect of the present invention stores a program that causes a computer to execute the following steps: a step of acquiring an inspection image of an inspection object; a step of generating one or more feature extraction images by applying a learned identifier that has been previously learned to the inspection image in a manner that extracts one or more features using learning image data; a step of determining an area corresponding to a defect based on one or more determination parameters for determining whether or not there is a detection object portion in the inspection object and a binary image generated from the feature extraction image; and a step of temporarily setting the determination parameters based on post-adjustment from the user when the number of learning image data corresponding to the feature is less than a threshold value when the area corresponding to the defect is determined based on the previously learned feature, and setting the determination parameters based on a designation from the user when the area corresponding to the defect is determined based on features other than the previously learned features. Thus, the determination parameters for determining the presence or absence of a defect can be appropriately and simply set, and erroneous determination of defect detection can be suppressed.

[0024] Effects of the Invention

[0025] According to the present invention, it is possible to provide a technique for appropriately and simply setting determination parameters for determining the presence or absence of defects in a defect inspection device that inspects the presence or absence of defects using the results output by a previously learned identifier. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram showing an example of a system configuration of a defect inspection system according to the present embodiment.

[0027] Figure 2 It is a schematic diagram showing the hardware structure of the defect inspection device according to this embodiment.

[0028] Figure 3 It is a schematic diagram showing the functional structure of the defect inspection device according to this embodiment.

[0029] Figure 4 This is a diagram for explaining an example of a processing flow of image measurement processing using CNN in the defect inspection system according to the present embodiment.

[0030] Figure 5A This is a diagram showing an example of a learning data set provided to a convolutional neural network (CNN) engine according to the present embodiment.

[0031] Figure 5B This is a schematic diagram for explaining the input, output, and expected values ​​during the learning of the CNN engine according to this embodiment.

[0032] Figure 6 This is a flowchart for explaining an example of processing in the semi-automatic setting mode in the defect inspection system of this embodiment.

[0033] Figure 7 This is a flowchart for explaining an example of processing in the automatic manual setting mode in the defect inspection system of this embodiment.

[0034] Figure 8 This is a diagram for explaining an example of a defect area in the defect inspection device according to this embodiment.

[0035] Fig. 9 This is a flowchart for explaining an example of processing in the automatic manual setting mode in the defect inspection system of this embodiment.

[0036] Fig. 10A This is a schematic diagram showing an example of a user interface screen 200 provided by the defect inspection device of this embodiment.

[0037] Fig. 10B It is a schematic diagram showing an example of a user interface screen 200 provided by the defect inspection device of this embodiment.

[0038] Fig. 10C It is a schematic diagram showing an example of a user interface screen 200 provided by the defect inspection device of this embodiment.

[0039] Fig. 10D This is a schematic diagram showing an example of a user interface screen 200 provided by the defect inspection device of this embodiment.

[0040] Fig.11 This is a flowchart showing the processing flow of the preparation step in the defect inspection system of this embodiment.

[0041] Fig.12 This is a flowchart showing the processing flow of the operation process in the defect inspection system of this embodiment.

[0042] Fig.13 This is a flowchart showing an example of the flow of the switching process of the setting mode of the determination parameter according to the present embodiment.

[0043] Fig.14 This is an explanatory diagram showing an example of features that have been learned in advance in this embodiment.

[0044] Fig.15 This is an explanatory diagram showing an example of features other than the features learned in advance according to the present embodiment.

[0045] [Explanation of Symbols]

[0046] 1: Defect inspection system

[0047] 2: Belt conveyor

[0048] 4: Artifacts

[0049] 6: Shooting field of view

[0050] 8: Upper network

[0051] 10: PLC

[0052] 12: Database device

[0053] 100: Defect inspection device

[0054] 102: Camera

[0055] 104: Display

[0056] 106: Keyboard

[0057] 108: Mouse

[0058] 110: Processor

[0059] 112: Main memory

[0060] 114: Camera interface

[0061] 116: Input interface

[0062] 118: Display interface

[0063] 120: Communication interface

[0064] 122: Internal bus

[0065] 130: Storage

[0066] 132: Image Processing Program

[0067] 136: Determination parameters

[0068] 138: Input image

[0069] 140: Measurement results

[0070] 152: Input buffer

[0071] 154: Pre-processing unit

[0072] 156: Engine

[0073] 158: Selection Department

[0074] 160: Image processing unit

[0075] 162: Judgment Department

[0076] 166: Setting Department

[0077] 170: Post-processing unit

[0078] 300: Automatically set the screen

[0079] 700: Manual setting screen

[0080] 710: Binarization level setting unit

[0081] 711: Binarization level controller

[0082] 712: Binarization level display column

[0083] 720: Judgment condition setting unit

[0084] 721: Determination item selection column

[0085] 722: Judgment threshold setting column

[0086] 730: Measurement result image display unit

[0087] 800: Semi-automatic setting screen

[0088] 830: Third feature region selection unit

[0089] 900: Automatically set the screen

[0090] 901: Graphics registration area

[0091] 902: Coordinate input area

[0092] 903: Display area

[0093] 911: Graphic Button

[0094] 1000: Defects

[0095] 1100: Hole

[0096] A: Area

[0097] GT: Defective Area

[0098] L: Length

[0099] R: circumference

[0100] T: Width

[0101] S101~S104, S201~S215, S401~S432, S501~S505, S601~S606: Steps DETAILED DESCRIPTION

[0102] Hereinafter, an embodiment of one aspect of the present invention (hereinafter also referred to as "the present embodiment") is described based on the accompanying drawings. However, the embodiment described below is merely an illustration of the present invention in all aspects. Of course, various improvements or modifications can be made without exceeding the scope of the present invention. That is, when implementing the present invention, a specific structure corresponding to the embodiment can also be appropriately adopted. In addition, in the present embodiment, the data that appears is described by natural language, and more specifically, it is specified by a simulation language, command, parameter, machine language, etc. that can be recognized by a computer.

[0103] §1 Application examples

[0104] First, use Figure 1 An example of a scenario to which the present invention is applicable will be described. Figure 1 1 is a schematic diagram showing an example of an application scenario of the defect inspection system 1 of the present embodiment. The defect inspection system 1 of the present embodiment can assist an operator (hereinafter also referred to as a "user") by setting appropriate judgment parameters according to features extracted as defects when inspecting defects on an input image generated by photographing an inspection object. In addition, the inspection object includes, for example, workpieces such as parts and products in the manufacturing process.

[0105] like Figure 1 As shown, the defect inspection system 1 realizes appearance inspection or appearance measurement of the workpiece 4 by performing image measurement processing on an input image obtained by photographing the workpiece 4, which is the inspection object conveyed on a belt conveyor 2. In the following description, as a typical example of image measurement processing, an example of inspection for the presence or absence of defects on the surface of the workpiece 4 is described, but it is not limited to this, and can also be applied to the determination of defect types, the dimensional measurement of defect appearance shapes, etc.

[0106] A camera 102 as an imaging unit is disposed above the belt conveyor 2, and an imaging field of view 6 of the camera 102 is configured to include a predetermined area of ​​the belt conveyor 2. Image data (hereinafter also referred to as "input image") generated by imaging of the camera 102 is sent to the defect inspection device 100. The imaging of the camera 102 is performed periodically or event-based.

[0107] The defect inspection device 100 is connected to a programmable logic controller (PLC) 10 and a database device 12 via a host network 8. The measurement result in the defect inspection device 100 can also be sent to the PLC 10 and / or the database device 12. In addition, in addition to the PLC 10 and the database device 12, the host network 8 can also be connected to any device.

[0108] The defect inspection apparatus 100 may be connected to a display 104 for displaying the processing status and measurement results, and a keyboard 106 and a mouse 108 as an input unit for accepting user operations.

[0109] The defect inspection device 100 has an identifier generated by machine learning. As an example, the defect inspection device 100 has a CNN engine. The CNN engine is configured as an identifier using a convolutional neural network (CNN), and is configured to generate: the probability that an input image belongs to any one of a plurality of pre-specified classes (classifications) corresponding to prescribed features, and a feature extraction image corresponding to each class. Here, a feature extraction image refers to an image in which prescribed features are extracted from an input image. In the present embodiment, the prescribed features (classes) are five types: background, black dots, white dots, black lines, and white lines. The CNN engine performs prior learning based on a learning data set including learning images and teacher data (labels) prepared according to the plurality of categories, thereby generating a feature extraction image in which prescribed features are extracted from the input image. The CNN engine obtains internal parameters adjusted in advance in a manner to generate a probability and a feature extraction image belonging to a prescribed category by prior learning using the learning data set. Here, the internal parameters include the structure of the neural network (for example, the number of layers of the neural network, the number of neurons in each layer, the connection relationship between neurons, the activation function of each neuron), and hyperparameters (information representing the weight of the connection between neurons and the threshold of each neuron). In the present embodiment, the specified features include features related to the shape of the defect and features related to the concentration of the color of the defect. More specifically, as features related to the shape of the defect, point defects and line defects are included, and as features related to the concentration of the color of the defect, white defects and black defects are included. Through their combination, the CNN engine of the present embodiment includes "white dots", "white lines", "black dots", and "black lines" as specified categories, and generates one or more feature extraction images corresponding to each category. These feature extraction images are represented by gray scale. The structure of the CNN engine and the learning process of the CNN engine will be described later.

[0110] In addition, the defect inspection device 100 has an inspection unit (hereinafter also referred to as a "post-processing unit"), which generates a binary image in which features corresponding to each category are represented by white or black pixels based on one or more feature extraction images output by the CNN engine, and uses this binary image and the parameters for determination (hereinafter also referred to as "determination parameters") to determine whether there are defects in the workpiece as the object. In addition, in addition to the presence or absence of defects, the post-processing unit can also detect the size, position, type, etc. of the defects. Here, the determination parameters are parameters including the binarization level (level) used to generate the binary image, the determination items of whether the features contained in the binary image are determined as defects, and the determination thresholds set corresponding to each determination item. As the determination items, the area of ​​the pixels representing the features, the width and height of the circumscribed rectangle, the perimeter, the circularity, etc. can be listed. In addition, the circularity is a numerical value used to indicate the complexity of the figure. The larger the value of the circularity, the closer it is to a circle, and the more it indicates a certain pattern rather than a defect. The determination threshold preferably includes an upper limit value and a lower limit value, and is a threshold value for determining a feature having a feature amount included in the upper limit value and the lower limit value as a defect.

[0111] Inspection conditions such as the types of workpieces flowing on the production line or photographic conditions vary depending on the production line and may not be consistent with the conditions during learning. Therefore, when the learned CNN is used on the production line, there is a situation where noise is included in the feature extraction image depending on the internal parameters. Noise is, for example, an unnecessary feature quantity mixed into the image due to light reflection or shadows. This type of noise can lead to erroneous judgments that a defect is not a defect or erroneous judgments that a defect is not a defect. Therefore, sometimes the post-processing unit needs to separate the noise from the defect when the feature extraction image contains noise. The separation of noise and defects is performed based on the judgment parameters, and it takes time to manually adjust the judgment parameters appropriately according to the production line, which reduces productivity.

[0112] In view of the above situation, the defect inspection device 100 of the present embodiment has a parameter for determining the noise and defects contained in the feature extraction image output by the CNN engine in the post-processing unit, which is updated according to the input image for which the defect determination is actually performed. Specifically, the defect inspection device 100 of the present embodiment first applies a learner (CNN) to the input image (inspection image) to generate one or more feature extraction images. Then, addition and subtraction processing (which may not be performed) and binarization processing based on the initial value of the predetermined binarization level are performed on the one or more feature extraction images to generate a binarized image. In addition, the defect inspection device 100 performs a determination process for determining the defective part by the inspection unit based on the predetermined determination items and the initial value of the determination threshold. At this time, the inspection unit can display the determination processing result to the user (prompt the area determined to be a defect together with the image) and accept feedback from the user. For example, the defect inspection device 100 can accept the user's addition of the defect area when the inspection unit misses the area to be detected as a defect (defect area). Furthermore, the defect inspection apparatus 100 can accept the deletion of the defect area when the inspection unit mistakenly judges the noise as a defect area. When receiving feedback from the user, the defect inspection apparatus 100 uses the image (setting image) in which the defect area is specified to adjust the judgment parameters (binarization level, judgment item, judgment threshold) in such a way that the difference in density inside and outside the defect area becomes larger.

[0113] In addition, the process of "accepting the area designation from the user via the display unit" may not be performed. In this case, it is sufficient to obtain an image of the predetermined defect area (such as Figure 7 , Fig. 9 Just like S201 in the fully automatic mode, an image with a predetermined defect area can be used).

[0114] In addition, the defect inspection device 100 of the present embodiment has at least a function (semi-automatic mode) for the user to adjust the preset judgment parameters as a setting mode for the judgment parameters. Thus, the user can make adjustments when the preset judgment parameters are inappropriate, thereby reducing the load of setting the judgment parameters. Moreover, in addition to the semi-automatic mode, the defect inspection device 100 of the present embodiment also has a mode for automatically setting the judgment parameters (fully automatic mode) and a function for the user to manually set the judgment parameters (manual mode). In addition, the first setting mode, the second setting mode, and the third setting mode correspond to the semi-automatic mode, the manual mode, and the fully automatic mode, respectively.

[0115] §2 Structure Example

[0116] <1. Hardware Configuration of Defect Inspection Device 100 >

[0117] Next, the hardware configuration of the defect inspection device 100 included in the defect inspection system 1 of the present embodiment will be described.

[0118] Figure 2 Schematic diagram showing the hardware configuration of the defect inspection device 100 according to the present embodiment. Figure 2 As an example, the defect inspection device 100 can also be implemented using a general-purpose computer configured in accordance with a general-purpose computer architecture. The defect inspection device 100 includes a processor 110, a main memory (main storage unit) 112, a camera interface 114, an input interface 116, a display interface 118, a communication interface 120, and a storage (auxiliary storage unit) 130. Typically, these components are connected to each other via an internal bus 122 so as to be communicable with each other.

[0119] The processor 110 expands and executes the program stored in the storage 130 in the main memory 112, thereby realizing the same as using Figure 3 and Fig.12 The main memory 112 includes a volatile memory and functions as a work memory required for the processor 110 to execute a program.

[0120] The camera interface 114 is an example of an acquisition unit. The camera interface 114 is connected to the camera 102 to acquire an input image captured by the camera 102. The camera interface 114 can also instruct the camera 102 on the timing of capturing images.

[0121] The input interface 116 is connected to an input unit for user operations such as the keyboard 106 and the mouse 108. The input interface 116 acquires a command indicating an operation performed by the user on the input unit.

[0122] The display interface 118 is connected to the display 104 as a display unit. The display interface 118 outputs various processing results generated by the processor 110 executing the program to the display 104 .

[0123] The communication interface 120 is responsible for processing for communicating with the PLC 10 , the database device 12 , and the like via the host network 8 .

[0124] The memory 130 stores programs for making the computer function as the defect inspection device 100, such as an image processing program 132 for realizing the CNN engine and an operating system (OS) 134. In addition, the memory 130 may store determination parameters 136 for realizing image measurement processing as described later, an input image 138 obtained from the camera 102, and a measurement result 140 obtained by image measurement processing.

[0125] The image processing program 132 stored in the memory 130 may be installed in the defect inspection apparatus 100 via an optical recording medium such as a digital versatile disc (DVD) or a semiconductor recording medium such as a universal serial bus (USB) memory. Alternatively, the image processing program 132 may be downloaded from a server device on a network.

[0126] The image processing program 132 of this embodiment may provide necessary functions by cooperating with the OS without including all software modules for realizing the functions of this embodiment.

[0127] The image processing program 132 of the present embodiment may also be provided as part of another program. In this case, the image processing program 132 itself does not include the modules included in the other programs combined as described above, but performs processing in cooperation with the other programs. In this way, the image processing program 132 of the present embodiment may also be provided as part of another program.

[0128] Figure 2 An example of using a general-purpose computer to implement the defect inspection device 100 is shown, but the present invention is not limited thereto, and a dedicated circuit (e.g., an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA)) may be used to implement all or part of its functions. Furthermore, an external device connected via a network may be responsible for a part of the processing.

[0129] <2. Functional structure of defect inspection device 100 >

[0130] Secondly, refer to Figure 3 and Figure 4 The functional structure of the defect inspection device 100 included in the defect inspection system 1 of this embodiment is described. Figure 3In the figure, the CNN engine 156 corresponds to the image generation unit, and the post-processing unit 170 (especially the determination unit 162) corresponds to the inspection unit.

[0131] Figure 3 1 is a schematic diagram showing the functional structure of the defect inspection device 100 of this embodiment. Typically, each functional structure of the defect inspection device 100 is a calculation process implemented by the processor 110 executing the image processing program 132. Figure 4 This is a schematic diagram for explaining an example of an inspection process (operation process) in the defect inspection device 100 of the present embodiment.

[0132] Reference Figure 3 The defect inspection device 100 includes an input buffer 152, a pre-processing unit 154, a CNN engine 156, a post-processing unit 170, and a setting unit 166 as a functional structure. Hereinafter, each functional unit will be described in detail.

[0133] (2-1. Input buffer 152)

[0134] The input buffer 152 temporarily stores the input image captured by the camera 102. The processor 110 stores the input image in the memory 130, thereby realizing the input buffer 152. The input buffer 152 can be accessed by the pre-processing unit 154 and the setting unit 166.

[0135] (2-2. Pre-processing unit 154)

[0136] The pre-processing unit 154 performs the required pre-processing on the input image stored in the input buffer 152. The pre-processing unit 154 of the present embodiment generates a pre-processing filter when starting the inspection process (hereinafter also referred to as the "preparation process"). The pre-processing filter is, for example, a parameter (filter parameter) for converting the input image. In addition, as specific examples of the pre-processing filter, brightness correction, color grayscale conversion, and enlargement and reduction of the input image described later can be listed. In addition, the pre-processing filter can be appropriately applied to the input image according to the form.

[0137] The CNN engine 156 described later acquires internal parameters for extracting a specified feature extraction image through prior learning. Thus, the CNN engine 156 can extract features that converge to the width of the feature quantity specified by the internal parameters. However, the range of the feature quantity corresponding to the internal parameters is determined by the type of defects contained in the learning data used in the generation of the learned model. Therefore, when a defect with a specific feature that is not included in the learning data is generated on the production line, the feature quantity of this defect deviates from the feature quantity obtained by prior learning, resulting in misidentification (missed detection). Moreover, when a pattern of a background area with a specific feature that is not included in the learning data is generated on the generation line, the pattern of this background area is consistent with the range of the feature quantity obtained by prior learning, resulting in misidentification (over-detection).

[0138] Therefore, the pre-processing unit 154 generates a pre-processing filter capable of converting the input image as follows in the preparation step.

[0139] The input image is enlarged or reduced so that the width of the feature amount of the region corresponding to the defect included in the input image is included in the range of the feature amount corresponding to the internal parameter.

[0140] The input image is enlarged or reduced so that the features of the non-defective region included in the input image do not converge to the feature amount extracted using the internal parameters.

[0141] In the actual inspection process (hereinafter also referred to as "application process"), the input image is converted by applying the pre-processing filter as pre-processing to the input image. Figure 4 The purpose of this pre-processing is to process the input image so as to facilitate the extraction of features by the CNN engine 156 in the later stage. The content of the pre-processing can also be specified by the user via the setting unit 166. The input image after pre-processing (hereinafter also referred to as "pre-processed image") is output to the CNN engine 156 ( Figure 4 of S2).

[0142] (2-3.CNN engine 156)

[0143] The CNN engine 156 provides a feature extraction image generation function, that is, the CNN engine 156 with multiple categories learned in advance is applied to the input image, thereby generating multiple feature extraction images corresponding to the multiple categories. The multiple feature extraction images generated by the CNN engine 156 are output to the post-processing unit 170 and can also be accessed by the setting unit 166.

[0144] The following is a more detailed description of the functions of the CNN engine 156.

[0145] The CNN engine 156 is configured to output the probability prob(n) that the input image belongs to a plurality of pre-specified categories (categories: n) when an image is input. The probability is calculated according to a plurality of pre-specified categories (categories). The CNN engine 156 in this embodiment outputs, through prior learning, the probability prob(n) that the input image belongs to a certain category of image and the feature extraction images (feature extraction image 1, feature extraction image 2, ..., feature extraction curve N) belonging to the said category ( Figure 4 In this embodiment, the multiple categories are five categories: background, black dots, white dots, black lines, and white lines. By inputting the input image captured by the camera 102 or the like into the CNN engine 156, feature extraction images are generated in which the features classified into these categories "white dots", "black dots", "white lines", and "black lines" are extracted. Figure 4 In the feature extraction image shown, the area representing each feature is displayed in a manner in which the concentration difference between the area and other areas becomes larger. In addition, as an example of displaying with a larger concentration difference, it may include a form in which it is displayed brighter than other areas, or a form in which it is displayed darker than other areas, but it is not limited to these, and any form may be used as long as it is a form that can distinguish the area representing the specified feature.

[0146] As described above, the CNN engine 156 obtains internal parameters for generating feature extraction images corresponding to each category through prior learning. For example, when extracting the category of "white line" or "black line", the internal parameters can be expressed as the number of pixels of the width of the defect that can be extracted. The internal parameters are obtained based on the types of defects contained in the learning image provided by prior learning.

[0147] The CNN engine 156 of this embodiment has one or more convolution layers, one or more pooling layers, a fully connected layer, and a normalized index layer (softmax layer). The information of each image of the input image is output to the fully connected layer via multiple convolution layers and multiple pooling layers. The features of the image are extracted by the convolution processing of the convolution layer and the compression processing of the image size of the pooling layer.

[0148] The full integration layer integrates the image data whose features are extracted by the convolution layer and the pooling layer to a specific node, and outputs a feature variable converted by a predetermined function. Each node in each integration layer is image data corresponding to a plurality of pre-specified categories.

[0149] The output of the full integration layer is output to the normalized index layer (output layer). In the normalized index layer, the probability prob(n) of belonging to a plurality of pre-specified categories (n) is output in the range of 0 to 1.

[0150] In addition, the calculation formulas of the convolution layer and the full integration layer are provided as formula (1) and formula (2) respectively. In each formula, the multiple weights W and the bias B are hyperparameters included in the internal parameters, and these internal parameters are determined by learning. Moreover, the calculation formula of the normalized exponential layer is represented by formula (3).

[0151] [Number 1]

[0152] The calculation formula of the convolution layer

[0153]

[0154] I top (X,Y,n): output image

[0155] I btm (x,y,c): input image

[0156] W(x,y,c,n): convolution coefficients

[0157] B(n): Bias voltage

[0158] Kx, Ky: The size of the convolution kernel

[0159] C: Number of channels of the input image

[0160] [Number 2]

[0161] Calculation formula for the full combined layer

[0162]

[0163] I top (n): Output image

[0164] I btm (c) Input image

[0165] W(c,n): Fully integrated coefficient

[0166] B(n): Bias voltage

[0167] C: Number of channels of the input image

[0168] [Number 3]

[0169] Calculation formula of normalized index layer

[0170]

[0171] prob(n): probability of belonging to the nth category (0-1)

[0172] I btm (c) Input image

[0173] N: number of categories

[0174] Next, the learning of the CNN engine 156 of this embodiment is described. An example of a learning data set including learning images and teacher data (labels) used in this embodiment is shown in FIG. Figure 5A . And, will use Figure 5A The outline of the learning process of the set of learning data and teacher data shown is shown in Figure 5B .

[0175] like Figure 5A As shown in FIG. 1 , the learning data has learning images corresponding to a plurality of pre-specified categories (classification: n). Figure 5A As shown, a plurality of learning images corresponding to five categories, namely, background, defects represented by black dots, defects represented by white dots, defects represented by black lines, and defects represented by white lines, are prepared. In addition, in each learning image data, teacher data (labels) representing the classification of each image data are assigned with numbers from 0 to 4. More specifically, 0 is assigned to the background, 1 is assigned to the defects represented by black dots, 2 is assigned to the defects represented by white dots, 3 is assigned to the defects represented by black lines, and 4 is assigned to the defects represented by white lines.

[0176] like Figure 5B As shown in FIG. 1 , in the learning of the CNN engine 156, first, the values ​​of all the hyperparameters constituting the internal CNN are initialized by random numbers. Figure 5A The learning images contained in the learning data set shown are input to the CNN engine 156, and the CNN engine 156 outputs the probability distribution prob(n). Then, the measured value prob(n) of the probability distribution output by the CNN engine 156 is compared with the output expected value of the probability distribution. Here, the output expected value of the probability distribution is: the probability distribution prob(n) of the label corresponding to the input learning image = 1 and the probability distribution prob(n) of the label not corresponding to the input learning image = 0. Therefore, Figure 5BAs shown, when an input image containing a defect represented by a black line is associated with 3 as the teacher data (label), the output expected value of its probability distribution is preferably: prob(3) = 1 and the output expected value of the other probability distributions is prob(n: 0, 1, 2, 4) = 0. Therefore, the learning of the CNN engine 156 is the following processing, that is, to explore and update the combination of hyperparameters in a way that minimizes the difference between the measured value of the probability distribution output by the normalized exponential layer when a certain learning image is input and the output expected value of the label corresponding to the learning image.

[0177] The hyperparameters are updated in the following manner: the probability distribution prob(n) is calculated using multiple learning images, and the sum of the cross entropy of the measured value of the probability distribution and the output expected value is used as the loss function. The value of the hyperparameter is repeatedly calculated to minimize the loss function shown in the following formula (4). At this time, the gradient descent method and the error back propagation method can be used in the calculation of the hyperparameters. When the difference between the hyperparameters before and after the update is less than the specified value, the learning is completed.

[0178] [Number 4]

[0179] Calculation formula of loss function (cross entropy)

[0180]

[0181] prob(n): The measured value of the probability of belonging to the nth category (0 to 1)

[0182] ex(n): expected value of the probability of belonging to the nth category (0 or 1)

[0183] N: number of categories

[0184] Cnt: number of learning images

[0185] (2-4. Post-processing unit 170)

[0186] The post-processing unit 170 generates a measurement result image by post-processing at least a portion of the feature extraction images output from the CNN engine 156. Specifically, the post-processing unit 170 selects one or more specified feature extraction images from the plurality of feature extraction images output from the CNN engine 156, and performs post-processing, thereby outputting a measurement result image ( Figure 4 Regarding the selection of one or more feature extraction images, the following can also be done: Figure 3As shown, the user's designation is accepted via the setting unit 166. In addition, the post-processing unit 170 may also output the measurement result together with the measurement result image. The measurement result includes the determination result obtained when the defect inspection process is performed on the input image (for example, the presence or absence of defects, the size of the defect pattern, the position of the defect pattern, etc.).

[0187] In the present embodiment, the post-processing unit 170 includes a selection unit 158 ​​, an image operation unit 160 , and a determination unit 162 .

[0188] The selection unit 158 ​​selects one or more feature extraction images from the plurality of feature extraction images output by the CNN engine 156, and outputs the selected feature extraction images to the image operation unit 160. In addition, when selecting the feature extraction images, the selection unit 158 ​​may also accept the user's selection via the setting unit 166 described later.

[0189] When the selection unit 158 ​​selects a plurality of feature extraction images, the image operation unit 160 performs a predetermined image processing as necessary, and outputs the result to the determination unit 162. Here, the image operation processing includes performing any mathematical processing including four arithmetic operations between corresponding pixels between the plurality of images. More specifically, the image operation unit 160 can perform, for example, image addition processing, image subtraction processing, and weighted operation processing thereof using two or more feature extraction images among the selected plurality of feature extraction images as the image operation processing.

[0190] Figure 4 An example is shown in which a feature extraction image of a "black line" is selected by the selection unit 158 ​​as the most appropriate feature extraction image. However, in this example, a feature equivalent to a "black dot" also appears in the feature extraction image of the "black line". That is, in both the feature extraction image of the "black line" and the feature extraction image of the "black dot", a dot-shaped feature portion appears in common. In view of the input image, this feature equivalent to the "black dot" does not represent a defect but noise. In this way, depending on the type or size of the feature contained in the input image, it becomes difficult to separate the defect from a pattern other than the defect (for example, a background portion or noise). At this time, the image operation unit 160 can perform image operation processing by subtracting the feature appearing in one of the feature extraction images from the other feature extraction image, thereby extracting only the target feature. That is, in Figure 4In the example shown, the image operation unit 160 performs a process of calculating the difference between the brightness value of each pixel of the feature extraction image constituting the "black line" and the brightness value of each pixel of the feature extraction image constituting the "black dot". On the other hand, sometimes the features corresponding to the defect appear dispersedly in multiple categories of feature extraction images. For example, when multiple scratch-shaped defects are generated in the inspection object, sometimes one of the scratch defects is extracted as a feature extraction image of a "white line" due to the lighting conditions, while the other scratch defects are extracted as feature extraction images of "black lines". In this case, the image operation unit 160 may also perform an addition process of the feature extraction image of the "white line" and the feature extraction image of the "black line". In this way, by performing addition and subtraction processing and weighted operation processing on the selected multiple feature extraction images, an image containing the features extracted as defects can be generated.

[0191] In addition, when the selection unit 158 ​​selects only one feature extraction image, the image operation unit 160 may output the feature extraction image directly to the determination unit 162 without performing image operation processing. Furthermore, the image operation unit 160 may receive from the user via the setting unit 166 which image operation processing to perform.

[0192] The determination unit 162 performs binarization processing and determination processing on the feature extraction image (processed by image operation or not processed by image operation) output by the image operation unit 160 according to at least the determination parameters input from the setting unit 166 described later, and outputs a measurement result image. In addition, the determination unit 162 may output the measurement result together with the measurement result image.

[0193] In this embodiment, the judgment parameter includes at least a binarization level or a judgment condition. The binarization level is a threshold used by the judgment unit 162 to generate an image (binarized image) that has been binarized by binarization processing, wherein the image is a feature extraction image, or an image obtained by image processing by the image operation unit 160 on multiple feature extraction images. Moreover, the judgment condition is information obtained by combining the judgment item representing the type of feature quantity used by the judgment unit 162 to determine whether a defect is contained in the binary image (for example, the area of ​​this image when detected as a defect or the width, height, perimeter, aspect ratio, circularity, etc. of the circumscribed rectangle) and the judgment threshold value set in this judgment item to represent the range of the feature quantity detected as a defect. The judgment threshold is preferably set with an upper limit and a lower limit. Moreover, the judgment item contained in the judgment condition is not limited to a single item, and may also include multiple judgment items. In this case, the judgment condition refers to the combination information of multiple judgment items and threshold values ​​set for the multiple judgment items. In addition, the judgment parameter may also include information specifying the judgment logic, etc.

[0194] In the following description, an example is described in which the determination parameters are set by the processing of the setting unit 166 described later, but when a learner such as machine learning is used as the post-processing unit 170, a configuration in which the determination parameters are acquired by prior learning may be adopted. In this case, the determination parameters are updated to appropriate values ​​by the processing of the setting unit 166 described later.

[0195] The details of the binarization process and the determination process by the determination unit 162 will be described.

[0196] The binarization process is a process in which the determination unit 162 generates a binarized image from a feature extraction image or an image obtained by performing image processing on a plurality of feature extraction images by the image operation unit 160 (hereinafter also referred to as an "intermediate image") according to the binarization level contained in the determination parameter. In more detail, as a binarization process, the determination unit 162 first generates a binarized image based on the binarization level contained in the determination parameter for the intermediate image output by the image operation unit 160. The binarization level is, for example, a threshold value related to the intensity of a pixel. For example, the case where the determination unit 162 generates a binarized image in which the density of the feature extraction image is represented by the binary values ​​of white and black is described as an example. In this case, although the density of the original feature extraction image has a continuous value, the determination unit 162 converts all pixels having an intensity above the binarization level to black, and converts all pixels having an intensity less than the binarization level to white, thereby generating a binarized image in which the feature extraction image is binarized. In addition, the correspondence between intensity and black and white is not limited to this, and may be reversed.

[0197] Next, the determination process is a process in which the determination unit 162 generates a measurement result image (or a measurement result image and a measurement result) from a binarized image (an example of an intermediate image) according to the determination conditions contained in the determination parameters. More specifically, as the determination process, the determination unit 162 extracts a pixel block connected by the same color (hereinafter also referred to as the "first feature area") from the binarized image generated by the binarization process. Furthermore, the determination unit 162 extracts an area to be detected as a defect from the extracted first feature area based on the determination conditions provided as the determination parameters. Furthermore, a measurement result image in which only the first feature area detected as a defect is extracted is generated and output.

[0198] For example, when a determination condition is provided that uses the area as a determination item, the determination unit 162 extracts the first characteristic region as a region to be detected as a defect when the area of ​​the first characteristic region is within the range of the determination threshold provided as the determination condition. Furthermore, the determination unit 162 generates a measurement result image in which the region detected as a defect is extracted from the binary image.

[0199] (2-5. Setting unit 166)

[0200] The setting unit 166 sets the determination parameters used by the determination unit 162 in the determination process, and outputs the settings to the determination unit 162. The setting unit 166 of the present embodiment has the following three modes for setting the determination parameters.

[0201] Manual mode

[0202] Semi-automatic mode

[0203] Fully automatic mode

[0204] In addition, the setting unit 166 only needs to have at least the semi-automatic mode among the above-mentioned setting modes, and does not need to have all the modes. The setting process of each mode will be described in detail.

[0205] (1) Manual mode

[0206] In the manual mode, the setting unit 166 receives the selection of the determination item from the user and the setting of the determination threshold (upper limit and lower limit) set in the selected determination item as the setting of the determination condition. In addition, the setting unit 166 also receives the setting of the binarization level from the user in the manual mode. The setting unit 166 outputs the received binarization level and determination condition to the determination unit 162 as determination parameters.

[0207] (2) Semi-automatic mode

[0208] The semi-automatic mode is a mode in which the setting unit 166 accepts the user's adjustment of the parameters after temporarily setting the determination parameters. This is a setting mode in which the temporary setting of the determination parameters is automatically performed while the user freely adjusts the determination parameters. Figure 6 An example of the processing of the setting unit 166 in the semi-automatic mode will be described.

[0209] In the semi-automatic mode, first, the setting unit 166 temporarily sets the judgment parameters and outputs them to the judgment unit 162 (S101). Specifically, the setting unit 166 may also temporarily set the judgment conditions based on the characteristics of the defects contained in the learning image contained in the learning data set used in the learning of the CNN engine 156. Moreover, the setting unit 166 may also temporarily set the judgment conditions based on the internal parameters obtained by the CNN engine 156. Here, the learning image contains defects of various forms. Therefore, when the characteristics of the shapes of these defects, such as the area, length, circumference, and circularity of the defects, are clear, the judgment items and judgment thresholds are set based on the shapes of the defects contained in the learning images. Accordingly, the judgment conditions corresponding to the distribution of the shapes of the defects in the learning images contained in the learning data set can be set, and defects with the same shape as the defects contained in the learning data set can be detected. Moreover, the internal parameters of the CNN engine 156 obtained using the learning data set are obtained by detecting various forms of defects contained in the learning image. Therefore, by setting the judgment items and judgment thresholds based on the internal parameters of the CNN engine 156, it is possible to set judgment conditions that can detect defects with the same shape as the defects contained in the learning data. In this way, for example, the setting unit 166 temporarily sets the feature quantity corresponding to the learning image or the internal parameter as the judgment threshold. At this time, the setting unit 166 preferably temporarily sets the judgment parameters in consideration of the pre-processing filter set by the pre-processing unit 154. For example, in the case where the input image is enlarged or reduced by the pre-processing filter, the judgment threshold for the judgment items such as the area of ​​the first feature area is preferably temporarily set in a manner that is enlarged compared to the internal parameters learned in advance in consideration of the enlargement and reduction ratio of the pre-processing filter.

[0210] In addition, regarding the binarization level and the judgment item, the following structure may be adopted, that is, the user's designation is accepted in advance. This can speed up the temporary setting process of the judgment parameter. In this case, in the process of S101, the setting unit 166 temporarily sets the judgment threshold as the judgment parameter based on the internal parameter according to the judgment item designated by the user.

[0211] When the determination parameters temporarily set by the determination unit 162 are output to the determination unit 162 (S102), the determination unit 162 extracts the area that matches the temporarily set determination parameters from the first feature area extracted from the binary image as the area to be detected as a defect (hereinafter also referred to as the second feature area). In addition, the setting image (refer to FIG. 103 ) in which the second feature area is highlighted in the binary image is output. Fig. 10BThe setting unit 166 presents the output setting image to the user, and accepts the selection of the second feature area (hereinafter also referred to as the "third feature area") to be excluded (i.e., not detected as a defect) from the highlighted second feature area (S103). In addition, the determination unit 162 may also be configured as follows: the measurement result image is presented to the user as a setting image, and the selection of the third feature area from the area detected as a defect in the measurement result image is accepted.

[0212] Furthermore, the setting unit 166 resets the determination condition so that the third feature region is not detected as a defect. Specifically, the setting unit 166 resets the determination threshold so that the feature amount of the third feature region is not included in the range of the determination condition (S104). Figure 7 As shown in FIG. 1 , the determination threshold is reset (updated) based on the difference in the image score determined based on the difference in the color density of the pixels inside and outside the area to be detected as a defect. At this time, the setting unit 166 may select a determination item different from the determination item included in the temporarily set determination parameter and set the determination threshold.

[0213] Thus, in the semi-automatic mode, appropriate determination parameters can be set by adjusting the determination parameters temporarily set in advance. Thus, appropriate determination parameters can be easily set so that defects can be detected with high accuracy.

[0214] (3) Fully automatic mode

[0215] In the fully automatic mode, the setting unit 166 receives the user's designation of an area of ​​the input image to be detected as a defect (hereinafter also referred to as a "defect area"), and automatically sets the determination parameters based on the designated defect area. Figures 7 to 9 , an example of the processing of the setting unit 166 in the full automatic mode is described.

[0216] Figure 7 This is an example of a processing flow of the setting unit 166 when automatically setting the determination parameters based on one input image.

[0217] First, the setting unit 166 receives the user's specification of a defect area in an input image ( S201 ). Figure 8 FIG. 1 is a diagram showing an example of a determined defect area. Figure 8 In FIG. 1 , the rectangle GT corresponds to the defect region. In addition, the defect region is not limited to a rectangle, and may be any shape having an area.

[0218] return Figure 7 , continue to explain the process.

[0219] When the defect area is specified, the CNN engine 156 generates a feature extraction image. At this time, the setting unit 166 performs initial setting of the determination parameters (S202). The initial setting of the determination parameters is, for example, the initialization of the binarization level, the selection of the determination item, and the initialization of the determination threshold corresponding to the selected determination item. The setting unit 166 can also temporarily set the determination parameters including the binarization level and the determination condition based on the characteristics of the defects contained in the learning image contained in the learning data set used in the learning of the CNN engine 156. Moreover, the setting unit 166 can also temporarily set the determination parameters including the binarization level and the determination condition based on the internal parameters obtained by the CNN engine 156. In addition, the binarization level and the determination item can also be the following structure, that is, accepting the user's designation in advance. This can speed up the setting process of the determination parameters. The determination unit 162 generates a binarization image based on the binarization level contained in the initially set determination parameters. In addition, the determination unit 162 generates a measurement result image based on the determination items and the determination threshold contained in the initially set determination parameters.

[0220] The setting unit 166 obtains the generated measurement result image (S203) and calculates a score (image score) (S204). Specifically, the setting unit 166 calculates the difference between the color concentration of the pixels in the defect area and the color concentration of the pixels outside the defect area in the measurement result image as a score. Here, the color concentration of the pixel may refer to the ratio of the pixels corresponding to the features including the defect (hereinafter referred to as feature pixels) in the defect area or outside the defect area (hereinafter referred to as each object area). The ratio of feature pixels in each object area may be the number (number, area, etc.) of feature pixels contained in this object area, or the ratio of the total number of feature pixels in this object area to the total number of pixels that do not correspond to the features (hereinafter referred to as non-feature pixels), or the ratio of feature pixels or non-feature pixels in this object area to the number of all pixels.

[0221] In a binary image, when white pixels correspond to feature areas, black pixels correspond to non-feature areas. In this case, the color concentration of the pixels in the defect area is the number of white pixels in the defect area, and the color concentration of the pixels outside the defect area is the number of white pixels outside the defect area. The difference between the two concentrations can be calculated as a score.

[0222] When a density value corresponding to the color of each pixel is preset (for example, 1 for white and 0 for black), the total value of the density values ​​of the pixels in each target area may be calculated as the first image score.

[0223] As described above, the measurement result image is an image in which the second feature image is extracted from the first feature area contained in the binary image. Therefore, when the second feature area is properly extracted in the defect area (that is, when there is no missed detection of the defect), the concentration in the defect area becomes larger. On the other hand, when the second feature area is not extracted outside the defect area (that is, when there is no over-detection), the concentration outside the defect area becomes smaller. That is, when the judgment parameter is set most appropriately, the difference (score) between the concentration in the defect area and the concentration outside the defect area becomes the maximum. Thus, the setting unit 166 can explore the appropriate judgment parameter by calculating the score and comparing it.

[0224] Therefore, the setting unit 166 changes the judgment parameter (S215) and repeatedly executes the processing of S203 and S204 until the end condition (S205) is satisfied. The end condition is, for example, when the scores are calculated for all possible judgment thresholds or when the scores converge to a certain value. In addition, the end condition can also be set to the elapsed time from the start of this processing flow, or the threshold value of the number of trials of the processing of S203 and S204.

[0225] For example, the setting unit 166 may fix the binarization level and the judgment item, and change the judgment threshold in various ways, and repeat the processing of S203 and S204, and then set the next judgment item, and change the judgment threshold in various ways, and repeat the processing of S203 and S204. Alternatively, the binarization level, judgment item, and judgment threshold may all be changed each time the processing of S203 and S204 is repeated.

[0226] When it is determined that the termination condition is satisfied (S205: YES), the setting unit 166 selects a determination parameter that maximizes the score and updates the determination parameter to the selected determination parameter (S206). In addition, it is not necessary to select a determination parameter that maximizes the score from all possible determination parameters. For example, the maximum score t and the determination parameter corresponding to the score may be selected from the scores calculated within a specified elapsed time or a specified number of trials. That is, it is sufficient to select a determination parameter that can obtain a relatively large score compared to the determination parameter set at the beginning of this processing flow. Here, when the determination item of the determination parameter when the score becomes maximum is the area, the width and / or height of the circumscribed rectangle, the perimeter, the aspect ratio, and the circularity, it is preferred to use the determination threshold when the score becomes maximum as the lower limit value. Moreover, when the determination item of the determination parameter when the score becomes maximum is the circularity, it is preferred to use the determination threshold when the score becomes maximum as the upper limit value. Moreover, when multiple defect areas are identified in an image, and a judgment threshold is calculated for each defect area in a manner that maximizes the difference in image scores between the inside and outside of the area, the maximum and minimum values ​​among the calculated multiple judgment thresholds can be used as the upper limit or lower limit of the judgment threshold depending on the type of judgment item.

[0227] Fig. 9 This is an example of the processing flow of the setting unit 166 when automatically setting the determination parameters based on a plurality of input images. Fig. 9 , for processing with multiple input images, with Figure 7 The explanation will focus on the differences.

[0228] In this case, the setting unit 166 receives the designation of a defect area for all of the plurality of input images in S201.

[0229] Then, in S203, the setting unit 166 obtains the measurement result images of each of the plurality of input images from the determination unit 162. Then, for each measurement result image, the difference between the density in the defect area and the density outside the defect area is calculated, and the total value of the differences calculated for each input image is calculated as a score (S304). Figure 7 The process is the same as in the previous example. By using multiple input images to set the judgment parameters, the accuracy of defect detection can be further improved.

[0230] In this way, in the fully automatic mode, the user only needs to specify the area to be detected as a defect, and appropriate determination parameters can be automatically set.

[0231] <4. User interface screen example>

[0232] Secondly, refer to FIG. 10A to FIG. 10DSeveral examples of the user interface screen output to the display unit provided by the defect inspection device 100 of the present embodiment will be described.

[0233] Fig. 10A 1 is a schematic diagram showing an example of a manual setting screen 700 provided by the defect inspection device 100 when setting the determination parameters. The manual setting screen 700 includes a binarization level setting unit 710, a determination condition setting unit 720, and a measurement result image display unit 730. The manual setting screen 700 is mainly used in the manual mode.

[0234] The binarization level setting unit 710 includes a binarization level controller 711 and a binarization level display column 712. The user can set the threshold and upper limit of the binarization level from the binarization level controller 711. The set binarization level is displayed in the binarization level display column 712.

[0235] The determination condition setting section 720 includes a determination item selection column 721 and a determination threshold setting column 722. The user can select a determination item to be designated as a determination condition from the determination item selection column 721, for example, by using a pull-down box. Fig. 10A In the example of , the settable determination items are three types, but the present invention is not limited thereto, and the manual setting screen 700 may also have an interface for setting any number of determination items. Furthermore, the user may set the determination condition by setting the upper limit and lower limit of the determination threshold in the determination threshold setting column 722 of the corresponding determination item.

[0236] Then, the measurement result image generated by the determination unit 162 based on the set determination parameters is displayed on the measurement result image display unit 730 .

[0237] Fig. 10B and Fig. 10C 1 is a schematic diagram showing an example of a semi-automatic setting screen 800 provided by the defect inspection device 100 when setting the judgment parameters. The semi-automatic setting screen 800 includes a third feature area selection unit 830, the binarization level setting unit 710, and a judgment condition setting unit 720. The semi-automatic setting screen 800 is mainly used in the semi-automatic mode. In addition, the semi-automatic setting screen 800 can also be used in the defect area determination operation in the full automatic mode when the defect area for the inspection image is determined in advance.

[0238] The functions of the binarization level setting unit 710 and the determination condition setting unit 720 are as described above, and the temporarily set determination parameters are preset and displayed on the semi-automatic setting screen 800 .

[0239] The third feature region selection unit 830 displays a setting image generated by the determination unit 162 based on the temporarily set determination parameters. In this setting image, the second feature region is surrounded by frames 831 to 833 to be highlighted ( Fig. 10B ). The user can select a region designated as the third feature region from the highlighted second feature regions. Fig. 10C Shows the Fig. 10B An example of a screen display when the second feature area surrounded by the frame 833 is selected as the third feature area. When the third feature area is selected, the judgment parameters are updated, and the judgment parameters displayed in the binarization level setting unit 710 or the judgment condition setting unit 720 are changed. Fig. 10C In the example, the lower limit value of the aspect ratio, which is the determination item, is increased from 0 ( Fig. 10B ) changes to 0.8( Fig. 10C ). In addition, at this time, not only the determination threshold or the binarization level, but also the determination item selected in the determination condition setting unit 720 may be changed.

[0240] Fig. 10D 1 is a schematic diagram showing an example of an automatic setting screen 900 provided by the defect inspection device 100 of the present embodiment. Fig. 10D In the example of , the automatic setting screen 900 has a pattern registration area 901 , a coordinate input area 902 , and a display area 903 .

[0241] The pattern registration area 901 includes a pattern button 911. The user can select a pattern for determining a defective area by selecting a button of a desired shape from the pattern buttons 911. Fig. 10D In the example of , a square or rectangle, circle, pentagon, arc, or concentric circle is displayed as the graphic button 911, but it is not limited to this, and any graphic can be set. Moreover, the method of selecting a graphic is not limited to a button, and it can also be a pull-down box, a check box, a radio button, etc.

[0242] The coordinate input area 902 accepts input of the coordinates of the defective area. Fig. 10D In the example of FIG. 9 , the user can specify the defect region GT by inputting the upper left and upper right coordinates of the defect region in the coordinate input area 902 . The defect region GT specified by the user is displayed in the display area 903 .

[0243] In addition, the method of specifying the defect area is not limited to Fig. 10D For example, a structure in which a defective area is input by directly drawing the image displayed in the display area 903 may be adopted.

[0244] §3 Action Examples

[0245] Next, an example of the operation in the defect inspection system 1 of the present embodiment is described. In the defect inspection system 1 of the present embodiment, there are: a preparation process for setting the judgment parameters related to the image measurement process; and an application process for actually photographing the object workpiece and performing the image measurement process. In addition, the processing sequence of the preparation process and the processing sequence of the application process can be selected by the user using the aforementioned input unit. Moreover, in the processing sequence of the application process, the following processing can also be performed, namely: updating the set pre-processing filter according to the content of the inspection result (for example, the presence or absence of defects, the size of the area corresponding to the defect, the position of this area, and other information). For example, in the processing sequence of the application process, when undetected defects occur a specified number of times, the aforementioned judgment parameters are updated using an arbitrary setting mode.

[0246] Fig.11 This is a flowchart showing the processing flow of the preparation step in the defect inspection system 1 of the present embodiment. Fig.12 1 is a flowchart showing the processing flow of the operation process in the defect inspection system 1 of this embodiment. Typically, Fig.11 and Fig.12 Each step of the processing flow shown is implemented by the processor 110 of the defect inspection device 100 executing the image processing program 132 or the like.

[0247] Reference Fig.11 In the preparation process, the defect inspection device 100 acquires an input image obtained by photographing the workpiece, which will be the reference of the image measurement process, using the camera 102 (step S401). At this time, the input image (image data) generated by photographing the workpiece by the camera 102 is forwarded to the defect inspection device 100 and expanded in the main memory 112 of the defect inspection device 100.

[0248] Next, the defect inspection apparatus 100 receives selection of a setting mode (S402). When the setting mode is the manual mode (CASE: manual mode), the defect inspection apparatus 100 displays the manual setting screen 700 and receives setting of determination parameters by the user (S411).

[0249] When the setting mode is the semi-automatic mode (CASE: semi-automatic mode), the defect inspection device 100 first temporarily sets the determination parameters (S421). Next, the setting image is generated using the temporarily set determination parameters, and the user's determination of the third feature area for the second feature area displayed in the setting image is accepted (S422). Based on the determined third feature area, the defect inspection device 100 updates the determination parameters (S423).

[0250] When the setting mode is the fully automatic mode (CASE: fully automatic mode), the defect inspection apparatus 100 displays the automatic setting screen 900 and accepts the user's determination of the defect area (S431). Based on the determined defect area, the defect inspection apparatus 100 sets the determination parameters (S432).

[0251] Then, the defect inspection apparatus 100 stores the set determination parameters (S403), and then ends the processing in the preparation step.

[0252] Reference Fig.12 In the operation process, the defect inspection device 100 acquires an input image obtained by photographing the workpiece using the camera 102 when the workpiece serving as the reference for image measurement processing reaches the photographing field of view 6 of the camera 102 (S501). At this time, the input image (image data) generated by photographing the workpiece by the camera 102 is forwarded to the defect inspection device 100 and expanded in the main memory 112 of the defect inspection device 100.

[0253] Next, the defect inspection apparatus 100 performs pre-processing on the acquired input image (S502). Furthermore, the defect inspection apparatus 100 performs a process of extracting features for each of one or more feature types (categories) from the pre-processed input image using the previously learned CNN. The defect inspection apparatus 100 generates a feature extraction image for each of the one or more categories through the feature extraction process (S503).

[0254] Next, the defect inspection apparatus 100 performs post-processing to generate a measurement result image ( S504 ).

[0255] Finally, the defect inspection device 100 outputs the generated measurement result image (S505). The output target of the measurement result image may be a display 104 or the like, or a PLC 10 and / or a database device 12 connected via a host network 8. Then, the processing of the application process ends. In addition, the defect inspection device 100 may also output an inspection result instead of the measurement result image, or together with the measurement result image, wherein the inspection result at least includes information on whether the inspection object contains defects. The inspection result is, for example, delivered to a prescribed action machine for classifying the inspection object in the production line. Accordingly, the action machine can perform automatic classification of the inspection object corresponding to the inspection result.

[0256] In addition, start Fig.12 The condition of the processing flow of the illustrated operation process may be any one of a trigger signal from a timing sensor that detects the arrival of a workpiece, an execution start command from a host device, and an instruction from a user.

[0257] Secondly, while referring to Fig.13 , while explaining the switching of the setting mode of the judgment parameter. Fig.13 This is a flowchart showing an example of the flow of the switching process of the setting mode of the determination parameter according to the present embodiment.

[0258] In step S601, the defect inspection apparatus 100 determines whether to determine the area corresponding to the defect based on the features learned in advance. Examples of the features learned in advance include features (e.g., shape, size, number, etc.) of defects (e.g., "white dots", "black dots", "white lines", or "black lines", etc.).

[0259] In step S602, the defect inspection device 100 determines whether the number of image data for learning corresponding to the feature for determining the area corresponding to the defect is greater than a threshold value. The threshold value is set to, for example, a value that serves as a reference for determining whether the CNN engine 156 has sufficiently learned the feature for determining the area corresponding to the defect.

[0260] In step S603, the setting unit 166 sets the determination parameters in the fully automatic mode. In the fully automatic mode, the setting unit 166 automatically sets the determination parameters.

[0261] In step S604, the setting unit 166 sets the determination parameters in the semi-automatic mode. In the semi-automatic mode, the setting unit 166 temporarily sets the determination parameters on the premise of subsequent adjustment by the user.

[0262] In step S605 , the defect inspection apparatus 100 determines whether the missed detection rate or the over-detection rate of defect detection based on the determination parameters set in step S603 or step S604 exceeds respective predetermined threshold values.

[0263] In step S606, the setting unit 166 sets the determination parameters in the manual mode. In the manual mode, the setting unit 166 sets the determination parameters according to the designation from the user.

[0264] Secondly, while referring to Fig.14 and Fig.15 , while explaining an example of determining a region corresponding to a defect based on features other than features learned in advance. Fig.14 The features of the defect 1000 having a rectangular shape are shown, and the CNN engine 156 has previously learned the range of the shape, length L, width T, area A, and perimeter R of the defect 1000. Therefore, the CNN engine 156 can extract features having the same features (e.g., shape, length, width, area, and perimeter) as the features of the defect 1000 that have been learned from the inspection image. In contrast, for example, Fig.15 As shown, when the CNN engine 156 has not previously learned the features (e.g., shape, size, number, etc.) of the holes 1100 formed on the defect 1000, it is impossible to determine the region corresponding to the defect based on the presence or number of the holes 1100. Thus, when determining the region corresponding to the defect based on features other than the features learned in advance, it is desirable that the setting unit 166 sets the determination parameters in the manual mode according to the designation from the user.

[0265] <H. Advantages>

[0266] The defect inspection device 100 of this embodiment can appropriately and simply set the determination parameters for determining the presence or absence of defects when inspecting the presence or absence of defects using the results output by the previously learned identifier. In such a defect inspection device 100, since the determination parameters can be appropriately set, false determinations are reduced. In particular, since noise can be reduced, false detections of non-defective objects that are identified as defects are reduced. Furthermore, since the determination parameters can be easily set, the setting man-hours and startup man-hours of the defect inspection device can be reduced.

[0267] Furthermore, the defect inspection device 100 of the present embodiment is used to facilitate the setting of the determination parameters for segmenting the noise contained in the feature extraction image output by the CNN engine having multiple categories learned in advance and the defects to be extracted. Specifically, the defect inspection device 100 of the present embodiment has at least a function (semi-automatic mode) for the user to adjust the preset threshold. Thus, the user only needs to adjust the threshold when the preset threshold is inappropriate, thereby reducing the load of setting the determination parameters.

[0268] Furthermore, the defect inspection device 100 of the present embodiment has a manual mode and a fully automatic mode as modes for setting the determination parameters in addition to the semi-automatic mode. For example, by using the fully automatic mode for setting the determination parameters, the operator can appropriately set the determination parameters by only specifying the defect area. In this way, since the defect inspection device of the present embodiment has a plurality of setting modes, an appropriate setting mode can be selected according to the proficiency of the operator.

[0269] Above, the embodiments of the present invention are described in detail, but the description so far is only an illustration of the present invention in all aspects. Of course, various improvements or modifications can be made without exceeding the scope of the present invention. In addition, part or all of the embodiments may also be recorded as the following notes, but are not limited to the following.

[0270] (Note 1)

[0271] A defect inspection device 100, comprising:

[0272] An acquisition unit 114 acquires an inspection image of the inspection object;

[0273] The image generating unit 156 generates one or more feature extraction images by applying a learned classifier that has been previously learned to extract one or more features using the learning image data to the inspection image;

[0274] The inspection unit 170 determines a region corresponding to a defect based on one or more determination parameters for determining whether a detection target portion exists in the inspection target object and a binary image generated using the feature extraction image; and

[0275] The setting unit 166, when determining the area corresponding to the defect based on features that have been learned in advance, temporarily sets the judgment parameters based on subsequent adjustments from the user when the number of learning image data corresponding to the features is less than a threshold value, and when determining the area corresponding to the defect based on features other than features that have been learned in advance, sets the judgment parameters based on specifications from the user.

[0276] (Note 2)

[0277] The defect inspection apparatus 100 according to supplementary note 1, wherein:

[0278] When a region corresponding to a defect is specified based on a feature learned in advance, the setting unit 166 automatically sets a determination parameter when the number of learning image data corresponding to the feature is equal to or larger than a threshold value.

[0279] (Note 3)

[0280] The defect inspection apparatus 100 according to Supplementary Note 1 or 2, wherein:

[0281] The setting unit 166 uses a binary image, i.e., a setting image, which determines the area corresponding to the defect, to calculate an image score based on the color concentration of the pixels of the setting image, and updates the judgment parameters in a manner that makes the difference between the image score inside the area and the image score outside the area relatively larger.

[0282] (Note 4)

[0283] The defect inspection apparatus 100 according to supplementary note 3, wherein:

[0284] The binary image includes white pixels and black pixels.

[0285] The white pixels and the black pixels have corresponding concentration values, respectively.

[0286] The setting unit 166 calculates the total value of the color concentration values ​​for the multiple pixels contained in the area as the first image score, calculates the total value of the color concentration values ​​for the multiple pixels contained outside the area as the second image score, and updates the judgment parameters in a manner that maximizes the difference between the first image score and the second image score.

[0287] (Note 5)

[0288] The defect inspection apparatus 100 according to Note 3 or 4, wherein:

[0289] The inspection unit 170 determines the presence or absence of a defect based on the updated determination parameter and the binarized image, and outputs a determination result.

[0290] (Note 6)

[0291] The defect inspection apparatus 100 according to supplementary note 5, wherein:

[0292] The inspection unit 170 outputs at least the binary image in which a defect is identified based on the updated determination parameter as the determination result.

[0293] (Note 7)

[0294] The defect inspection device 100 according to any one of Supplementary Notes 1 to 6, wherein:

[0295] The determination parameters include a binarization level used to generate the binarized image.

[0296] (Note 8)

[0297] The defect inspection device 100 according to any one of Notes 1 to 7, wherein:

[0298] The determination parameters include one or more determination items for determining the defect and a determination threshold value set for each of the determination items.

[0299] (Note 9)

[0300] The defect inspection apparatus 100 according to supplementary note 8, wherein:

[0301] One or more determination items for determining the defect include at least one of the area of ​​a specified region represented by a pixel block of the same color in the binary image, the width and / or height of a circumscribed rectangle, the perimeter, the aspect ratio, and the circularity, and the determination threshold includes an upper limit value and / or a lower limit value set for each of these determination items.

[0302] (Note 10)

[0303] The defect inspection apparatus 100 according to Supplementary Note 8 or 9, wherein:

[0304] The determination item and the determination threshold are determined based on the characteristics of defects included in the learning image data used in the learning of the image generating unit or the inspecting unit.

[0305] (Note 11)

[0306] The defect inspection device 100 according to any one of Supplementary Notes 1 to 10, further comprising a display unit 104,

[0307] The display unit 104 receives the designation of the area.

[0308] The inspection unit 170 determines a region to be determined as a defect based on the predetermined determination parameter, and outputs the determined region together with the inspection image to the display unit 104.

[0309] The setting unit 166 generates the setting image based on the designation of the area accepted via the display unit.

[0310] (Note 12)

[0311] The defect inspection device 100 according to any one of Notes 1 to 11, wherein:

[0312] The inspection unit 170

[0313] In the binary image, based on a determination threshold value set for each of one or more feature quantities for determining a defect, an area in the binary image to be determined as a defect is determined, and the determined area is presented to a user,

[0314] The setting unit 166

[0315] The device receives a designation from the user of an area determined as a defect by the inspection unit 170 but should not be determined as a defect and / or an area not determined as a defect by the inspection unit but should be determined as a defect, and updates the determination threshold based on the designation.

[0316] (Note 13)

[0317] The defect inspection apparatus 100 according to Supplementary Note 12, wherein the determination parameter includes one or more determination items for determining the defect and a determination threshold value set for each of the determination items,

[0318] One or more determination items and the determination threshold for determining the defect are determined based on the user's designation.

[0319] (Note 14)

[0320] A defect inspection method is provided, wherein a computer 100 executes the following steps:

[0321] A step of acquiring an inspection image of an inspection object;

[0322] A step of generating one or more feature extraction images by applying a learned identifier that has been previously learned to extract one or more features using learning image data to the inspection image;

[0323] A step of determining a region corresponding to a defect based on one or more determination parameters for determining whether or not a detection target portion is present in the inspection target object and a binary image generated using the feature extraction image; and

[0324] In the case of determining the area corresponding to the defect based on features that have been learned in advance, when the number of learning image data corresponding to the features is less than a threshold value, the judgment parameters are temporarily set based on subsequent adjustments from the user, and in the case of determining the area corresponding to the defect based on features other than the features that have been learned in advance, the judgment parameters are set according to the designation from the user.

[0325] (Note 15)

[0326] A program that causes the computer 100 to execute the following steps:

[0327] A step of acquiring an inspection image of an inspection object;

[0328] A step of generating one or more feature extraction images by applying a learned identifier that has been previously learned to extract one or more features using learning image data to the inspection image;

[0329] A step of determining a region corresponding to a defect based on one or more determination parameters for determining whether or not a detection target portion is present in the inspection target object and a binary image generated using the feature extraction image; and

[0330] In the case of determining the area corresponding to the defect based on features that have been learned in advance, when the number of learning image data corresponding to the features is less than a threshold value, the judgment parameters are temporarily set based on subsequent adjustments from the user, and in the case of determining the area corresponding to the defect based on features other than the features that have been learned in advance, the judgment parameters are set according to the designation from the user.

Claims

1. A defect inspection device, comprising: an acquisition unit that acquires an inspection image of an inspection object; an image generating unit that generates one or more feature-extracted images by applying a learned classifier that has been previously learned to extract one or more features using learning image data to the inspection image; An inspection unit that determines a region corresponding to a defect based on one or more determination parameters for determining whether or not the inspection object has a defect and a binary image generated using the feature extraction image; as well as a setting unit that, when determining an area corresponding to a defect based on the feature learned in advance, sets the determination parameter in a semi-automatic mode when the number of learning image data corresponding to the feature is less than a threshold value, Wherein, in the semi-automatic mode, The setting unit temporarily sets the determination parameter based on a post-adjustment by a user, and outputs the determination parameter to the inspection unit; The inspection unit extracts a region corresponding to a defect that matches the temporarily set determination parameter from a first feature region of a pixel block connected by the same color extracted from the binary image as a second feature region, thereby generating a setting image; The setting unit displays the setting image on a user interface screen, accepts selection of a third feature area in the setting image through the user interface screen, and resets the determination parameter based on the third feature area.

2. The defect inspection device according to claim 1, wherein: The setting unit uses the binary image, i.e., the setting image, which determines the area corresponding to the defect, to calculate an image score based on the color concentration of the pixels of the setting image, and updates the judgment parameter in a manner that makes the difference between the image score inside the area and the image score outside the area relatively larger.

3. The defect inspection device according to claim 2, wherein: The binary image includes white pixels and black pixels. The white pixels and the black pixels have corresponding concentration values, respectively. The setting unit calculates the total value of the concentration values ​​as the first image score for the multiple pixels contained in the area, calculates the total value of the concentration values ​​as the second image score for the multiple pixels contained outside the area, and updates the judgment parameters in a manner that maximizes the difference between the first image score and the second image score.

4. The defect inspection device according to claim 2, wherein: The inspection unit determines the presence or absence of a defect based on the updated determination parameter and the binarized image, and outputs a determination result.

5. The defect inspection device according to claim 4, wherein: The inspection unit outputs at least the binarized image in which a defect is specified based on the updated determination parameter as the determination result.

6. The defect inspection device according to claim 1, wherein: The determination parameters include a binarization level used to generate the binarized image.

7. The defect inspection device according to claim 1, wherein: The determination parameters include one or more determination items for determining the defect and a determination threshold value set for each of the determination items.

8. The defect inspection device according to claim 7, wherein: The one or more determination items for determining the defect include at least one of the area of ​​a specified region represented by a pixel block of the same color in the binary image, the width and / or height of a circumscribed rectangle, the perimeter, the aspect ratio, and the circularity, and the determination threshold includes an upper limit value and / or a lower limit value set for each of these determination items.

9. The defect inspection device according to claim 7, wherein: The determination item and the determination threshold are determined based on the characteristics of defects included in the learning image data used in the learning of the image generating unit or the inspecting unit.

10. The defect inspection device according to claim 2, further comprising a display unit, The display unit receives the designation of the area, The inspection unit determines a region to be determined as a defect based on the predetermined determination parameter, and outputs the determined region together with the inspection image to the display unit, The setting unit generates the setting image based on the designation of the area accepted via the display unit.

11. The defect inspection device according to claim 1, wherein: The inspection department In the binary image, based on a determination threshold value set for each of one or more feature quantities for determining a defect, an area in the binary image to be determined as a defect is determined, and the determined area is presented to a user, The setting part The device receives a designation from the user of an area determined as a defect by the inspection unit but should not be determined as a defect and / or an area not determined as a defect by the inspection unit but should be determined as a defect, and updates the determination threshold based on the designation.

12. The defect inspection device according to claim 11, wherein: The determination parameters include one or more determination items for determining the defect and a determination threshold value set for each of the determination items. The one or more determination items and the determination threshold for determining the defect are determined based on the designation of the user.

13. The defect inspection device according to claim 1, wherein when the area corresponding to the defect is determined based on the feature learned in advance, when the number of learning image data corresponding to the feature is greater than a threshold value, the setting unit sets the determination parameter in a fully automatic mode, in, In the fully automatic mode, The setting unit accepts the user's determination of the defect area of ​​the inspection image and performs initial setting of the determination parameters; The inspection unit generates a measurement result image based on the initially set determination parameters; The setting unit calculates an image score based on the measurement result image, and changes the determination parameter based on the image score.

14. A defect inspection method, wherein a computer executes the following steps: A step of acquiring an inspection image of an inspection object; A step of generating one or more feature extraction images by applying a learned identifier that has been previously learned to extract one or more features using learning image data to the inspection image; A step of determining a region corresponding to a defect based on one or more determination parameters for determining whether or not a detection target portion is present in the inspection target object and a binary image generated using the feature extraction image; as well as In the case of determining an area corresponding to a defect based on the feature learned in advance, when the number of learning image data corresponding to the feature is less than a threshold value, the step of setting the determination parameter in a semi-automatic mode, in, The step of setting the determination parameters in the semi-automatic mode includes: The determination parameters are temporarily set based on subsequent adjustments by the user; Extracting a region corresponding to a defect that matches the temporarily set judgment parameter from a first feature region of a pixel block connected by the same color in the binary image as a second feature region, thereby generating a setting image; The setting image is displayed on a user interface screen, and a selection of a third feature area in the setting image is accepted through the user interface screen, and the determination parameter is reset based on the third feature area.

15. A storage medium storing a program for causing a computer to execute the following steps: A step of acquiring an inspection image of an inspection object; A step of generating one or more feature extraction images by applying a learned identifier that has been previously learned to extract one or more features using learning image data to the inspection image; A step of determining a region corresponding to a defect based on one or more determination parameters for determining whether or not a detection target portion is present in the inspection target object and a binary image generated using the feature extraction image; as well as In the case of determining an area corresponding to a defect based on the feature learned in advance, when the number of learning image data corresponding to the feature is less than a threshold value, the step of setting the determination parameter in a semi-automatic mode, in, The step of setting the determination parameters in the semi-automatic mode includes: The determination parameters are temporarily set based on subsequent adjustments by the user; Extracting a region corresponding to a defect that matches the temporarily set judgment parameter from a first feature region of a pixel block connected by the same color in the binary image as a second feature region, thereby generating a setting image; The setting image is displayed on a user interface screen, and a selection of a third feature area in the setting image is accepted through the user interface screen, and the determination parameter is reset based on the third feature area.

Citation Information

Patent Citations

  • Discriminator generator, quality determine method, and program

    JP2017049974A

  • Image quality inspection device

    JP2005127878A

  • Method for optimizing observed image classification criterion and image classification apparatus

    US20130077850A1