Defect detection program, defect detection device, and defect detection method
The defect detection system addresses the issue of inconsistent defect judgments by integrating multi-angle features into a three-dimensional map with region-specific criteria, enhancing productivity through precise defect differentiation.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- SOMIC MANAGEMENT HLDG INC
- Filing Date
- 2024-12-17
- Publication Date
- 2026-06-29
AI Technical Summary
Existing defect detection systems fail to differentiate pass/fail judgments based on the type of defect, leading to incorrect judgments and decreased production efficiency.
A defect detection system that integrates detection features from multiple angles into a three-dimensional feature map, using region-specific criteria to determine the type and severity of defects, allowing for variable judgment standards across different regions of an inspection target.
Improves production efficiency by accurately distinguishing between acceptable and unacceptable defects, reducing false positives and enhancing overall productivity.
Smart Images

Figure 2026106051000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a defect detection program, a defect detection device, and a defect detection method. For example, it relates to a defect detection program, a defect detection device, and a defect detection method for detecting defects in an inspection target product based on a product image acquired from the inspection target product.
Background Art
[0002] In the manufacturing process of producing products, defect inspections for checking the presence or absence of defects in the products produced are performed at various timings. This defect inspection is often performed using image analysis. Therefore, an example of such a defect inspection using image analysis is disclosed in Patent Document 1.
[0003] The wall thickness inspection device described in Patent Document 1 is a container wall thickness inspection device for inspecting a container in which regions with relatively large and small wall thicknesses are distributed along the circumferential direction, and has a sensor unit for measuring the wall thickness of the container at a site on the outer peripheral surface of the container where the sensor unit faces, a rotation drive mechanism for axially rotating the container around the central axis of the container in order to measure the wall thickness of the container over the entire circumference by the wall thickness measurement device, a region detection device for detecting in which region of the container the wall thickness measurement site by the wall thickness measurement device is located, and a determination device for determining the quality of the wall thickness of the container from the measured values of the wall thickness over the entire circumference of the container obtained from the output of the wall thickness measurement device. The determination device includes a storage unit for storing the pass / fail determination reference values for each region, and a comparison unit for comparing the measured value of the wall thickness obtained from the output of the wall thickness measurement device with the pass / fail determination reference value stored in the storage unit of the region detected by the region detection device.
Prior Art Documents
Patent Documents
[0004]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0005] However, Patent Document 1 neither discloses nor suggests differences in pass / fail judgments based on the type of defect. For example, even with the same defect, if an item under inspection has both an acceptable range and an unacceptable range, it can only be inspected according to the range requiring the strictest pass / fail judgment. In such cases, items under inspection that only have defects that would not normally be a problem may be judged as defective, leading to a decrease in production efficiency. [Means for solving the problem]
[0006] One embodiment of the defect detection program according to this disclosure includes an input image set containing multiple images of an item to be inspected obtained by photographing one item to be inspected from multiple different angles, a defect location extraction process that generates a three-dimensional feature map in which the detection features corresponding to the multiple images of the item to be inspected are integrated into a single value for each three-dimensional position of the item to be inspected, with the feature quantities output when the item to be inspected is determined to be good being used as reference features, and detection features are generated for each image of the item to be inspected in which the difference from the reference features is greater for areas where the shape and color differ from the item to be inspected which is determined to be good being, and the detection features corresponding to the multiple images of the item to be inspected are integrated into a single value for each three-dimensional position of the item to be inspected, and a quality determination process that determines whether the item to be inspected is good or bad based on at least one of the shape, size, and size of the detection features in the three-dimensional feature map where the detection features that differ greatly from the reference features are mapped, and the size of the detection features in the defective area, and the computer executes the following:
[0007] One embodiment of the defect detection device according to this disclosure includes: an input image set including multiple images of an item to be inspected obtained by photographing one item to be inspected from multiple different angles, a defect location extraction unit that generates a three-dimensional feature map in which the detection features corresponding to the multiple images of the item to be inspected are integrated into a single value for each three-dimensional position of the item to be inspected, with the feature quantities output when the item to be inspected is determined to be good being used as reference features, and detection features are generated for each image of the item to be inspected in such cases that the difference from the reference features is greater in areas where the shape and color differ from the item to be inspected, and the detection features corresponding to the multiple images of the item to be inspected are integrated into a single value for each three-dimensional position of the item to be inspected; and a quality determination unit that determines whether the item to be inspected is good or bad based on at least one of the shape, size, and size of the detection features in the defective area where the detection features that differ significantly from the reference features are mapped in the three-dimensional feature map, and the size of the detection features in the defective area. The quality determination unit determines whether there is a defect in each area of the item to be inspected based on area determination criteria in which the types of defects to be determined to be defective are set for each area of the item to be inspected, and determines that the item to be inspected is good if it is determined that there are no defects in any area.
[0008] One aspect of the defect detection method according to this disclosure is a defect location extraction process that takes as input an input image set including multiple images of an item to be inspected obtained by photographing one item to be inspected from multiple different angles, and when the item to be inspected is determined to be a good product, the feature amount output is used as a reference feature amount, and for each of the items to be inspected, a detection feature amount is generated in which the difference from the reference feature amount is larger for areas where the shape and color differ from the item to be inspected that is determined to be a good product, and the detection feature amounts corresponding to the multiple items to be inspected are integrated into a three-dimensional feature map in which the detection feature amounts are combined into a single value for each three-dimensional position of the item to be inspected, and In the three-dimensional feature map, a pass / fail judgment process is performed by an automated computer to determine whether the inspected product is good or bad based on at least one of the shape and size of the defective region where the detected feature, which has a large difference from the reference feature, is mapped, and the size of the detected feature in the defective region. In the pass / fail judgment process, the presence or absence of defects is determined for each region of the inspected product based on region judgment criteria, which are set to determine the type of defect that is judged as defective for each region of the inspected product. If it is determined that there are no defects in any region, the inspected product is judged to be good.
[0009] The defect detection program, defect detection device, and defect detection method disclosed herein perform pass / fail judgments that vary the type of defect judged as defective for each region by applying region judgment criteria that differ for each region. [Effects of the Invention]
[0010] The defect detection program, defect detection device, and defect detection method described herein make it possible to improve the productivity efficiency of the inspected products. [Brief explanation of the drawing]
[0011] [Figure 1] This is a schematic diagram of the defect detection system according to Embodiment 1. [Figure 2] This figure illustrates an example of an input image set generated by the defect detection system according to Embodiment 1. [Figure 3]This is a block diagram of the defect detection device according to Embodiment 1. [Figure 4] This is a diagram illustrating an example of an item to be inspected according to Embodiment 1. [Figure 5] This figure illustrates an example of the region determination criteria according to Embodiment 1. [Figure 6] This is a block diagram of the defect detection device according to Embodiment 2. [Figure 7] This is a block diagram of the defect detection device according to Embodiment 3. [Figure 8] This figure illustrates an example of a region determination criterion and region unit threshold according to Embodiment 3. [Modes for carrying out the invention]
[0012] For clarity of explanation, the following descriptions and drawings have been omitted and simplified as appropriate. Furthermore, each element shown in the drawings as a functional block performing various processes can be composed of a CPU (Central Processing Unit), memory, and other circuits in hardware terms, and implemented in software terms by programs loaded into memory. Therefore, it will be understood by those skilled in the art that these functional blocks can be implemented in various ways using hardware alone, software alone, or a combination thereof, and are not limited to any one of these. In each drawing, the same elements are denoted by the same reference numeral, and redundant explanations have been omitted where necessary.
[0013] Furthermore, the program described above includes, when loaded into a computer, a set of instructions (or software code) for causing the computer to perform one or more of the functions described in the embodiments. The program may be stored in a non-temporary computer-readable medium or a physical storage medium. Examples, but not limited to, include random-access memory (RAM), read-only memory (ROM), flash memory, solid-state drive (SSD) or other memory technologies, CD-ROM, digital versatile disc (DVD), Blu-ray® disc or other optical disc storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices. The program may be transmitted over a temporary computer-readable medium or a communication medium. Examples, but not limited to, include temporary computer-readable medium or a communication medium that includes electrically, optically, acoustically, or otherwise propagating signals.
[0014] Embodiment 1 The defect detection system 1 according to Embodiment 1 aims to detect defects in an item under inspection using image analysis technology. Therefore, the defect detection system 1, which includes a configuration for photographing the item under inspection and a defect detection device that determines whether the item is good or bad based on the captured image, will be described. Figure 1 shows a schematic diagram of the defect detection system 1 according to Embodiment 1.
[0015] In the example shown in Figure 1, the defect detection system 1 according to Embodiment 1 includes a defect detection device 10, a camera 11, lighting 12, and a rotating table 13. The defect detection system 1 according to Embodiment 1 places the object to be inspected (OBJ) on the rotating table 13 and rotates the object to be inspected (OBJ) in predetermined rotational angles, while the camera 11 photographs the object to be inspected (OBJ) at each rotational angle, thereby acquiring multiple images of the object to be inspected (OBJ) taken from various angles. In the example shown in Figure 1, lighting 12 is also shown. Lighting 12 illuminates the object to be inspected (OBJ) so that the image of the object to be inspected (OBJ) is more clearly reflected in the inspection image.
[0016] In the example shown in FIG. 1, an example is shown in which the inspection target product OBJ is rotated to capture the inspection target product OBJ at a number of imaging angles to obtain a plurality of inspection target images. However, without rotating the inspection target product OBJ, a plurality of cameras 11 and illuminations 12 may be arranged around the inspection target product OBJ to obtain a plurality of inspection target images from the plurality of cameras 11. Further, it is preferable that the imaging system is configured so that the inspection target product OBJ can be imaged from more angles such as the upper surface, the lower surface, and the diagonal direction, rather than from the side surface of the inspection target product OBJ.
[0017] In the defect detection system 1 according to Embodiment 1, a plurality of inspection target images obtained by imaging one inspection target product from a plurality of imaging angles are used as one input image set. Then, the defect detection device 10 outputs one three-dimensional feature amount data for one input image set. This three-dimensional feature amount data is, for example, data in which the values of portions corresponding to defective regions having different shapes and colors from those of non-defective products are labeled with detection feature amounts having a large difference from the reference feature amounts that are the feature amounts of non-defective products so that the three-dimensional positions of the inspection target products can be known. More specifically, the three-dimensional feature amount data is a three-dimensional feature amount map in which each of the detection feature amounts is mapped to the three-dimensional position of the inspection target product based on the label attached to the detection feature amount. Then, in the defect detection system 1 according to Embodiment 1, the presence or absence of a defective region of the inspection target product is determined based on the three-dimensional feature amount map.
[0018] First, in order to explain an example of a defect to be determined in the defect detection system 1, the input image set will be described. FIG. 2 shows a diagram for explaining an example of an input image set generated by the defect detection system 1 according to Embodiment 1. The example of the input image set shown in FIG. 2 includes eight inspection target images captured by changing the imaging angle by 45° around a rotation axis extending in the longitudinal direction of the inspection target product OBJ. Note that the example shown in FIG. 2 is an example of the input image set, and the number of images included in the input image set is not limited to eight, and if the number of imaging angles increases, it will be nine or more.
[0019] Also, in the example shown in FIG. 2, defective regions A to E are shown. The defective region A is, for example, a stain and has little color change regardless of the change in the shooting angle. The defective region B is, for example, a dent, and the luminance (color) changes greatly as the shooting angle changes. The defective region C is, for example, fiber dust or processing scraps, and the shape changes as the shooting angle changes. The defective region D is, for example, defects on protrusions such as granular dust, molding defects, processing defects, and burrs, and the shape changes as the shooting angle changes. The defective region E is, for example, a concave defect such as a cavity generated during casting, and the shape changes as the shooting angle changes.
[0020] As described above, there are defects in the inspection target product whose shape and color change by changing the shooting angle. In the defect detection device 10, a detection feature amount whose difference from the reference feature amount becomes large due to the characteristics of the defective region is generated for each pixel of the inspection target image, and among the detection feature amounts generated based on a plurality of inspection target images included in one input image set, a plurality of detection feature amounts having the same three-dimensional position of the inspection target product are integrated using statistical processing to generate three-dimensional feature amount data. That is, it is possible to determine the type of defect based on the magnitude of the detection feature amount included in the three-dimensional feature amount data. In the defect detection system 1 according to the first embodiment, a determination criterion that defines the type of defect determined as a defect by the defect detection device 10 according to the importance of each region is applied, and only the inspection target product determined to have no defect in all regions is determined as a non-defective product. Therefore, the defect detection device 10 will be described in detail below.
[0021] Subsequently, the defect detection device 10 will be described in detail. The defect detection device 10 can be configured by dedicated hardware, and can also be implemented by executing a defect detection program in a computer provided with an arithmetic unit capable of executing a program. Hereinafter, an example of realizing the functions and processes described by various functional blocks by the defect detection program will be described.
[0022] Figure 3 shows a block diagram of the defect detection device according to Embodiment 1. As shown in Figure 3, the defect detection device 10 has a defect location extraction unit 20 and a pass / fail determination unit 21. The defect location extraction unit 20 takes an input image set as input and, when the product to be inspected is determined to be a good product, uses the feature quantity output as the reference feature quantity. For each product to be inspected, it generates detection feature quantities where the difference from the reference feature quantity is larger for areas where the shape and color differ from the product to be inspected that is determined to be a good product. It then performs a defect location extraction process that generates a three-dimensional feature map (three-dimensional feature data) in which the detection feature quantities corresponding to multiple products to be inspected are integrated into a single value for each three-dimensional position of the product to be inspected. The input image set includes multiple products to be inspected obtained by photographing one product to be inspected from multiple different angles.
[0023] In three-dimensional feature data, as explained in Figure 2, the detected features have characteristics related to the type of defect. Therefore, by examining the magnitude of the detected feature values included in the three-dimensional feature data, and the range in which the difference between the detected feature and the reference feature becomes large, it is possible to determine the type of defect from the three-dimensional feature data.
[0024] The quality determination unit 21 performs quality determination on the inspected product based on at least one of the following: the shape and size of the defective region where the detected feature that shows a large difference from the reference feature is mapped in the three-dimensional feature map (e.g., three-dimensional feature data), and the size of the detected feature in the defective region. In this quality determination process, the quality determination unit 21 determines whether there are defects in each region of the inspected product based on region determination criteria that define the types of defects to be judged as defects for each region. If it determines that there are no defects in any region, it judges the inspected product to be good. In other words, the quality determination unit 21 has different types of defects to judge as defects for each region. For example, the quality determination unit 21 performs quality determination processing that includes a larger number of types of defects to judge as defects for regions requiring strict quality control, and a smaller number of types of defects to judge as defects for regions where a lower quality control level is acceptable.
[0025] Therefore, the area determination criteria will be explained in detail. Figure 4 shows an example of an item to be inspected according to Embodiment 1, and an example of what is set for an item to be inspected will be explained with reference to Figure 4. Note that the area determination criteria are set for each item to be inspected, and will naturally differ if the item to be inspected changes.
[0026] Figure 4 shows the object to be inspected, photographed from the front and from the back. In the example shown in Figure 4, the object to be inspected has a shape in which an annular part is connected to one end of a rod-shaped member. The rod-shaped portion is called the shaft, the side of the annular part connected to one end of the shaft is called the head, the highest part of the head is called the crown, the inner circumference side of the annular part is called the inner diameter, the front side of the annular part is called the crimped part, and the front side of the annular part is called the reference surface. The other end of the shaft is called the shaft end, and the flat surface on the shaft end side of the shaft is called the width across flats.
[0027] For the parts being inspected, minor defects in the top, head, and shaft will not affect performance, so the inspection standards will be set low. Similarly, the inner diameter will be machined in the next process, so the inspection standards will be set low. In areas where low inspection standards are set, a standard will be established to exclude removable debris such as fiber and granular debris, and debris that does not affect the shape, such as oil stains. For the shaft end, a medium inspection standard will be set because shot deficiency and shot residue may occur. When the inspection standard is set to a medium level, a standard will be established to exclude removable debris such as fiber and granular debris. For the crimped section, abnormalities may lead to crimp cracking. For the reference surface, abnormalities may cause defects in the next process. Furthermore, abnormalities in the wrench width may prevent the wrench from fitting smoothly. In such areas where specific defects are anticipated, the judgment standards will be set high. In areas where high judgment standards are set, all detectable defects will be subject to defect judgment.
[0028] Figure 5 shows an example of a region judgment criterion according to Embodiment 1. The example shown in Figure 5 is an example of a region judgment criterion corresponding to the inspected product shown in Figure 4. As shown in Figure 5, the region judgment criterion defines an inspection standard level and the type of defect to be judged as defective for each region. The pass / fail judgment unit 21 performs defect judgment processing for each region based on this region judgment criterion, and shows the user a good product judgment result only for inspected products that are judged as good in all regions. In addition, if the pass / fail judgment unit 21 determines that there is a defect in at least one region, it shows the user a judgment result that presents the name of the region judged as defective and the type of defect. In Figure 5, the types of defects to be judged as defective are shown as many, moderate, and few. The specific types of defects to be set can be set for each region according to the performance required for that region, and only the number of such types is shown in Figure 5.
[0029] As described above, the defect detection device 10 according to Embodiment 1 can determine defects in a single inspection, including areas that should be inspected with strict inspection standards and areas that should be inspected with lenient inspection standards. By conforming to strict inspection standards, it becomes possible to reduce the number of items that are actually good products but are incorrectly judged as defective, thereby increasing production efficiency.
[0030] Embodiment 2 Embodiment 2 describes a defect detection device 10a, which is a modified version of the defect detection device 10. In the description of Embodiment 2, components that are the same as those described in Embodiment 1 are denoted by the same reference numerals as in Embodiment 1 and their descriptions are omitted.
[0031] Figure 6 shows a block diagram of the defect detection device according to Embodiment 2. As shown in Figure 6, the defect detection device 10a is obtained by replacing the defect location extraction unit 20 of the defect detection device 10 with a defect location extraction unit 20a. The defect location extraction unit 20a has a feature extraction unit 31 and a three-dimensional alignment processing unit 32.
[0032] The feature extraction unit 31 takes the input image set as input and performs feature extraction processing to output feature data that includes detected features for each position of the item to be inspected. The feature extraction unit 31 can use a classifier that outputs detected features that abstract the input values based on a pre-generated transfer function, or it can use a classifier to which trained parameters generated by machine learning are applied. An example of a classifier to which trained parameters are applied is an algorithm based on the k-nearest neighbors method that outputs the similarity (distance) between the input value and all the training data as detected features.
[0033] The three-dimensional alignment processing unit 32 applies a coordinate transformation mask (e.g., an XYZ mask) generated from the shooting position and shooting angle when the inspection target image was captured to the feature data, and performs a three-dimensional alignment process to generate a three-dimensional feature map by integrating multiple detected features from the feature data where the three-dimensional position of the inspection target is the same into a single value. The synthesis process in the three-dimensional alignment process, in which multiple detected features where the three-dimensional position of the inspection target is the same into a single value, uses statistical methods to combine multiple values into a single value while maintaining the meaning of each value as much as possible. Examples of synthesis processes include averaging, which takes the average of multiple values, and function processing, which combines multiple values into a single value using a predetermined function.
[0034] As described above, by using the defect extraction unit 20a, it becomes possible to generate three-dimensional feature data that includes detection features capable of determining the location, size, and type of defect.
[0035] Embodiment 3 Embodiment 3 describes a defect detection device 10b, which is a modified version of the defect detection device 10a. In the description of Embodiment 3, components that are the same as those described in Embodiments 1 and 2 are denoted by the same reference numerals as in Embodiments 1 and 2, and their descriptions are omitted.
[0036] Figure 7 shows a block diagram of the defect detection device according to Embodiment 3. As shown in Figure 7, the defect extraction unit 20b is the defect extraction unit 20a with the addition of an image conversion processing unit 33. The image conversion processing unit 33 performs image conversion processing to output a detection result image as feature data, which maps the detected features contained in the feature data output by the feature extraction unit 31 to the corresponding positions in the image to be inspected. In this image conversion processing, if the detected features are less than a preset threshold, the detected features are replaced with a first value, and if the detected features are equal to or greater than the threshold, the detected features are replaced with a second value. The image conversion processing unit 33 then refers to a region-unit threshold in the binarization processing and changes the threshold that determines whether to use the first value or the second value for each region.
[0037] By changing the threshold for each region in this way, it becomes possible to change whether or not defective regions are reflected in the three-dimensional feature data. Therefore, Figure 8 shows an example of the region judgment criterion and region-unit threshold according to Embodiment 3. The example shown in Figure 8 adds a region-unit threshold to the region judgment criterion explained in Figures 4 and 5. In the example shown in Figure 8, there are two types of defects to judge as defective: many or few. The region-unit threshold is set to the normal level for regions where the inspection criterion is set to a low level, and to a stricter value (for example, a threshold smaller than the normal bell) for regions where the inspection criterion is set to a medium or high level.
[0038] This makes it possible to detect areas with a smaller difference between the detected feature and the reference feature as defective areas in regions where the inspection criteria are set to a medium or high level, compared to regions where the inspection criteria are set to a low level.
[0039] As explained above, the strictness of the inspection criteria for each region can be changed not only by defining the types of defects for each region based on the region judgment criteria, but also by changing the number of defective regions detected by applying region-specific thresholds.
[0040] It should be noted that the present invention is not limited to the embodiments described above, and can be modified as appropriate without departing from the spirit of the invention. [Explanation of symbols]
[0041] 1. Defect detection system 10. Defect detection device 11 Cameras 12 Lighting 13 Rotating Stands 20 Defect extraction unit 21. Quality Determination Unit 31 Feature Extraction 32 Three-dimensional alignment processing unit 33 Image conversion processing unit
Claims
1. The defect extraction process takes an input image set containing multiple images of an item to be inspected, obtained by photographing the same item from multiple different angles, and uses the feature quantity output when the item to be inspected is determined to be good as the reference feature quantity. For each of the images to be inspected, a detection feature quantity is generated where the difference from the reference feature quantity is larger for areas where the shape and color differ from the item to be inspected that is determined to be good. The defect extraction process generates a three-dimensional feature quantity map in which the detection feature quantities corresponding to the multiple images to be inspected are integrated into a single value for each three-dimensional position of the item to be inspected. The computer is instructed to perform a pass / fail determination process, which determines whether the inspected product is good or bad based on at least one of the shape, size, and size of the detected feature in the three-dimensional feature map where the detected feature has a large difference from the reference feature, and the size of the detected feature in the defective region. In the above pass / fail determination process, Based on the area determination criteria set for each area of the inspected product, the presence or absence of defects is determined for each area, where the type of defect to be judged as defective is set. A defect detection program that determines that an inspected product is good if it is determined that there are no defects in any area.
2. A feature extraction process takes the aforementioned input image set as input and outputs feature data including the detected feature quantities for each position of the item to be inspected. A three-dimensional alignment process is performed by applying a coordinate transformation mask generated from the shooting position and shooting angle when the inspection target image was taken to the feature data, integrating multiple detected features from the feature data where the three-dimensional position of the inspection target is the same into a single value, and generating the three-dimensional feature map. A defect detection program according to claim 1, further performing the following steps.
3. In the feature extraction process, an image transformation process is performed to output a detection result image as feature data, in which the detected features are mapped to the corresponding positions in the image to be inspected. The defect detection program according to claim 2, wherein the image conversion process performs a binarization process in which the detected feature quantities are binarized based on region-unit thresholds that are different thresholds for each region.
4. A defect extraction unit takes an input image set containing multiple images of an item to be inspected, obtained by photographing the same item from multiple different angles, as input. When the item to be inspected is determined to be good, the feature quantity output is used as the reference feature quantity. For each of the items to be inspected, a detection feature quantity is generated where the difference from the reference feature quantity is larger for areas where the shape and color differ from the item to be inspected that is determined to be good. The unit generates a three-dimensional feature quantity map in which the detection feature quantities corresponding to the multiple items to be inspected are integrated into a single value for each three-dimensional position of the item to be inspected. The three-dimensional feature map includes a quality determination unit that determines whether the inspected product is good or bad based on at least one of the shape and size of the defective region where the detected feature, which has a large difference from the reference feature, is mapped, and the size of the detected feature in the defective region. The good / bad judgment unit is a defect detection device that determines whether there is a defect in each region of the inspected product based on region judgment criteria in which the type of defect to be judged as defective is set for each region of the inspected product, and determines that the inspected product is good if it is determined that there are no defects in all regions.
5. The defect extraction process takes an input image set containing multiple images of an item to be inspected, obtained by photographing the same item from multiple different angles, as input, and uses the feature quantity output when the item to be inspected is determined to be good as the reference feature quantity. For each of the images to be inspected, a detection feature quantity is generated in which the difference from the reference feature quantity is larger for areas where the shape and color differ from the item to be inspected that is determined to be good. The detection feature quantities corresponding to the multiple images to be inspected are then integrated into a single value for each three-dimensional position of the item to be inspected to generate a three-dimensional feature quantity map. In the three-dimensional feature map, a pass / fail determination process is performed by computer-based automated processing to determine whether the inspected product is good or bad based on at least one of the shape, size, and size of the detected feature in the defective region where the detected feature that makes a large difference from the reference feature is mapped, and the size of the detected feature in the defective region. The defect detection method involves determining whether a defect exists in each region of the inspected product based on region determination criteria, where the type of defect for each region of the inspected product is set, and determining that the inspected product is a good product if it is determined that there are no defects in any region.