Neural network training method and defect detection method, device and storage medium
By introducing defects and noise associated with the original image features in neural network training, the problem of low detection accuracy and degree of automation in existing defect detection methods is solved, and more efficient defect detection is achieved.
Patent Information
- Application Number
- CN202011535094.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2040-12-23
AI Technical Summary
The existing defect detection methods are difficult to achieve accurate detection of disordered defects and automatic acquisition of detection results, and the number of labeled data required for training neural networks is large and the efficiency is low.
By introducing defects associated with the original training image features as input training images, the neural network is trained and noise is introduced during the training process to enrich samples, improving detection accuracy and automation.
Improves the accuracy and automation of neural networks in defect detection, reduces dependence on labeled data, and improves user experience.
Smart Images

Figure CN114663337B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a neural network training method, and a method, device and computer-readable storage medium for defect detection using a neural network. Background Art
[0002] Defect detection is an important factor in product quality control. Since the defect patterns and colors on the product surface are random, robust and automatic detection of various defects is a key issue that needs to be solved in this field.
[0003] In current defect detection methods, a large amount of labeled data is usually used to train the neural network for defect detection. In addition, during defect detection, post-processing is often required by manually setting thresholds. The above-mentioned neural network training method and the defect detection method using this neural network cannot achieve accurate detection of disordered defects and automatic acquisition of detection results. Summary of the invention
[0004] To solve the above technical problems, according to one aspect of the present invention, a neural network training method is provided, comprising: inputting an input training image into the neural network, wherein the input training image is an image generated by introducing defects into an original training image, and the defects are associated with image features of the original training image; decomposing the input training image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; performing defect detection on the synthesized training image using the neural network, and adjusting parameters of the neural network at least according to the original training image and the defect detection results.
[0005] According to another aspect of the present invention, there is provided a method for defect detection using a neural network, comprising: inputting an input image into the neural network, wherein the neural network is trained by the above-mentioned neural network training method; performing defect detection on the input image using the neural network, extracting the contour of the defect, and obtaining a defect detection result.
[0006] According to another aspect of the present invention, there is provided a neural network training device, comprising: an input unit, configured to input an input training image into the neural network, wherein the input training image is an image generated by introducing defects into an original training image, and the defects are associated with image features of the original training image; a synthesis unit, configured to decompose the input training image using the neural network, introduce noise into the decomposition result, and synthesize the decomposition result and the noise to obtain a synthesized training image; and a detection unit, configured to perform defect detection on the synthesized training image using the neural network, and adjust parameters of the neural network at least according to the original training image and the defect detection result.
[0007] According to another aspect of the present invention, there is provided a neural network training device, comprising: a processor; and a memory, wherein computer program instructions are stored in the memory, wherein when the computer program instructions are executed by the processor, the processor is caused to perform the following steps: inputting an input training image into the neural network, wherein the input training image is an image generated by introducing defects into an original training image, and the defects are associated with image features of the original training image; decomposing the input training image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; performing defect detection on the synthesized training image using the neural network, and adjusting parameters of the neural network at least according to the original training image and the defect detection result.
[0008] According to another aspect of the present invention, there is provided a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the following steps: inputting an input training image into a neural network, wherein the input training image is an image generated by introducing defects into an original training image, and the defects are associated with image features of the original training image; decomposing the input training image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; performing defect detection on the synthesized training image using the neural network, and adjusting parameters of the neural network at least according to the original training image and the defect detection result.
[0009] According to another aspect of the present invention, there is provided an apparatus for defect detection using a neural network, comprising: an input unit configured to input an input image into the neural network, wherein the neural network is trained by the above-mentioned neural network training method; and a detection unit configured to perform defect detection on the input image using the neural network, extract the contour of the defect, and obtain a defect detection result.
[0010] According to another aspect of the present invention, there is provided an apparatus for performing defect detection using a neural network, comprising: a processor; and a memory, wherein computer program instructions are stored in the memory, wherein when the computer program instructions are executed by the processor, the processor executes the following steps: inputting an input image into the neural network, wherein the neural network is trained by the above-mentioned neural network training method; performing defect detection on the input image using the neural network, extracting the contour of the defect, and obtaining a defect detection result.
[0011] According to another aspect of the present invention, there is provided a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the following steps: inputting an input image into a neural network, wherein the neural network is trained by the above-mentioned neural network training method; performing defect detection on the input image using the neural network, extracting the contour of the defect, and obtaining a defect detection result.
[0012] According to the above-mentioned neural network training method, device and computer-readable storage medium, as well as the method, device and computer-readable storage medium for defect detection using a neural network of the present invention, it is possible to train a neural network for defect detection by introducing defects associated with image features of an original training image as an input training image, and it is possible to enrich defect detection samples used for neural network training by further introducing noise, thereby improving the defect detection accuracy and automation of the neural network and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other objects, features and advantages of the present invention will become more apparent by describing in detail the embodiments of the present invention in conjunction with the accompanying drawings.
[0014] Figure 1 A flowchart showing a neural network training method according to an embodiment of the present invention is shown;
[0015] Figure 2 A flow chart showing a method for defect detection using a neural network according to an embodiment of the present invention;
[0016] Figure 3 A schematic diagram of the structure of a neural network used for training according to an example of an embodiment of the present invention is shown;
[0017] Figure 4 A schematic diagram showing a decomposition process in an example according to an embodiment of the present invention;
[0018] Figure 5 A schematic diagram showing a first discriminant network or a second discriminant network according to an example of an embodiment of the present invention;
[0019] Figure 6 A schematic diagram showing defect detection on a synthetic training image according to an example of an embodiment of the present invention is shown;
[0020] Figure 7 A block diagram showing a neural network training device according to an embodiment of the present invention;
[0021] Figure 8 A block diagram showing a neural network training device according to an embodiment of the present invention;
[0022] Fig. 9 A block diagram showing an apparatus for defect detection using a neural network according to an embodiment of the present invention;
[0023] Fig.10 A block diagram of a device for defect detection using a neural network according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] The following will describe a neural network training method, apparatus, and computer-readable storage medium according to an embodiment of the present invention, as well as a method, apparatus, and computer-readable storage medium for defect detection using a neural network, with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same elements throughout. It should be understood that the embodiments described herein are merely illustrative and should not be interpreted as limiting the scope of the present invention.
[0025] When training a neural network for defect detection, it is often necessary to introduce a large number of input images containing various defects as samples to adjust the parameters of the neural network. However, in the actual training process, it is often difficult to guarantee the collection of samples and the training effect of the neural network. Figure 1 FIG. 1 is a flowchart of a neural network training method 100 according to an embodiment of the present invention. Figure 1 A neural network training method according to an embodiment of the present invention is described.
[0026] In step S101, an input training image is input into the neural network, wherein the input training image is an image generated by introducing defects into an original training image, and the defects are associated with image features of the original training image.
[0027] In this step, the original training images used to train the neural network can be images of products without defects. In order to enrich the training samples as much as possible, the original training images can be various product images of the same product collected at different angles, different lighting conditions, and different backgrounds, so as to further improve the defect detection accuracy of the trained neural network.
[0028] After acquiring the original training image, defects can be introduced into the original training image to obtain an input training image for inputting into the neural network. The introduced defects can be associated with the image features of the original training image. Optionally, the image features of the original training image can include at least one or more of the image shape, texture, and color of the original training image. By introducing defects associated with its image features into the original training image, the generated input training image can be closer to the image of a product with defects in a real situation. In one example, the defects can be associated with the theme color of the original training image. For example, the product shown in the original training image is a doll, which has colors such as black, skin color, and red. The defects introduced into the original training image can include defects of the above-mentioned colors to better simulate the samples with defects in the real situation. For another example, the defects can be associated with the texture of the original training image. For example, there are multiple dots in the original training image, and the introduced defects can also be dots with similar patterns. This is also to simulate the samples with defects in the real situation more realistically.
[0029] In step S102, the input training image is decomposed using the neural network, noise is introduced into the decomposition result, and the decomposition result and the noise are synthesized to obtain a synthesized training image.
[0030] In this step, the input training image can be decomposed into multiple components using a neural network, for example, including a restored image component without defects restored by the neural network, a defect image component showing defects in the input training image, and a correction factor for indicating a mapping of the ratio of the restored image component to the defect image component in the input training image. Optionally, the input training image I can be expressed as formula (1):
[0031] I=αN+(1-α)D (1)
[0032] Wherein N is the restored image component without defects restored by the neural network, D is the defective image component showing defects in the input training image, and α is a correction factor for indicating the mapping of the ratio of the restored image component N and the defective image component D in the input training image. For example, the restored image component N and the defective image component D can be matrices arranged in the same manner as the input training image I, respectively, and the correction factor α represents the weights occupied by the restored image component N and the defective image component D at each one-to-one corresponding matrix point of the two, and the value of α can be 0≤α≤1. For example, when the value of α is 1 at a certain matrix point, the point of the input training image I is the value of the restored image component N without defects at that point; and when the value of α is 0 at a certain matrix point, the point of the input training image I is the value of the defective image component D at that point.
[0033] In the above example, the defective image component D can be understood as the real pixel value at each matrix point. In another example, the defective image component D can also be understood as the difference between the matrix point pixel values of the input training image I and the restored image component N without defects at the corresponding defect position, that is, it can be expressed as the pixel difference between the matrix points of the input training image I and the restored image component N. Of course, at this time, the above formula (1) can also be adjusted accordingly according to the above principle. In practical applications, any representation method of defective image components can be adopted, and there is no restriction here. Optionally, this part of the structure of the neural network for decomposing the input training image can include a generation network, which can be composed of an encoder, a decoder and a generator. The encoder can use multiple groups of convolution, normalization and pooling processes with different parameters to extract feature maps of different scales of the input training image. Specifically, the input training image can be first convolved with a convolution kernel to obtain a convolution map, and then the convolution map can be normalized using a rectified linear unit and a batch normalization method to obtain a normalized convolution map, and then the normalized convolution map is applied with a maximum pooling or average pooling process. The above process can be repeated multiple times, and multiple downsampling processes can be used to extract multi-scale feature maps. The decoder in the generative network can use multiple sets of convolution, normalization and upsampling processes to restore the resolution of the feature map generated in the encoder. The generator in the generative network can combine the characteristics of images with the same resolution obtained in the encoder and decoder, and use multiple sets of convolution processes to output the decomposition results. Among them, the generation of restored image components can be supervised based on the original training image that does not contain defects. In addition, the generation of defective image components and correction factors can also be supervised based on the defects introduced by the input training image. The above-mentioned operation process for decomposing the input training image is only an example. In actual applications, the input training image can be decomposed using any decomposition method, and there is no limitation here.
[0034] After decomposing the input training image, the original training image and the restored image component can be compared according to the first discriminant network in the neural network, and the parameters of the generation network can be adjusted according to the comparison results. For example, the first discriminant network can extract features from the generated restored image component, compare and discriminate with the original training image based on the extracted features, and output the discrimination result. More specifically, the first discriminant network can use multiple sets of convolution, normalization and pooling processes with different parameters to respectively extract feature maps of different scales of the restored image component, and judge whether the restored image component is true. If the result is true, it means that it judges that the restored image component has a high similarity with the original training image, and also means that the generated restored image component is good enough. The above-mentioned first discriminant network can adjust the parameters of the neural network through feedback, so as to generate high-quality restored image components and corresponding high-quality defect image components and correction factors during the training stage.
[0035] After obtaining the decomposition result, noise can be introduced to the decomposition result, for example, random noise can be introduced, and the decomposition result and the noise can be synthesized into a synthetic training image. Among them, the noise defect image component and the noise correction factor can be obtained respectively according to the defect image component, the correction factor and the introduced noise; then the restored image component, the noise defect image component and the noise correction factor are synthesized to obtain the synthetic training image. When random noise is introduced to the decomposition result, it may affect the defect image component and the correction factor obtained by decomposition, so it is necessary to update the defect image component to the noise defect image component according to the position and size of the introduced random noise, and update the correction factor to the noise correction factor at the corresponding position where the random noise appears. After the update, it can be combined with the restored image component generated by the previous decomposition to synthesize into a synthetic training image.
[0036] In the process of acquiring the synthetic training image, considering that the introduced random noise may affect the judgment of the noise part in the synthetic training image, the synthetic training image can be further adjusted according to at least one of the following: at least the defect edge smoothness calculated according to the noise defect image component and the noise correction factor; at least the color similarity calculated according to the restored image component and the noise defect image component. Specifically, the defect edge smoothness can be calculated at least according to the noise defect image component and the noise correction factor using various boundary or gradient extraction methods, and the noise defect image component and the noise correction factor can be further adjusted according to the calculated defect edge smoothness, so that the defect edge is as smooth as possible, or the degree of smoothness of the defect edge is greater than a preset threshold. Subsequently, after the defect edge smoothness is adjusted, various similarity measurement algorithms can be used to calculate the color similarity between the restored image component and the adjusted noise defect image component, so that only the noise defects that are not similar enough to the color of the restored image component (or the similarity is less than a preset threshold) are retained, and the noise defect image component and the noise correction factor can be further modified accordingly, and the generated synthetic training image can be further updated.
[0037] In step S103, defect detection is performed on the synthetic training image using the neural network, and parameters of the neural network are adjusted at least according to the original training image and the defect detection result.
[0038] In this step, a restored training image can be obtained according to the synthesized training image. Specifically, a restored training image without defects can be obtained according to a multi-task network in the neural network, and the contour of the defect can be extracted. The generation process of the restored training image can be similar to the operation process of the generation network in the aforementioned decomposition input training image, and the process of extracting the contour of the defect can be supervised by the noise defect image component and the noise correction factor used to synthesize the synthesized training image.
[0039] After obtaining the restored training image, the parameters of the neural network can be adjusted at least according to the original training image and the restored training image. Specifically, the original training image and the restored training image can be compared according to the second discriminant network in the neural network, and the relevant parameters of the neural network can be adjusted according to the comparison result. For example, the second discriminant network can extract features from the generated restored training image, compare and discriminate with the original training image based on the extracted features, and output the discrimination result. More specifically, the second discriminant network can use multiple groups of convolution, normalization and pooling processes with different parameters to respectively extract feature maps of different scales of the restored image components, and judge whether the restored training image is true. If the result is true, it means that it judges that the restored training image is consistent with the original training image, indicating that the generated restored training image is good enough. The above-mentioned second discriminant network can adjust the relevant parameters of the neural network through feedback, so as to generate high-quality restored training images and correspondingly extract defect contours with high quality during the training stage.
[0040] According to the above neural network training method of the embodiment of the present invention, the neural network for defect detection can be trained by introducing defects associated with the image features of the original training image as the input training image, and the defect detection samples used for neural network training can be enriched by further introducing noise, thereby improving the accuracy and automation of neural network defect detection and improving user experience. The above neural network training method of the embodiment of the present invention can be applied to various product inspections and computer vision tasks such as surface defect detection of objects such as road surfaces and chip surfaces.
[0041] In addition, according to another embodiment of the present invention, the neural network training may not be limited to the specific operation process of the above-mentioned neural network training method. Further, the architecture and process of the neural network may be used to achieve other requirements in various application scenarios. For example, the architecture of the above-mentioned neural network may be used to realize the production of diversified samples, such as faces, animated images, etc.; or it may be applicable to other corresponding scenarios that require the introduction of image defects or noise. Specifically, in the above-mentioned case, the input sample image may be used to replace the input training image, and the original sample image may be used to replace the original training image, and there may be no need for the subsequent process of adjusting the parameters of the neural network. The above-mentioned method may, for example, include the following steps: inputting the input sample image into the neural network, wherein the input sample image is an image generated by introducing defects into the original sample image, and the defects are associated with the image features of the original sample image; decomposing the input sample image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthetic sample image. The various synthetic sample images obtained according to the above-mentioned steps can be used as diversified samples and applied to the corresponding scenarios. The above method according to the embodiment of the present invention can generate an input sample image with corresponding defects by combining the image features of the original sample image, and introduce various noises, such as random noise, to process the input sample image, thereby obtaining diversified samples suitable for corresponding application scenarios.
[0042] Figure 2 A flow chart of a method 200 for defect detection using a neural network according to an embodiment of the present invention is shown. Figure 2 A method for defect detection using a neural network according to an embodiment of the present invention is described.
[0043] In step S201, an input image is input into the neural network, wherein the neural network is constructed by Figure 1 Specifically, when the input image to be detected is input into the neural network, it can be directly input from the port where the input training image is input during the neural network training, or it can be input from the port where the synthetic training image is input into the neural network. Both input methods can obtain defect detection results through the trained neural network. Of course, in the defect detection stage, the first and second discriminant networks mentioned above are not required to perform true and false discrimination and parameter adjustment on the image restored by the neural network, and only the trained neural network needs to be used for defect detection.
[0044] In step S202, the input image is subjected to defect detection using the neural network, the contour of the defect is extracted, and the defect detection result is obtained. In the defect detection process, the above-mentioned multi-task network can be used to restore the detection image without defects and extract the contour of the defect.
[0045] According to the above-mentioned method for defect detection using a neural network in the embodiment of the present invention, defect detection can be performed by using a neural network trained by the neural network training method in the embodiment of the present invention, thereby improving the accuracy and automation of defect detection of the neural network and improving the user experience. The above-mentioned method for defect detection using a neural network in the embodiment of the present invention can be applied to computer vision tasks such as various product inspections and surface defect detection of objects such as road surfaces and chip surfaces.
[0046] The following describes an example of a neural network training method and a defect detection method using the neural network according to an embodiment of the present invention.
[0047] Figure 3 FIG. 2 shows a schematic diagram of a neural network structure for training according to an example of an embodiment of the present invention. Figure 3 As shown, for introducing defects into the original training image I0, an input training image I is generated, wherein the introduced defects are associated with at least one or more of the image features of the original training image, such as image shape, texture, and color.
[0048] For the neural network used for training, different input training images I can be input multiple times, wherein the input training image I can be an input training image I obtained by introducing different defects into the same original training image I0, or can be an input training image I obtained by introducing the same or different defects into different original training images I0 collected at different angles, different lighting conditions, and different backgrounds.
[0049] Figure 4 A specific example of the decomposition process of the above example according to an embodiment of the present invention is shown. After introducing defects to the original training image I0 and inputting the input training image I into the neural network, the generation network in the neural network can be used to decompose it, and the restored image component N without defects restored by the neural network, the defective image component D showing the defects in the input training image, and the correction factor α used to indicate the mapping of the ratio of the restored image component and the defective image component in the input training image are obtained. The relationship between these components and the input training image I can be expressed by formula (1). Among them, the generation of the restored image component N can be supervised based on the original training image I0 that does not contain defects. In addition, the generation of the defective image component D and the correction factor α can also be supervised based on the defects introduced by the input training image, and the corresponding loss functions L_N, L_D, and L_α can be obtained.
[0050] After decomposing the input training image I, the original training image I0 and the restored image component N can be compared according to the first discriminant network in the neural network, and the relevant parameters of the generation network can be adjusted according to the comparison result. The first discriminant network can adjust the parameters of the neural network through feedback, so as to generate high-quality restored image components N and corresponding high-quality defective image components D and correction factors α during the training stage. Figure 5 A schematic diagram of the first discriminant network or the subsequent second discriminant network according to the above example of an embodiment of the present invention is shown, which can perform true or false discrimination based on the input restored image component N or restored training image N* and the original training image I0 and obtain the corresponding loss function L_A or L_N*.
[0051] After obtaining the decomposition result, random noise Z can be introduced into the decomposition result, wherein the noise defect image component and the noise correction factor can be obtained respectively according to the defect image component D, the correction factor α and the introduced noise, and then the restored image component, the noise defect image component and the noise correction factor are synthesized to obtain the synthesized training image I*.
[0052] In the process of obtaining the synthetic training image I*, the synthetic training image I* can be further adjusted according to at least one of the following: at least the defect edge smoothness calculated based on the noise defect image component and the noise correction factor; at least the color similarity calculated based on the restored image component and the noise defect image component.
[0053] Subsequently, a neural network may be used to perform defect detection on the synthetic training image I*, and parameters of the neural network may be adjusted at least according to the original training image I0 and the defect detection result. Figure 6 A schematic diagram of defect detection on a synthetic training image according to the above example of an embodiment of the present invention is shown, wherein a restored training image N* without defects restored by a neural network can be obtained based on the synthetic training image I*, and the contour C of the defect can be extracted at the same time.
[0054] After obtaining the restored training image N*, the parameters of the neural network can be adjusted at least according to the original training image I0 and the restored training image N*. Figure 5 The second discriminant network in the neural network shown compares the original training image I0 and the restored training image N*, obtains the loss function L_N* according to the comparison result, and adjusts the relevant parameters of the neural network. In addition, the extracted defect contour C can be supervised according to the noise defect image component and the noise correction factor in the synthesized training image I*, and the loss function L_C can be obtained.
[0055] After obtaining the above loss functions, the total loss function of the neural network including L_N, L_D, L_α, L_N*, L_C, L_A, etc. can be calculated, and the various parameters of the neural network can be updated.
[0056] The above describes in detail a neural network training method according to an example of an embodiment of the present invention. Figure 3 When the neural network shown in the figure performs defect detection, the input image can be first input into the neural network. Specifically, the input can be directly input from the input port of I or from the input port of I*. Both input methods can obtain defect detection results through the trained neural network. In addition, in the defect detection stage, the first discriminant network and the second discriminant network are not required to perform true and false discrimination and parameter adjustment on the image restored by the neural network. Instead, only the trained neural network needs to be used for defect detection, the contour C of the defect is extracted, and the restored training image N* without defects restored by the neural network is output.
[0057] Below, refer to Figure 7 The neural network training device according to an embodiment of the present invention is described. Figure 7 FIG. 7 is a block diagram of a neural network training device 700 according to an embodiment of the present invention. Figure 7 As shown in FIG. 7 , the neural network training device 700 includes an input unit 710, a synthesis unit 720, and a detection unit 730. In addition to these units, the neural network training device 700 may also include other components. However, since these components are irrelevant to the content of the embodiment of the present invention, their illustration and description are omitted here. In addition, since the specific details of the following operations performed by the neural network training device 700 according to the embodiment of the present invention are the same as those described above with reference to FIG. Figure 1 The details described are the same, so repeated description of the same details is omitted here to avoid repetition.
[0058] Figure 7 The input unit 710 of the neural network training device 700 inputs an input training image into the neural network, wherein the input training image is an image generated by introducing defects into the original training image, and the defects are associated with the image features of the original training image.
[0059] The original training images used to train the neural network can be images of products without defects. In order to enrich the training samples as much as possible, the original training images can be various product images of the same product collected at different angles, different lighting conditions, and different backgrounds, so as to further improve the defect detection accuracy of the trained neural network.
[0060] After acquiring the original training image, the input unit 710 may introduce defects to the original training image to obtain an input training image for inputting the neural network. The introduced defects may be associated with the image features of the original training image. Optionally, the image features of the original training image may include at least one or more of the image shape, texture, and color of the original training image. By introducing defects associated with its image features to the original training image, the generated input training image may be closer to the image of a product with defects in a real situation. In one example, the defects may be associated with the theme color of the original training image. For example, the product shown in the original training image is a doll, which has colors such as black, skin color, and red. The defects introduced to the original training image may include defects of the above-mentioned colors to better simulate the samples with defects in the real situation. For another example, the defects may be associated with the texture of the original training image. For example, if there are multiple dots in the original training image, the introduced defects may also be dots with similar patterns, which is also for the purpose of more realistically simulating the samples with defects in the real situation.
[0061] The synthesis unit 720 decomposes the input training image using the neural network, introduces noise into the decomposition result, and synthesizes the decomposition result and the noise to obtain a synthesized training image.
[0062] The synthesis unit 720 can use a neural network to decompose the input training image into multiple components, for example, including a restored image component without defects restored by the neural network, a defective image component showing defects in the input training image, and a correction factor for indicating the mapping of the ratio of the restored image component and the defective image component in the input training image. Optionally, the input training image I can be expressed as formula (1). Wherein N is the restored image component without defects restored by the neural network, D is the defective image component showing defects in the input training image, and α is a correction factor for indicating the mapping of the ratio of the restored image component N and the defective image component D in the input training image. For example, the restored image component N and the defective image component D can be matrices arranged in the same manner as the input training image I, respectively, and the correction factor α represents the weights occupied by the restored image component N and the defective image component D at each one-to-one corresponding matrix point between the two, and the value of α can be 0≤α≤1. For example, when the value of α at a certain matrix point is 1, then the point of the input training image I is the value of the restored image component N without defects at that point; and when the value of α at a certain matrix point is 0, then the point of the input training image I is the value of the defective image component D at that point.
[0063] In the above example, the defective image component D can be understood as the real pixel value at each matrix point. In another example, the defective image component D can also be understood as the difference between the matrix point pixel values of the input training image I and the restored image component N without defects at the corresponding defect position, that is, it can be expressed as the pixel difference between the matrix points of the input training image I and the restored image component N. Of course, at this time, the above formula (1) can also be adjusted accordingly according to the above principle. In practical applications, any representation method of the defective image component can be adopted, and there is no restriction here. Optionally, the part of the structure of the neural network used by the synthesis unit 720 to decompose the input training image can include a generation network, which can be composed of an encoder, a decoder and a generator. The encoder can use multiple groups of convolution, normalization and pooling processes with different parameters to extract feature maps of different scales of the input training image. Specifically, the input training image can be first convolved with a convolution kernel to obtain a convolution map, and then the convolution map can be normalized using a rectified linear unit and a batch normalization method to obtain a normalized convolution map, and then the normalized convolution map is applied with a maximum pooling or average pooling process. The above process can be repeated multiple times, and multiple downsampling processes can be used to extract multi-scale feature maps. The decoder in the generative network can use multiple sets of convolution, normalization and upsampling processes to restore the resolution of the feature map generated in the encoder. The generator in the generative network can combine the characteristics of images with the same resolution obtained in the encoder and decoder, and use multiple sets of convolution processes to output the decomposition results. Among them, the generation of restored image components can be supervised based on the original training image that does not contain defects. In addition, the generation of defective image components and correction factors can also be supervised based on the defects introduced by the input training image. The above-mentioned operation process for decomposing the input training image is only an example. In actual applications, the input training image can be decomposed using any decomposition method, and there is no limitation here.
[0064] After decomposing the input training image, the synthesis unit 720 can compare the original training image and the restored image component according to the first discriminant network in the neural network, and adjust the parameters of the generation network according to the comparison result. For example, the first discriminant network can extract features from the generated restored image component, compare and discriminate with the original training image based on the extracted features, and output the discrimination result. More specifically, the first discriminant network can use multiple groups of convolution, normalization and pooling processes with different parameters to respectively extract feature maps of different scales of the restored image component, and judge whether the restored image component is true. If the result is true, it means that it judges that the restored image component has a high similarity with the original training image, and also means that the generated restored image component is good enough. The above-mentioned first discriminant network can adjust the parameters of the neural network through feedback, so as to generate high-quality restored image components and corresponding high-quality defective image components and correction factors in the training stage.
[0065] After obtaining the decomposition result, the synthesis unit 720 can introduce noise to the decomposition result, for example, random noise can be introduced, and the decomposition result and the noise can be synthesized into a synthetic training image. Among them, the noise defect image component and the noise correction factor can be obtained respectively according to the defect image component, the correction factor and the introduced noise; then the restored image component, the noise defect image component and the noise correction factor are synthesized to obtain the synthetic training image. When random noise is introduced to the decomposition result, it may affect the defect image component and the correction factor obtained by decomposition, so that the defect image component needs to be updated to the noise defect image component according to the position and size of the introduced random noise, and the correction factor needs to be updated to the noise correction factor at the corresponding position where the random noise appears. After the update, it can be combined with the restored image component generated by the previous decomposition to synthesize into a synthetic training image.
[0066] In the process of acquiring the synthetic training image, considering that the introduced random noise may affect the judgment of the noise part in the synthetic training image, the synthesis unit 720 can further adjust the synthetic training image according to at least one of the following: at least the defect edge smoothness calculated according to the noise defect image component and the noise correction factor; at least the color similarity calculated according to the restored image component and the noise defect image component. Specifically, the defect edge smoothness can be calculated at least according to the noise defect image component and the noise correction factor using various boundary or gradient extraction methods, and the noise defect image component and the noise correction factor can be further adjusted according to the calculated defect edge smoothness, so that the defect edge is as smooth as possible, or the degree of smoothness of the defect edge is greater than a preset threshold. Subsequently, after the defect edge smoothness is adjusted, various similarity measurement algorithms can be used to calculate the color similarity between the restored image component and the adjusted noise defect image component, so that only the noise defects that are not similar enough to the color of the restored image component (or the similarity is less than a preset threshold) are retained, and the noise defect image component and the noise correction factor can be further modified accordingly, and the generated synthetic training image can be further updated.
[0067] The detection unit 730 performs defect detection on the synthetic training image using the neural network, and adjusts the parameters of the neural network at least according to the original training image and the defect detection result.
[0068] The detection unit 730 may obtain a restored training image based on the synthesized training image. Specifically, a restored training image without defects may be obtained based on the synthesized training image according to a multi-task network in the neural network, and the contour of the defect may be extracted. The generation process of the restored training image may be similar to the operation process of the generation network in the aforementioned decomposition input training image, and the process of extracting the contour of the defect may be supervised by the noise defect image component and the noise correction factor used to synthesize the synthesized training image.
[0069] After obtaining the restored training image, the detection unit 730 can adjust the parameters of the neural network at least according to the original training image and the restored training image. Specifically, the original training image and the restored training image can be compared according to the second discriminant network in the neural network, and the relevant parameters of the neural network can be adjusted according to the comparison result. For example, the second discriminant network can extract features from the generated restored training image, compare and discriminate with the original training image based on the extracted features, and output the discrimination result. More specifically, the second discriminant network can use multiple groups of convolution, normalization and pooling processes with different parameters to respectively extract feature maps of different scales of the restored image components, and judge whether the restored training image is true. If the result is true, it means that it judges that the restored training image is consistent with the original training image, indicating that the generated restored training image is good enough. The above-mentioned second discriminant network can adjust the relevant parameters of the neural network through feedback, so as to generate high-quality restored training images and correspondingly extract defect contours with high quality during the training stage.
[0070] According to the above-mentioned neural network training device of the embodiment of the present invention, it is possible to train the neural network for defect detection by introducing defects associated with the image features of the original training image as the input training image, and can enrich the defect detection samples used for neural network training by further introducing noise, thereby improving the accuracy and automation of neural network defect detection and improving user experience. The above-mentioned neural network training device of the embodiment of the present invention can be applied to various product inspections and computer vision tasks for surface defect detection of objects such as road surfaces and chip surfaces.
[0071] In addition, according to another embodiment of the present invention, the neural network training may not be limited to the specific implementation method of the neural network training device. Further, the architecture and process of the neural network may be used to achieve other requirements in various application scenarios. For example, the architecture of the neural network may be used to achieve diversified samples, such as the production of human faces, animated images, etc.; or it may be applicable to other corresponding scenarios that require the introduction of image defects or noise. Specifically, in the above case, the input sample image may be used to replace the input training image, and the original sample image may be used to replace the original training image, and there may be no need for the subsequent process of adjusting the parameters of the neural network. The above device may, for example, include an input unit and a synthesis unit, wherein the input unit inputs the input sample image into the neural network, wherein the input sample image is an image generated by introducing defects into the original sample image, and the defects are associated with the image features of the original sample image; the synthesis unit decomposes the input sample image using the neural network, introduces noise into the decomposition result, and synthesizes the decomposition result and the noise to obtain a synthesized sample image. The synthesized sample images obtained by the above device can be used as diversified samples in corresponding scenarios. The above-mentioned device according to the embodiment of the present invention can generate an input sample image with corresponding defects by combining the image features of the original sample image, and introduce various noises, such as random noise, to process the input sample image, so as to obtain diversified samples suitable for corresponding application scenarios.
[0072] Below, refer to Figure 8 The neural network training device according to an embodiment of the present invention is described. Figure 8 FIG. 8 is a block diagram of a neural network training device 800 according to an embodiment of the present invention. Figure 8 As shown, the device 800 may be a computer or a server.
[0073] like Figure 8 As shown, the neural network training device 800 includes one or more processors 810 and a memory 820. Of course, in addition to this, the neural network training device 800 may also include an input device, an output device (not shown), etc. These components may be interconnected via a bus system and / or other forms of connection mechanisms. It should be noted that Figure 8 The components and structure of the neural network training device 800 shown are merely exemplary and non-limiting. The neural network training device 800 may also have other components and structures as required.
[0074] The processor 810 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may utilize computer program instructions stored in the memory 820 to perform desired functions, which may include: inputting an input training image into a neural network, wherein the input training image is an image generated by introducing defects into an original training image, and the defects are associated with image features of the original training image; utilizing a neural network to decompose the input training image, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; utilizing a neural network to perform defect detection on the synthesized training image, and adjusting the parameters of the neural network at least based on the original training image and the defect detection results.
[0075] The memory 820 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 810 may execute the program instructions to implement the functions of the neural network training device of the embodiment of the present invention described above and / or other desired functions, and / or may execute the neural network training method according to the embodiment of the present invention. Various applications and various data may also be stored in the computer-readable storage medium.
[0076] The following describes a computer-readable storage medium according to an embodiment of the present invention, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, implement the following steps: inputting an input training image into a neural network, wherein the input training image is an image generated by introducing defects into an original training image, and the defects are associated with image features of the original training image; decomposing the input training image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; and performing defect detection on the synthesized training image using the neural network, and adjusting parameters of the neural network at least according to the original training image and the defect detection results.
[0077] Below, refer to Fig. 9 A device for defect detection using a neural network according to an embodiment of the present invention is described. Fig. 9 FIG. 9 is a block diagram of an apparatus 900 for performing defect detection using a neural network according to an embodiment of the present invention. Fig. 9As shown, the apparatus 900 for defect detection using a neural network includes an input unit 910 and a detection unit 920. In addition to these units, the apparatus 900 may also include other components. However, since these components are irrelevant to the content of the embodiment of the present invention, their illustration and description are omitted here. In addition, since the specific details of the following operations performed by the apparatus 900 according to the embodiment of the present invention are the same as those described above with reference to Figure 2 The details described are the same, so repeated description of the same details is omitted here to avoid repetition.
[0078] Fig. 9 The input unit 910 of the apparatus 900 for defect detection using a neural network inputs an input image into the neural network, wherein the neural network is formed by Figure 1 Specifically, when the input unit 910 inputs the input image to be detected into the neural network, it can be directly input from the port where the input training image is input during the neural network training, or it can be input from the port where the synthetic training image is input into the neural network. Both input methods can obtain defect detection results through the trained neural network. Of course, in the subsequent defect detection stage, the first discriminant network and the second discriminant network mentioned above are not required to perform true and false discrimination and parameter adjustment on the image restored by the neural network, and only the trained neural network needs to be used for defect detection.
[0079] The detection unit 920 uses the neural network to perform defect detection on the input image, extracts the contour of the defect, and obtains the defect detection result. In the defect detection process, the above-mentioned multi-task network can be used to restore the detection image without defects and extract the contour of the defect.
[0080] According to the above-mentioned apparatus for defect detection using a neural network in the embodiment of the present invention, defect detection can be performed by using a neural network trained by the neural network training method in the embodiment of the present invention, thereby improving the accuracy and automation of defect detection of the neural network and improving the user experience. The above-mentioned apparatus for defect detection using a neural network in the embodiment of the present invention can be applied to computer vision tasks such as various product inspections and surface defect detection of objects such as road surfaces and chip surfaces.
[0081] Below, refer to Fig.10 A device for defect detection using a neural network according to an embodiment of the present invention is described. Fig.10 FIG. 1 is a block diagram of an apparatus 1000 for performing defect detection using a neural network according to an embodiment of the present invention. Fig.10 As shown, the device 1000 may be a computer or a server.
[0082] like Fig.10As shown, the device 1000 includes one or more processors 1010 and a memory 1020. Of course, in addition to this, the device 1000 may also include an input device, an output device (not shown), etc. These components may be interconnected via a bus system and / or other forms of connection mechanisms. It should be noted that Fig.10 The components and structures of the device 1000 shown are merely exemplary and non-limiting. The device 1000 may also have other components and structures as required.
[0083] The processor 1010 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may utilize computer program instructions stored in the memory 1020 to perform desired functions, which may include: inputting an input image into a neural network, wherein the neural network is trained by the aforementioned neural network training method; utilizing the neural network to perform defect detection on the input image, extracting the contour of the defect, and obtaining a defect detection result.
[0084] The memory 1020 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1010 may execute the program instructions to implement the functions of the apparatus for defect detection using a neural network according to the embodiment of the present invention described above and / or other desired functions, and / or may execute the method for defect detection using a neural network according to the embodiment of the present invention. Various applications and various data may also be stored in the computer-readable storage medium.
[0085] Below, a computer-readable storage medium according to an embodiment of the present invention is described, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, implement the following steps: inputting an input image into a neural network, wherein the neural network is trained by the neural network training method as described above; performing defect detection on the input image using the neural network, extracting the contour of the defect, and obtaining a defect detection result.
[0086] Of course, the above-mentioned specific embodiments are merely examples rather than limitations, and those skilled in the art can, based on the concept of the present invention, merge and combine some steps and devices from the various embodiments described separately above to achieve the effects of the present invention. Such merged and combined embodiments are also included in the present invention, and such merges and combinations are not described one by one herein.
[0087] Note that the advantages, strengths, effects, etc. mentioned in the present invention are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present invention. In addition, the specific details of the above invention are only for the purpose of illustration and facilitating understanding, not limitation, and the above details do not limit the present invention to being implemented by adopting the above specific details.
[0088] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present invention are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with it.
[0089] The step flow charts and the above method descriptions in the present invention are only illustrative examples and are not intended to require or imply that the steps of each embodiment must be performed in the order given. As will be appreciated by those skilled in the art, the order of the steps in the above embodiments can be performed in any order. Words such as "thereafter", "then", "next", etc. are not intended to limit the order of the steps; these words are only used to guide the reader through the description of these methods. In addition, any reference to a singular element, such as using the article "a", "an", or "the", is not to be construed as limiting the element to the singular.
[0090] In addition, the steps and devices in the various embodiments of this document are not limited to being implemented in a certain embodiment. In fact, based on the concept of the present invention, relevant partial steps and partial devices in the various embodiments of this document can be combined to conceive new embodiments, and these new embodiments are also included in the scope of the present invention.
[0091] Each operation of the method described above may be performed by any suitable means capable of performing the corresponding functions. The means may include various hardware and / or software components and / or modules, including but not limited to circuits, application specific integrated circuits (ASICs) or processors.
[0092] The various illustrated logic blocks, modules and circuits described may be implemented or performed using a general purpose processor, digital signal processor (DSP), ASIC, field programmable gate array signal (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete hardware components or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but as an alternative, the processor may be any commercially available processor, controller, microcontroller or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors cooperating with a DSP core, or any other such configuration.
[0093] The steps of the method or algorithm described in conjunction with the present invention can be directly embedded in hardware, in a software module executed by a processor, or in a combination of the two. A software module can exist in any form of tangible storage medium. Some examples of storage media that can be used include random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, hard disks, removable disks, CD-ROMs, etc. A storage medium can be coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. In an alternative manner, the storage medium can be integral with the processor. A software module can be a single instruction or many instructions, and can be distributed on several different code segments, between different programs, and across multiple storage media.
[0094] The method invented herein includes one or more actions for implementing the method described. Methods and / or actions can be interchangeable with each other without departing from the scope of the claims. In other words, unless a specific order of actions is specified, the order and / or use of specific actions can be modified without departing from the scope of the claims.
[0095] The functions described can be implemented by hardware, software, firmware or any combination thereof. If implemented in software, the functions can be stored as one or more instructions on a tangible computer-readable medium. The storage medium can be any available tangible medium that can be accessed by a computer. By way of example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device or any other tangible medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer. As used herein, a disc includes a compact disc (CD), a laser disc, an optical disc, a digital versatile disc (DVD), a floppy disk and a blue disc.
[0096] Thus, a computer program product may perform the operations presented herein. For example, such a computer program product may be a computer-readable tangible medium having instructions tangibly stored (and / or encoded) thereon, which instructions may be executed by one or more processors to perform the operations described herein. The computer program product may include packaging materials.
[0097] Software or instructions may also be transmitted via a transmission medium. For example, the software may be transmitted from a website, server or other remote source using a transmission medium such as coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology such as infrared, radio or microwave.
[0098] In addition, the module and / or other appropriate means for performing the methods and techniques described herein can be downloaded and / or otherwise obtained by the user terminal and / or base station when appropriate. For example, such a device can be coupled to a server to facilitate the transmission of the means for performing the methods described herein. Alternatively, the various methods described herein can be provided via a storage component (e.g., RAM, ROM, a physical storage medium such as a CD or a floppy disk, etc.) so that the user terminal and / or base station can obtain the various methods when being coupled to the device or providing a storage component to the device. In addition, any other appropriate technology for providing the methods and techniques described herein to a device can be utilized.
[0099] Other examples and implementations are within the scope and spirit of the present invention and the appended claims. For example, due to the nature of software, the functions described above can be implemented using software executed by a processor, hardware, firmware, hard wiring, or any combination of these. Features that implement the functions can also be physically located in various locations, including being distributed so that parts of the functions are implemented at different physical locations. Moreover, as used herein, including as used in the claims, "or" used in the enumeration of items beginning with "at least one" indicates a separate enumeration, so that, for example, the enumeration of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). In addition, the wording "exemplary" does not mean that the example described is preferred or better than other examples.
[0100] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present invention is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0101] The above description of the invented aspects is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features of the present invention.
[0102] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present invention to the form invented herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A neural network training method, comprising: Inputting an input training image into the neural network, wherein the input training image is an image generated by introducing a defect into an original training image, and the defect is associated with an image feature of the original training image; Decomposing the input training image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; Performing defect detection on the synthesized training image using the neural network, and adjusting parameters of the neural network at least according to the original training image and the defect detection result; Wherein, decomposing the input training image by using the neural network includes: Decomposing the input training image using the neural network to obtain a restored image component, a defective image component and a correction factor; In which, noise is introduced into the decomposition result, and the decomposition result and the noise are synthesized to obtain a synthetic training image including: According to the defect image component, the correction factor and the introduced noise, a noise defect image component and a noise correction factor are obtained respectively; The restored image component, the noise defect image component and the noise correction factor are synthesized to obtain the synthesized training image.
2. The method of claim 1, wherein: The defect is associated with at least one image feature including image shape, texture, and color of the original training image.
3. The method of claim 1, wherein: The method further comprises: The parameters of the neural network are adjusted according to the original training image and the restored image components.
4. The method of claim 1, wherein: Combining the restored image component, the noise defect image component and the noise correction factor to obtain the synthesized training image further includes adjusting the synthesized training image according to at least one of the following: a defect edge smoothness calculated at least based on the noise defect image component and the noise correction factor; A color similarity is calculated based on at least the restored image component and the noise defect image component.
5. The method of claim 1, wherein: Performing defect detection on the synthetic training image using the neural network, and adjusting the parameters of the neural network at least according to the original training image and the defect detection result comprises: A restored training image is obtained according to the synthesized training image, and parameters of the neural network are adjusted at least according to the original training image and the restored training image.
6. A method for defect detection using a neural network, comprising: Inputting an input image into the neural network, wherein the neural network is trained by the method according to any one of claims 1 to 5; The neural network is used to perform defect detection on the input image, extract the contour of the defect, and obtain the defect detection result.
7. A neural network training device, comprising: An input unit, configured to input an input training image into the neural network, wherein the input training image is an image generated by introducing a defect into an original training image, and the defect is associated with an image feature of the original training image; a synthesis unit configured to decompose the input training image using the neural network, introduce noise into the decomposition result, and synthesize the decomposition result and the noise to obtain a synthesized training image; a detection unit configured to perform defect detection on the synthetic training image using the neural network, and adjust parameters of the neural network at least according to the original training image and a result of the defect detection; The synthesis unit decomposes the input training image using the neural network to obtain a restored image component, a defective image component and a correction factor; The synthesis unit obtains a noise defect image component and a noise correction factor according to the defect image component, the correction factor and the introduced noise respectively; and synthesizes the restored image component, the noise defect image component and the noise correction factor to obtain the synthesized training image.
8. A neural network training device, comprising: processor; and a memory having computer program instructions stored therein, Wherein, when the computer program instructions are executed by the processor, the processor is caused to perform the following steps: Inputting an input training image into the neural network, wherein the input training image is an image generated by introducing a defect into an original training image, and the defect is associated with an image feature of the original training image; Decomposing the input training image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; Performing defect detection on the synthesized training image using the neural network, and adjusting parameters of the neural network at least according to the original training image and the defect detection result; Wherein, decomposing the input training image by using the neural network includes: Decomposing the input training image using the neural network to obtain a restored image component, a defective image component and a correction factor; In which, noise is introduced into the decomposition result, and the decomposition result and the noise are synthesized to obtain a synthetic training image including: According to the defect image component, the correction factor and the introduced noise, a noise defect image component and a noise correction factor are obtained respectively; The restored image component, the noise defect image component and the noise correction factor are synthesized to obtain the synthesized training image.
9. A computer-readable storage medium having computer program instructions stored thereon, wherein: When the computer program instructions are executed by a processor, the following steps are implemented: Inputting an input training image into a neural network, wherein the input training image is an image generated by introducing a defect into an original training image, and the defect is associated with an image feature of the original training image; Decomposing the input training image using the neural network, introducing noise into the decomposition result, and synthesizing the decomposition result and the noise to obtain a synthesized training image; Performing defect detection on the synthesized training image using the neural network, and adjusting parameters of the neural network at least according to the original training image and the defect detection result; Wherein, decomposing the input training image by using the neural network includes: Decomposing the input training image using the neural network to obtain a restored image component, a defective image component and a correction factor; In which, noise is introduced into the decomposition result, and the decomposition result and the noise are synthesized to obtain a synthetic training image including: According to the defect image component, the correction factor and the introduced noise, a noise defect image component and a noise correction factor are obtained respectively; The restored image component, the noise defect image component and the noise correction factor are synthesized to obtain the synthesized training image.
10. A device for defect detection using a neural network, comprising: An input unit, configured to input an input image into the neural network, wherein the neural network is trained by the method according to any one of claims 1 to 5; The detection unit is configured to use the neural network to perform defect detection on the input image, extract the contour of the defect, and obtain a defect detection result.
Citation Information
Patent Citations
Image defect detection model training method and device, image defect detection model testing method and device and storage medium
CN110796637A
Product surface defect detection method and device
CN111652098A