A material surface defect sample generation method based on machine vision deep learning, a computer and a storage medium

By judging and adjusting the directional features of the defect contour, and combining the target background and the defect to generate samples, the problem of abrupt changes in defect features in the existing technology is solved, and the reliability of samples and the accuracy of model training are improved.

CN122116052APending Publication Date: 2026-05-29HANGZHOU CHIPO INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU CHIPO INTELLIGENT TECH CO LTD
Filing Date
2026-04-30
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies ignore the difference in directional features between the defect contour and the target defect when generating material surface defect samples, which leads to a decrease in sample reliability and affects the training quality of machine vision deep learning models.

Method used

By determining whether the drawn defect contour is consistent with the directional features of the target defect, if they are inconsistent, rotation enhancement is performed to make them consistent. Samples are generated by combining the target background and the target defect, and noise reduction is performed considering structural characteristics and edge optimization.

Benefits of technology

The generated sample features closely resemble the target defects, improving sample reliability and ensuring the training accuracy of the machine vision deep learning model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116052A_ABST
    Figure CN122116052A_ABST
Patent Text Reader

Abstract

The application discloses a material surface defect sample generation method based on machine vision deep learning, a computer and a storage medium. The material surface defect sample generation method comprises the following steps: obtaining a target background required for generating the material surface defect sample; drawing a defect contour required for generating the material surface defect sample on the target background; obtaining a target defect required for generating the material surface defect sample; judging whether the defect contour drawn and a defect contour of the target defect have the same or similar directional features; if not, rotating and enhancing the target defect; and obtaining the material surface defect sample based on the defect contour drawn, the target background and the target defect. The material surface defect sample obtained has defect features close to the target defect, has high reliability and can guarantee the accuracy of machine vision deep learning model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision deep learning, and in particular, to a method, computer, and storage medium for generating material surface defect samples based on machine vision deep learning. Background Technology

[0002] Deep learning, as a major research direction in the field of artificial intelligence in recent years, has developed rapidly, demonstrating enormous application value and attracting close attention from industry and academia. This is especially true for deep learning in machine vision. To ensure the training quality of deep learning in machine vision, a massive and reliable collection of material surface defect samples is required.

[0003] The technical solution of Chinese invention application CN120047438A, entitled "Method for Generating Defect Contours of Surface Defect Samples for Machine Vision Deep Learning, Electronic Device and Storage Medium," includes: Step S1, determining the background source image and defect source image used for the surface defect sample, wherein the background source image has a target background and the defect source image has a target defect; Step S2, determining the defect contour used for the target background. Step S2 includes: Sub-step S21, referring to the defect contour of the target defect, drawing a defect contour that is the same as or similar to the defect contour of the target defect as the defect contour used for the target background. The disadvantage of the above technical solution is that the obtained surface defect sample may have abrupt changes in defect features, which adversely affects subsequent model training. Summary of the Invention

[0004] The applicant discovered that the fundamental reason why the surface defect sample obtained by Chinese invention application CN120047438A may have abrupt changes in defect features is that the difference in directional features between the drawn defect contour and the target defect contour is ignored in terms of the reliability of sample generation.

[0005] The technical problem to be solved by the present invention is to reduce the occurrence of abrupt changes in defect features in material surface defect samples, and to provide a method, computer and storage medium for generating material surface defect samples based on machine vision deep learning.

[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: a method for generating material surface defect samples based on machine vision deep learning, comprising: Obtain the target background required for generating the surface defect sample of the material; Draw the defect contour required to generate the surface defect sample of the material onto the target background; Obtain the surface defect sample of the material to generate the target defect required; Determine whether the drawn defect contour and the defect contour of the target defect have the same or similar directional features: if not, perform rotation enhancement on the target defect so that the drawn defect contour and the rotated target defect have the same or similar directional features; and, Based on the drawn defect contour, combined with the target background and the target defect, a sample of the material surface defect is obtained.

[0007] The beneficial effect lies at least in that the sample generation method fully considers the impact of the difference in directional features between the drawn defect contour and the target defect contour on the reliability of sample generation. When the directional features of the drawn defect contour and the target defect contour are not the same and not similar, the target defect is rotated and enhanced. Then, based on the drawn defect contour, combined with the target background and the target defect (which has been rotated and enhanced), the material surface defect sample is obtained. The defect features of the obtained material surface defect sample are close to the target defect, with high reliability, which can ensure the accuracy of machine vision deep learning model training.

[0008] As a preferred embodiment of the method for generating material surface defect samples, the rotation enhancement involves calculating the difference in directional features between the drawn defect contour and the defect contour of the target defect, and then rotating the target defect based on the calculated difference. The beneficial effect is at least that it provides a specific method for the rotation enhancement, ensuring that the drawn defect contour and the rotated target defect have the same directional features.

[0009] As a preferred embodiment of the method for generating material surface defect samples, the rotation enhancement involves configuring a certain number of rotation levels and rotating the target defect step by step until the drawn defect contour has the same or similar directional characteristics as the rotated target defect. The beneficial effect is at least that it provides a specific method for the rotation enhancement, ensuring that the drawn defect contour has the same or similar directional characteristics as the rotated target defect.

[0010] As a preferred method for generating material surface defect samples, the structure preservation parameters required for the combination of the target background and the target defect are determined based on the structural characteristics of the target defect. The beneficial effect is at least that the sample generation method fully considers the impact of the structural characteristics of the target defect on the reliability of sample generation, thus ensuring the accuracy of training machine vision deep learning models.

[0011] As a preferred method for generating material surface defect samples, the material surface defect samples undergo edge optimization along the drawn defect contour. The beneficial effect is at least that the sample generation method fully considers the impact of a complex target background on the reliability of sample generation, thus ensuring the accuracy of machine vision deep learning model training.

[0012] As a preferred embodiment of the method for generating material surface defect samples, the edge optimization involves determining edge pixels along the drawn defect contour based on the target background. The beneficial effect is at least that it provides a specific method for edge optimization.

[0013] As a preferred embodiment of the method for generating material surface defect samples, the required fusion background range for combining the target background and the target defect is determined. By adjusting the fusion background range, it is determined whether the defect characteristics of the material surface defect sample change with the target background. The beneficial effect is at least that material surface defect samples with different effects are obtained.

[0014] As a preferred method for generating material surface defect samples, the material surface defect samples undergo noise reduction processing. The beneficial effect is at least that it ensures the accuracy of training machine vision deep learning models.

[0015] Another technical solution of the present invention is as follows: A computer includes a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the operation performed by the material surface defect sample generation method. The beneficial effect is at least that the sample generation method fully considers the impact of the difference in directional features between the drawn defect contour and the defect contour of the target defect on the reliability of sample generation. When the directional features of the drawn defect contour and the defect contour of the target defect are not the same and not similar, the target defect is rotated and enhanced, and then, based on the drawn defect contour, combined with the target background and the target defect (which has been rotated and enhanced), the material surface defect sample is obtained. The defect features of the obtained material surface defect sample are close to the target defect, resulting in high reliability and ensuring the accuracy of machine vision deep learning model training.

[0016] Another technical solution of the present invention is as follows: a storage medium storing at least one instruction, which is loaded and executed by a processor to perform the operations of the material surface defect sample generation method described above. The beneficial effect is at least that the sample generation method fully considers the impact of the difference in directional features between the drawn defect contour and the defect contour of the target defect on the reliability of sample generation. When the directional features of the drawn defect contour and the defect contour of the target defect are not the same and not similar, the target defect is rotated and enhanced, and then, based on the drawn defect contour, combined with the target background and the target defect (which has been rotated and enhanced), the material surface defect sample is obtained. The defect features of the obtained material surface defect sample are close to the target defect, resulting in high reliability and ensuring the accuracy of machine vision deep learning model training.

[0017] In addition to the technical problems solved by the present invention, the technical features constituting the technical solutions, and the beneficial effects brought about by the technical features of these technical solutions as described above, other technical problems that the present invention can solve, other technical features contained in the technical solutions, and the beneficial effects brought about by these technical features will be further described in detail with reference to the accompanying drawings. Attached Figure Description

[0018] Figure 1 This is a flowchart of the method for generating surface defect samples of materials according to the present invention.

[0019] Figure 2 This is a source diagram illustrating a rotational enhancement example of the present invention.

[0020] Figure 3 A defect sample diagram illustrating the rotational enhancement example of the present invention (the drawn defect contour is consistent with...) Figure 2 The defect profiles in the data have similar directional features, and rotation enhancement was not used.

[0021] Figure 4 A defect sample diagram illustrating the rotational enhancement example of the present invention (the drawn defect contour is consistent with...) Figure 2 The defect profiles in the defect features have opposite directional characteristics and rotation enhancement was not used.

[0022] Figure 5 A defect sample diagram illustrating the rotational enhancement example of the present invention (the drawn defect contour is consistent with...) Figure 2 The defect profiles in the defect features have opposite directional features, which are enhanced by rotation.

[0023] Figure 6 The source diagram is for an example of the structure of this invention.

[0024] Figure 7 A defective sample diagram of the structure retention example of the present invention (without using structure retention).

[0025] Figure 8 A defect sample diagram (using structure preservation) is shown as an example of the structure preservation of the present invention.

[0026] Figure 9 The source diagram is for an example of edge optimization in this invention.

[0027] Figure 10 This is a defect sample image (without edge optimization) as an example of edge optimization in this invention.

[0028] Figure 11 A defect sample image (using edge optimization) is shown as an example of edge optimization in this invention.

[0029] Figure 12 This is a source diagram illustrating the background example of the present invention.

[0030] Figure 13 Defect samples for the fusion background example of this invention Figure 1 (Use blended background).

[0031] Figure 14 Defect samples for the fusion background example of this invention Figure 2 (Use blended background).

[0032] Figure 15 Defect samples for the fusion background example of this invention Figure 3 (Use blended background).

[0033] Figure 16 This is a schematic diagram of the structure of the electronic device of the present invention. Detailed Implementation

[0034] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. It should be noted that these descriptions of embodiments are intended to aid in understanding the invention and do not constitute a limitation thereof. Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0035] See Figure 1 The figure illustrates a method for generating material surface defect samples based on machine vision deep learning. The material surface defect samples can be membrane surface defect samples, sheet surface defect samples, or plate surface defect samples.

[0036] The method for generating material surface defect samples based on machine vision deep learning includes: A background source map is generated from the surface defect sample of the material. This background source map includes a target background. In some embodiments, the background source map includes only the target background and excludes features other than the target background (e.g., defect features). In other embodiments, the background source map includes both the target background and features other than the target background (e.g., defect features).

[0037] The defect contours required to generate the surface defect samples of the material are drawn on the target background. In practice, the drawn defect contours are either manually drawn by the user or automatically drawn by a machine.

[0038] A defect source map is generated by obtaining a sample of surface defects in the material. This defect source map includes a target defect. In some embodiments, the defect source map includes only the target defect and excludes other features (e.g., background features). In other embodiments, the defect source map includes both the target defect and other features (e.g., background features).

[0039] It is determined whether the drawn defect contour and the defect contour of the target defect have the same or similar directional features. If yes, the target defect does not need to be rotated for enhancement. If not, the target defect is rotated for enhancement so that the drawn defect contour and the rotated target defect have the same or similar directional features. In some embodiments, the rotation enhancement is implemented by: stepless rotation. The stepless rotation calculates the difference between the directional features of the drawn defect contour and the defect contour of the target defect, and then rotates the target defect according to the calculated difference. In other embodiments, the rotation enhancement is implemented by: stepped rotation. The stepped rotation configures a certain number of rotation levels (e.g., 10° increments), and rotates step by step until the drawn defect contour and the rotated target defect have the same or similar directional features.

[0040] Based on the drawn defect contour, combined with the target background and the target defect, a material surface defect sample is obtained. The defect features of the material surface defect sample obtained in this way closely resemble the target defect, exhibiting high reliability and ensuring the accuracy of machine vision deep learning model training.

[0041] Specific examples: Figure 3 , Figure 4 and Figure 5 All based on Figure 2 The defect sample image is generated from the background features and defect features in the image. Figure 3 The drawn defect outline and Figure 2 The defect contours of the defects in the model have similar directional features (diagonal lines from the upper left to the lower right). Figure 3 The rotation enhancement was not used during generation. Figure 4 The drawn defect outline and Figure 2 The defect features in the text have opposite directional characteristics (diagonal lines from the lower left to the upper right). Figure 4 The rotation enhancement was not used during generation. Figure 5 The drawn defect outline and Figure 2 The defect features in the text have opposite directional characteristics (diagonal lines from the lower left to the upper right). Figure 5 The rotation enhancement is used during generation. It is not difficult to see that... Figure 3 and Figure 5 All are close to Figure 2 ,and Figure 4 and Figure 2 There are significant differences ( Figure 4 (relatively rough).

[0042] In some embodiments, a structure preservation parameter is determined based on the structural characteristics of the target defect to determine the required structure preservation parameter when combining the target background with the target defect. A larger value for the structure preservation parameter indicates that structural features farther from the drawn defect contour need to maintain or at least maintain the structure of the target defect as much as possible. Conversely, a smaller value for the structure preservation parameter indicates that structural features closer to the drawn defect contour need to maintain or at least maintain the structure of the target defect as much as possible. This sample generation method fully considers the impact of the structural characteristics of the target defect on the reliability of sample generation, ensuring the accuracy of training the machine vision deep learning model.

[0043] Specific examples: Figure 7 and Figure 8 All based on Figure 6 The defect sample image is generated from the background features and defect features in the image. Figure 7 The texture on the right side is random. Figure 8 same Figure 6 It has a dark edge on the right. Figure 8 Compared to Figure 7 Closer to Figure 6 .

[0044] In some embodiments, edge optimization is performed on the material surface defect samples along the drawn defect contour, especially when the target background is complex. Specifically, edge pixels are determined based on the target background along the drawn defect contour; that is, the edge pixels of the material surface defect samples will vary depending on different target backgrounds. This sample generation method fully considers the impact of a complex target background on the reliability of sample generation, ensuring the accuracy of machine vision deep learning model training.

[0045] Specific examples: Figure 10 and Figure 11 All based on Figure 9 The defect sample image is generated from the background features and defect features in the image. Figure 10 The edge optimization was not used during generation, but Figure 11 The edge optimization is used during generation. It's not difficult to see that... Figure 11 Compared to Figure 10 Closer to Figure 9 .

[0046] In some embodiments, a blending background range is determined to be required when the target background is combined with the target defect. The blending background range is defined as the extent extending inward from the drawn defect outline. The color of the resulting blending background range is determined by the target background. By adjusting the blending background range parameters, it is determined whether the defect features of the material surface defect sample change with the target background.

[0047] Specific examples: Figures 13 to 15 Based on Figure 12 The defect sample image is generated from the defect features in the image. Figures 13 to 15 The background features are the same, and are the same as Figure 12 The background features exhibit differences in color and brightness. By adjusting the range of the blended background, defect sample images with different effects are obtained.

[0048] In some embodiments, the defect features of the material surface defect samples are subjected to overall noise reduction, especially when pixel abrupt changes exist. Specifically, the kernel width for noise reduction is set; a larger kernel width results in a more significant noise reduction effect. The resulting material surface defect samples are closer to the target defect, exhibiting higher reliability and ensuring the accuracy of machine vision deep learning model training.

[0049] See Figure 16 This application provides an electronic device. The electronic device includes a processor 1 and a memory 2. The processor 1 is connected to the memory 2. The processor 1 is used to execute a computer program stored in the memory 2, so that the electronic device performs the material surface defect sample generation method.

[0050] In specific implementation, the processor 1 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0051] In specific implementation, the memory 2 includes various media capable of storing program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk.

[0052] This application provides a storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, it implements the method for generating material surface defect samples.

[0053] The above description merely illustrates embodiments of the present invention and is quite specific and detailed; however, it should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for generating material surface defect samples based on machine vision deep learning, characterized in that, include: Obtain the target background required for generating the surface defect sample of the material; Draw the defect contour required to generate the surface defect sample of the material onto the target background; Obtain the surface defect sample of the material to generate the target defect required; Determine whether the drawn defect contour and the defect contour of the target defect have the same or similar directional features: if not, perform rotation enhancement on the target defect so that the drawn defect contour and the rotated target defect have the same or similar directional features; and, Based on the drawn defect contour, combined with the target background and the target defect, a sample of the material surface defect is obtained.

2. The method for generating material surface defect samples according to claim 1, characterized in that, The rotation enhancement involves calculating the difference in directional features between the drawn defect contour and the defect contour of the target defect, and then rotating the target defect based on the calculated difference.

3. The method for generating material surface defect samples according to claim 1, characterized in that, The rotation enhancement involves configuring a certain number of rotation levels to rotate the target defect step by step until the drawn defect outline has the same or similar directional characteristics as the rotated target defect.

4. The method for generating material surface defect samples according to claim 1, characterized in that, Based on the structural characteristics of the target defect, determine the structural retention parameters required when the target background is combined with the target defect.

5. The method for generating material surface defect samples according to claim 1, characterized in that, Edge optimization is performed on the surface defect sample of the material along the drawn defect contour.

6. The method for generating material surface defect samples according to claim 5, characterized in that, The edge optimization involves determining edge pixels along the drawn defect contour based on the target background.

7. The method for generating material surface defect samples according to claim 1, characterized in that, Determine the required blending background range when the target background and the target defect are combined, and determine whether the defect features of the material surface defect sample change with the target background by adjusting the blending background range.

8. The method for generating material surface defect samples according to claim 1, characterized in that, The surface defect samples of the material are subjected to noise reduction processing.

9. A computer, characterized in that, The computer includes a processor and a memory, the memory storing at least one instruction that is loaded and executed by the processor to perform the operation performed by the material surface defect sample generation method according to any one of claims 1 to 8.

10. A storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to perform the operation of the material surface defect sample generation method according to any one of claims 1 to 8.