CN109685030A - A kind of mug rim of a cup defects detection classification method based on convolutional neural networks - Google Patents

A kind of mug rim of a cup defects detection classification method based on convolutional neural networks Download PDF

Info

Publication number
CN109685030A
CN109685030A CN201811631744.8A CN201811631744A CN109685030A CN 109685030 A CN109685030 A CN 109685030A CN 201811631744 A CN201811631744 A CN 201811631744A CN 109685030 A CN109685030 A CN 109685030A
Authority
CN
China
Prior art keywords
image
convolutional neural
detection
mug
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811631744.8A
Other languages
Chinese (zh)
Inventor
李东洁
李若昊
李东阁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin University of Science and Technology
Original Assignee
Harbin University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Harbin University of Science and Technology filed Critical Harbin University of Science and Technology
Priority to CN201811631744.8A priority Critical patent/CN109685030A/en
Publication of CN109685030A publication Critical patent/CN109685030A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/20Scenes; Scene-specific elements in augmented reality scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes
    • G06F18/24137Distances to cluster centroïds
    • G06F18/2414Smoothing the distance, e.g. radial basis function networks [RBFN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/32Normalisation of the pattern dimensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The mug rim of a cup defects detection classification method based on convolutional neural networks that the invention discloses a kind of, comprising the following steps: mug rim of a cup image information A, is acquired by image capturing system;B, the noise of image is collected using opencv removal and data set expands;C, flaw labeling is carried out to mug rim of a cup image using LabelImg, the training set image marked is uniformly formatted as fixed size: 2M*2M;D, training convolutional neural networks are treated using formatted training set to be trained;E, image characteristics extraction is carried out to the image after flaw labeling using convolutional neural networks model after training;F, region recommendation network generates the positive sample candidate frame and negative sample candidate frame of identical quantity according to characteristics of image;G, detection target in region is recommended to classify target.So far, whole system, which completes, classifies to mug rim of a cup defects detection.The present invention can be effectively used for the classification of mug rim of a cup defects detection, improve detection degree of automation and efficiency and reduce the labor intensity of influence and worker of the human factor to detection process.

Description

一种基于卷积神经网络的马克杯杯口缺陷检测分类方法A detection and classification method of mug mouth defect based on convolutional neural network

技术领域technical field

本发明涉及杯口缺陷检测分类技术领域,具体为一种基于卷积神经网络的马克杯杯口缺陷检测分类方法。The invention relates to the technical field of cup mouth defect detection and classification, in particular to a mug cup mouth defect detection and classification method based on a convolutional neural network.

背景技术Background technique

随着中国制造业的不断发展,人民生活水平的不断提高,马克杯已经成为人民日常生活的一部分,马克杯杯口缺陷主要是指杯口的斑点、缺口和划痕,这些缺陷直接影响着产品销量和企业形象。因此,采用合适的缺陷检测分类手段则变得尤为重要。传统人工检测方法存在着的检测效率低下,工作强度大,精度低等弊端,另外一些研究人员将计算机视觉和图像处理相结合,通过缺陷比对来检测马克杯的缺陷情况,这种缺陷图像识别算法需要手工构建、选择目标的主要特征,并选取合适的分类器进行识别,局限性较大。例如,候选区域判别,即对分割出的候选区域依据形状特征、灰度特征以及Hu不变矩特征进行甄别,这需要人参与设计缺陷的一些主要特征,这就存在一个问题: 基于手工设计的特征对于缺陷多样化的变化没有很好的鲁棒性,只适用于特定的缺陷检测,很难适应缺陷面积大小不一、形状种类多样化、背景区域复杂的图像的自动识别与定位。With the continuous development of China's manufacturing industry and the continuous improvement of people's living standards, mugs have become a part of people's daily life. The defects of the mug mouth mainly refer to the spots, gaps and scratches on the mouth of the cup, which directly affect the product. Sales and corporate image. Therefore, it is particularly important to adopt appropriate defect detection and classification methods. Traditional manual detection methods have disadvantages such as low detection efficiency, high work intensity and low precision. Other researchers combine computer vision and image processing to detect defects in mugs through defect comparison. This kind of defect image recognition The algorithm needs to manually construct, select the main features of the target, and select an appropriate classifier for identification, which has great limitations. For example, the candidate region discrimination, that is, the segmented candidate regions are identified based on shape features, grayscale features and Hu invariant moment features, which requires people to participate in the design of some main features of the defect, which has a problem: based on manual design The feature is not very robust to the diverse changes of defects, and is only suitable for specific defect detection.

近年来,随着数以百万带标签训练集的出现以及基于GPU训练算法的出现,使训练复杂卷积网络模型不再奢望。卷积神经网络相比于传统手工提取特征的方法,不仅可以自动学习到目标的特征,而且适合数据集的处理,还能进行端到端的学习,并且绝大部分预测都在 GPU中完成,大幅提升了目标检测的速度和准确度。In recent years, with the emergence of millions of labeled training sets and the emergence of GPU-based training algorithms, training complex convolutional network models has become a luxury. Compared with the traditional method of manually extracting features, the convolutional neural network can not only automatically learn the features of the target, but also be suitable for the processing of data sets, and can also perform end-to-end learning, and most of the predictions are completed in the GPU, greatly Improved the speed and accuracy of object detection.

故基于以上所诉将卷积神经网络引入到马克杯杯口缺陷检测分类中成为一种可行方案,相比于缺陷比对提高了目标检测的速度和准确度,同时相比于传统人工检测提高了检测自动化程度和效率并减少人为因素对检测过程的影响以及工人的劳动强度。Therefore, based on the above, it has become a feasible solution to introduce convolutional neural network into the detection and classification of mug cup mouth defects, which improves the speed and accuracy of target detection compared with defect comparison, and improves the speed and accuracy of target detection compared with traditional manual detection. In order to detect the degree of automation and efficiency and reduce the impact of human factors on the detection process and the labor intensity of workers.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于设计一种基于卷积神经网络的马克杯杯口缺陷检测分类方法,以解决上述背景技术中提出的问题。The purpose of the present invention is to design a method for detecting and classifying defects of a mug mouth based on a convolutional neural network, so as to solve the problems raised in the above background art.

为实现上述目的,本发明提供如下技术方案:一种基于卷积神经网络的马克杯杯口缺陷检测分类方法,包括以下步骤:In order to achieve the above purpose, the present invention provides the following technical solutions: a method for detecting and classifying defects of a mug mouth based on a convolutional neural network, comprising the following steps:

A、由图像采集系统采集马克杯杯口图像信息;A. The image information of the mug mouth is collected by the image acquisition system;

B、利用opencv去除采集到的图像的噪声和数据集扩充;B. Use opencv to remove the noise of the collected images and expand the dataset;

C、利用labelImg对马克杯杯口图像进行缺陷标记,将标记好的训练集图像统一格式化为固定大小:2M*2M;C. Use labelImg to mark the defects of the mug cup mouth image, and uniformly format the marked training set images to a fixed size: 2M*2M;

D、利用格式化后的训练集对待训练卷积神经网络进行训练;D. Use the formatted training set to train the convolutional neural network to be trained;

E、利用训练后卷积神经网络模型对缺陷标记后的图像进行图像特征提取;E. Use the post-training convolutional neural network model to extract image features from the images marked with defects;

F、 区域推荐网络根据图像特征生成相同数量的正样本候选框和负样本候选框;F. The regional recommendation network generates the same number of positive sample candidate frames and negative sample candidate frames according to image features;

G、对目标推荐区域内检测目标进行分类。G. Classify the detection targets in the target recommendation area.

优选的,所述步骤D中训练网络中权值更新包括以下部分:Preferably, the weight update in the training network in the step D includes the following parts:

A、在传统Adam方法的中加入权值衰减;A. Add weight decay to the traditional Adam method;

B、权值衰减并不是添加到损失函数中参与梯度计算,而是参数每次更新时会再额外进行一次权重的衰减过程;B. The weight decay is not added to the loss function to participate in the gradient calculation, but an additional weight decay process will be performed each time the parameters are updated;

C、权值衰减的参数更新步为:C. The parameter update step of weight decay is:

其中,为学习率,为权重衰减系数,便是额外的权重衰减项,是用于数值稳定的小常数,默认,修正的一阶矩的偏差,修正的二阶矩的偏差在区间内,建议默认为:分别为0.9和0.999。in, is the learning rate, is the weight decay coefficient, is the additional weight decay term, is a small constant for numerical stability, the default , the deviation of the corrected first moment , the deviation of the corrected second moment , and in the interval , the recommended defaults are: 0.9 and 0.999, respectively.

优选的,所述步骤F中生成正负样本框包括以下部分:Preferably, generating positive and negative sample frames in step F includes the following parts:

A、在特征图上生成一个(默认取)的小滑窗;A. Generate a feature map on the (default is to take ) small sliding window;

B、在生成每个小划窗的同时预测出个推荐区域候选框;B. Predict while generating each small window recommended region candidate boxes;

C、每个小滑窗在ZF网络下映射为256维特征向量,将该向量送入两个并列的全连接层,包括目标框分类层和目标框回归层,其中目标框分类层输出两个得分,即每个目标框对应于目标和非目标的概率。目标框回归层输出四个回归参数,分别代表目标框的中心坐标和宽高,用作对滑动窗口的修正,获取一次修正的目标框;C. Each small sliding window is mapped to a 256-dimensional feature vector under the ZF network, and the vector is sent to two parallel fully connected layers, including the target box classification layer and the target box regression layer, of which the target box classification layer outputs two Score, i.e. the probability that each target box corresponds to the target and non-target. The target box regression layer outputs four regression parameters , respectively represent the center coordinates and width and height of the target frame, which are used to correct the sliding window to obtain a corrected target frame;

D、将与目标真实框的交并比IOU大于0.7的候选框作为正样本,将与目标真实框交并比IOU小于0.3的候选框作为负样本,其余的候选框则会被舍弃。D. The candidate frame whose intersection ratio with the target real frame is greater than 0.7 is regarded as a positive sample, and the candidate frame whose intersection ratio with the target real frame is less than 0.3 is regarded as a negative sample, and the rest of the candidate frames will be discarded.

优选的,所述步骤G中对目标推荐区域内检测目标进行分类包括以下部分:Preferably, the classification of the detection targets in the target recommendation area in the step G includes the following parts:

A、把步骤F生成的正负候选框映射到卷积神经网络最后提取到的原始特征图上;A. Map the positive and negative candidate frames generated in step F to the original feature map finally extracted by the convolutional neural network;

B、通过ROI池化层对其进行统一格式化为默认n=7;B. It is uniformly formatted through the ROI pooling layer as default n=7;

C、网络对获得的推荐区域特征使用分类器判断目标类别,并对属于某一个类别的区域候选框利用网络的回归层进行第二次调整,进一步修正其位置;C. The network uses the obtained recommended region features The classifier judges the target category, and uses the regression layer of the network to make a second adjustment to the regional candidate frame belonging to a certain category to further correct its position;

D、得出最后的分类结果。D. Get the final classification result.

与现有技术相比,本发明的有益效果是:Compared with the prior art, the beneficial effects of the present invention are:

(1)本发明提供的马克杯缺陷检测分类方法能够有效提高检测分类自动化程度以及准确性和效率;(1) The mug defect detection and classification method provided by the present invention can effectively improve the degree of automation, accuracy and efficiency of detection and classification;

(2)该检测方法可以精确反映马克杯缺陷类型,便于对马克杯的杯口缺陷有个较准确评估,有利于生产厂家根据缺陷类型改进工艺,提高生产效率。(2) The detection method can accurately reflect the defect type of the mug, which is convenient for a more accurate evaluation of the cup mouth defect of the mug, which is beneficial to the manufacturer to improve the process according to the defect type and improve the production efficiency.

附图说明Description of drawings

图1为本发明流程图。Fig. 1 is a flow chart of the present invention.

图2为ROI池化层的工作流程图。Figure 2 shows the workflow of the ROI pooling layer.

图3为本发明总网络结构图。FIG. 3 is a general network structure diagram of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

请参阅附图1、附图2和附图3,本发明提供一种系统方案:一种基于卷积神经网络的马克杯杯口缺陷检测分类方法。下面结合附图与具体实施方式对本发明作进一步详细描述:其中附图1为系统整体流程图,附图2为ROI池化层的工作流程图,附图3为本发明总网络结构图:Please refer to Fig. 1 , Fig. 2 and Fig. 3 , the present invention provides a system solution: a method for detecting and classifying cup mouth defects based on convolutional neural network. The present invention is described in further detail below in conjunction with the accompanying drawings and specific embodiments: wherein accompanying drawing 1 is the overall flow chart of the system, accompanying drawing 2 is the working flow chart of the ROI pooling layer, and accompanying drawing 3 is the overall network structure diagram of the present invention:

包括以下步骤:Include the following steps:

A、由图像采集系统采集马克杯杯口图像信息;A. The image information of the mug mouth is collected by the image acquisition system;

B、利用opencv去除采集到的图像的噪声和数据集扩充;B. Use opencv to remove the noise of the collected images and expand the dataset;

C、利用labelImg对马克杯杯口图像进行缺陷标记,将标记好的训练集图像统一格式化为固定大小:2M*2M;C. Use labelImg to mark the defects of the mug cup mouth image, and uniformly format the marked training set images to a fixed size: 2M*2M;

D、利用格式化后的训练集对待训练卷积神经网络进行训练;D. Use the formatted training set to train the convolutional neural network to be trained;

E、利用训练后卷积神经网络模型对缺陷标记后的图像进行图像特征提取;E. Use the post-training convolutional neural network model to extract image features from the images marked with defects;

F、 区域推荐网络根据图像特征生成相同数量的正样本候选框和负样本候选框;F. The regional recommendation network generates the same number of positive sample candidate frames and negative sample candidate frames according to image features;

G、对目标推荐区域内检测目标进行分类。G. Classify the detection targets in the target recommendation area.

本发明中,步骤A中图像采集系统包括以下步骤:In the present invention, the image acquisition system in step A includes the following steps:

A、将CCD相机固定于操作平台;A. Fix the CCD camera on the operating platform;

B、位置调整合适后,CCD相机获取马克杯的杯口图像;B. After the position is adjusted properly, the CCD camera obtains the image of the cup mouth of the mug;

C、图像通过上位机采集并保存,用于后续的操作。C. The image is collected and saved by the host computer for subsequent operations.

本发明采用CCD相机来代替传统人工检测中人眼的工作,CCD相机固定于操作平台上可以保证检测的稳定性,提高检测过程的自动化程度,同时减少人为因素所带来的误差。The invention uses a CCD camera to replace the work of human eyes in traditional manual detection. The CCD camera is fixed on the operating platform to ensure the stability of detection, improve the automation degree of the detection process, and reduce errors caused by human factors.

本发明中,步骤B中图像去噪和数据集扩充包括以下步骤:In the present invention, in step B, image denoising and data set expansion include the following steps:

A、安装opencv3.3.0和visual studio2013并进行环境配置;A. Install opencv3.3.0 and visual studio2013 and configure the environment;

B、使用opencv中medianBlur函数对采集到的图像进行滤波操作;B. Use the medianBlur function in opencv to filter the collected image;

C、使用opencv中resize、flip等函数对数据集进行扩充。C. Use functions such as resize and flip in opencv to expand the data set.

本发明采用opencv中medianBlur函数进行去噪,相比其他传统去噪方法有着更适合本方法的去噪效果,采用图像几何变换扩充数据集,使训练完的卷积神经网络效果更好,增加结果的准确性。The present invention uses the medianBlur function in opencv for denoising, which has a more suitable denoising effect compared to other traditional denoising methods. The image geometric transformation is used to expand the data set, so that the trained convolutional neural network has better effect and increases the results. accuracy.

本发明中,步骤C中缺陷标记包括以下步骤:In the present invention, the defect marking in step C comprises the following steps:

A、安装python2.7.17和labelImg并进行环境配置;A. Install python2.7.17 and labelImg and configure the environment;

B、源码文件夹使用notepad++打开predefined_classes.txt,并修改默认类别;B. Use notepad++ to open predefined_classes.txt in the source code folder, and modify the default category;

C、“Open Dir”打开图片文件夹,依次选择图片开始进行标注,使用“Create RectBox”开始画框,并标记相应缺陷类别;C. "Open Dir" to open the picture folder, select the pictures in turn to start marking, use "Create RectBox" to start drawing the frame, and mark the corresponding defect category;

D、将标记好的训练集图像统一格式化为固定大小:2M*2M。D. Format the labeled training set images into a fixed size: 2M*2M.

本发明采用的labelImg是一种便捷的图片标注工具,它可以将指定的区域标记为指定的缺陷类别,方便进行卷积神经网络的训练。The labelImg adopted in the present invention is a convenient image labeling tool, which can mark a designated area as a designated defect category, so as to facilitate the training of the convolutional neural network.

本发明中,步骤D中卷积神经网络训练包括以下步骤:In the present invention, the convolutional neural network training in step D includes the following steps:

A、选择卷积神经网络结构与确定初始参数;A. Select the convolutional neural network structure and determine the initial parameters;

B、训练的迭代过程包括依次对每一个小批量数据的前向传播以及误差的反向传播,在数据全部反向传播完成后,然后统一的更新权值参数,用于下一轮迭代,当达到预期迭代次数停止迭代,计算网络最终准确率;B. The iterative process of training includes forward propagation of each small batch of data and back propagation of errors in turn. After all data back propagation is completed, the weight parameters are uniformly updated for the next iteration. When When the expected number of iterations is reached, the iteration is stopped, and the final accuracy rate of the network is calculated;

C、根据训练情况不断调整网络结构与相关参数,直到训练准确率到达要求;C. Continuously adjust the network structure and related parameters according to the training situation, until the training accuracy rate reaches the requirements;

D、训练后的卷积神经网络模型与权值参数等数据用于后续操作。D. Data such as the trained convolutional neural network model and weight parameters are used for subsequent operations.

本发明采用的卷积神经网络,需要先利用步骤C标记好的数据集对网络进行训练,训练好的网络模型便可以用于对采集到的图像进行检测与分类,该方案提高了检测的智能化程度,同时减少工人的劳动强度。The convolutional neural network adopted in the present invention needs to first use the data set marked in step C to train the network, and the trained network model can be used to detect and classify the collected images, and this scheme improves the intelligence of detection The degree of transformation, while reducing the labor intensity of workers.

本发明中,步骤E中图像特征提取包括以下步骤:In the present invention, the image feature extraction in step E includes the following steps:

A、卷积层基于局部感受野原理对图像进行感知,获取图像特征作为特征图用于后续操作;A. The convolution layer perceives the image based on the principle of the local receptive field, and obtains the image features as a feature map for subsequent operations;

B、池化层基于图像的局部相关性原理对特征图进行二次提取,在尽可能保留图像特征的前提下进一步减少所需训练的参数个数并减少过拟合的风险。B. The pooling layer performs a secondary extraction of the feature map based on the principle of local correlation of the image, and further reduces the number of parameters required for training and the risk of overfitting on the premise of retaining the image features as much as possible.

本发明采用的图像特征提取网络,卷积层能获取和实际图像更符合的特征,减少了网络的复杂度,防止过拟合;池化层是对卷积层提取到的特征图进行二次提取,减少过拟合的风险。In the image feature extraction network adopted in the present invention, the convolution layer can obtain features that are more in line with the actual image, reducing the complexity of the network and preventing over-fitting; extraction, reducing the risk of overfitting.

本发明中,步骤F中图像特征提取包括以下步骤:In the present invention, the image feature extraction in step F includes the following steps:

A、在特征图上生成一个(默认取)的小滑窗;A. Generate a feature map on the (default is to take ) small sliding window;

B、在生成每个小划窗的同时预测出个推荐区域候选框;B. Predict while generating each small window recommended region candidate boxes;

C、每个小滑窗在ZF网络下映射为256维特征向量,将该向量送入两个并列的全连接层,包括目标框分类层和目标框回归层,其中目标框分类层输出两个得分,即每个目标框对应于目标和非目标的概率。目标框回归层输出四个回归参数,分别代表目标框的中心坐标和宽高,用作对滑动窗口的修正,获取一次修正的目标框;C. Each small sliding window is mapped to a 256-dimensional feature vector under the ZF network, and the vector is sent to two parallel fully connected layers, including the target box classification layer and the target box regression layer, of which the target box classification layer outputs two Score, i.e. the probability that each target box corresponds to the target and non-target. The target box regression layer outputs four regression parameters , respectively represent the center coordinates and width and height of the target frame, which are used to correct the sliding window to obtain a corrected target frame;

D、将与目标真实框的交并比IOU大于0.7的候选框作为正样本,将与目标真实框交并比IOU小于0.3的候选框作为负样本,其余的候选框则会被舍弃。D. The candidate frame whose intersection ratio with the target real frame is greater than 0.7 is regarded as a positive sample, and the candidate frame whose intersection ratio with the target real frame is less than 0.3 is regarded as a negative sample, and the rest of the candidate frames will be discarded.

本发明采用的区域推荐网络生成正负样本框,相比于以往的获取候选框方法,更加快速,并且很容易和之后的目标分类结合到一起。The region recommendation network used in the present invention generates positive and negative sample frames, which is faster than the previous method for obtaining candidate frames, and can be easily combined with subsequent target classification.

本发明中,步骤G中目标分类包括以下步骤:In the present invention, the target classification in step G comprises the following steps:

A、把步骤F生成的正负候选框映射到卷积神经网络最后提取到的原始特征图上;A. Map the positive and negative candidate frames generated in step F to the original feature map finally extracted by the convolutional neural network;

B、通过ROI池化层对其进行统一格式化为默认n=7;B. It is uniformly formatted through the ROI pooling layer as default n=7;

C、网络对获得的推荐区域特征使用分类器判断目标类别,并对属于某一个类别的区域候选框利用网络的回归层进行第二次调整,进一步修正其位置;C. The network uses the obtained recommended region features The classifier judges the target category, and uses the regression layer of the network to make a second adjustment to the regional candidate frame belonging to a certain category to further correct its position;

D、得出最后的分类结果。D. Get the final classification result.

本发明采用的对目标推荐区域内检测目标进行分类,在分类的同时会获得回归参数修正分类结果,使分类结果更加准确。The invention adopts the classification of the detection target in the target recommendation area, and at the same time of classification, the classification result of the regression parameter correction is obtained, so that the classification result is more accurate.

Claims (3)

1.一种基于卷积神经网络的马克杯杯口缺陷检测分类方法,其特征在于:使用改进后的Adam更新卷积神经网络网络权值,根据更新过程中的梯度下降情况,适当的对学习率进行修改,以适应不同的梯度,提高训练效率。1. A method for detecting and classifying defects of mug cup mouth based on convolutional neural network, characterized in that: using the improved Adam to update the weights of the convolutional neural network network, according to the gradient descent in the update process, appropriate learning The rate is modified to adapt to different gradients and improve training efficiency. 2.一种基于卷积神经网络的马克杯杯口缺陷检测分类方法,其特征在于:特征图上生成小滑窗同时预测出推荐区域候选框,将与目标真实框的交并比IOU大于0.7的候选框作为正样本,将与目标真实框交并比IOU小于0.3的候选框作为负样本,其余的候选框则会被舍弃。2. A method for detection and classification of mug mouth defects based on convolutional neural network, characterized in that: a small sliding window is generated on the feature map and a candidate frame of the recommended region is predicted at the same time, and the intersection and union ratio with the target real frame is greater than 0.7 IOU The candidate frame of 1 is used as a positive sample, and the candidate frame that intersects with the target ground-truth frame and is less than 0.3 IOU is regarded as a negative sample, and the rest of the candidate frames are discarded. 3.一种基于卷积神经网络的马克杯杯口缺陷检测分类方法,其特征在于:对获得的推荐区域特征使用softmax分类器判断目标类别,并对属于某一个类别的区域候选框利用网络的回归层进行第二次调整,进一步修正其位置,直至效果最佳,最终达到最优分类。3. A method for detection and classification of cup mouth defects based on convolutional neural network, characterized in that: using the softmax classifier to determine the target category for the obtained recommended region features, and using the network's method for the region candidate frame belonging to a certain category. The regression layer makes a second adjustment to further correct its position until the effect is the best, and finally the optimal classification is achieved.
CN201811631744.8A 2018-12-29 2018-12-29 A kind of mug rim of a cup defects detection classification method based on convolutional neural networks Pending CN109685030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811631744.8A CN109685030A (en) 2018-12-29 2018-12-29 A kind of mug rim of a cup defects detection classification method based on convolutional neural networks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811631744.8A CN109685030A (en) 2018-12-29 2018-12-29 A kind of mug rim of a cup defects detection classification method based on convolutional neural networks

Publications (1)

Publication Number Publication Date
CN109685030A true CN109685030A (en) 2019-04-26

Family

ID=66190164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811631744.8A Pending CN109685030A (en) 2018-12-29 2018-12-29 A kind of mug rim of a cup defects detection classification method based on convolutional neural networks

Country Status (1)

Country Link
CN (1) CN109685030A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764790A (en) * 2019-10-18 2020-02-07 东北农业大学 A Dataset Labeling Method for Deep Learning
CN111105411A (en) * 2019-12-30 2020-05-05 创新奇智(青岛)科技有限公司 Magnetic shoe surface defect detection method
CN111768388A (en) * 2020-07-01 2020-10-13 哈尔滨工业大学(深圳) A product surface defect detection method and system based on positive sample reference
CN112113978A (en) * 2020-09-22 2020-12-22 成都国铁电气设备有限公司 Vehicle-mounted tunnel defect online detection system and method based on deep learning
CN112633327A (en) * 2020-12-02 2021-04-09 西安电子科技大学 Staged metal surface defect detection method, system, medium, equipment and application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886755A (en) * 2017-01-19 2017-06-23 北京航空航天大学 A kind of intersection vehicles system for detecting regulation violation based on Traffic Sign Recognition
US20180322623A1 (en) * 2017-05-08 2018-11-08 Aquifi, Inc. Systems and methods for inspection and defect detection using 3-d scanning
CN108985337A (en) * 2018-06-20 2018-12-11 中科院广州电子技术有限公司 A kind of product surface scratch detection method based on picture depth study
CN109035233A (en) * 2018-07-24 2018-12-18 西安邮电大学 Visual attention network and Surface Flaw Detection method
CN109064454A (en) * 2018-07-12 2018-12-21 上海蝶鱼智能科技有限公司 Product defects detection method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886755A (en) * 2017-01-19 2017-06-23 北京航空航天大学 A kind of intersection vehicles system for detecting regulation violation based on Traffic Sign Recognition
US20180322623A1 (en) * 2017-05-08 2018-11-08 Aquifi, Inc. Systems and methods for inspection and defect detection using 3-d scanning
CN108985337A (en) * 2018-06-20 2018-12-11 中科院广州电子技术有限公司 A kind of product surface scratch detection method based on picture depth study
CN109064454A (en) * 2018-07-12 2018-12-21 上海蝶鱼智能科技有限公司 Product defects detection method and system
CN109035233A (en) * 2018-07-24 2018-12-18 西安邮电大学 Visual attention network and Surface Flaw Detection method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764790A (en) * 2019-10-18 2020-02-07 东北农业大学 A Dataset Labeling Method for Deep Learning
CN111105411A (en) * 2019-12-30 2020-05-05 创新奇智(青岛)科技有限公司 Magnetic shoe surface defect detection method
CN111105411B (en) * 2019-12-30 2023-06-23 创新奇智(青岛)科技有限公司 Magnetic shoe surface defect detection method
CN111768388A (en) * 2020-07-01 2020-10-13 哈尔滨工业大学(深圳) A product surface defect detection method and system based on positive sample reference
CN111768388B (en) * 2020-07-01 2023-08-11 哈尔滨工业大学(深圳) A product surface defect detection method and system based on positive sample reference
CN112113978A (en) * 2020-09-22 2020-12-22 成都国铁电气设备有限公司 Vehicle-mounted tunnel defect online detection system and method based on deep learning
CN112633327A (en) * 2020-12-02 2021-04-09 西安电子科技大学 Staged metal surface defect detection method, system, medium, equipment and application
CN112633327B (en) * 2020-12-02 2023-06-30 西安电子科技大学 Staged metal surface defect detection method, system, medium, equipment and application

Similar Documents

Publication Publication Date Title
CN109961049B (en) Cigarette brand identification method under complex scene
CN108416307B (en) An aerial image pavement crack detection method, device and equipment
CN109685030A (en) A kind of mug rim of a cup defects detection classification method based on convolutional neural networks
CN106875381B (en) Mobile phone shell defect detection method based on deep learning
CN107610087B (en) An automatic segmentation method of tongue coating based on deep learning
CN108960245B (en) Tire mold character detection and recognition method, device, equipment and storage medium
CN107145908B (en) A small target detection method based on R-FCN
CN110853015A (en) Aluminum profile defect detection method based on improved Faster-RCNN
CN107423760A (en) Based on pre-segmentation and the deep learning object detection method returned
CN107180430A (en) A kind of deep learning network establishing method and system suitable for semantic segmentation
CN108520273A (en) A fast detection and recognition method for dense small commodities based on target detection
CN112085024A (en) A method for character recognition on the surface of a tank
CN111488920A (en) Bag opening position detection method based on deep learning target detection and recognition
CN111540006A (en) Plant stomata intelligent detection and identification method and system based on deep migration learning
CN113393438B (en) A resin lens defect detection method based on convolutional neural network
CN110543906A (en) Skin type automatic identification method based on data enhancement and Mask R-CNN model
CN111462068A (en) A method for screw and nut detection based on transfer learning
CN115457044B (en) Pavement Crack Segmentation Method Based on Class Activation Mapping
CN112508857A (en) Aluminum product surface defect detection method based on improved Cascade R-CNN
CN115147380A (en) Small transparent plastic product defect detection method based on YOLOv5
CN109815923B (en) Needle mushroom head sorting and identifying method based on LBP (local binary pattern) features and deep learning
CN108932471A (en) A kind of vehicle checking method
CN115797367A (en) Tea tree tea bud segmentation method based on deep learning
CN115439405A (en) A Classification Method for Steel Plate Surface Defects
CN116523916B (en) Product surface defect detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190426