Automated defect inspection system for metal surfaces based on deep learning and data augmentation

Automated defect inspection system for metal surfaces based on deep learning and data augmentation

 

基于深度学习和数据增强的金属表面缺陷自动检测系统


简述:卷积变分自动编码器(CVAE)生成特定的图像,再使用基于深度CNN的缺陷分类算法进行分类。在生成足够的数据来训练基于深度学习的分类模型之后,使用生成的数据来训练分类模型。

解决:由于金属制造业的性质,由于一些缺陷很少发生,较难收集


ABSTRACT

owing to the nature of the metal manufacturing industry, it is difficult to obtain enough data because some defects occur rarely.

由于金属制造业的性质,由于一些缺陷很少发生,因此获取足够的数据是一种狂热的做法。

In this study, we propose a new convolutional variational autoencoder (CVAE) and deep CNN-based defect classification al- gorithm to solve this problem.A conditional CVAE (CCVAE) is proposed to generate images for each defect type in a single CVAE model.

在这项研究中,我们提出了一种新的卷积变分自动编码器(CVAE)和基于深度CNN的缺陷分类算法来解决这一问题。提出了一种条件CVAE(CCVAE)来为单个CVAE模型中的每种缺陷类型生成图像。

1. Introduction

In general, a smart factory can be defined as a factory that operates base on advanced information and communications technologies.

一般而言,智能工厂可以被定义为基于先进信息和通信技术(信通技术)运作工厂

In order to optimize production conditions and to develop the technology needed to create products using minimal cost and time, it is important to measure the product quality in real time and store the measurement in a data-base.many manufacturers still rely on visual and sampling inspection by an operator, as opposed to total in- spection in real-time.

为了优化生产条件和开发以最小成本和时间创造产品所需的技术,重要的是实时测量产品质量并将测量结果存储在数据库中。许多制造商仍然依赖操作员的目测和抽样检查,而不是实时的全面检查。

For this reason, vision-based systems that automatically detect defects in products have been studied in various industries such as image sensors [1], bottles [2], IC chips [3], fabrics [4]-[5], LCDs [6], car body surfaces [7], magnetic tiles [8], concrete bridges [9], fruits [10], ceramic tiles [11], machines [12]- [13], metals [14] and railways [15].

由于这个原因,已经在各种行业研究了自动检测产品缺陷的基于视觉的系统,如图像传感器[1],瓶子[2],IC芯片[3],织物[4]-[5] LCD[6]],汽车表面[7],磁性瓷砖[8],混凝土桥梁[9],水果[10],陶瓷瓷砖[11],机器[12]-[13],金属[14]和铁路[15]。

This paper focuses on defect inspection of products in the product quality control process.In this study, we propose a defect classification algorithm for metal surfaces using a CNN model.a data augmentation method using the conditional convolu- tional variational autoencoder (CCVAE) in place of a general data augmentation method such as rotation, translation, or noise addition.

本文主要研究产品质量控制过程中的产品缺陷检测问题。在这项研究中,我们提出了一种基于CNN模型的金属表面缺陷分类算法,一种使用条件卷积变分自动编码器(CCVAE)代替诸如旋转、平移或噪声添加的一般数据增强方法的数据增强方法。

2. System configuration

Fig. 1. To inspect the surface of moving metal products, a line scan camera suitable for moving objects is used. The collimated illu- mination is used to increase the signal to noise ratio of the surface defects.Furthermore, the result is displayed on the human-machine interface (HMI) screen, and defect information is provided to the operator.

图1.为了检查移动的金属产品的表面,使用了适合移动物体的线扫描相机。采用准直照明来提高表面缺陷的信噪比。此外,结果显示在人机界面(HMI)屏幕上,并将缺陷信息提供给操作员。

Fig. 2 shows the defect images for the metal surfaces that were obtained from the proposed system.

图2显示了从所提出的系统获得的金属表面的缺陷图像。

The size of the obtained defect images is 120 × 120 (width × height) pixels and consists of six types of defects, as shown in Fig. 2. The brightness of the background also varies. The status of the defect images obtained is shown in Table 1.

得到的缺陷图像大小为120×120(宽×高)像素,由六种缺陷组成,如图2所示。背景的亮度也不同。所获得的缺陷图像的状态如表1所示。

We propose a new defect classification algorithm using CCVAE and DCNN in order to solve the problem of im- balanced data between classes and to improve defect classification performance.

我们提出了一种新的基于CCVAE和DCNN的缺陷分类算法,以解决类别间数据不平衡的问题,提高缺陷分类性能。

3. Defect classification algorithm

The proposed defect classification algorithm consists of a data generation module and a defect classification module.After generating enough data to train a deep learning- based classification model, the classification model is trained by using the generated data.

这个提出的缺陷分类算法由数据生成模块和缺陷分类模块组成。在生成足够的数据来训练基于深度学习的分类模型之后,使用生成的数据来训练分类模型。

In an actual test, overfitting occurs and the performance drops sharply whenever a slight change in data occurs.

在实际测试中,每当数据发生轻微变化时,就会发生过拟合,性能会急剧下降。

In general, the augmentation method for data classification uses flipping, rotation, shifting, addition of noise, blurring, sharpening, and so on. However, there are restrictions when using this method in actual manufacturing.

一般而言,数据分类的增强方法使用翻转、旋转、平移、添加噪声、模糊、锐化等。然而,在实际生产中使用这种方法时有一些限制。

if data augmentation of these defects by the rotation method is used, different types of defects will be generated.Eventually, training with such data degrades defect classification performance.

如果采用旋转法对这些缺陷进行数据增强,则会产生不同类型的缺陷。最终,使用这样的数据进行训练会降低缺陷分类性能。

In this study, augmentation of images is per- formed by a variational autoencoder method which can generate images by learning the distribution of the given data itself.Based on the generated data, we propose a CNN based classification model with high generalization performance.

在这项研究中,图像的增强是通过一种变分自动编码方法来实现的,该方法可以通过学习给定数据本身的分布来生成图像。基于生成的数据,我们提出了一种具有较高泛化性能的基于CNN的分类模型。

3.1. CCVAE

The variational autoencoder (VAE) is a directed graphical model with certain types of latent variables,The VAE consists of an encoder that extracts features from input x and expresses latent variable z, which is the compressed information of the input.The encoder and decoder of the VAE can be composed of deep neural net- works.

变分自动编码器(VAE)是具有某些类型的潜在变量的有向图形模型,VAE由从输入x中提取特征并表示潜在变量z的编码器组成,该潜在变量z是输入的压缩信息。VAE的编解码器可以由深度神经网络组成。

In this study, we propose a CCVAE structure to generate image data for each defect.The CCVAE uses the same convolutional VAE (CVAE) structure based on an encoder and decoder, but here is a difference, in that it uses information from each class as conditions.

在这项研究中,我们提出了一种CCVAE结构来生成每个缺陷的图像数据。CCVAE使用基于编码器和解码器的相同卷积VAE(CVAE)结构,但这里有一个不同之处,因为它使用来自每个类的信息作为条件。

The difference is that to generate image data for each type of defect, a defect label composed of one-hot encoding is concatenated with latent variable z to be input to the decoder.

不同之处在于,为了生成每种类型缺陷的图像数据,将由一次热编码组成的缺陷标签与潜在变量z连接以输入到解码器。

The encoder consists of one basic block consisting of a convolution layer, which has 3 × 3 filters, a batch normalization layer, a rectified linear unit (ReLU) activation function, and a 2 × 2 max pooling layer, as shown in Fig. 4.

该编码器由一个基本块组成,如图4所示,该基本块由具有3×3个滤波器的卷积层、批归一化层、纠错线性单元(RELU)激活函数和2×2最大池层组成。

Figs. 4 and 5 show the structure of the data generation model based on the CCVAE, which is proposed in this study, to solve the defect data imbalance.

图4和图5显示了基于CCVAE的数据生成模型的结构,该模型是为了解决缺陷数据不平衡而提出的。

As shown in Fig. 6, various images related to the original image are generated using CCVAE, and the generated images are used as the training data of classifier.

如图6所示,使用CCVAE生成与原始图像相关的各种图像,并将生成的图像用作分类器的训练数据。

Fig. 6. Sample images: (a) original image (b) generated image by CCVAE with condition 1.

3.2. Classification

We propose a CNN-based deep learning model that can classify defects using the training data generated by CCVAE, as shown in Fig. 8.

我们提出了一个基于CNN的深度学习模型,该模型可以使用CCVAE生成的训练数据对缺陷进行分类,如图8所示。

4. Experimental results

Precision and Recall are complementary, and the higher the two indicators, the better.The F1 score is a harmonic average of precision and recall rate .

查准率和查全率是相辅相成的,两个指标越高越好。F1的分数是准确率和召回率的调和平均值。

Data augmentation converges faster than when raw data is used. The performance index for the trained model's average precision, average recall rate, accuracy, and F1- score is shown in Fig. 10.

数据扩充的收敛速度比使用原始数据时更快。训练模型的平均准确率、平均召回率、准确率和F1得分的性能指标如图10所示。

in the case of data augmentation with CCVAE, performance degradation owing to the amount of data was resolved, and the performance was excellent for all classes.

在使用CCVAE进行数据增强的情况下,解决了由于数据量而导致的性能下降问题,并且所有类别的性能都很优秀。

Therefore, the defect classification system proposed in this study showed good performance when tested on actual metal surface defects with imbalanced data.

因此,本文提出的缺陷分类系统在对非平衡数据的实际金属表面缺陷进行测试时表现出了良好的性能。

5. Conclusion

auto- matically classifying defects in metal surfaces.data augmentation method based on a variational autoencoder.

金属表面缺陷的自动分类。一种基于变分自动编码器的数据增强方法。

conditional VAE method that concatenated the class con- dition to the latent variables, to generate data for each defect.

条件VAE方法是将类条件与潜在变量连接起来,为每个缺陷生成数据。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/468958.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python第七章_python 第七章 模块

模块 一个py文件就是一个模块 模块一共三种:1.python标准库 2.第三方模块 3.应用程序自定义模块 import:1.执行对应文件 2.引入变量名 if__name__"__main__": #1.用于被调用文件测试 2.防止主程序被调用 time模块 常用命令 时间模块 1 importt…

openwrt 音频开发

1、Linux 音频架构图 音视频的好坏 直接影响 产品体验 2、音频架构图层次说明 openWRT 采用 ALSA 层次图,如下 Application: 上层应用 主要调用alsa-lib 中的接口 实现业务逻辑。使用alsa-util中aplay,arecord,amixer,speaker-test进行相关测试。HAL层 : 移植alsa-lib 和 a…

Automatic Detection of Welding Defects Using Faster R-CNN

Automatic Detection of Welding Defects Using Faster R-CNN 基于快速R-CNN的焊接缺陷自动检测 简介:使用Inception-ResNet模型进行缺陷检测 数据集:射线图像 Abstract Experts are required to properly detect the test results and it takes a lot…

让Android Studio支持系统签名(证书)

有时候,我们开发的apk需要用到系统权限,需要在AndroidManifest.xml中添加共享系统进程属性: android:sharedUserId"android.uid.system" android:sharedUserId"android.uid.shared" android:sharedUserId"android…

eslint 保存自动格式化_代码规范之理解ESLint、Prettier、EditorConfig

授权转载自:nowThenhttps://juejin.cn/post/6895889063111294990前言团队多人协同开发项目中困恼团队管理一个很大的问题是:无可避免地会出现每个开发者编码习惯不同、代码风格迥异,为了代码高可用、可维护性, 如何从项目管理上尽…

Deep learning based multi-scale channel compression feature surface defect detection system

基于深度学习的多尺度通道压缩特征表面缺陷检测系统 Deep learning based multi-scale channel compression feature surface defect detection system 简述:首先应用背景分割和模板匹配技术来定义覆盖目标工件的ROI区域。提取的感兴趣区域被均匀地裁剪成若干个图像…

前端MVC框架之 Angular

一、什么是Angular jQuery,它属于一种类库(一系列函数的集合),以DOM为驱动核心;而Angular是一种 MVC 的前端框架,则是前端框架,以数据和逻辑为驱动核心,它有着诸多特性,最重要的是:模…

C语言关键字(三)

之前的两篇文章 嵌入式Linux:c语言深度解剖(数据类型关键字)​zhuanlan.zhihu.com 嵌入式Linux:c语言深度解剖(入门篇)​zhuanlan.zhihu.com 这篇文件继续讲解C语言关键字 想问大家一个问题&#xff0c…

python bottle框架 运维_python bottle 框架实战教程:任务管理系统 V_1.0版 | linux系统运维...

经过1-2个星期的开发,现在用任务管理功能(添加、删除、修改,详细)、项目管理功能(添加、删除,修改,详细)等,我把现在完成的版本,叫做1.0吧。发布完这个版本后…

form 窗体增加边框_C#控件美化之路(13):美化Form窗口(上)

在开发中最重要的就是美化form窗口,在开发中,大多都是用会用自主美化的窗口开发程序。本文只是点多,分为上中下节。分段讲解。本文主要讲解窗口美化关键步骤。首先美化窗体,就需要自己绘制最大化 最小化 关闭按钮。其次就是界面样…

第四周数据结构

转载于:https://www.cnblogs.com/bgd150809329/p/6650255.html

gdb x命令_gdb基本命令

参考自:gdb基本命令(非常详细)_JIWilliams-CSDN博客_gdb命令​blog.csdn.net本文介绍使用gdb调试程序的常用命令。 GDB是GNU开源组织发布的一个强大的UNIX下的程序调试工具。如果你是在 UNIX平台下做软件,你会发现GDB这个调试工具有比VC、BCB的图形化调试…

YOLOX-PAI: An Improved YOLOX, Stronger and Faster than YOLOv6

YOLOX-PAI:一种改进的YOLOX,比YOLOv6更强更快 原文:https://arxiv.org/pdf/2208.13040.pdf 代码:https://github.com/alibaba/EasyCV 0.Abstract We develop an all-in-one computer vision toolbox named EasyCV to facilita…

安装一直初始化_3D max 软件安装问题大全

纵使3D虐我千百遍,我待3D如初恋!大家好,我是小文。快节奏生活的今天,好不容易有点学习的热情,打开电脑学习下,没想到被简单的软件安装问题浇灭!这不是耽误了一位伟大的世界设计师诞生的节奏吗&a…

TCP/IP 协议栈 -- 编写UDP客户端注意细节

上节我们说到了TCP 客户端编写的主要细节&#xff0c; 本节我们来看一下UDP client的几种情况&#xff0c;测试代码如下&#xff1a; server&#xff1a; #include <stdio.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h>…

RuntimeError: Address already in use

问题描述&#xff1a;Pytorch用多张GPU训练时&#xff0c;会报地址已被占用的错误。其实是端口号冲突了。 因此解决方法要么kill原来的进程&#xff0c;要么修改端口号。 在代码里重新配置 torch.distributed.init_process_group()dist_init_method tcp://{master_ip}:{mast…

Windows环境下的安装gcc

Windows具有良好的界面和丰富的工具&#xff0c;所以目前linux开发的流程是&#xff0c;windows下完成编码工作&#xff0c;linux上实现编译工作。 为了提高工作效率&#xff0c;有必要在windows环境下搭建一套gcc,gdb,make环境。 MinGW就是windows下gcc的版本。 下载地址ht…

RuntimeError: NCCL error in:XXX,unhandled system error, NCCL version 2.7.8

项目场景&#xff1a; 分布式训练中遇到这个问题&#xff0c; 问题描述 大概是没有启动并行运算&#xff1f;&#xff1f;&#xff1f;&#xff08; 解决方案&#xff1a; &#xff08;1&#xff09;首先看一下服务器GPU相关信息 进入pytorch终端&#xff08;Terminal&#x…

一张倾斜图片进行矫正 c++_专业性文章:10分钟矫正骨盆前倾

如今&#xff0c;骨盆前倾(又称“下交叉综合征”)非常多&#xff0c;大部分是由于以下两个原因而变得越来越突出&#xff1a;经常久坐不良的运动习惯后面我们讲到纠正骨盆前倾的四个基本步骤&#xff0c;让你快速解决&#xff0c;提高生活质量知识型和系统型的内容&#xff0c;…

TypeError: can‘t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory

项目场景&#xff1a; 运行程序&#xff0c;出现报错信息 TypeError: cant convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.。 Traceback (most recent call last):File "tools/demo.py", line 97, in <module>vi…