Method for automatically judging real defects and overtaking kills based on decision tree

文档序号:170341 发布日期:2021-10-29 浏览:23次 中文

阅读说明:本技术 基于决策树自动判别真实缺陷与过杀方法 (Method for automatically judging real defects and overtaking kills based on decision tree ) 是由 许琦 于 2021-07-05 设计创作,主要内容包括:本发明提供了一种基于决策树自动判别真实缺陷与过杀方法,包括:准备一组实际生产过程中过杀和真实缺陷的原图及mask图;通过mask图获取缺陷形状、面积、长度、缺陷类别,通过原图获取缺陷的对比度、极性,将生成的特征信息保存至文本当中,利用决策树自动获取缺陷的判别规则;通过缺陷算法得到一组缺陷数据,生成缺陷小图及mask图,获取缺陷形状、面积、长度、对比度、极性及缺陷类别特征信息;根据决策树生成的判别规则计算当前缺陷属于过杀还是真实缺陷。发明根据已有缺陷和过杀数据特征信息自动判别新产生缺陷是否过杀,算法通用性强,与现有技术中的手动设置缺陷检出参数相比,可以将缺陷漏检和过杀风险控制最低,进而达到实际生产要求。(The invention provides a method for automatically judging real defects and overtopping based on a decision tree, which comprises the following steps: preparing a group of original images and mask images of overkill and real defects in the actual production process; acquiring the shape, area, length and defect category of a defect through a mask image, acquiring the contrast and polarity of the defect through an original image, storing the generated characteristic information into a text, and automatically acquiring a defect judgment rule by using a decision tree; obtaining a group of defect data through a defect algorithm, generating a defect small graph and a mask graph, and obtaining defect shape, area, length, contrast, polarity and defect category characteristic information; and calculating whether the current defect belongs to the over-killing defect or the real defect according to a judgment rule generated by the decision tree. The invention automatically judges whether the newly generated defects are over killed or not according to the existing defects and over killed data characteristic information, has strong algorithm universality, and can control the defect missing detection and over killed risks to the minimum compared with the manual defect detection parameter setting in the prior art, thereby further meeting the actual production requirements.)

1. A method for automatically judging real defects and overtopping based on a decision tree is characterized by comprising the following steps:

step 1, preparing a group of original images and mask images of overkill and real defects in the actual production process, wherein the number of overkill and defects is close to and not lower than 500;

step 2, acquiring the shape, area, length and defect type of the defect through a mask image, acquiring the contrast and polarity of the defect through an original image, and storing the generated characteristic information into a text;

step 3, reading a defect label and characteristic information in the text, and automatically acquiring a defect judgment rule by using a decision tree;

step 4, obtaining a group of defect data through a defect algorithm;

step 5, generating a small defect map and a mask map according to the defect data in the step 4, and acquiring defect shape, area, length, contrast, polarity and defect type characteristic information;

and 6, taking the data generated in the step 5 as input, and calculating whether the current defect belongs to a killed defect or a real defect according to a judgment rule generated by the decision tree in the step 3.

2. The method of claim 1, wherein the defect shape mainly comprises a point, a thin straight line, a thin curve, a surface, etc.

Technical Field

The invention relates to the field of defect detection, in particular to a method for automatically judging real defects and overtaking kills based on a decision tree.

Background

In an industrial production field, there is generally a high requirement on the authenticity of a defect, and both for a conventional algorithm and deep learning, detection parameters (such as defect area, length and width, contrast, etc.) of the defect are often set too tightly in order to reduce the risk of missing detection, so that a large amount of killing exists in practical application.

Disclosure of Invention

The invention provides a method for automatically judging real defects and overtopping based on a decision tree, which aims to solve at least one technical problem.

To solve the above problems, as an aspect of the present invention, there is provided a method for automatically discriminating real defects and overcast based on a decision tree, comprising:

step 1, preparing a group of original images and mask images of overkill and real defects in the actual production process, wherein the number of overkill and defects is close to and not lower than 500;

step 2, acquiring the shape, area, length and defect type of the defect through a mask image, acquiring the contrast and polarity of the defect through an original image, and storing the generated characteristic information into a text;

step 3, reading a defect label and characteristic information in the text, and automatically acquiring a defect judgment rule by using a decision tree;

step 4, obtaining a group of defect data through a defect algorithm;

step 5, generating a small defect map and a mask map according to the defect data in the step 4, and acquiring defect shape, area, length, contrast, polarity and defect type characteristic information;

and 6, taking the data generated in the step 5 as input, and calculating whether the current defect belongs to a killed defect or a real defect according to a judgment rule generated by the decision tree in the step 3.

Preferably, the defect shape mainly includes a point, a thin straight line, a thin curved line, a plane, and the like.

By adopting the technical scheme, whether the newly generated defect is over-killed or not is automatically judged according to the characteristic information of the existing defect and over-killed data, the algorithm is strong in universality, and compared with the defect detection parameters manually set in the prior art, the method can minimize the defect missing detection and over-killed risk control, and further achieve the actual production requirement.

Detailed Description

The following detailed description of embodiments of the invention, but the invention can be practiced in many different ways, as defined and covered by the claims.

The invention discloses a method for automatically judging real defects and over-killing based on a decision tree, which is characterized in that a group of over-killing and real defect samples are prepared in advance, defect characteristic information such as the shape (point, line, surface and the like), the area, the length, the contrast, the polarity (from black to white or from white to black and the like), the defect category and the like of the defects is obtained through an algorithm, then the defect characteristics are used as input, labels (over-killing or real defects) to which the samples belong are trained through the decision tree, and finally a set of rules for automatically judging whether the defects exist or not according to the defect characteristic information is generated.

The method for automatically judging real defects and overtaking the defects based on the decision tree comprises two stages, wherein one stage is a training stage, so that the decision tree is utilized to automatically obtain the judgment rule of the defects; the second stage is the actual detection process to automatically determine whether the defect exists according to the defect feature information.

In the first stage, the training process mainly comprises the following three steps:

step 1: and a sample preparation stage, preparing a group of original images and mask images of overkill and real defects in the actual production process, wherein the number of overkill and defects is close to and not less than 500.

Step 2: the shape (mainly including points, thin straight lines, thin curves, surfaces and the like), the area, the length and the defect type of the defect are obtained through the mask, the contrast and the polarity of the defect are obtained through the original image, and the generated characteristic information is stored in the text.

And step 3: and reading the defect label and the characteristic information in the text, and automatically acquiring the judgment rule of the defect by using the decision tree.

In the second stage, the actual detection process is as follows:

step 1: a set of defect data is obtained by other defect algorithms.

Step 2: and generating a small defect map and a mask map, and acquiring defect shape, area, length, contrast, polarity and defect category characteristic information.

And step 3: and (3) taking the data generated in the step (2) as input, and calculating whether the current defect belongs to a killed defect or a real defect according to a judgment rule generated by a previous decision tree.

By adopting the technical scheme, whether the newly generated defect is over-killed or not is automatically judged according to the characteristic information of the existing defect and over-killed data, the algorithm is strong in universality, and compared with the defect detection parameters manually set in the prior art, the method can minimize the defect missing detection and over-killed risk control, and further achieve the actual production requirement.

The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

4页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于边缘平滑性的缺陷检测算法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!