WO2021004130A1 - Logo缺陷检测方法及装置 - Google Patents

Logo缺陷检测方法及装置 Download PDF

Info

Publication number
WO2021004130A1
WO2021004130A1 PCT/CN2020/086818 CN2020086818W WO2021004130A1 WO 2021004130 A1 WO2021004130 A1 WO 2021004130A1 CN 2020086818 W CN2020086818 W CN 2020086818W WO 2021004130 A1 WO2021004130 A1 WO 2021004130A1
Authority
WO
WIPO (PCT)
Prior art keywords
logo
image
picture
defect
layer
Prior art date
Application number
PCT/CN2020/086818
Other languages
English (en)
French (fr)
Inventor
邓远志
陈润康
戴志威
刘志永
林淼
陈志列
Original Assignee
研祥智能科技股份有限公司
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 研祥智能科技股份有限公司 filed Critical 研祥智能科技股份有限公司
Publication of WO2021004130A1 publication Critical patent/WO2021004130A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • 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/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • 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/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20216Image averaging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20224Image subtraction

Definitions

  • the invention relates to the technical field of image recognition and detection, in particular to a method and device for detecting logo defects.
  • logo inspection is to eliminate products with obvious shape and surface defects during processing, and make necessary interventions on production equipment according to the actual production situation, and improve the pass rate of products by overhauling the corresponding equipment and modifying process parameters.
  • the traditional manual inspection method to judge whether there are defects on the logo surface has the following shortcomings: it is easy to make people physically and mentally fatigued to make mistakes and missed inspections, easy to be subjectively affected and difficult to form a consistent inspection standard, and labor and management costs increase.
  • the existing CNN Convolutional Neural Network
  • VGG Vehicle Geometry Group
  • VGG Vehicle Geometry Group
  • VGG Expands the depth of the neural network and improves the quality of the model by continuously adding convolutional layers to the network.
  • it also faces the disadvantages of too large and redundant parameters, slow training and prediction, and so on, resulting in slower logo defect detection speed.
  • the Logo defect detection method and device provided by the present invention can improve the detection speed of Logo defects.
  • the present invention provides a logo defect detection method, including:
  • VGG network model Constructing a VGG network model, wherein the two maximum pooling layers in the VGG network model are followed by a PCA layer;
  • the segmented pictures are passed into the defect classification model, and the defects of the Logo pictures are judged.
  • the constructing a VGG network model includes:
  • the principal component vector is roughly extracted from the feature map matrix after the maximum pooling layer, and the obtained variables are then subjected to two Conv256 layer convolution operations and the maximum pooling layer operation;
  • the feature is integrated into a 1000-dimensional feature vector, and the feature vector is classified by the Softmax function. 0 indicates that the logo image is defective, and 1 indicates that the Logo image is normal.
  • the method before the training the VGG network model, the method further includes:
  • the calculation process of the PCA layer is:
  • the passing the segmented picture into the defect classification model, and determining the defect of the Logo picture includes:
  • the present invention provides a Logo defect detection device, including:
  • the construction unit is used to construct a VGG network model, wherein the two maximum pooling layers in the VGG network model are followed by a PCA layer;
  • the segmentation unit is used to segment the logo image to be detected, and remember the relative position of each image after segmentation in the original image;
  • the training unit is used to train the VGG network model until the preset maximum number of iterations is reached, and the training to output the defect classification model is finished;
  • the judging unit is used to pass the segmented picture into the defect classification model to judge the defect of the Logo picture.
  • the construction unit is used for subtracting the mean value of image RGB from each pixel of each image in the training set during preprocessing; rough extraction of the feature map matrix after the maximum pooling layer through the PCA layer Principal component vector, the obtained variables are then subjected to two Conv256 layer convolution operations and the maximum pooling layer operation; the obtained feature map matrix is finely extracted principal component vectors; the features are integrated into 1000-dimensional features in the fully connected layer Vector.
  • Use the Softmax function to classify the feature vector. 0 means that the logo image is defective, and 1 means that the logo image is normal.
  • the device further includes:
  • the labeling unit is used for labeling the segmented pictures before the training unit trains the VGG network model, where 0 indicates that the picture is defective, and 1 indicates that the picture is normal;
  • the augmentation unit is used to rotate, flip, randomly change the exposure and add noise to the segmented image to achieve the augmentation of the data set.
  • the calculation process of the PCA layer is:
  • the judging unit is configured to pass the segmented pictures into the trained defect classification model to classify all the pictures; locate the defective pictures on the original Logo picture according to their relative positions, find out the defects and Determine the location of the defect.
  • the Logo defect detection method and device modify the VGG network and add a PCA mechanism to form a cascaded PCA convolutional neural network.
  • the network model is simplified, so that the model can quickly converge and can cause Logo defects
  • the detection speed is further improved.
  • the amount of network parameters is reduced, making the training speed faster.
  • Figure 1 is a model architecture diagram of an existing VGG network
  • FIG. 2 is a flowchart of a method for detecting a logo defect provided by an embodiment of the present invention
  • Figure 3 is a model architecture diagram of a VGG network provided by an embodiment of the present invention.
  • Figure 4 is a normal original image of the Logo provided by an embodiment of the present invention.
  • FIG. 5 is an original diagram of a defect in the Y letter in the Logo provided by an embodiment of the present invention.
  • FIG. 7 is a schematic diagram after labeling FIG. 6 according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram after augmenting FIG. 7 according to an embodiment of the present invention.
  • FIG. 9 is an architecture diagram of a training model provided by an embodiment of the present invention.
  • Figure 10 is a logo defect detection effect diagram provided by an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a Logo defect detection device passed by an embodiment of the present invention.
  • the embodiment of the present invention uses a method for extracting features based on a cascaded PCA (Principal Component Analysis) convolutional network to determine whether the logo is defective.
  • PCA Principal Component Analysis
  • the direction with the largest variance is used as the coordinate axis direction, because the maximum variance of the variable gives the most important information of the variable, eliminating the redundant Variables, that is, seek for variables that are linearly independent of variables, so that the set of variables is reduced in dimension.
  • Dimensionality reduction is a method of processing high-dimensional features of data. The most important features of high-dimensional data are retained, and noise is removed to achieve the purpose of improving data processing speed. In actual production and application, dimensionality reduction is within a certain range of information loss, which can save a lot of time and cost.
  • the embodiment of the present invention provides a Logo defect detection method. As shown in FIG. 2, the method includes:
  • S22 Segment the logo picture to be detected, and record the relative position of each picture after the segmentation in the original image
  • the Logo defect detection method provided by the embodiment of the present invention modifies the VGG network and adds a PCA mechanism to form a cascaded PCA convolutional neural network.
  • the network model is simplified, so that the model can converge quickly, and the logo defect detection speed can be achieved To further improve, at the same time, when training the network, the amount of network parameters is reduced, making the training speed faster.
  • the Logo defect detection method of this embodiment mainly includes three parts: model construction, model training, and model application.
  • the input image size of the cascaded PCA network is 224 ⁇ 224 pixels.
  • the average RGB value of each image in the training set needs to be subtracted from each pixel.
  • Conv_x convolution kernels of 1 ⁇ 1, 3 ⁇ 3, and 5 ⁇ 5 pixels are used respectively.
  • the convolution step size is 1 pixel, the filling around the image is 1 pixel, using Max-pooling (maximum pooling), there are a total of four layers, after the convolution layer is distributed among them, the window size is a 2 ⁇ 2 volume Product core, step size is 2.
  • the principal component vector is roughly extracted from the feature map matrix after the MaxPooling layer, and the obtained variables are then subjected to two Conv256 layer convolution operations and Maxpooling layer operations. Then, the principal component vector is extracted finely on the obtained feature map matrix. Finally, the feature is integrated into a 1000-dimensional feature vector in the fully connected layer, and the feature vector is classified by the Softmax function. 0 means that the Logo image is defective, and 1 means that the Logo image is normal.
  • the image size is 800 ⁇ 120
  • the input size of the defect classification network is 224 ⁇ 224.
  • this implementation For example, divide each collected picture into 16 small pictures, and record the relative position of each divided picture in the original picture. Then pass the segmented pictures into the trained defect classification model to classify all pictures. Finally, the defective picture is located on the original picture according to the relative position, so as to find the defect and determine its position. Add a PCA layer behind the two Maxpooling layers of the original VGG. The features output by the Maxpooling layer are filtered and "purified" by the PCA layer. The calculation process of the PCA layer is as follows:
  • the segmented picture is transferred to the defect classification model, and the defect of the Logo picture is judged.
  • the invention reduces the number of parameters of the original VGG network model, and processes the VGG network model through the cascaded PCA method to realize the judgment of Logo defects. Compared with the original VGG network model, the number of model parameters is reduced In terms of training time, the training speed of the model has increased by 50%, and in the application of the model, the forward calculation speed of the model has increased by 1/3.
  • the embodiment of the present invention also provides a Logo defect detection device. As shown in FIG. 11, the device includes:
  • the construction unit 21 is configured to construct a VGG network model, wherein the two maximum pooling layers in the VGG network model are followed by a PCA layer;
  • the segmentation unit 22 is used for segmenting the Logo picture to be detected, and remembering the relative position of each picture after the segmentation in the original image;
  • the training unit 23 is configured to train the VGG network model until the preset maximum number of iterations is reached, and then finish training and output the defect classification model;
  • the judging unit 24 is configured to pass the segmented picture into the defect classification model to judge the defect of the Logo picture.
  • the Logo defect detection device modifies the VGG network and adds a PCA mechanism to form a cascaded PCA convolutional neural network.
  • the network model is simplified, so that the model can quickly converge, and the logo defect detection speed can be achieved To further improve, at the same time, when training the network, the amount of network parameters is reduced, making the training speed faster.
  • the construction unit 21 is configured to subtract the mean value of image RGB from each pixel of each image in the training set during preprocessing; use the PCA layer to roughen the feature map matrix after the maximum pooling layer. Extract the principal component vector, and then perform the two Conv256 layer convolution operation and the maximum pooling layer operation on the obtained variables; finely extract the principal component vector from the obtained feature map matrix; integrate the features into 1000-dimensional in the fully connected layer Feature vector, use the Softmax function to classify the feature vector, 0 means that the logo image is defective, and 1 means that the logo image is normal.
  • the device further includes:
  • the labeling unit is used to label the segmented pictures before the training unit 23 trains the VGG network model, where 0 indicates that the picture is defective, and 1 indicates that the picture is normal;
  • the augmentation unit is used to rotate, flip, randomly change the exposure and add noise to the segmented image to achieve the augmentation of the data set.
  • the calculation process of the PCA layer is:
  • the judging unit 24 is used to pass the segmented pictures into the trained defect classification model to classify all the pictures; locate the defective pictures on the original Logo picture according to their relative positions to find out the defects And determine the location of the defect.
  • the device in this embodiment can be used to implement the technical solutions of the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • the program can be stored in a computer readable storage medium. During execution, it may include the procedures of the above-mentioned method embodiments.
  • the storage medium may be a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.

Landscapes

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

Abstract

本发明提供一种Logo缺陷检测方法及装置。所述方法包括:构建VGG网络模型,其中,所述VGG网络模型中的两个最大池化层后面具有PCA层;对待检测的Logo图片进行分割,并记好分割后的每张图片在原图中的相对位置;对所述VGG网络模型进行训练,直至达到预设的最大迭代数,结束训练输出缺陷分类模型;将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定。本发明能够提升Logo缺陷的检测速度。

Description

Logo缺陷检测方法及装置 技术领域
本发明涉及图像识别与检测技术领域,尤其涉及一种Logo缺陷检测方法及装置。
背景技术
Logo检测是对加工过程中有明显形状和表面缺陷的产品进行剔除,并根据实际生产情况对生产设备做出必要的干预,通过对相应的设备进行检修、修改工艺参数等手段提高产品的合格率。然而传统人工检测方式对Logo的表面是否存在缺陷进行判断存在如下缺点:易使人身心疲劳产生错检、漏检,易受人主观影响难以形成一致的检测标准,人力成本和管理成本增加。
现有的CNN(Convolutional Neural Network)技术作为一种非常有效的特征提取方法,目前在图像识别与检测等领域取得了巨大的突破。如VGG(Visual Geometry Group)卷积网络结构,对不同部位图像进行卷积操作提取特征映射,能够实现于图像目标的分类,针对Logo缺陷判定。VGG通过对网络不停地加卷积层,扩展神经网络的深度,提高模型质量,但它同时也面临着参数过于庞大冗余,训练和预测较慢等缺点,导致Logo缺陷检测速度较慢。
发明内容
本发明提供的Logo缺陷检测方法及装置,能够提升Logo缺陷的检测速度。
第一方面,本发明提供一种Logo缺陷检测方法,包括:
构建VGG网络模型,其中,所述VGG网络模型中的两个最大池化层后面具有PCA层;
对待检测的Logo图片进行分割,并记好分割后的每张图片在原图中的相对位置;
对所述VGG网络模型进行训练,直至达到预设的最大迭代数,结束训练输出缺陷分类模型;
将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定。
可选地,所述构建VGG网络模型包括:
在预处理时,将训练集中每张图像的每个像素上减去图像RGB的均值;
通过PCA层对最大池化层后的特征图矩阵进行粗提取主成分向量,得到的变量再进行两个Conv256层的卷积操作和最大池化层的操作;
对得到的特征图矩阵进行细提取主成分向量;
在全连接层将特征整合成1000维的特征向量,用Softmax函数对特征向量进行分类,0表示Logo图片存在缺陷,1表示Logo图片正常。
可选地,在所述对所述VGG网络模型进行训练之前,所述方法还包括:
对分割后的图片进行标注,其中0表示图片存在缺陷,1表示图片正常;
对分割后的图片进行旋转、翻转、随机改变曝光度和添加噪声操作,实现数据集增广。
可选地,所述PCA层的计算流程为:
输入粗特征向量;
将每个特征值减去平均特征值;
求特征向量协方差矩阵;
求协方差矩阵的特征向量;
将特征向量中的特征值进行重新按大小排列,选取最大的K个,其中,K 为预设值;
输出这K个向量作为新的特征向量。
可选地,所述将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定包括:
将分割后的图片传入训练好的缺陷分类模型,对所有图片进行分类;
将有缺陷的图片依据相对位置在原Logo图片上进行定位,找出缺陷并确定缺陷所在位置。
第二方面,本发明提供一种Logo缺陷检测装置,包括:
构建单元,用于构建VGG网络模型,其中,所述VGG网络模型中的两个最大池化层后面具有PCA层;
分割单元,用于对待检测的Logo图片进行分割,并记好分割后的每张图片在原图中的相对位置;
训练单元,用于对所述VGG网络模型进行训练,直至达到预设的最大迭代数,结束训练输出缺陷分类模型;
判定单元,用于将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定。
可选地,所述构建单元,用于在预处理时,将训练集中每张图像的每个像素上减去图像RGB的均值;通过PCA层对最大池化层后的特征图矩阵进行粗提取主成分向量,得到的变量再进行两个Conv256层的卷积操作和最大池化层的操作;对得到的特征图矩阵进行细提取主成分向量;在全连接层将特征整合成1000维的特征向量,用Softmax函数对特征向量进行分类,0表示Logo图片存在缺陷,1表示Logo图片正常。
可选地,所述装置还包括:
标注单元,用于在所述训练单元对所述VGG网络模型进行训练之前,对分割后的图片进行标注,其中0表示图片存在缺陷,1表示图片正常;
增广单元,用于对分割后的图片进行旋转、翻转、随机改变曝光度和添加噪声操作,实现数据集增广。
可选地,所述PCA层的计算流程为:
输入粗特征向量;
将每个特征值减去平均特征值;
求特征向量协方差矩阵;
求协方差矩阵的特征向量;
将特征向量中的特征值进行重新按大小排列,选取最大的K个,其中,K为预设值;
输出这K个向量作为新的特征向量。
可选地,所述判定单元,用于将分割后的图片传入训练好的缺陷分类模型,对所有图片进行分类;将有缺陷的图片依据相对位置在原Logo图片上进行定位,找出缺陷并确定缺陷所在位置。
本发明实施例提供的Logo缺陷检测方法及装置,通过对VGG网络进行修改,添加PCA机制,组建级联的PCA卷积神经网络,将网络模型进行精简,使得模型能够快速收敛,能够使得Logo缺陷检测速度进一步提升,同时,在训练网络时,降低了网络参数量,使得训练速度加快。
附图说明
图1为现有的VGG网络的模型架构图;
图2为本发明实施例提供的Logo缺陷检测方法的流程图;
图3为本发明实施例提供的VGG网络的模型架构图;
图4为本发明实施例提供的Logo正常原图;
图5为本发明实施例提供的Logo中Y字母处有缺陷的原图;
图6为本发明实施例提供的图像分割后的效果图;
图7为本发明实施例提供的对图6进行标注后的示意图;
图8为本发明实施例提供的对图7进行增广后的示意图;
图9为本发明实施例提供的训练模型的架构图;
图10为本发明实施例提供的logo缺陷检测效果图;
图11为本发明实施例通过的Logo缺陷检测装置的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例使用基于级联的PCA(Principal Component Analysis,主成分分析)卷积网络提取特征的方法来对Logo进行缺陷的有无判定。PCA将变量从原来的坐标系转换到新的坐标系,转换坐标系时,以方差最大的方向作为坐标轴方向,因为变量的最大方差给出了变量的最重要的信息,去除了冗余的变量,即寻求变量中线性无关的变量,使得变量集进行降维。降维是对数据高维度特征的一种处理方法,将高维度的数据保留下最重要的一些特征,通过去除噪声,从而实现提升数据处理速度的目的。在实际的生产和应用中,降维在一定的信息损失范围内,可以节省大量的时间和成本。
本发明实施例提供一种Logo缺陷检测方法,如图2所示,所述方法包括:
S21、构建VGG网络模型,其中,所述VGG网络模型中的两个最大池化层后面具有PCA层;
S22、对待检测的Logo图片进行分割,并记好分割后的每张图片在原图中的相对位置;
S23、对所述VGG网络模型进行训练,直至达到预设的最大迭代数,结束训练输出缺陷分类模型;
S24、将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定。
本发明实施例提供的Logo缺陷检测方法,通过对VGG网络进行修改,添加PCA机制,组建级联的PCA卷积神经网络,将网络模型进行精简,使得模型能够快速收敛,能够使得Logo缺陷检测速度进一步提升,同时,在训练网络时,降低了网络参数量,使得训练速度加快。
下面对本发明实施例Logo缺陷检测方法进行详细说明。
本实施例Logo缺陷检测方法主要包括三大部分:模型构建、模型训练和模型应用。
首先构建VGG网络模型,本实施例构建的VGG网络模型架构如图3所示:
级联PCA网络输入图像大小为224×224像素,在预处理时,训练集中每张图像的每个像素上都需要减去图像RGB的均值。卷积层Conv_x中,分别使用了1×1、3×3和5×5像素的卷积核。卷积步长为1个像素,图像四周的填充为1个像素,采用Max-pooling(最大池化),总共有四层,分布于其中的卷积层后,窗口大小为2×2的卷积核,步长为2。然后通过PCA对MaxPooling层后的特征图矩阵进行粗提取主成分向量,得到的变量再进行两个Conv256 层的卷积操作和Maxpooling层的操作。接着再对得到的特征图矩阵进行细提取主成分向量。最后,在全连接层将特征整合成1000维的特征向量,用Softmax函数对特征向量进行分类,0表示Logo图片存在缺陷,1表示Logo图片正常。
然后对所述VGG网络模型进行训练。
在对所述VGG网络模型进行训练之前,先对待检测的Logo图片进行预处理,包括图片的分割和数据集的增广。由于在Logo检测设备上采集的图片并提取Logo的ROI(Region Of Interest,感兴趣区域)后图片大小为800×120,而缺陷分类网络输入大小为224×224,为了实现全覆盖检测,本实施例将每张采集图片分割出16张小图,并记好每张分割图片在原图中相对位置。然后将分割后的图片传入训练好的缺陷分类模型,对所有图片进行分类。最后将有缺陷的图片依据相对位置在原图上进行定位,以此来找出缺陷并确定其位置。在原来VGG的两个Maxpooling层后面增加PCA层。在前面通过Maxpooling层输出的特征,通过PCA层进行特征的筛选“提纯”,其中PCA层的计算流程如下:
输入“粗”特征向量;
每个特征值减去平均特征值;
求特征向量协方差矩阵;
求协方差矩阵的特征向量;
将特征向量中的特征值进行重新按大小排列,选取最大的K个;
输出这K个向量作为新的特征向量。
如图4所示,为训练数据的Logo正常原图SKYWORTH。
如图5所示,为训练数据的Logo中Y字母处有缺陷的原图。
先对图像进行分割,水平方向分成8份,垂直方向分成2份,得到16个 小图像,分割效果如图6所示。
接着对分割后的图像进行标注,标识结果如图7所示,其中0表示Logo图片存在缺陷,1表示Logo图片正常。
接着对图像进行增广,对图像进行旋转、翻转、随机改变曝光度和添加噪声,以期提高模型的鲁棒性,增广后图像如图8所示。
训练模型的流程如图9所示,直至达到预设的最大迭代数,结束训练输出缺陷分类模型。
最后,将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定。
得到训练好的模型后,加载模型到显卡的显存,通过输入的Logo分割后的每张图片来对Logo缺陷进行判定,对每张小图变换到224×224的大小。
模型预测出输入的图片是否为有缺陷的Logo后,将位置坐标还原回原图,检测出的Logo缺陷效果如图10所示。
本发明通过减少原有的VGG网络模型的参数量,通过级联的PCA方法来对VGG网络模型进行加工,实现对Logo缺陷的判定,对比原有的VGG网络模型,在模型的参数数量上减少了1/3,在训练时间上,模型的训练速度加快了50%,在模型的应用上,模型的前向计算速度增加了1/3。
本发明实施例还提供一种Logo缺陷检测装置,如图11所示,所述装置包括:
构建单元21,用于构建VGG网络模型,其中,所述VGG网络模型中的两个最大池化层后面具有PCA层;
分割单元22,用于对待检测的Logo图片进行分割,并记好分割后的每张图片在原图中的相对位置;
训练单元23,用于对所述VGG网络模型进行训练,直至达到预设的最大迭代数,结束训练输出缺陷分类模型;
判定单元24,用于将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定。
本发明实施例提供的Logo缺陷检测装置,通过对VGG网络进行修改,添加PCA机制,组建级联的PCA卷积神经网络,将网络模型进行精简,使得模型能够快速收敛,能够使得Logo缺陷检测速度进一步提升,同时,在训练网络时,降低了网络参数量,使得训练速度加快。
可选地,所述构建单元21,用于在预处理时,将训练集中每张图像的每个像素上减去图像RGB的均值;通过PCA层对最大池化层后的特征图矩阵进行粗提取主成分向量,得到的变量再进行两个Conv256层的卷积操作和最大池化层的操作;对得到的特征图矩阵进行细提取主成分向量;在全连接层将特征整合成1000维的特征向量,用Softmax函数对特征向量进行分类,0表示Logo图片存在缺陷,1表示Logo图片正常。
可选地,所述装置还包括:
标注单元,用于在所述训练单元23对所述VGG网络模型进行训练之前,对分割后的图片进行标注,其中0表示图片存在缺陷,1表示图片正常;
增广单元,用于对分割后的图片进行旋转、翻转、随机改变曝光度和添加噪声操作,实现数据集增广。
可选地,所述PCA层的计算流程为:
输入粗特征向量;
将每个特征值减去平均特征值;
求特征向量协方差矩阵;
求协方差矩阵的特征向量;
将特征向量中的特征值进行重新按大小排列,选取最大的K个,其中,K为预设值;
输出这K个向量作为新的特征向量。
可选地,所述判定单元24,用于将分割后的图片传入训练好的缺陷分类模型,对所有图片进行分类;将有缺陷的图片依据相对位置在原Logo图片上进行定位,找出缺陷并确定缺陷所在位置。
本实施例的装置,可以用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
本领域普通技术人员可以理解实现上述方法实施例中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。

Claims (10)

  1. 一种Logo缺陷检测方法,其特征在于,包括:
    构建VGG网络模型,其中,所述VGG网络模型中的两个最大池化层后面具有PCA层;
    对待检测的Logo图片进行分割,并记好分割后的每张图片在原图中的相对位置;
    对所述VGG网络模型进行训练,直至达到预设的最大迭代数,结束训练输出缺陷分类模型;
    将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定。
  2. 根据权利要求1所述的方法,其特征在于,所述构建VGG网络模型包括:
    在预处理时,将训练集中每张图像的每个像素上减去图像RGB的均值;
    通过PCA层对最大池化层后的特征图矩阵进行粗提取主成分向量,得到的变量再进行两个Conv256层的卷积操作和最大池化层的操作;
    对得到的特征图矩阵进行细提取主成分向量;
    在全连接层将特征整合成1000维的特征向量,用Softmax函数对特征向量进行分类,0表示Logo图片存在缺陷,1表示Logo图片正常。
  3. 根据权利要求1所述的方法,其特征在于,在所述对所述VGG网络模型进行训练之前,所述方法还包括:
    对分割后的图片进行标注,其中0表示图片存在缺陷,1表示图片正常;
    对分割后的图片进行旋转、翻转、随机改变曝光度和添加噪声操作,实现 数据集增广。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述PCA层的计算流程为:
    输入粗特征向量;
    将每个特征值减去平均特征值;
    求特征向量协方差矩阵;
    求协方差矩阵的特征向量;
    将特征向量中的特征值进行重新按大小排列,选取最大的K个,其中,K为预设值;
    输出这K个向量作为新的特征向量。
  5. 根据权利要求4所述的方法,其特征在于,所述将分割后的图片传入所述缺陷分类模型,对所述Logo图片的缺陷进行判定包括:
    将分割后的图片传入训练好的缺陷分类模型,对所有图片进行分类;
    将有缺陷的图片依据相对位置在原Logo图片上进行定位,找出缺陷并确定缺陷所在位置。
  6. 一种Logo缺陷检测装置,其特征在于,包括:
    构建单元,用于构建VGG网络模型,其中,所述VGG网络模型中的两个最大池化层后面具有PCA层;
    分割单元,用于对待检测的Logo图片进行分割,并记好分割后的每张图片在原图中的相对位置;
    训练单元,用于对所述VGG网络模型进行训练,直至达到预设的最大迭代数,结束训练输出缺陷分类模型;
    判定单元,用于将分割后的图片传入所述缺陷分类模型,对所述Logo图 片的缺陷进行判定。
  7. 根据权利要求6所述的装置,其特征在于,所述构建单元,用于在预处理时,将训练集中每张图像的每个像素上减去图像RGB的均值;通过PCA层对最大池化层后的特征图矩阵进行粗提取主成分向量,得到的变量再进行两个Conv256层的卷积操作和最大池化层的操作;对得到的特征图矩阵进行细提取主成分向量;在全连接层将特征整合成1000维的特征向量,用Softmax函数对特征向量进行分类,0表示Logo图片存在缺陷,1表示Logo图片正常。
  8. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    标注单元,用于在所述训练单元对所述VGG网络模型进行训练之前,对分割后的图片进行标注,其中0表示图片存在缺陷,1表示图片正常;
    增广单元,用于对分割后的图片进行旋转、翻转、随机改变曝光度和添加噪声操作,实现数据集增广。
  9. 根据权利要求6至8中任一项所述的装置,其特征在于,所述PCA层的计算流程为:
    输入粗特征向量;
    将每个特征值减去平均特征值;
    求特征向量协方差矩阵;
    求协方差矩阵的特征向量;
    将特征向量中的特征值进行重新按大小排列,选取最大的K个,其中,K为预设值;
    输出这K个向量作为新的特征向量。
  10. 根据权利要求9所述的装置,其特征在于,所述判定单元,用于将分割后的图片传入训练好的缺陷分类模型,对所有图片进行分类;将有缺陷的图 片依据相对位置在原Logo图片上进行定位,找出缺陷并确定缺陷所在位置。
PCT/CN2020/086818 2019-07-10 2020-04-24 Logo缺陷检测方法及装置 WO2021004130A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910619417.9A CN110910339B (zh) 2019-07-10 2019-07-10 Logo缺陷检测方法及装置
CN201910619417.9 2019-07-10

Publications (1)

Publication Number Publication Date
WO2021004130A1 true WO2021004130A1 (zh) 2021-01-14

Family

ID=69814564

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/086818 WO2021004130A1 (zh) 2019-07-10 2020-04-24 Logo缺陷检测方法及装置

Country Status (2)

Country Link
CN (1) CN110910339B (zh)
WO (1) WO2021004130A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110910339B (zh) * 2019-07-10 2022-11-22 研祥智能科技股份有限公司 Logo缺陷检测方法及装置
CN112037205A (zh) * 2020-09-01 2020-12-04 湖北微特传感物联研究院有限公司 一种基于深度学习的起重机裂纹检测方法
CN112051270B (zh) * 2020-09-10 2021-08-13 广州云从人工智能技术有限公司 一种输电线缺陷检测方法、系统、设备及介质
CN113239960B (zh) * 2021-04-09 2024-05-28 中用科技有限公司 融合ai视觉算法的道路防护智能预警方法和系统
CN113610832B (zh) * 2021-08-19 2023-02-10 创优数字科技(广东)有限公司 一种徽标缺陷检测方法、装置、设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130113914A1 (en) * 2011-11-03 2013-05-09 Pratt & Whitney System and Method for Automated Borescope Inspection User Interface
CN108109137A (zh) * 2017-12-13 2018-06-01 重庆越畅汽车科技有限公司 车辆部件的机器视觉检测系统及方法
CN110910339A (zh) * 2019-07-10 2020-03-24 研祥智能科技股份有限公司 Logo缺陷检测方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130113914A1 (en) * 2011-11-03 2013-05-09 Pratt & Whitney System and Method for Automated Borescope Inspection User Interface
CN108109137A (zh) * 2017-12-13 2018-06-01 重庆越畅汽车科技有限公司 车辆部件的机器视觉检测系统及方法
CN110910339A (zh) * 2019-07-10 2020-03-24 研祥智能科技股份有限公司 Logo缺陷检测方法及装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HUANG, SENLIN: "Research and Application of Bottle Body Defect Detection Algorithm for Beer Empty Bottle Detection Robot", ELECTRONIC TECHNOLOGY & INFORMATION SCIENCE, CHINA MASTER’S THESES FULL-TEXT DATABASE, no. 02, 15 February 2019 (2019-02-15), ISSN: 1674-0246, DOI: 20200722212205Y *
LIU, LIN: "Non-official translation: House Number Recognition Method Based on CNN Cross-Layer Fusion Feature", INFORMATION SCIENCE AND TECHNOLOGY, CHINESE MASTER’S THESES FULL-TEXT DATABASE, no. 01, 15 January 2019 (2019-01-15), ISSN: 1674-0246, DOI: 20200722212505Y *

Also Published As

Publication number Publication date
CN110910339A (zh) 2020-03-24
CN110910339B (zh) 2022-11-22

Similar Documents

Publication Publication Date Title
WO2021004130A1 (zh) Logo缺陷检测方法及装置
Wei et al. Multi-target defect identification for railway track line based on image processing and improved YOLOv3 model
CN109558832B (zh) 一种人体姿态检测方法、装置、设备及存储介质
CN110826389B (zh) 基于注意力3d频率卷积神经网络的步态识别方法
CN110807422A (zh) 一种基于深度学习的自然场景文本检测方法
Wan et al. Ceramic tile surface defect detection based on deep learning
US10242294B2 (en) Target object classification using three-dimensional geometric filtering
Xu et al. Fast vehicle and pedestrian detection using improved Mask R‐CNN
CN111489339A (zh) 高速铁路定位器螺栓备母缺陷的检测方法
CN113112416B (zh) 一种语义引导的人脸图像修复方法
Wang et al. Self-attention guided model for defect detection of aluminium alloy casting on X-ray image
CN112084838B (zh) 一种车间安全帽检测方法
CN108416780A (zh) 一种基于孪生-感兴趣区域池化模型的物体检测与匹配方法
Khodabakhsh et al. A generalizable deepfake detector based on neural conditional distribution modelling
Salem A Survey on Various Image Inpainting Techniques.
Wang et al. Welding seam detection and location: Deep learning network-based approach
Li et al. Fabric defect segmentation system based on a lightweight GAN for industrial Internet of Things
CN105740814B (zh) 一种使用视频分析确定固废危废存放状态的方法
CN111881803B (zh) 一种基于改进YOLOv3的畜脸识别方法
Song et al. Artificial Intelligence‐Assisted Fresco Restoration with Multiscale Line Drawing Generation
CN112532999B (zh) 基于深度神经网络的数字视频删帧篡改检测方法
CN112446292B (zh) 一种2d图像显著目标检测方法及系统
KR20230162010A (ko) 이미지들 및 비디오로부터 반사 특징들을 제거하기 위한 실시간 기계 학습-기반 프라이버시 필터
He et al. PCSGAN: A perceptual constrained generative model for railway defect sample expansion from a single image
Chen et al. Improved model for image tampering monitoring based on fast-RCNN

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20837696

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20837696

Country of ref document: EP

Kind code of ref document: A1