Method for generating defect profile of machine vision deep learning surface defect sample, electronic device and storage medium

By generating surface defect samples by referencing the target defect contour and adjusting its shape, the problem of limited model training accuracy in existing technologies is solved, and the realism and versatility of model training are improved.

CN120047438BActive Publication Date: 2026-02-06HANGZHOU CHIPO INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510510408.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2026-02-06
Estimated Expiration
2045-04-23

AI Technical Summary

Technical Problem

Existing automatic sample generation methods for machine vision deep learning have limited accuracy improvements in model training because the drawing of closed shapes is not rigorous, leading to mismatch in sample data and affecting the accuracy of model training.

Method used

By referencing the defect contour of the target defect, drawing or selecting defect contours that are the same as or similar to it, and performing morphological adjustments and shape fusion, surface defect samples are generated to ensure the realism and versatility of model training.

Benefits of technology

This improved the accuracy and versatility of model training, expanded the number of surface defect samples, and ensured the realism and versatility of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047438B_ABST
    Figure CN120047438B_ABST
Patent Text Reader

Abstract

The application discloses a defect contour generation method for a machine vision deep learning surface defect sample, an electronic device and a storage medium. The defect contour generation method comprises the following steps: S1, determining a background source image and a defect source image used by the surface defect sample. The background source image has a target background, and the defect source image has a target defect. S2, determining a defect contour used by the target background. The application has the beneficial effect that since the defect contour used by the target background is the same as or similar to the defect contour of the target defect, the defect material data is filled into the defect contour used by the target background, and the obtained surface defect sample can guarantee the authenticity of model training.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of machine vision deep learning, in particular, a machine vision deep learning surface defect sample defect contour generation method, an electronic device and a storage medium. BACKGROUND

[0002] Deep learning, as the main research direction in the field of artificial intelligence in recent years, has developed rapidly and shown great application value, and has been closely followed by the industry and academia. Especially in the field of machine vision detection. At present, in the field of machine vision detection, the premise of using deep learning is to need a large number of sample pictures for model training. That is, in order to train a relatively accurate model, the number of sample pictures is required to be at least tens of thousands, even hundreds of thousands or millions. At this time, the source of sample pictures is undoubtedly the biggest obstacle in applying deep learning, and in the process of actual project application, there are usually only a small number of sample pictures that need to be collected for a long time.

[0003] Chinese invention patent application CN114419399A "Machine vision deep learning sample automatic generation method, computer and storage medium" can generate a sample quantity required for model training of machine vision deep learning through a small number of sample pictures, thereby improving the accuracy of model training. It has been verified that the improvement is relatively limited and cannot break through the bottleneck. SUMMARY

[0004] The applicant found that the reason why Chinese invention patent application CN114419399A cannot effectively improve the accuracy of model training is that in order to pursue more sample quantities, the drawing of the closed shape in step S5 is relatively arbitrary without strict constraints, resulting in a possible mismatch between the drawn closed shape and the filled material data, thereby affecting the improvement of the accuracy of model training.

[0005] The present application solves the problem that the existing machine vision deep learning sample automatic generation method has a relatively limited improvement in model training, and provides a machine vision deep learning surface defect sample defect contour generation method, an electronic device and a storage medium.

[0006] In order to achieve the above object, the technical scheme of the present application is as follows: a defect contour generation method for machine vision deep learning surface defect samples, comprising: step S1, determining a background source image and a defect source image used by 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 a defect contour used by the target background; wherein step S2 comprises: sub-step S21, referring to the defect contour of the target defect, drawing a defect contour same as or similar to the defect contour of the target defect as the defect contour used by the target background; the beneficial effect is that since the defect contour used by the target background is same as or similar to the defect contour of the target defect, the defect material data is filled into the defect contour used by the target background, and the obtained surface defect sample can guarantee the authenticity (accuracy) of model training.

[0007] As a preferred scheme of the defect contour generation method for machine vision deep learning surface defect samples, step S2 comprises: sub-step S22, referring to the defect contour of the target defect, selecting a defect contour same as or similar to the defect contour of the target defect from a built contour type library as the defect contour used by the target background; the beneficial effect is that more defect contours used by the target background can be obtained, and the number of surface defect samples is further expanded under the premise of guaranteeing the authenticity of model training.

[0008] As a preferred scheme of the defect contour generation method for machine vision deep learning surface defect samples, step S2 comprises: sub-step S23, determining a contour style based on the formation reason of the target defect according to the formation reason of the target defect, and then selecting a defect contour same as or similar to the contour style from a built contour type library as the defect contour used by the target background; the beneficial effect is that more defect contours used by the target background can be obtained, and the number of surface defect samples is further expanded under the premise of guaranteeing the authenticity of model training.

[0009] As a preferred scheme of the defect contour generation method for machine vision deep learning surface defect samples, further comprising: step S3, enhancing the defect contour used by the target background; step S3 comprises: sub-step S31, adjusting the shape of the defect contour; wherein the shape adjustment comprises: overall distortion of the defect contour; wherein the shape adjustment comprises: line disturbance of the defect contour; the beneficial effect is that the generality of model training is considered under the premise of guaranteeing the authenticity of model training, and the problem of insufficient generalization ability is solved.

[0010] As a preferred scheme of the defect contour generation method of the machine vision deep learning surface defect sample, step S3 comprises: a sub-step S32 of performing shape fusion on the defect contour and / or the defect contour after the shape adjustment.

[0011] Another technical solution of the present application is as follows: an electronic device comprising a processor and a memory. The memory stores at least one instruction. The instruction is loaded and executed by the processor to implement the operations performed by the defect contour generation method of the machine vision deep learning surface defect sample.

[0012] Still another technical solution of the present application is as follows: a storage medium, which stores at least one instruction. The instruction is loaded and executed by a processor to implement the operations performed by the defect contour generation method of the machine vision deep learning surface defect sample.

[0013] In addition to the technical problems solved by the present application described above, the technical features constituting the technical solutions, and the beneficial effects brought by these technical features, other technical problems solved by the present application, other technical features included in the technical solutions, and the beneficial effects brought by these technical features will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 is a method flowchart of the defect contour generation method embodiment of the present application.

[0015] Figure 2 is a method flowchart of step S2 of the defect contour generation method embodiment of the present application.

[0016] Figure 3 is a method flowchart of step S3 of the defect contour generation method embodiment of the present application.

[0017] Figure 4 is a schematic diagram of the contour type library of the defect contour generation method embodiment of the present application.

[0018] Figure 5 is a schematic diagram of the enhanced effect of step S3 of the defect contour generation method embodiment of the present application.

[0019] Figure 6 is a structural schematic diagram of the electronic device of the defect contour generation method embodiment of the present application. DETAILED DESCRIPTION

[0020] The application will be described in further detail below with specific embodiments in conjunction with the accompanying drawings. It should be noted that the description of these embodiments is used to help understand the application, but does not constitute a limitation of the application. In addition, the technical features involved in the various embodiments of the application described below can be combined with each other as long as they do not conflict with each other.

[0021] Referring to Figure 1 , the embodiments of the present application provide a defect contour generation method for machine vision deep learning surface defect samples. The surface defect samples include but are not limited to film surface defect samples, plate surface defect samples and sheet surface defect samples. The defect contour generation method for machine vision deep learning surface defect samples includes:

[0022] Step S1, determining the background source image and the defect source image used by the surface defect sample. The background source image has a target background. The defect source image has a target defect.

[0023] Step S2, determining the defect contour used by the target background: Referring to Figure 2 , 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 by the target background. Sub-step S22, referring to the defect contour of the target defect, selecting a defect contour that is the same as or similar to the defect contour of the target defect from the built contour type library as the defect contour used by the target background. Sub-step S23, according to the formation reason of the target defect, determining the contour style generated based on the formation reason of the target defect, and then selecting a defect contour that is the same as or similar to the contour style from the built contour type library as the defect contour used by the target background. For example, the formation reason of the target defect is hard scratch, and the determined contour style is a thin line, then a defect contour related to the thin line can be selected from the built contour type library as the defect contour used by the target background.

[0024] It should be noted that the more the contour type library is classified, the more convenient and accurate the selection of the defect contour is.

[0025] In specific implementation, in sub-step S21, the defect contour that is the same as or similar to the defect contour of the target defect is drawn by hand or with the aid of a computer.

[0026] In specific implementation, in sub-step S22 or sub-step S23, the classification of the contour type library includes but is not limited to: circle, near circle, ellipse, near ellipse (see Figure 4 the first line); circular irregular, near circular irregular (see Figure 4Convex polygon, near-convex polygon (see Figure 4 Convex polygon irregular, near-convex polygon irregular (see Figure 4 Rectangle, near-rectangle (see Figure 4 Elongated shape, near-elongated shape (see Figure 4 Radial, near-radial (see Figure 4 Cloud irregular, near-cloud irregular (see Figure 3 Eighth row in the middle.

[0027] It should be noted that in other embodiments, step S2 can only include any one or a combination of two of sub-steps S21, S22 and S23.

[0028] Preferably, the machine vision deep learning surface defect sample defect contour generation method can further include:

[0029] Step S3, the defect contour used for the target background is enhanced: see Figure 5 , sub-step S31, the morphology of the defect contour is adjusted. Sub-step S32, the shape of the defect contour and / or the defect contour after morphology adjustment is fused.

[0030] In specific implementation, the morphology adjustment includes: the whole distortion of the defect contour. Wherein, the setting parameters of the whole distortion can be adjusted within a specified range, the purpose is to obtain more defect contours. See Figure 5 , before the whole distortion, the effect is contour 51; after the whole distortion, the effect is contour 52 and contour 53.

[0031] In specific implementation, the morphology adjustment includes: line disturbance of the defect contour. Wherein, the setting parameters of the line disturbance can be adjusted within a specified range, the purpose is to obtain more defect contours. See Figure 5 , before the line disturbance, the effect is contour 51; after the line disturbance, the effect is contour 54 and contour 55.

[0032] In specific implementation, the shape fusion includes: in the set of the defect contour and the defect contour after morphology adjustment, any two are selected and fused in shape. Wherein, the setting parameters of the shape fusion can be adjusted within a specified range, the purpose is to obtain more defect contours. See Figure 6 , before the shape fusion, the effect is contour 53 and contour 55; after the shape fusion, the effect is contour 56 and contour 57. It should be noted that the higher the proportion of the number of contour shapes to the total number of contours, the higher the diversity of the surface defect sample.

[0033] It should be noted that in other embodiments, step S3 can only perform sub-step S31 or only perform sub-step S32.

[0034] The surface defect sample obtained by filling the defect profile used by the target background and / or the enhanced defect profile used by the target background with the defect material data can ensure the authenticity of model training and also consider the generality of model training, thereby effectively improving the accuracy of model training.

[0035] Referring to ​ The embodiments of the present application also provide an electronic device. The electronic device comprises a processor 61 and a memory 62. The processor 61 is connected with the memory 62. The processor 61 is used to execute a computer program stored in the memory 62, so that the electronic device performs the method for generating a defect profile of a machine vision deep learning surface defect sample.

[0036] In specific implementation, the processor can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; or can 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, discrete hardware components.

[0037] In specific implementation, the memory comprises a ROM, a RAM, a magnetic disc, a U disk, a memory card or an optical disc and various storage program code media.

[0038] Optionally, the electronic device further comprises a display. The display is connected with the memory and the processor in communication respectively. The display is used to display a related graphical user interface (GUI) of the method for generating a defect profile of a machine vision deep learning surface defect sample.

[0039] The embodiments of the present application also provide a storage medium. The storage medium stores a computer program. The computer program is executed by a processor to implement the method for generating a defect profile of a machine vision deep learning surface defect sample.

[0040] The above merely expresses the embodiments of the present application, the description is more specific and detailed, but cannot be understood as the limitation of the patent scope of the application. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application patent should be subject to the appended claims.

Claims

1. A method for generating defect contours from surface defect samples using machine vision deep learning, wherein the surface defect samples are membrane surface defect samples, plate surface defect samples, or sheet surface defect samples, characterized in that, The method comprises the following steps: S1, determining a background source image and a defect source image used by the surface defect sample, wherein the background source image has a target background, and the defect source image has a target defect; S2, determining a defect contour used by the target background for filling defect material data, wherein S2 comprises the following sub-steps: S21, referring to the defect contour of the target defect, drawing a defect contour same as or similar to the defect contour of the target defect as the defect contour used by the target background; S22, referring to the defect contour of the target defect, selecting a defect contour same as or similar to the defect contour of the target defect from a built contour type library as the defect contour used by the target background; S23, according to the forming reason of the target defect, determining a contour style generated based on the forming reason of the target defect, and then selecting a defect contour same as or similar to the contour style from the built contour type library as the defect contour used by the target background.

2. The method of claim 1, wherein the method further comprises: The method further comprises the following step S3: enhancing the defect contour used by the target background.

3. The method of claim 2, wherein the method further comprises: S3 comprises the following sub-step S31: adjusting the shape of the defect contour.

4. The method of claim 3, wherein the method further comprises: The shape adjustment comprises overall distortion of the defect contour.

5. The method of claim 3, wherein the method further comprises: The shape adjustment comprises line disturbance of the defect contour.

6. The method of claim 2, wherein the method further comprises: S3 comprises the following sub-step S32: shape fusion of the defect contour and / or the defect contour after the shape adjustment. 7.An electronic device comprising a processor and a memory having stored therein at least one instruction, wherein, The instructions are loaded and executed by the processor to implement the operations performed by the defect contour generation method of the machine vision deep learning surface defect sample according to any one of claims 1 to 6.

8. A storage medium having stored therein at least one instruction, characterized in that, The instructions are loaded and executed by the processor to implement the operations performed by the defect contour generation method of the machine vision deep learning surface defect sample according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Machine vision deep learning sample automatic generation method, computer and storage medium

    CN114419399A

  • Panel defect classification model generation method and panel defect classification method

    CN113935940A

  • Battery defect data enhancement method and device

    CN117788405A

  • Full-automatic generation method and system for hub X-ray image spongy defect image

    CN118397144A

  • Small sample defect classification method based on retrieval enhancement and multi-modal large model

    CN119622014A