Appearance inspection device and appearance inspection method
The appearance inspection apparatus generates artificial defect images by superimposing shapes on captured images, addressing the inefficiency of collecting defective samples in conventional methods, thereby improving inspection efficiency and realism of defect representation.
Patent Information
- Application Number
- JP2023022389
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-16
- Publication Date
- 2024-08-28
AI Technical Summary
Conventional visual inspection methods require a large number of defective product samples for machine learning, which is inefficient due to the low frequency of defective products, leading to a time-consuming collection process.
An appearance inspection apparatus that combines a captured image of an object with a defect element image created by superimposing predetermined shapes to generate artificial defect images, using machine learning to inspect surfaces without the need for actual defective product samples.
Reduces the time and effort required to collect defective product samples, enhances inspection efficiency, especially in low-defective-rate production lines, and allows for the generation of more complex and realistic artificial defect images.
Smart Images

Figure 2024116664000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an appearance inspection apparatus and an appearance inspection method. [Background technology]
[0002] Patent Document 1 discloses a technique for inspecting the surface of an object to be inspected based on a captured image of the surface of the object to be inspected and a learning result obtained by machine learning using a plurality of defective sample images. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent Publication Summary of the Invention [Problem to be solved by the invention]
[0004] In the above-mentioned conventional appearance inspection devices, a large number of sample images of defective products are required to build a machine learning model, but because the occurrence frequency of defective products is low, there was a risk that the collection process would become enormous. An object of the present invention is to provide an appearance inspection apparatus and an appearance inspection method capable of reducing the number of steps required for collecting defective product samples. [Means for solving the problem]
[0005] In one embodiment of the present invention, the visual inspection device inspects the surface of the object to be inspected based on the results of machine learning using a captured image of the surface of the object to be inspected and multiple artificial defect images generated by combining defect element images made by overlaying multiple predetermined shapes with a surface image of a sample product equivalent to the object to be inspected. Effect of the Invention
[0006] Therefore, in the present invention, since it is not necessary to collect defective samples, the configuration for collecting defective samples can be reduced. [Brief description of the drawings]
[0007] [Figure 1] 1 is a schematic diagram of a visual inspection device 1 according to a first embodiment. [Diagram 2] 1 is an example of an initial shape E1 and a final shape E2 of an ellipse. [Diagram 3] This is an example of an image of generating defect elements for blowholes using the ellipses shown in Figure 2. [Figure 4] 1 is an example batch image of defective elements for blowholes. [Diagram 5] FIG. 3 is another example of a generated image of defect elements for blowholes and scratches using the ellipses shown in FIG. 2. [Figure 6] 13 is an example of a patch image of a defect element for a blowhole and a defect element for a scratch. [Figure 7] 13 is another example of an initial shape E1 and a final shape E2 of an ellipse. [Figure 8] This is an example of an image of generating defect elements for a cast cavity using the ellipses shown in Fig. 7. [Figure 9] 13 is another example of a patch image of a defect element for a casting cavity. [Figure 10] 1A and 1B are diagrams illustrating a method for generating an artificial defect image and a patch image of an artificial defect. [Figure 11] 1 is a flowchart showing a procedure for optimizing defective elements using statistical analysis. [Figure 12] FIG. 13 is a diagram showing the relationship between the major axis and brightness in a captured image of an actual defect. [Figure 13] This is an example of a defect element that is generated so that the brightness decreases as the defect becomes larger. [Figure 14] 1 is a flowchart showing a procedure for optimizing defective elements using an optimization method. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] [Embodiment 1] FIG. 1 is a schematic diagram of a visual inspection device 1 according to the first embodiment. The appearance inspection device 1 of the embodiment 1 includes a camera (imaging unit) 2, a robot 3, and a computer 4. The camera 2 images the surface of an inspection object, which is an engine piston material or a finished processed engine piston product (hereinafter simply referred to as a piston) 5. The robot 3 is an articulated robot and has a hand 3a that holds the piston 5.
[0009] The computer 4 is, for example, a personal computer, and includes a CPU 6 and a memory (storage unit) 7. The CPU 6 includes an inspection unit 8 and a learning unit 9. The inspection unit 8 includes an acquisition unit 8a and a defect determination unit 8b. The acquisition unit 8a acquires an image captured by the camera 2. The defect determination unit 8b inspects whether or not there are scratches or defects on the surface of the piston 5 based on the image acquired by the acquisition unit 8a and the learning results stored in the memory 7 (products with scratches or defects are NG, products without scratches or defects are OK).
[0010] The learning unit 9 has a defect element generating unit 9a, an artificial defect image generating unit 9b, and a CNN learning unit 9c. The defect element generating unit 9a generates a defect element image by overlapping a plurality of predetermined shapes (first image generating step). The artificial defect image generating unit 9b synthesizes the defect element image with a surface image of a sample product equivalent to the piston 5 to generate an artificial defect image that is a pseudo defective sample image (second image generating step). The CNN learning unit 9c performs machine learning using a plurality of artificial defect images. The machine learning is learning using a neural network, and in the first embodiment, deep learning using a CNN (Convolutional Neural Network) model is adopted. The memory 7 stores a plurality of defect element images generated by the defect element generating unit 9a, a plurality of artificial defect images generated by the artificial defect image generating unit 9b, and a learning result by the CNN learning unit 9c.
[0011] Next, a method for generating a defect element image by the defect element generating unit 9a will be described. The defect element generating unit 9a generates a defect element image by superimposing a plurality of basic shapes having different sizes and brightness (second parameters). In the first embodiment, the basic shape is an ellipse, and the defect element image is generated by changing the input parameters. FIG. 2 shows an example of an initial shape E1 and a final shape E2 of an ellipse. The initial shape E1 in FIG. 2(a) has a major axis d1 and an aspect ratio a1. On the other hand, the final shape E2 in FIG. 2(b) has a major axis d2 and an aspect ratio a2.
[0012] The defect element is generated by generating one or more intermediate shapes that complement the initial shape E1 and the final shape E2, and overlapping each shape. Figure 3 shows an example of a generation image of a defect element for a blowhole using the ellipse shown in Figure 2, and the input parameters are the major axis (first parameter) d, the brightness (second parameter) L, the drawing path (third parameter) p(t), the rotation angle θ, and the number of ellipses n. The drawing path p(t) is expressed mathematically as a straight line, and the number of ellipses n=3. This makes it possible to generate a patch image of a defect element for a blowhole as shown in Figure 4.
[0013] Figure 5 shows an image of how defect elements for blowholes and scratches are generated using the ellipses shown in Figure 2, with the input parameters being the major axis d, brightness L, depiction path p(t), random rotation angle dθ, random coordinate shift amount dP, and number of ellipses n. The depiction path p(t) is expressed mathematically as a straight line, and the number of ellipses n = 4. By randomly rotating / translating the basic shape, it is possible to generate patch images of defect elements for blowholes, as shown in Figure 6(a), and defect elements for scratches, as shown in Figure 6(b).
[0014] FIG. 7 shows another example of an initial shape E1 and a final shape E2 of an ellipse, and in this example, the major axis d1 and the aspect ratio a1 of the initial shape E1 in FIG. 7(a) are approximately equal to the major axis d2 and the aspect ratio a2 of the final shape E2 in FIG. 7(b). FIG. 8 shows an image of generating a defect element for a blowhole using the ellipse shown in FIG. 7, and the input parameters are the major axis d, the brightness L, the drawing path p(t), and the number of ellipses n. The drawing path p(t) is expressed mathematically as a curve such as a quadratic function or a Bezier curve, and the number of ellipses n=5. This makes it possible to generate a patch image of a defect element for a blowhole as shown in FIG. 9.
[0015] 10A and 10B are diagrams showing a method for generating an artificial defect image by the artificial defect image generating unit 9b, where FIG. 10A shows the method for generating an artificial defect image, and FIG. 10B shows the method for generating a patch image of an artificial defect. As shown in Fig. 10(a), a plurality of artificial defect images 12 can be generated by synthesizing patch images 10 of a plurality of defect elements with a patch image 13 of the piston 5 as a background image. On the other hand, as shown in Fig. 10(b), a plurality of artificial defect patch images 14 can be generated by synthesizing patch images 10 of a plurality of defect elements with a patch image 13 of the piston 5 as a background image.
[0016] Next, the optimization of defective elements will be described. The CNN learning unit 9c makes the neural network learn defect images from the multiple artificial defect images and multiple artificial defect patch images generated by the artificial defect image generating unit 9b. At this time, if artificial defect images having different visual characteristics from actual defects are learned, the accuracy of the CNN decreases, so a defect element capable of improving the recognition accuracy of the CNN, that is, a defect element similar to an actual defect and not similar to a non-defective product, is required. In other words, in order to improve the accuracy of the CNN, it is necessary to optimize the defect element (the generation parameters of the defect element). Two methods for optimizing the defect element will be described below.
[0017] The first method is to generate defect elements that are close to real defects by generating defect elements from statistical information of real defects. Figure 11 is a flowchart showing the procedure for optimizing defect elements using statistical analysis. In step S1, past samples of actual defects are statistically analyzed for each defect type (blowholes, scratches). Specifically, for example, the relationship between the major axis and brightness is extracted. In step S2, defect elements are designed / generated for each defect type based on the results of the statistical analysis in step S1. For example, if the statistical analysis reveals a relationship in which the larger the defect, the lower the brightness, as shown in Fig. 12, parameters are set so that the larger the defect, the lower the brightness (the darker it becomes), as shown in Fig. 13, and defect elements are generated.
[0018] In step S3, an artificial defect image is generated from the defect elements generated in step S2. In step S4, a machine learning model (CNN model) is generated by labeling each defect type from the artificial defect image generated in step S3. In step S5, real defects are inspected based on the learning results of the CNN model generated in step S4.
[0019] The second method is to optimize the design variables of the defective element using an optimization method, etc. Figure 14 is a flowchart showing the procedure for optimizing the defective element using the optimization method. In step S11, the parameters of the defect element (major axis d, brightness L, depiction path p(t), rotation angle θ, number of ellipses n) are designed for each defect type, and a defect element is generated with the provisional parameters. In step S12, an artificial defect image is generated from the defect elements generated in step S11. In step S13, a machine learning model (CNN model) is generated by labeling each defect type from the artificial defect image generated in step S12.
[0020] In step S14, past samples of actual defects are inspected. In step S15, it is determined whether or not the termination condition is satisfied, and if YES, the process proceeds to step S16, and if NO, the process proceeds to step S17. Here, the termination condition is whether or not the objective function (the correct answer rate for NG and OK) is equal to or greater than a threshold value. In step S16, an actual defect inspection is performed. In step S17, the parameters are modified so as to maximize the objective function.
[0021] Next, the effects of the first embodiment will be described. In conventional appearance inspection methods, CNN learns images of defects from collected images of defective product samples and judges whether or not there are defects in the image to be inspected. For this reason, in manufacturing lines with low defect rates, it takes time and effort to collect the defective product samples necessary for learning. In contrast, in the visual inspection method of embodiment 1, the surface of the piston 5 is inspected based on the results of machine learning using a captured image of the surface of the piston 5 and multiple artificial defect images generated by combining defect element images made by overlapping multiple predetermined shapes with a surface image of a sample product equivalent to the piston 5.
[0022] In other words, by using the artificial defect image, it is not necessary to collect and store the defective product sample image. Since the time required to generate the artificial defect image is shorter than the time required to collect the defective product sample, the actual work time can be reduced and the inspection efficiency can be improved. This effect is particularly noticeable in a production line that requires a long time to collect the defective product sample, such as a production line with a low defect rate or a production line that manufactures a wide variety of products. Furthermore, in the appearance inspection method of embodiment 1, a defect element image is generated by overlapping multiple predetermined shapes, making it easier to generate an artificial defect image compared to a method of generating a defect element image using a 3D model.
[0023] The defect element image of the first embodiment is generated by superimposing a plurality of shapes with at least one of dimensions or brightness different from each other. By changing the parameters of the shape or brightness and superimposing them, a defect element image closer to a real defect can be created. In the conventional method of generating a defect element image using a single figure, only specific shapes such as ellipses and circles and monotonous changes in brightness can be expressed. On the other hand, in the appearance inspection method of the first embodiment, defects of various shapes and appearances can be created by changing the shapes and brightness to be superimposed, and an artificial defect image that more closely matches a real defect can be generated. In particular, by having a plurality of parameters and changing them, a more complex artificial defect image can be easily generated. Furthermore, the defect variation to be detected can be parametrically managed / optimized.
[0024] Furthermore, the defect element images have an ellipse as the basic shape to be overlaid. By changing the dimensional parameters of each ellipse, such as the major axis, minor axis, and rotation angle, a wide variety of defect shapes can be expressed, such as circular or elliptical cast holes and linear scratches. Shapes with rounded corners, just like actual defects, can also be easily expressed. For example, a curved linear defect can be expressed by making the dimensions of the ellipse as small as possible.
[0025] A defect element image is generated by superimposing an initial shape, a final shape, and one or more intermediate shapes. If a defect element image is generated by superimposing only the initial shape and the final shape, it is difficult to generate an artificial defect image close to a real defect because the dimensions and brightness change suddenly. Therefore, by providing an intermediate shape between the initial shape and the final shape, it is possible to suppress the sudden changes in dimensions and brightness, and to generate an artificial defect image closer to a real defect.
[0026] The defect element image has a drawing path that connects the initial shape and the final shape as a parameter, and an intermediate shape is generated at a position according to the drawing path. This makes it possible to generate more complex artificial defect images, such as arc-shaped defects. The parameters of the defect element image are set based on statistical data obtained from past samples of real defects. By generating defect elements from statistical information of real defects, various artificial defect elements can be generated with shapes closer to those of real defects.
[0027] Other Embodiments The above describes an embodiment for carrying out the present invention, but the specific configuration of the present invention is not limited to the configuration of the embodiment, and design changes and the like that do not deviate from the gist of the invention are also included in the present invention. For example, the basic figure to be superimposed when generating the defect element image is not limited to an ellipse, but may be a circle or a polygon. The object to be inspected is not limited to a piston. The learning results are not limited to neural networks or deep learning, but can be any machine learning results. [Explanation of symbols]
[0028] REFERENCE SIGNS LIST 1... appearance inspection device, 2... camera (imaging section), 5... piston (inspection subject), 7... memory (storage section), 8... inspection section
Claims
1. A visual inspection apparatus for inspecting a surface of an object to be inspected, comprising: an imaging unit that images a surface of the object to be inspected; a memory unit in which learning results are stored, the learning results being obtained by machine learning using a plurality of artificial defect images generated by synthesizing a defect element image created by overlapping a plurality of predetermined shapes with a surface image of a sample product equivalent to the inspection object; an inspection unit that inspects a surface of the object to be inspected based on an image captured by the imaging unit and the learning result; An appearance inspection device comprising:
2. 2. The visual inspection apparatus according to claim 1, The plurality of shapes have feature amounts of the shapes as first parameters, The defect element image is generated by superimposing a plurality of the shapes each having the first parameter changed. Visual inspection equipment.
3. 3. The visual inspection apparatus according to claim 2, the first parameter being a size or brightness of the shape; Visual inspection equipment.
4. 3. The visual inspection apparatus according to claim 2, the shape is an ellipse, and the first parameter is at least one of a major axis and a minor axis of the ellipse; Visual inspection equipment.
5. 3. The visual inspection apparatus according to claim 2, The plurality of shapes have a feature amount different from the first parameter as a second parameter, The defect element image is generated by superimposing a plurality of the shapes obtained by changing the first parameter and the second parameter, respectively. Visual inspection equipment.
6. 6. The visual inspection apparatus according to claim 5, the first parameter being a dimension of the feature; the second parameter being the brightness of the shape; Visual inspection equipment.
7. 6. The visual inspection apparatus according to claim 5, The shape is an ellipse, the first parameter is at least one of a major axis and a minor axis of the ellipse; the second parameter being the brightness of the shape; Visual inspection equipment.
8. 3. The visual inspection apparatus according to claim 2, The plurality of shapes are selected from two shapes, an initial shape and a final shape, generating an intermediate shape that is complementary between the initial shape obtained by changing the first parameter and the final shape; The defect element image is generated by superimposing the initial shape, the final shape, and the intermediate shape. Visual inspection equipment.
9. 9. The visual inspection apparatus according to claim 8, a path connecting the initial shape and the final shape can be specified as a third parameter, and the intermediate shape is generated at a position according to the third parameter; Visual inspection equipment.
10. 6. The visual inspection apparatus according to claim 5, The first and second parameters are set based on statistical data obtained from a sample of actual defects. Visual inspection equipment.
11. 1. An image generating method for generating an artificial defect image used for inspecting a surface of an object to be inspected, comprising: a first image generating step of generating a defect element image by superimposing a plurality of predetermined shapes; a second image generating step of generating a plurality of artificial defect images by combining the surface image of the sample corresponding to the inspection object; An image generating method comprising:
Citation Information
Patent Citations
Graphic processor and graphic processing method
JP1996016803A
Graphic preparing device
JP1996087603A
X-y plotter
JP1999175306A
Training data generation device and defect discrimination system
WO2021152416A1
