Defect inspection device, program, and defect inspection method
The defect inspection device and method enhance accuracy by calculating and setting thresholds based on defective area sizes in product images, reducing misidentification and enabling operator verification for improved defect detection.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- RESONAC CORP
- Filing Date
- 2025-12-09
- Publication Date
- 2026-06-18
AI Technical Summary
The accuracy of defect inspection using semantic segmentation in product images is affected by the setting of the threshold value, which existing technologies have not adequately addressed.
A defect inspection device and method that utilize a threshold setting unit to calculate the size of defective areas in images using a learned machine learning model, setting a threshold based on this size, and determine defectiveness through comparison, with additional units for defect location calculation and operator confirmation.
Improves the accuracy of defect inspection by reducing misidentification of non-defective products and allowing operator verification, enhancing the reliability of defect detection.
Smart Images

Figure JP2025042962_18062026_PF_FP_ABST
Abstract
Description
Defect inspection device, program, and defect inspection method
[0001] The present disclosure relates to a defect inspection device, a program, and a defect inspection method.
[0002] In recent years, with the improvement of image recognition technology using machine learning, defect inspection of products using product images has come to be performed. In defect inspection of products using product images, a technique for determining whether a product in an image is defective using semantic segmentation has been conventionally known (see, for example, Patent Document 1).
[0003] Specification of Chinese Patent Application Publication No. 116664846
[0004] In defect inspection of products using semantic segmentation, the accuracy of defect inspection of products may deteriorate depending on the setting of a threshold value for determining whether a product is defective. In defect inspection of products using semantic segmentation, a technique for setting a threshold value so as to improve the accuracy of defect inspection of products has been desired. Note that Patent Document 1 does not describe such problems.
[0005] An object of the present disclosure is to provide a defect inspection device, a program, and a defect inspection method for improving the accuracy of defect inspection using semantic segmentation.
[0006] The present disclosure has the following configuration.
[0007] [1] A threshold setting unit that calculates the size of a defective portion in an image of verification data using a learned machine learning model for defective portions in an image of learning data by semantic segmentation, and sets a threshold value based on the size of the defective portion; A defective portion calculation unit that calculates the size of a defective portion in an image of inspection data using the learned machine learning model; A determination unit that determines an image of the inspection data of a defective product based on a comparison result between the size of the defective portion in the image of the inspection data and the threshold value; An output unit that outputs the result of the determination; A defect inspection device having.
[0008] [2] The defect inspection apparatus according to [1], wherein the threshold setting unit calculates the size of the defective area in the image for each image of the verification data of the defective product, and sets the minimum value of the sizes of the defective areas for each image of the verification data of the defective product as the threshold.
[0009] [3] The defect inspection apparatus according to [1] or [2], wherein the output unit draws the defective parts in the image of the inspection data of the determined defective product.
[0010] [4] A defect inspection apparatus according to any one of [1] to [3], further comprising: a receiving unit that receives from an operator whether the image of the inspection data that the determination unit has determined to be a defective product is a good product or a defective product.
[0011] [5] The defect location calculation unit calculates the size of the defect location in the image of the inspection data from the pixel-level defect locations inferred using the trained machine learning model, according to any one of [1] to [4].
[0012] [6] The defect inspection apparatus according to any one of [1] to [5], wherein the size of the defective area is the area, length, or number of pixels.
[0013] [7] A program that causes an information processing device to function as: a threshold setting unit that calculates the size of defective areas in images of verification data using a machine learning model that has been trained to identify defective areas in images of training data by semantic segmentation, and sets a threshold based on the size of the defective areas; a defective area calculation unit that calculates the size of defective areas in images of inspection data using the trained machine learning model; a determination unit that determines the image of the inspection data of a defective product based on the result of comparing the size of the defective areas in the image of the inspection data with the threshold; and an output unit that outputs the result of the determination.
[0014] [8] A defect inspection method performed by a defect inspection device, comprising: a threshold setting step of calculating the size of defective areas in images of verification data using a machine learning model that has been trained to identify defective areas in images of training data by semantic segmentation, and setting a threshold based on the size of the defective areas; a defect area calculation step of calculating the size of defective areas in images of inspection data using the trained machine learning model; a determination step of determining the image of the inspection data of a defective product based on a comparison result between the size of the defective areas in the image of the inspection data and the threshold; and an output step of outputting the result of the determination.
[0015] According to this disclosure, the accuracy of defect inspection using semantic segmentation can be improved.
[0016] This is a diagram showing the configuration of an example of a defect inspection system according to this embodiment. This is a hardware configuration diagram of an example of a computer according to this embodiment. This is a functional configuration diagram of an example of a defect inspection system according to this embodiment. This is a flowchart showing an example of the processing of a defect inspection device according to this embodiment. This is a flowchart showing an example of the processing in step S10. This is an image diagram of an example of an image of a copper-clad laminate. This is a flowchart showing an example of the processing in step S12. This is a flowchart showing an example of the processing in step S14. This is a flowchart showing an example of the processing in steps S16 and S18. This is an image diagram of an example of a screen that outputs the judgment result.
[0017] Next, embodiments of the present invention will be described in detail. However, the present invention is not limited to the following embodiments.
[0018] [First Embodiment] <System Configuration> Figure 1 is a configuration diagram of an example of a defect inspection system 1 according to this embodiment. The defect inspection system 1 in Figure 1 has a defect inspection device 10 and an operator terminal 12. The defect inspection device 10 and the operator terminal 12 are connected via a communication network 18 such as a local area network (LAN) or the internet to enable data communication.
[0019] The worker terminal 12 is an information processing device such as a PC, tablet, or smartphone operated by the worker. The worker terminal 12 displays a screen and accepts operations from the worker. The worker terminal 12 transmits the content of the operations received from the worker to the defect inspection device 10. The worker terminal 12 displays the results of the processing by the defect inspection device 10 on its screen for the worker to confirm.
[0020] The defect inspection device 10 is an information processing device such as a PC or workstation that performs processing to support defect inspection of products using images of the products, based on the content of the operation received from the operator. The defect inspection device 10 supports defect inspection of products by using a machine learning model that has been trained to identify defective areas in product images using semantic segmentation. The defect inspection device 10 may display the processing results on a display device such as the display of the operator terminal 12 for the operator to confirm, or it may display them on the display device of the defect inspection device 10 for the operator to confirm.
[0021] In the defect inspection system 1 according to this embodiment, the size of the defective area in the product image is calculated using a machine learning model that has been trained to identify defective areas in the product image through semantic segmentation. Based on the comparison result between the calculated size of the defective area and a threshold, the image of the defective product is determined to be defective. For example, in the defect inspection system 1 according to this embodiment, if the calculated size of the defective area exceeds the threshold, the product in the image is determined to be defective. Details of the size of the defective area and the threshold will be described later.
[0022] The defect inspection system 1 shown in Figure 1 is merely an example, and it goes without saying that there are various system configurations depending on the application and purpose. For example, the defect inspection device 10 may be implemented using multiple computers, or it may be implemented as a cloud computing service. Furthermore, the defect inspection system 1 shown in Figure 1 may be implemented using a standalone computer.
[0023] <Hardware Configuration> The defect inspection device 10 and the worker terminal 12 in Figure 1 are implemented by a computer 500 with the hardware configuration shown in Figure 2, for example.
[0024] Figure 2 is a hardware configuration diagram of an example of a computer 500 according to this embodiment. The computer 500 shown in Figure 2 includes an input device 501, a display device 502, an external interface 503, RAM 504, ROM 505, CPU 506, a communication interface 507, and an HDD 508, and each of these is interconnected via bus B. The input device 501 and the display device 502 may also be used by connecting them to the computer 500 via the external interface 503.
[0025] The input device 501 includes a touch panel, operation keys and buttons, a keyboard and mouse, etc., used by the operator to input various signals. The display device 502 consists of a display such as a liquid crystal or organic EL that displays the screen, and a speaker that outputs sound data such as voice and sound.
[0026] The communication interface 507 is an interface for the computer 500 to perform data communication. The HDD 508 is an example of a non-volatile storage device that stores programs and data. The programs and data stored include the OS, which is the basic software that controls the entire computer 500, and applications that provide various functions on the OS. The computer 500 may also use a drive device that uses flash memory as a storage medium (for example, a solid-state drive: SSD, etc.) instead of the HDD 508.
[0027] The external I / F 503 is an interface to an external device. An external device may be a recording medium 503a, etc. This allows the computer 500 to read from and / or write to the recording medium 503a via the external I / F 503. The recording medium 503a may be a flexible disk, CD, DVD, SD memory card, or USB memory, etc.
[0028] ROM 505 is an example of a non-volatile semiconductor memory (storage device) that can retain programs and data even when the power is turned off. ROM 505 stores programs and data such as the BIOS, OS settings, and network settings that are executed when the computer 500 starts up. RAM 504 is an example of a volatile semiconductor memory (storage device) that temporarily holds programs and data.
[0029] The CPU 506 is an arithmetic unit that controls and implements the functions of the entire computer 500 by reading programs and data from storage devices such as ROM 505 and HDD 508 onto RAM 504 and executing processing. In this embodiment, the computer 500 can implement various functions of the defect inspection device 10 and the worker terminal 12 described later by executing a program. The CPU 506 may also read and execute a program from the recording medium 503a where the program is stored via an external I / F 503.
[0030] <Functional Configuration> The configuration of the defect inspection system 1 according to this embodiment will now be described. Figure 3 is a functional configuration diagram of an example of the defect inspection system 1 according to this embodiment. Note that parts of the configuration diagram in Figure 3 that are not necessary for the explanation of this embodiment have been appropriately omitted.
[0031] The defect inspection device 10 of the defect inspection system 1 shown in Figure 3 has the following configuration: request receiving unit 20, response transmission unit 22, data division unit 24, learning unit 26, inference unit 28, threshold setting unit 30, defect location calculation unit 32, judgment unit 34, output unit 36, reception unit 38, data storage unit 40, machine learning model storage unit 42, and inspection data storage unit 44. The operator terminal 12 has the following configuration: information display unit 50, operation reception unit 52, request transmission unit 54, and response receiving unit 56.
[0032] The information display unit 50 of the worker terminal 12 displays a screen on the display device 502 that supports the worker's inspection of product defects. The operation reception unit 52 receives various operations from the worker. The request transmission unit 54 transmits processing requests to the defect inspection device 10 based on the various operations received from the worker. The response reception unit 56 receives responses from the defect inspection device 10 to the processing requests transmitted by the request transmission unit 54.
[0033] The request receiving unit 20 of the defect inspection device 10 receives a processing request from the worker terminal 12 based on the operator's operation. The response transmission unit 22 transmits a response to the processing request received by the request receiving unit 20 to the worker terminal 12.
[0034] The data splitting unit 24 splits the image data of the product to be inspected for defects, which is labeled so that defective areas can be identified pixel by pixel, into training data and verification data. The image data of the product to be inspected for defects, which is labeled so that defective areas can be identified pixel by pixel, is stored in the data storage unit 40. The data storage unit 40 stores the image data of the defective product.
[0035] The learning unit 26 uses semantic segmentation to train a machine learning model to identify defective areas in the training data images. A neural network can be used as the machine learning model for semantic segmentation. Examples of machine learning models for semantic segmentation include DeepLab v3, SegNet, FCN (Fully Convolutional Network), U-NET, or CNN (Convolutional Neural Network). Alternatively, the learning unit 26 may divide the image, perform semantic segmentation, and then merge the segments into a single image.
[0036] The machine learning model storage unit 42 stores the machine learning model that the learning unit 26 is trained on, and the machine learning model that has already been trained by the learning unit 26. The inference unit 28 uses the machine learning model that has already been trained by the learning unit 26 to infer the defective areas in the image on a pixel-by-pixel basis.
[0037] The threshold setting unit 30 uses a machine learning model that has already learned about defective areas to calculate the size of defective areas in the image of the verification data, and sets a threshold based on the size of the defective areas. The size of a defective area in an image is, for example, the area of the defective area or the length of the defective area. The area of the defective area is the number of pixels in the defective area. The length of the defective area is the number of pixels counted after the pixels determined to be defective are thinned to a line with a thickness of 1 pixel.
[0038] The threshold setting unit 30 calculates the size of the defective area in each image of the defective product verification data, and sets the minimum value of the defective area size in each image of the defective product verification data as the threshold. By setting the minimum value as the threshold, the possibility of the judgment unit 34, described later, misidentifying an image of a defective product inspection data as an image of a good product inspection data can be reduced.
[0039] The defect location calculation unit 32 calculates the size of the defective location in the inspection data image using a machine learning model that has already been trained to identify defective locations. The inspection data storage unit 44 stores inspection data for performing defect inspections on the product.
[0040] The determination unit 34 determines the image of a defective product from the inspection data stored in the inspection data storage unit 44, based on the comparison result between the size of the defective area in the inspection data image calculated by the defective area calculation unit 32 and the threshold set by the threshold setting unit 30.
[0041] The output unit 36 outputs the result of the determination made by the determination unit 34. The output from the output unit 36 may be displayed on the display device 502 of the defect inspection device 10, or on the display device 502 of the worker terminal 12.
[0042] The operator can visually confirm the judgment result output by the output unit 36, thereby visually determining whether each image of the inspection data that the judgment unit 34 has determined to be defective is a good product or a defective product. The receiving unit 38 also receives from the operator whether the image of the inspection data that the judgment unit 34 has determined to be defective is a good product or a defective product.
[0043] <Process> Figure 4 is a flowchart of an example of the process of the defect inspection apparatus 10 according to the present embodiment. Hereinafter, an example in which the product to be defect inspected is a copper-clad laminate will be described, but it is not limited to the copper-clad laminate, and it may be a build-up film or prepreg, or a semiconductor package substrate or printed wiring board.
[0044] The copper-clad laminate is also called a CCL (Copper Clad Laminate) and is a material that serves as the base of the substrate used for semiconductor packages. The copper-clad laminate is produced by laminating copper foils on the top and bottom of a resin sheet and heating and pressing them. The resin sheet is produced by impregnating a glass cloth woven with highly insulating glass fibers with resin and heat-processing it into a plate shape.
[0045] In step S10, the defect inspection apparatus 10 uses the image data of the copper-clad laminate stored in the data storage unit 40 to cause a machine learning model to machine-learn defective portions in the image of the copper-clad laminate by semantic segmentation.
[0046] The process of step S10 is performed, for example, according to the procedure of the flowchart shown in FIG. 5. FIG. 5 is a flowchart of an example of the process of step S10.
[0047] In step S30, the data division unit 24 of the defect inspection apparatus 10 divides the image data of the copper-clad laminate as shown in FIG. 6 into learning data and verification data.
[0048] FIG. 6 is an image diagram of an example of the image of the copper-clad laminate. The image data in FIGS. 6(A) and 6(C) are examples of the image of the copper-clad laminate to be determined as defective products. The image data in FIGS. 6(B) and 6(D) are examples of the image of the copper-clad laminate to be determined as non-defective products. In addition, in FIG. 6(A), the outline of the defective portion specified by deep learning is drawn. In FIG. 6(C), a line is drawn at the defective portion visually identified by the operator.
[0049] The image data of the copper-clad laminate shown in Figure 6 is labeled so that defects can be identified pixel by pixel. The training data includes images of copper-clad laminates that should be judged as good products and images of copper-clad laminates that should be judged as defective products. The validation data includes images of copper-clad laminates that should be judged as defective products.
[0050] In step S32, the learning unit 26 inputs training data into the neural network and calculates a loss function. An existing loss function (such as Dice loss, mean squared error, or cross-entropy error) can be used. In step S34, the learning unit 26 calculates the gradient of the weights using backpropagation. The learning unit 26 can calculate the gradient of the weights using, for example, an existing library for calculating gradients.
[0051] In step S36, the learning unit 26 updates the weights of the neural network using gradient descent. In step S38, the learning unit 26 inputs the verification data divided in step S30 into the neural network and calculates the loss function. In step S40, the learning unit 26 determines whether the loss function calculated in step S38 has converged.
[0052] If the loss function has not converged, the learning unit 26 repeats the process in steps S32 to S40. If the loss function has converged, the learning unit 26 terminates the process shown in Figure 5. Whether or not the loss function has converged is determined by whether or not the set convergence conditions are met.
[0053] Returning to step S12 in Figure 4, the threshold setting unit 30 sets a threshold used to determine whether the product in the image is a good product or a defective product, using the neural network trained in step S10.
[0054] The process in step S12 is carried out, for example, according to the flowchart shown in Figure 7. Figure 7 is a flowchart of an example of the process in step S12.
[0055] In step S50, the threshold setting unit 30 inputs the verification data into the neural network trained in step S10 and identifies defective areas such as cracks in the verification data image on a pixel-by-pixel basis. The threshold setting unit 30 calculates the area of the defective areas in the verification data image identified on a pixel-by-pixel basis. The area of the defective areas in the verification data image is an example of the size of the defective areas in the verification data image.
[0056] In step S52, the threshold setting unit 30 sets a threshold based on the size of the defective area in the image calculated for each image of the verification data in step S50. The threshold setting unit 30 sets the minimum value of the size of the defective area in the image calculated for each image of the verification data in step S50 as the threshold. The threshold setting unit 30 may also use the average value or median value of the size of the defective area in the image calculated for each image of the verification data in step S50 as the threshold.
[0057] The processes in steps S10 to S12 of Figure 4 are the training and threshold setting processes for a machine learning model necessary to determine whether the product in the inspection data image is a good product or a defective product.
[0058] Returning to step S14 in Figure 4, the defect area calculation unit 32 calculates the area of the defective parts in the inspection data used to determine whether the product in the image is good or defective.
[0059] The process in step S14 is carried out, for example, according to the flowchart shown in Figure 8. Figure 8 is a flowchart of an example of the process in step S14.
[0060] In step S70, the defect location calculation unit 32 uses a trained neural network to infer the location of defects in the inspection data on a pixel-by-pixel basis. In step S72, the defect location calculation unit 32 calculates the area of defects such as cracks in the image of the inspection data inferred on a pixel-by-pixel basis.
[0061] Returning to step S16 in Figure 4, the determination unit 34 determines the image of the defective product based on the comparison result between the area of the defective part in the image of the inspection data calculated in step S14 and the threshold set in step S12. In step S18, the output unit 36 outputs the result of the determination.
[0062] Steps S16 and S18 are carried out, for example, according to the flowchart shown in Figure 9. Figure 9 is a flowchart of an example of the process in steps S16 and S18.
[0063] In step S90, the determination unit 34 determines whether the area of defective parts in the image of the inspection data calculated in step S14 exceeds the threshold set in step S12. If the area of defective parts in the image of the inspection data does not exceed the threshold, the process proceeds to step S102, and the determination unit 34 determines that it is inspection data for a good product.
[0064] If the area of the defective parts in the image of the inspection data exceeds the threshold, the process proceeds to step S92, and the determination unit 34 makes a provisional determination that it is inspection data for a defective product. As will be described later, in the process shown in Figure 9, the determination of whether the image of the inspection data is for a good product or a defective product is received from the operator, so the determination in step S92 is a provisional determination.
[0065] In step S94, the output unit 36 draws the defective area in the image of the inspection data that was provisionally determined to be defective in step S92. The defective area may be drawn by drawing the outline of the defective area, or by coloring the defective area.
[0066] In step S96, the output unit 36 outputs an image of the inspection data in which the defective areas were drawn in step S94, for example, as shown in screen 1000 of Figure 10. Figure 10 is an illustrative image of an example of a screen that outputs the judgment results.
[0067] The screen 1000 in Figure 10 displays the image 1006 of the inspection data that was provisionally determined to be defective in step S92. The screen 1000 in Figure 10 also displays multiple outlines 1008 of defective areas drawn in step S94. Furthermore, the screen 1000 in Figure 10 displays a "Good" button 1002 for the operator to confirm that the image 1006 of the inspection data provisionally determined to be defective is a "Good" product, and a "Defective" button 1004 for the operator to confirm that it is a "Defective" product. The right and left arrows displayed on the screen 1000 in Figure 10 are buttons that allow the operator to transition to the previous or next inspection data when there are multiple images of inspection data provisionally determined to be defective in step S92.
[0068] The operator can determine whether the image 1006 of the inspection data, which has been tentatively judged as defective, is a good product or a defective product by referring to the outline 1008 of the defective area drawn on the screen 1000 in Figure 10. If the operator determines that the image 1006 of the inspection data, which has been tentatively judged as defective, is a good product, the operator presses the good product button 1002. If the operator determines that the image 1006 of the inspection data, which has been tentatively judged as defective, is a defective product, the operator presses the defective product button 1004.
[0069] In step S98, the reception unit 38 receives a determination from the operator whether the image of the inspection data displayed on the screen 1000 is a good product or a defective product, in response to the operator's operation on the good product button 1002 or the defective product button 1004 on the screen 1000.
[0070] When the operator determines that the image of the inspection data displayed on screen 1000 is a good product, the determination unit 34 proceeds to step S102 and determines that the inspection data that was provisionally determined to be a defective product in step S92 is actually inspection data for a good product.
[0071] When the operator determines that the image of the inspection data displayed on screen 1000 is a defective product, the determination unit 34 proceeds to step S100 and determines that the inspection data that was provisionally determined to be a defective product in step S92 is indeed inspection data for a defective product. The determination unit 34 may also save the determination result in association with the inspection data.
[0072] According to the flowchart shown in Figure 9, the worker can omit the task of determining whether the images of inspection data that have been judged as good by deep learning are good or defective, thereby reducing the workload.
[0073] Furthermore, according to the flowchart shown in Figure 9, the operator can determine whether the image of the inspection data, which has been judged as defective by deep learning, is a good product or a defective product, thereby improving the accuracy of the good or defective product determination.
[0074] According to this embodiment, it is possible to provide a defect inspection device, program, and defect inspection method that improve the accuracy of defect inspection using semantic segmentation.
[0075] [Other Embodiments] If the amount of data stored in the data storage unit 40 is small, the verification data may be selected sequentially using cross-validation or the like, and the threshold may be set using the average value of the area of the defective parts of the multiple verification data. In addition, in the defect inspection device 10 according to this embodiment, if the amount of data stored in the data storage unit 40 increases, the threshold may be reset by retraining the machine learning model, thereby improving the accuracy of the defect inspection. Furthermore, in the case of defect inspection using images of products in which the way defects occur differs depending on the lot, the threshold may be reset by retraining the machine learning model using, for example, transfer learning, thereby improving the accuracy of the defect inspection.
[0076] Furthermore, if you divide an image, perform semantic segmentation, and then merge it back into a single image, you can set thresholds for either the divided images or the merged image.
[0077] The results of the defect inspection system 1 according to this embodiment, which determine whether an image is good or defective, may be used, for example, as information to be fed back to a manufacturing device that manufactures the product.
[0078] Although this embodiment has been described above, it will be understood that various modifications to the form and details are possible without departing from the spirit and scope of the claims. Although the present invention has been described above based on examples, the present invention is not limited to the above examples, and various modifications are possible within the scope described in the claims. This application claims priority to Basic Application No. 2024-215509 filed with the Japan Patent Office on December 10, 2024, the entire contents of which are incorporated herein by reference.
[0079] 1 Defect Inspection System 10 Defect Inspection Device 12 Operator Terminal 18 Communication Network 24 Data Splitting Unit 26 Learning Unit 28 Inference Unit 30 Threshold Setting Unit 32 Defect Location Calculation Unit 34 Judgment Unit 36 Output Unit 38 Reception Unit
Claims
1. A defect inspection apparatus comprising: a threshold setting unit that calculates the size of defective areas in images of verification data using a machine learning model trained to identify defective areas in images of training data through semantic segmentation, and sets a threshold based on the size of the defective areas; a defect area calculation unit that calculates the size of defective areas in images of inspection data using the trained machine learning model; a determination unit that determines the image of the inspection data of a defective product based on a comparison result between the size of the defective areas in the image of the inspection data and the threshold; and an output unit that outputs the result of the determination.
2. The defect inspection apparatus according to claim 1, wherein the threshold setting unit calculates the size of the defective area in each image of the verification data of the defective product, and sets the minimum value of the sizes of the defective areas in each image of the verification data of the defective product as the threshold.
3. The defect inspection apparatus according to claim 1 or 2, wherein the output unit draws the defective parts in the image of the inspection data of the determined defective product.
4. The defect inspection apparatus according to any one of claims 1 to 3, further comprising: a receiving unit that receives from an operator whether the image of the inspection data determined by the determination unit to be a defective product is a good product or a defective product.
5. The defect location calculation unit calculates the size of the defect location in the image of the inspection data from the pixel-level defect locations inferred using the trained machine learning model, as described in any one of claims 1 to 4.
6. The defect inspection apparatus according to any one of claims 1 to 5, wherein the size of the defective area is the area, length, or number of pixels.
7. A program that causes an information processing device to function as follows: a threshold setting unit that calculates the size of defective areas in images of verification data using a machine learning model trained on defective areas in images of training data through semantic segmentation, and sets a threshold based on the size of the defective areas; a defective area calculation unit that calculates the size of defective areas in images of inspection data using the trained machine learning model; a determination unit that determines the image of the inspection data of a defective product based on the comparison result between the size of the defective areas in the image of the inspection data and the threshold; and an output unit that outputs the result of the determination.
8. A defect inspection method performed by a defect inspection device, comprising: a threshold setting step of calculating the size of defective areas in images of verification data using a machine learning model that has been trained to identify defective areas in images of training data by semantic segmentation, and setting a threshold based on the size of the defective areas; a defect area calculation step of calculating the size of defective areas in images of inspection data using the trained machine learning model; a determination step of determining the image of the inspection data of a defective product based on a comparison result between the size of the defective areas in the image of the inspection data and the threshold; and an output step of outputting the result of the determination.