Method for generating training data, trained learning model, and system
By dividing image data into regions and using machine learning to mark and analyze differences, the method efficiently generates training data for defect detection, reducing the need for extensive image data while maintaining accuracy.
Patent Information
- Application Number
- JP2020100838
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-10-08
- Filing Date
- 2020-06-10
- Publication Date
- 2024-08-20
- Estimated Expiration
- 2040-06-10
AI Technical Summary
Existing systems require an equal number of non-defective and defective product images for training, leading to a need for a large amount of image data, which is inefficient.
The method involves dividing image data into multiple regions and marking each region for presence or absence of information, using machine learning to generate training data efficiently, and employing a trained model to determine defects by analyzing differences between images.
This approach reduces the required amount of image data while maintaining accuracy in defect detection, allowing for effective pass/fail determination.
Smart Images

Figure 0007536517000011 
Figure 0007536517000005 
Figure 0007536517000010
Abstract
Description
[Technical field]
[0001] The present invention relates to a method for generating teacher data, a trained learning model, and a system. [Background technology]
[0002] Systems are known that recognize products (workpieces) produced in factories. For example, there is an inspection system in which, in visual inspection of a workpiece, a machine recognizes defects from image data acquired by an imaging device, rather than a human's visual inspection, to determine the presence or absence of defects. Patent Document 1 discloses an inspection system in which an imaging device captures an image of a workpiece, and the image data acquired by the imaging device is input to a processing device configured by artificial intelligence to perform defect inspection. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2018-164272 A Summary of the Invention [Problem to be solved by the invention]
[0004] When performing inspection using artificial intelligence, such as the inspection system described in Patent Document 1, a trained model is generated. In Patent Document 1, training data including a plurality of images of good products and images of defective products is input to a training model to generate a trained model. In Patent Document 1, the same number of images of good products and images of defective products as the number of training data are required. The present invention aims to obtain the number of training data required for pass / fail judgment while reducing the amount of image data. [Means for solving the problem]
[0005] One aspect of the method for generating teacher data according to the present invention is a method for generating teacher data for image recognition, comprising the steps of acquiring image data of a workpiece, dividing the image data into a plurality of first regions, and generating a plurality of teacher data by marking each of the plurality of first regions as to whether or not it contains predetermined information.
[0006] One aspect of a learning method of the present invention includes inputting image data including a first portion of a first background color and a second portion of a second background color different from the first background color, performing machine learning using a plurality of training data for each of a plurality of first regions in the first portion, the plurality of training data being marked with a mark indicating whether or not the each of the plurality of first regions in the second portion contains the predetermined information, and performing machine learning using a plurality of training data being marked with a mark indicating whether or not the each of the plurality of first regions contains the predetermined information.
[0007] One aspect of the system of the present invention is a system comprising an imaging device and a processing device having a learning model into which image data captured by the imaging device is input, wherein the processing device includes a trained learning model in which each of a plurality of first regions of image data obtained by capturing an image of a first workpiece with the imaging device is assigned an indication of whether or not the region contains predetermined information, and second image data obtained by capturing an image of a second workpiece with the imaging device is input into the trained learning model, and a judgment is made regarding the second workpiece from the second image data.
[0008] One aspect of the system of the present invention is a system comprising an imaging device and a processing device having a learning model into which image data captured by the imaging device is input, wherein the processing device includes a trained learning model including a differential image between image data obtained by capturing an image of a good workpiece with the imaging device and image data obtained by capturing an image of a defective workpiece with the imaging device, and a differential image between second image data obtained by capturing an image of a second workpiece with the imaging device and image data obtained by capturing an image of the good workpiece is input into the trained learning model to make a judgment regarding the second workpiece. Effect of the Invention
[0009] According to the present invention, it is possible to obtain the amount of teacher data required for pass / fail judgment while reducing the amount of image data. [Brief description of the drawings]
[0010] [Figure 1] FIG. 1 is a diagram showing an overview of a system. [Diagram 2] FIG. 2 is a diagram illustrating a processing flow of the system. [Diagram 3] FIG. 2 is a diagram illustrating a learning model used in the system. [Figure 4] FIG. 2 is a diagram illustrating a method for generating teacher data according to the first embodiment. [Diagram 5] FIG. 2 is a diagram illustrating a method for generating teacher data according to the first embodiment. [Figure 6] FIG. 2 is a diagram illustrating a method for generating teacher data according to the first embodiment. [Figure 7] FIG. 11 is a diagram illustrating a method for generating teacher data according to the second embodiment. [Figure 8] FIG. 13 is a diagram illustrating a method for generating teacher data according to the third embodiment. [Figure 9] FIG. 13 is a diagram illustrating a method for generating teacher data according to the third embodiment. [Figure 10] FIG. 13 is a diagram illustrating a method for generating teacher data according to the third embodiment. [Figure 11] FIG. 13 is a diagram illustrating a method for generating teacher data according to the third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] The following embodiments are intended to embody the technical ideas of the present invention, and are not intended to limit the present invention. Note that the size and positional relationship of the components shown in each drawing may be exaggerated for clarity. In the following description, the same components are designated by the same reference numerals, and the description thereof will be omitted.
[0012] Fig. 1 shows the basic configuration of an inspection system as an example of a system. The system according to this embodiment can be used in various systems other than the inspection system. Examples of the various systems include an image recognition system that identifies whether or not a specific object exists in image data, and an automatic distribution system in a distribution center.
[0013] The inspection system according to this embodiment will be described below with reference to the process flow shown in FIG.
[0014] (Imaging device) First, the sensor 10 is used to detect the presence or absence of a workpiece (target object) within a predetermined range (FIG. 2: S1). The sensor 10 is, for example, a sensor for detecting a workpiece moving at high speed on a production line, and an infrared sensor is used, for example. When the sensor 10 detects a workpiece within the predetermined range, a signal is output from the sensor 10 to the trigger generation circuit 20. The trigger generation circuit 20 generates an imaging trigger signal based on the signal from the sensor 10 (FIG. 2: S2).
[0015] The trigger generation circuit 20 is composed of logic circuits such as a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC). The trigger generation circuit 20 performs hardware processing on the signal input from the sensor 10, and the hardware-processed trigger signal for imaging is transmitted to the imaging device 30. Then, the imaging device 30 images the workpiece (FIG. 2: S3).
[0016] According to this embodiment, the trigger generation circuit 20 is composed of a logic circuit, and parallel processing is performed by hardware processing. Then, the signal from the trigger generation circuit 20 is input to the imaging device 30 without going through software processing. Therefore, compared to software processing that performs sequential processing, unnecessary delays are less likely to occur. It is preferable to transmit the trigger signal from the trigger generation circuit 20 to the imaging device 30 by wire.
[0017] The imaging device 30 has a lens unit, an imaging element, a signal processing unit that processes a signal output from the imaging element, an output unit that outputs image data generated by the signal processing unit, and an input unit to which a trigger signal is input.
[0018] When a trigger signal is input to the input unit, the imaging device 30 starts imaging. The lens unit is provided so as to be removable from the imaging device, and an appropriate lens unit can be selected according to the size of the object and the shooting scene. The signal processing unit generates image data from the signal output from the imaging element. The output unit outputs the image data generated by the signal processing unit.
[0019] The image sensor is an element in which photoelectric conversion units are arranged in an array, such as a CMOS sensor. The image sensor may be an image sensor of a rolling shutter type in which the start and end of the exposure period differs for each row, or an image sensor of a global electronic shutter type in which the start and end of the exposure period is simultaneous for all rows.
[0020] (Processing device 40) The image data output from the imaging device 30 is input to the processing device 40, where the image data is estimated (FIG. 2: S4). The processing device 40 estimates the object of the image data. Here, the estimation of the object of the image data is performed according to the application of the system. Below, as the estimation process, a visual inspection process for determining whether or not the workpiece being imaged has a defect is described. In addition, for example, in the case of a system that identifies whether or not a specific object is present in image data, the identification process corresponds to the estimation process. In addition, in the case of an automatic sorting system, for example, the process of determining based on the size of the workpiece corresponds to the estimation process. It is preferable to transmit the image data from the imaging device 30 to the processing device 40 via a wired connection.
[0021] The processing device 40 has a trained model and judges whether the work is good or bad using the trained model. The GPU (Graphics Processing Unit) 42 can perform efficient calculations by processing more data in parallel. Therefore, when learning is performed using a learning model such as machine learning or deep learning using a multi-layered neural network, the GPU 42 can perform the processing. Note that machine learning and deep learning may be performed in the cloud instead of inside the processing device 40. By performing the learning in the cloud, the processing speed of machine learning and deep learning can be improved. Therefore, in this embodiment, the GPU 42 is used in addition to the CPU 41 for processing in the processing device 40. Specifically, when a learning program including a learning model is executed, the CPU 41 and the GPU 42 cooperate to perform calculations to perform learning. Note that the processing of the processing device 40 may be performed only by the CPU 41 or the GPU 42. Also, the execution of the learning program including the learning model may be performed in the cloud.
[0022] Each of the CPU 41 and the GPU 42 has a memory, and image data output from the imaging device is stored in these memories. As described above, the trigger generation circuit 20 causes the memories of the CPU 41 and the GPU 42 to store image data at the same time. Note that the processing device 40 may have a memory different from the memory of the CPU 41 and the main memory of the GPU 42. In this case, the image data is stored in the main memory. Then, as necessary, the image data stored in the main memory is written to the memory of the CPU 41 and the memory of the GPU 42.
[0023] The GPU 42 accesses the image data stored in the memory and processes the image data in parallel. The GPU 42 uses the trained model to determine whether or not the workpiece has a defect. The GPU 42 is more suitable for performing routine, large-scale calculation processing than the CPU 41, and the GPU 42 can perform estimation processing quickly.
[0024] The processing device 40 judges whether or not there is a defect in the area of the image data based on the image data acquired by the imaging device 30 (FIG. 2: S5). The judgment result made by the processing device 40 is output to a PLC (Programmable Logic Controller) 50, and if the final judgment result is that the workpiece is defective, the PLC 50 inputs an operation control signal to a robot 60. The robot 60 switches the movement operation of the workpiece, and moves the workpiece judged to be defective from the production line (FIG. 2: S6).
[0025] High-speed signal transmission is not required when outputting the determination result from the processing device 40 to the PLC 50. Therefore, the signal can be transferred using a general-purpose standard wired or wireless communication such as Ethernet.
[0026] (Trained model 430) Fig. 3 is a diagram for explaining an AI for determining defects in a workpiece, which is performed by the GPU 42 of the processing device 40. Fig. 4, Fig. 5, and Fig. 6 are diagrams for explaining a method for generating teacher data in the learning phase.
[0027] FIG. 3(A) is a conceptual diagram of the learning phase. An algorithm for defect determination is formed by inputting teacher data to the learning model 420. Details of the teacher data will be described later with reference to FIG. 4, FIG. 5, and FIG. 6, but the teacher data is image data obtained by dividing one image data into a plurality of regions. When performing learning with a correct answer (supervised learning), the data is data in which a plurality of regions obtained from one image data are marked to indicate whether or not predetermined information is included. The predetermined information is, for example, the presence or absence of a defect. The presence or absence of a defect is, for example, the presence or absence of peeling of metal in the case where the workpiece is a part having a metal surface, and the presence or absence of adhesion of a color different from the predetermined color in the case where the workpiece is a colored part. The learning model 430 is a model in which teacher data is input to the learning model 420, an algorithm is changed by an error backpropagation method or the like, and the learning model is trained to output information with higher accuracy regarding the presence or absence of the predetermined information. The processing of this learning phase is performed by at least one of the CPU 41 and the GPU 42. It is preferable that the processing of the learning phase is performed on the cloud. When the processing of the learning phase is performed by the processing device 40, a certain level of performance is required for the processing device 40. In contrast, by performing the processing of the learning phase on the cloud, it is possible to judge defects in the workpiece regardless of the performance of the processing device 40.
[0028] Specific learning algorithms may include machine learning such as nearest neighbor methods, naive Bayes methods, decision trees, and support vector machines. The learning algorithm may also be deep learning that uses a neural network to generate features and connection weighting coefficients. For example, a CNN model (Convolutional Neural Network Model) may be used as a deep learning model.
[0029] 3(B) is a conceptual diagram of the estimation phase. When a workpiece image 440 is input to a trained model 430 constructed in the learning phase, a defect presence / absence determination result 450 is output. Processing using this trained model 430 is executed by a GPU 42. Specifically, the workpiece image 440 is image data obtained by capturing an image of a workpiece to be inspected by an imaging device 30.
[0030] (First embodiment) Next, a method for generating teacher data according to the first embodiment will be described with reference to FIG.
[0031] First, image data is prepared by capturing images of a non-defective workpiece, a workpiece containing a first defect, a workpiece containing a second defect different from the first defect, etc. Then, one image data is divided into a plurality of regions (first regions), and each region is marked as to whether or not it contains predetermined information.
[0032] In FIG. 4, each first region is classified into a defective region R1 and a defect-free region R2. Then, data of the marked regions is input to the learning model. According to this embodiment, by dividing into a plurality of regions and creating training data, a plurality of training data can be obtained from one image data. Therefore, even if there is a small amount of image data that can be used for training data, the accuracy of the estimation process regarding the workpiece of the image data can be improved. In addition, since defective regions can be learned without reducing the resolution, the accuracy of judgment can be improved.
[0033] In this embodiment, the same image data is divided into a plurality of second regions by shifting the division position, and each second region is classified into region R1 and region R2, and the data of the marked regions is input to the learning model. This increases the amount of teacher data obtained from one image data. According to this embodiment, a plurality of regions R1 in which the defect position is shifted can be generated from one image data, and the amount of teacher data obtained from one image can be further increased. Although FIG. 4 shows one diagram in which the division position is shifted, it is preferable to increase the teacher data by shifting the division position little by little.
[0034] In addition, the division positions of multiple regions may be rotated, which increases the amount of training data that can be obtained from a single image data.
[0035] As training data, image data captured by changing the XY coordinates of the workpiece and image data captured by rotating the workpiece may be used. By inputting these image data as training data into the learning model, pass / fail judgment can be performed without reducing accuracy even if the workpiece is displaced from the specified position.
[0036] FIG. 5 shows a flowchart of the generation of teacher data according to this embodiment. In this embodiment, each of the regions described in FIG. 4 is decomposed into a plurality of components, and information on the decomposed components is used as teacher data. That is, each region is decomposed into a plurality of components, and each of the plurality of components is input to a learning model to generate a learned model. The plurality of components are color components, hue (H: Hue), saturation (S: Saturation), and value (V: Value). The values of these components are obtained, and the learned model makes an estimation based on each value. This can improve the judgment accuracy of the learned model.
[0037] First, the defective area R1 and the non-defective area R2 shown in Fig. 5 are decomposed into color image data, H image data, S image data, and V image data, respectively. The color image data is specifically red (R) image data, green (G) image data, and blue (B) image data.
[0038] Then, each data of region R1 and each data of region R2 are trained into a learning model. At this time, information on whether the image is good or bad is marked for each image group and trained. In other words, two-class classification training of good or bad is performed for each image data. This generates a trained model in which estimated values of R, G, B, H, S, and V for good or bad are trained. In the estimation phase, the obtained estimated values are compared with each data of the image of the workpiece to determine whether it is good or bad.
[0039] In this embodiment, when the background design is different, the trained model described above is created for each design. For example, FIG. 6 shows a case where the background color is different as the background design. In FIG. 6, a workpiece having a red background area (first part) and a blue background area (second part) is used. In FIG. 6, a trained model A trained on the first part of the captured image data and a trained model B trained on the second part are generated. That is, a trained model is generated for each background design. When the background design is different, it may not be possible to accurately judge pass / fail unless the number of teacher data input to the trained model is increased. For example, when the workpiece is a colored part, the amount of change for each color is different between a case where a color other than red is attached to a red background area and a case where a color other than blue is attached to a blue background area. In this way, when the background color is different and the attached color is also different, the number of teacher data for improving the accuracy of the trained model is likely to be larger than when only one of them is different. As in this embodiment, if a trained model is generated for each background color, it is necessary to perform only pass / fail judgment, and pass / fail judgment can be performed from a predetermined number of training data.
[0040] In the above description, the background color is used as the background design, but other than the background color, the background design also includes differences in the background pattern and background material.
[0041] In the above description, a non-defective workpiece, a workpiece containing a first defect, and a workpiece containing a second defect are used as the workpieces, but it is sufficient to use a workpiece containing at least one defect. Even in this case, multiple pieces of teacher data with different defect positions can be obtained by dividing the workpiece into multiple regions. On the other hand, for example, when the workpiece is a colored part, it is considered that the shapes of the defects are different. By using multiple workpieces containing different types of defects such as shapes as described above, the accuracy of pass / fail judgment can be improved.
[0042] Also, in the above description, the data marked in the area obtained from the non-defective image 411 is input as the training data, but this data is not necessary. For example, the data marked in the area obtained from the defect 1 image 412 and the data of the area obtained from the defect 2 image 413 may be used as the training data. This is because it is possible to input information on the defect-free area R2 from the areas obtained from the defect 1 image 412 and the areas obtained from the defect 2 image 412 as the training data.
[0043] 1, the processing device 40 generates the trained model, but the generated trained model may be input to the processing device 40. For example, image data captured by an imaging device may be transmitted to an information terminal, the information terminal may generate the trained model, and the trained model with a predetermined accuracy or higher may be input to the processing device 40. The information terminal is, for example, a computer such as a personal computer.
[0044] In the above description, the color image data and the hue data are input to the learning model, but this is not limited to the above. For example, the calculation parameters may be adjusted for each color, and a learned model may be generated based on the data.
[0045] Second Embodiment 7 shows a method for generating a trained model according to the second embodiment. This embodiment differs from the first embodiment in that difference information between defective products and non-defective products is input to the trained model. Other than the matters described below, this embodiment is the same as the first embodiment.
[0046] As shown in FIG. 7, when the workpiece is a colored part, the characters and patterns printed on the workpiece may differ for each model even if the shape and background color of the workpiece are the same. In such a case, a huge amount of training data is required to create a trained model for each model. In contrast, in this embodiment, a trained model is generated from difference information between defective image data and defect-free (non-defective) image data. Specifically, for model 1, difference information between defective image data (image data captured of the first workpiece) and non-defective image data (image data captured of the third workpiece) is input to the trained model as a defective product. Then, difference information between non-defective image data (image data captured of the second workpiece) and non-defective image data (image data captured of the fourth workpiece) is input to the trained model as a non-defective product. By performing this for each model, a trained model is generated.
[0047] Before generating the difference information, it is preferable to align the defective image data and the non-defective image data by pattern matching or the like, and then generate the difference information. This can improve the accuracy of the difference information. If the work is a component with a printed label attached, it is preferable to align the position of the label of the work and generate the difference information. By aligning the position of the label, it is possible to accurately determine whether the work is good or bad, even if the position of the label is misaligned for each work.
[0048] In this embodiment, even when a pass / fail judgment is performed using a trained model, differential information between the image data of a good product and image data of an actual workpiece is generated and input into the trained model, and a pass / fail judgment result is output from the trained model.
[0049] According to this embodiment, even if the characters or designs printed on each model are different, the same trained model can be used to determine pass / fail.
[0050] In Fig. 7, difference information for different models is input, but difference information for multiple defects for the same model may be generated and input. In the estimation phase, if difference information between non-defective product data of the model that performs pass / fail judgment and image data of an actual workpiece is input to the trained model, pass / fail judgment can be performed while maintaining a certain degree of accuracy.
[0051] (Third embodiment) 8 to 11 are diagrams for explaining a method for generating a trained model according to the third embodiment. This embodiment differs from the second embodiment in that, for one workpiece, difference information between captured image data and shift image data is input to the trained model. That is, this embodiment differs from the second embodiment in that the difference within the workpiece is observed, not the difference between the works. In general, even small differences in patterns or characters depending on the model affect the trained model, so it is necessary to generate a different trained model for each model. As in this embodiment, the presence or absence of defects is determined using a difference image in one workpiece having a predetermined repetitive pattern, thereby eliminating the influence of differences in patterns or characters. Other than the matters described below, this embodiment is the same as the second embodiment.
[0052] The workpiece assumed in this embodiment is a product having an area including a predetermined repeating pattern. Examples include wallpaper, stickers, wood grain decorative paper, woven fabric, and tableware. Among these products, the workpiece is assumed to have a pattern or material with a predetermined repeating pattern. A predetermined repeating pattern refers to a pattern that includes two or more identical patterns. The same pattern refers to a repeating cycle as shown in FIG. 9, and a repeating cycle that has a difference in the presence or absence of defects is considered to be included in the same pattern. In other words, even if there is a defect, if the predetermined pattern is repeatedly arranged, it is considered to have a predetermined repeating pattern.
[0053] 8A is a conceptual diagram of the learning phase. The learning phase according to this embodiment includes an image acquisition process P11, an image rotation process P12, a shift position detection process P13, a difference image generation process P14, an image segmentation process P15, an annotation process P16, and a machine learning process P17.
[0054] In the image acquisition step P11, a captured image is acquired by capturing an image of an area including a predetermined repeating pattern in a workpiece (first workpiece).
[0055] In the image rotation process P12, the rotation direction of the predetermined repeating pattern is adjusted so that the difference can be calculated appropriately. For example, in the case of a pattern as shown in FIG. 9, the captured image is rotated so that the straight line portion that is the outer edge of the captured image is horizontal, and the orientation in the rotation direction is adjusted. Other methods for calculating the rotation direction include a method of detecting the pattern direction included in the predetermined repeating pattern, and a method of detecting a straight line at the edge of the workpiece (first workpiece). Note that the image rotation process P12 is not a required configuration, and the shift position detection process P13 may be performed after the image acquisition process P11.
[0056] In the shift position detection process P13, the shift position is detected from the captured image for generating the shift image. Then, the shift image at the shift position is calculated. The shift position can be set appropriately. When detecting the shift position, a reference position is first set. For example, an end of a predetermined pattern is set as the reference position. Next, a position separated by one or more predetermined patterns is detected as the shift position and calculated as the shift image. An example of a method for detecting the shift position is described below, but the method for detecting the shift position is not limited to this.
[0057] When a predetermined periodic pattern is arranged in the row direction (horizontal direction), it is necessary to detect a pattern that has the highest similarity when a reference predetermined periodic pattern is shifted in the row direction. For example, in FIG. 9, it is necessary to detect a pattern that has the highest similarity to a periodic pattern including an area a1 and an area b1. The similarity can be obtained by calculating the difference between the luminance value (pixel value) of each pixel of a pattern at a reference position and the pixel value of each pixel of a pattern that is a predetermined distance away from the reference position in the row direction, and calculating the standard deviation of the difference. The pattern with the smallest standard deviation is determined to have the highest similarity, and an image of the pattern with the highest similarity is generated as a shifted image. Note that FIG. 9 shows a case where periodic patterns are arranged only in the row direction, but when periodic patterns are arranged in the column direction (vertical direction) or diagonal direction, a pattern with a high similarity when shifted in the column direction and a pattern with a high similarity when shifted in both the row and column directions may be generated as shifted images.
[0058] Next, a differential image generating step P14 is performed. As shown in Fig. 9, in the differential image generating step P14, a differential image between the captured image and the shifted image is generated. The differential image is less susceptible to the influence of a predetermined repeating pattern because the difference between the captured image and the shifted image is taken. In other words, the differential image allows only the presence or absence of defects to be confirmed. This makes it possible to determine the presence or absence of defects.
[0059] As shown in FIG. 9, when a defect is present in the captured image, the defect may also remain in the shifted image depending on the shift position. In this case, if the workpiece is judged to have a defect only when there are two defects based on the difference image alone, it is determined that there is a defect. Therefore, even if there is a defect in the shifted image, if there is no defect in the shifted image, it is determined that there is no defect. Therefore, it is necessary to eliminate the influence of defects in the shifted image.
[0060] In this embodiment, a difference value between a captured image and a shifted image is calculated, and the presence or absence of a defect is corrected based on whether or not the absolute value of the difference value exceeds a predetermined threshold, as shown in Fig. 10. The correction process can be changed depending on the object.
[0061] FIG. 10(A) shows image data of a captured image, and FIG. 10(C) shows image data of a shifted image. For convenience of explanation, in FIG. 10(A) and FIG. 10(C), only defects are shown in the captured image and the shifted image, and a predetermined periodic pattern is not shown. FIG. 10(E) shows a difference image between FIG. 10(A) and FIG. 10(C), and FIG. 10(G) shows an image after a process for correcting the presence or absence of defects is performed. FIG. 10(B), FIG. 10(D), FIG. 10(F), and FIG. 10(H) show pixel values at the broken lines in FIG. 10(A), FIG. 10(C), FIG. 10(E), and FIG. 10(G), respectively. In FIG. 10(A) and FIG. 10(C), the pixel value of the defect-free area is 255, and the pixel value of the defective area is 128. The difference image in FIG. 10(F) can be calculated by subtracting the pixel value of the shifted image from the pixel value of the captured image. For example, the pixel value of the defect in Fig. 10(B) becomes 128-256=-128 by subtraction (Fig. 10(F)). If the result of subtracting the pixel value of the shifted image from the pixel value of the captured image is a negative value, the area is determined to have a defect, and if the result of the subtraction is a positive value, the area is determined to have no defect. As a result, in the processed image, the defective area detected in the shifted image can be corrected to have no defect.
[0062] In generating the difference image, the subtraction result may be multiplied by a predetermined value to increase the contrast of the defect. For example, if the processed pixel value is calculated using the formula: subtraction result x 2 + 255, correction can be performed with increased contrast. This makes it possible to perform the correction process accurately and extract data of only the defects in the captured image. This makes it possible to learn data of only the defects in the captured image.
[0063] In addition, the example in Fig. 10 assumes a process for correcting a workpiece in which the pixel value (gradation) becomes low when a defect is present. For example, the object is a fiber, and the light that passes through the object is captured by an imaging device for inspection. Conversely to this example, when correcting a workpiece in which the pixel value becomes high when a defect is present, the area may be corrected to be a non-defective area when the subtraction result is a negative value, and to be a defective area when the subtraction result is a positive value.
[0064] Next, the image division step P15 is performed. In the image division step P15, the image is divided into sizes for performing AI learning / inference. If there is a defect at the boundary of the image division, it becomes difficult to detect the defect. Therefore, as shown in FIG. 11, when performing image division, it is preferable to determine the division position so that the regions overlap.
[0065] Next, in the image data obtained in the image segmentation step P15, information on good or bad products is marked and trained into a learning model (annotation step P16). In the annotation step P16, an image may be generated by rotating or translating the image data obtained in the image segmentation step P15, and the number of learning image data may be increased. Note that annotation may be performed using the difference image after processing without image segmentation. The learning model is trained using these data (machine learning step P17).
[0066] In the inference phase shown in Fig. 8(B), the workpiece to be actually inspected (second workpiece) is used to carry out image acquisition step P21, image rotation step P22, shift position detection step P23, difference image generation step P24, and image division step P25. Then, in inference step P26, it becomes possible to determine whether the workpiece is good or bad. In the inference phase, as in the learning phase, image rotation step P22 is not essential.
[0067] According to this embodiment, even if the patterns or characters differ slightly depending on the model of the workpiece, it is possible to perform inspection without creating a separate learning model for each model. In addition, by inputting the difference image of another model into the same learning model to create a trained model, it is also possible to determine the other model using the same trained model. [Explanation of symbols]
[0068] 30 Imaging device 40 Processing equipment
Claims
1. inputting image data including a first portion of a first background design and a second portion of a second background design different from the first background design; performing machine learning using a plurality of training data in which each of a plurality of first regions in the first portion is labeled with whether or not it contains predetermined information; A learning method for performing machine learning using a plurality of training data in which each of the plurality of first regions in the second portion is marked with whether or not it contains the specified information.
2. Decomposing each of the region including the predetermined information and the region not including the predetermined information into a plurality of components; The learning method according to claim 1, characterized in that training data for obtaining estimated values of each of the plurality of components in an area including the specified information and training data for obtaining estimated values of each of the plurality of components in an area not including the specified information are input into a learning model for machine learning.
3. Input the image data of the workpiece, Dividing the image data into a first region including predetermined information and a second region not including the predetermined information; Decomposing each of the first region and the second region into a plurality of components; A learning method for machine learning teacher data for obtaining estimated values of each of the plurality of components in the first domain and teacher data for obtaining estimated values of each of the plurality of components in the second domain.
4. 4. The learning method according to claim 1, wherein the predetermined information is the presence or absence of a defect.
5. 4. The method of claim 3, wherein the plurality of components include color components, hue, saturation, and brightness.
6. A system comprising an imaging device and a processing device having a learned learning model to which image data captured by the imaging device is input, The trained learning model is created by inputting difference information between first image data obtained by imaging a first workpiece with the imaging device and second image data different from the first image data, Inputting difference information between third image data obtained by imaging the second workpiece with the imaging device and fourth image data different from the third image data into the trained learning model, and making a judgment regarding the second workpiece. A system characterized by:
7. 7. The system according to claim 6, wherein the second image data and the fourth image data are image data obtained by photographing a non-defective workpiece.
8. the first workpiece includes a repeating pattern; The second image data is a shifted image obtained by shifting the first image data by one or more repeating patterns in image data obtained by capturing an image of the first workpiece, The system described in claim 6 or 7, characterized in that the fourth image data is a shifted image obtained by shifting the third image data by one or more repeating patterns in image data captured of the second workpiece.
9. The difference information between the first image data and the second image data input to the learning model is information that has been subjected to a predetermined process, The system described in claim 8, characterized in that the specified processing processes an area where there is a difference in difference information between the second image data and the first image data as an area where there is no difference if the absolute value of the difference value of the area exceeds a specified threshold.
10. 9. The system of claim 6, wherein the first workpiece is a colored part.
11. The system includes a sensor and a trigger generating circuit that communicates an imaging trigger signal to the imaging device; When the sensor detects that the second workpiece is within a predetermined range, the sensor outputs a signal to the trigger generating circuit; 9. The system according to claim 6, wherein the imaging device images the first workpiece based on the imaging trigger signal output from the trigger generating circuit based on the signal.
12. The system includes a robot; The system of claim 11 , further comprising: moving a workpiece determined to have a defect by the trained learning model.
Citation Information
Patent Citations
Pseudo defective image automatic creation device and imaging inspection device
JP2005156334A
Imaging processing apparatus
JP2018164272A
Defect detection method, system for defect detection, and training method
JP2018180545A
Defect inspection device, defect inspecting method, and program thereof
JP2019091249A
Image processing device, image processing method, and recording medium
WO2019146538A1
