CN110826588A - Drainage pipeline defect detection method based on attention mechanism - Google Patents
Drainage pipeline defect detection method based on attention mechanism Download PDFInfo
- Publication number
- CN110826588A CN110826588A CN201910810653.9A CN201910810653A CN110826588A CN 110826588 A CN110826588 A CN 110826588A CN 201910810653 A CN201910810653 A CN 201910810653A CN 110826588 A CN110826588 A CN 110826588A
- Authority
- CN
- China
- Prior art keywords
- module
- stride
- layer
- filters
- total
- 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
Links
- 230000007547 defect Effects 0.000 title claims abstract description 33
- 230000007246 mechanism Effects 0.000 title claims abstract description 18
- 238000001514 detection method Methods 0.000 title abstract description 15
- 238000012549 training Methods 0.000 claims abstract description 14
- 238000000034 method Methods 0.000 claims abstract description 12
- 238000012360 testing method Methods 0.000 claims abstract description 10
- 230000008021 deposition Effects 0.000 claims abstract description 6
- 230000007797 corrosion Effects 0.000 claims abstract description 5
- 238000005260 corrosion Methods 0.000 claims abstract description 5
- 230000008569 process Effects 0.000 claims abstract description 4
- 238000012795 verification Methods 0.000 claims abstract description 4
- 238000013528 artificial neural network Methods 0.000 claims abstract description 3
- 238000003062 neural network model Methods 0.000 claims abstract description 3
- 238000011176 pooling Methods 0.000 claims description 29
- 238000013527 convolutional neural network Methods 0.000 claims description 18
- 238000007689 inspection Methods 0.000 claims description 9
- 230000002159 abnormal effect Effects 0.000 claims description 6
- 238000010200 validation analysis Methods 0.000 claims description 4
- 238000013135 deep learning Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000010276 construction Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000005336 cracking Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000009545 invasion Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 239000002351 wastewater Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/243—Classification techniques relating to the number of classes
- G06F18/2431—Multiple classes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/26—Government or public services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Tourism & Hospitality (AREA)
- Molecular Biology (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computing Systems (AREA)
- Human Resources & Organizations (AREA)
- Economics (AREA)
- Educational Administration (AREA)
- Marketing (AREA)
- Primary Health Care (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Quality & Reliability (AREA)
- Development Economics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Image Analysis (AREA)
Abstract
本发明涉及一种基于注意力机制的排水管道缺陷检测方法,包括:从管道缺陷检测报告中抽取缺陷图片,并根据它对应的缺陷类型对其进行分类,一共分为:变形、腐蚀、结垢、错口、沉积、渗漏以及破裂等七类;搭建注意力机制模块,采用的注意力机制模块为CBAM模块;搭建基于注意力机制的神经网络模型,该卷积网络去掉VGG16网络的最后3个卷积层,又在基础上添加了若干CBAM模块;使用反向传播算法对神经网络进行训练,在训练过程中进行验证,当验证准确率最高时保存网络训练的最优模型;使用保存的最优模型对测试集进行测试,得到管道缺陷图片的分类结果。
The invention relates to a drainage pipeline defect detection method based on an attention mechanism, comprising: extracting defect pictures from a pipeline defect detection report, and classifying them according to their corresponding defect types, which are divided into: deformation, corrosion, scaling , wrong mouth, deposition, leakage and rupture; build the attention mechanism module, the attention mechanism module used is the CBAM module; build the neural network model based on the attention mechanism, the convolutional network removes the last 3 of the VGG16 network. A convolutional layer is added, and several CBAM modules are added on the basis; the neural network is trained using the backpropagation algorithm, and the verification is performed during the training process. When the verification accuracy is the highest, the optimal model for network training is saved; The optimal model is tested on the test set, and the classification results of pipeline defect pictures are obtained.
Description
技术领域technical field
本发明涉及到的方面包括计算机视觉、计算机图像处理和深度学习等计算机领域和排水管道异常检测领域。本发明更加专注于深度学习技术对于排水管道缺陷检测方面的应用。The aspects involved in the present invention include computer fields such as computer vision, computer image processing and deep learning, and the field of abnormal detection of drainage pipes. The present invention is more focused on the application of deep learning technology to the detection of drainage pipe defects.
背景技术Background technique
排水管道系统是城市最大的基础设施之一,旨在收集和运输废水和雨水。该系统的正常使用对于城市的排水安全非常重要。随着近年来城市的快速发展,我国突出了地下管线建设规模不足,管理水平低等问题。一些城市接连发生了暴雨和道路坍塌等事件,严重影响了人们的生活和城市运行秩序。因此排水管道的定期检查与修复是城市建设中不可缺少的措施。The sewer system is one of the city's largest infrastructures, designed to collect and transport wastewater and stormwater. The normal use of this system is very important for the drainage safety of the city. With the rapid development of cities in recent years, my country has highlighted the problems of insufficient underground pipeline construction scale and low management level. Incidents such as torrential rain and road collapse occurred one after another in some cities, which seriously affected people's lives and the order of urban operations. Therefore, regular inspection and repair of drainage pipes is an indispensable measure in urban construction.
管道闭路电视系统(Closed Circuit Television Inspection,CCTV)是管道检测领域迄今为止使用最广泛的技术。该系统由管道检测机器人和安装在机器人上的CCTV摄像机组成,该设备在工作人员的遥控操作或计算机自动控制下,获取包含管道内部信息的视频数据[1]。检查员根据捕获的视频进行人工缺陷识别,然后编写管道缺陷检测报告。这种方式往往过度依赖于检测人员的经验,存在很大的主观性,同时需要消耗大量的时间和精力。Pipeline CCTV (Closed Circuit Television Inspection, CCTV) is by far the most widely used technology in pipeline inspection. The system consists of a pipeline inspection robot and a CCTV camera installed on the robot. The device obtains video data containing the internal information of the pipeline under the remote operation of the staff or the automatic control of the computer [1]. Inspectors perform manual defect identification based on the captured video and then write a pipeline defect detection report. This method often relies too much on the experience of the inspector, has a lot of subjectivity, and consumes a lot of time and energy.
近年来,深度学习尤其是卷积神经网络(Convolutional Neural Network,CNN)在计算机视觉领域取得了巨大进展。随之产生了基于卷积神经网络的管道缺陷检测方法,例如:Kumar等人在2018提出采用一个简单的分类卷积神经网络对根侵入,沉积和裂缝这三种缺陷进行了分类[2];Li等人使用具有分层分类的深度卷积神经网络从不平衡的CCTV检查数据检测对下水道缺陷类型进行检测分类[3]。然而,这些方法都没有对管道数据的独有特征进行利用,效果并不理想。In recent years, deep learning, especially Convolutional Neural Network (CNN), has made great progress in the field of computer vision. Subsequently, pipeline defect detection methods based on convolutional neural networks have emerged. For example, Kumar et al. proposed in 2018 to use a simple classification convolutional neural network to classify three defects of root invasion, deposition and cracks [2]; Li et al. used a deep convolutional neural network with hierarchical classification to detect and classify sewer defect types from unbalanced CCTV inspection data detection [3]. However, none of these methods take advantage of the unique characteristics of pipeline data, and the effect is not ideal.
参考文献references
[1]Costello,S.,Chapman,D.,Rogers,C.,Metje,N.:Underground assetlocation and condition assessment technologies.Tunnelling and UndergroundSpace Technology 22(5-6),524-542(2007).[1] Costello, S., Chapman, D., Rogers, C., Metje, N.: Underground assetlocation and condition assessment technologies. Tunnelling and UndergroundSpace Technology 22(5-6), 524-542 (2007).
[2]Kumar,Srinath S.,et al.″Automated defect classification in sewerclosed circuit television inspections using deep convolutional neuralnetworks.″Automation in Construction 91(2018):273-283.[2] Kumar, Srinath S., et al. "Automated defect classification in sewerclosed circuit television inspections using deep convolutional neural networks." Automation in Construction 91 (2018): 273-283.
[3]Li,Duanshun,Anran Cong,and Shuai Guo.″Sewer damage detection fromimbalanced CCTV inspection data using deep convolutional neural networks withhierarchica1 classification.″Automation in Construction 101(2019):199-208.[3] Li, Duanshun, Anran Cong, and Shuai Guo. "Sewer damage detection fromimbalanced CCTV inspection data using deep convolutional neural networks withhierarchica1 classification."Automation in Construction 101(2019): 199-208.
发明内容SUMMARY OF THE INVENTION
本发明使用VGG-16卷积神经网络为基础的结构作为主要模型,提出一种基于注意力机制的管道缺陷自动检测方法来解决上述问题,利用大量已有标注的管道异常样本进行训练和测试,本发明能够快速准确判别排水管道异常类型。本发明技术方案如下:The present invention uses the VGG-16 convolutional neural network-based structure as the main model, proposes an automatic detection method for pipeline defects based on attention mechanism to solve the above problems, and uses a large number of existing marked pipeline abnormal samples for training and testing, The invention can quickly and accurately determine the abnormal type of the drainage pipeline. The technical scheme of the present invention is as follows:
一种基于注意力机制的排水管道缺陷检测方法,大致步骤如下描述:An attention-based defect detection method for drainage pipes, the general steps are described as follows:
步骤1:从管道缺陷检测报告中抽取缺陷图片,并根据它对应的缺陷类型对其进行分类,一共分为:变形、腐蚀、结垢、错口、沉积、渗漏以及破裂等七类。Step 1: Extract the defect pictures from the pipeline defect inspection report, and classify them according to their corresponding defect types, which are divided into seven categories: deformation, corrosion, scaling, misalignment, deposition, leakage and rupture.
步骤2:将数据集划分为训练集测试集和验证集。Step 2: Divide the dataset into training set, test set and validation set.
步骤3:搭建注意力机制模块,采用的注意力机制模块为CBAM模块(ConvolutionalBlock Attention Module),该模块可以直接加入卷积神经网络模型中,当作一个网络层使用。该模块的输入为卷积层的输出O∈RC×H×W,其中C为Feature map的通道数,H和W分别为Feature map的高和宽将O先后经过通道注意力模块AC∈RC×1×1和空间注意力模块AS∈R1×H×W最终得到输出Oa∈RC×H×W.Step 3: Build an attention mechanism module. The attention mechanism module used is the CBAM module (Convolutional Block Attention Module). This module can be directly added to the convolutional neural network model and used as a network layer. The input of this module is the output of the convolutional layer O∈R C×H×W , where C is the number of channels of the Feature map, H and W are the height and width of the Feature map, respectively. O passes through the channel attention module A C ∈ R C×1×1 and the spatial attention module A S ∈ R 1×H×W finally get the output O a ∈ R C×H×W .
其中表示逐元素乘法,O1表示中间结果。经过CBAM模块获得的Oa能够直接再送入卷积神经网络的其它部分。in means element-wise multiplication, O 1 means intermediate result. The O a obtained by the CBAM module can be directly fed into other parts of the convolutional neural network.
步骤4:搭建基于注意力机制的神经网络模型,该卷积网络去掉VGG16网络的最后3个卷积层,又在基础上添加了若干CBAM模块,该卷积神经网络总体结构为:Step 4: Build a neural network model based on the attention mechanism. The convolutional network removes the last three convolutional layers of the VGG16 network, and adds several CBAM modules on the basis. The overall structure of the convolutional neural network is:
第一卷积层,卷积核大小为3*3,总共64个滤波器,步幅stride=1。The first convolution layer, the convolution kernel size is 3*3, a total of 64 filters, stride=1.
第一注意力模块,CBAM模块,缩放系数r=8。The first attention module, the CBAM module, has a scaling factor r=8.
第二卷积层,卷积核大小为3*3,总共64个滤波器,步幅stride=1。The second convolution layer, the convolution kernel size is 3*3, a total of 64 filters, stride=1.
第一最大池化层,池化大小为2*2,步幅stride=2。The first maximum pooling layer, the pooling size is 2*2, and the stride=2.
第三卷积层,卷积核大小为3*3,总共128个滤波器,步幅stride=1。The third convolutional layer, the convolution kernel size is 3*3, a total of 128 filters, stride=1.
第二注意力模块,CBAM模块,缩放系数r=8。The second attention module, the CBAM module, has a scaling factor r=8.
第四卷积层,卷积核大小为3*3,总共128个滤波器,步幅stride=1。The fourth convolutional layer, the convolution kernel size is 3*3, a total of 128 filters, stride=1.
第二最大池化层,池化大小为2*2,步幅stride=2。The second maximum pooling layer, the pooling size is 2*2, and the stride=2.
第五卷积层,卷积核大小为3*3,总共256个滤波器,步幅stride=1。The fifth convolutional layer, the convolution kernel size is 3*3, a total of 256 filters, stride=1.
第三注意力模块,CBAM模块,缩放系数r=8。The third attention module, the CBAM module, has a scaling factor r=8.
第六卷积层,卷积核大小为3*3,总共256个滤波器,步幅stride=1。The sixth convolutional layer, the convolution kernel size is 3*3, a total of 256 filters, stride=1.
第四注意力模块,CBAM模块,缩放系数r=8。The fourth attention module, the CBAM module, has a scaling factor r=8.
第七卷积层,卷积核大小为3*3,总共256个滤波器,步幅stride=1。The seventh convolutional layer, the convolution kernel size is 3*3, a total of 256 filters, stride=1.
第三最大池化层,池化大小为2*2,步幅stride=2。The third maximum pooling layer, the pooling size is 2*2, and the stride=2.
第八卷积层,卷积核大小为3*3,总共512个滤波器,步幅stride=1。The eighth convolutional layer, the convolution kernel size is 3*3, a total of 512 filters, stride=1.
第五注意力模块,CBAM模块,缩放系数r=8。The fifth attention module, the CBAM module, has a scaling factor r=8.
第九卷积层,卷积核大小为3*3,总共512个滤波器,步幅stride=1。The ninth convolutional layer, the convolution kernel size is 3*3, a total of 512 filters, stride=1.
第六注意力模块,CBAM模块,缩放系数r=8。The sixth attention module, the CBAM module, has a scaling factor r=8.
第十卷积层,卷积核大小为3*3,总共512个滤波器,步幅stride=1。The tenth convolution layer, the convolution kernel size is 3*3, a total of 512 filters, stride=1.
第四最大池化层,池化大小为2*2,步幅stride=2。The fourth maximum pooling layer, the pooling size is 2*2, and the stride=2.
第一全连接层,节点个数为4096个。The first fully connected layer has 4096 nodes.
第二全连接层,节点个数为4096个。The second fully connected layer has 4096 nodes.
Softmax层,最终输出该图像对应7个异常类别的概率。The Softmax layer finally outputs the probability that the image corresponds to 7 abnormal categories.
步骤5:使用反向传播算法对神经网络进行训练,在训练过程中进行验证,当验证准确率最高时保存网络训练的最优模型。Step 5: Use the back-propagation algorithm to train the neural network, verify during the training process, and save the optimal model for network training when the verification accuracy is the highest.
步骤6:使用保存的最优模型对测试集进行测试,得到管道缺陷图片的分类结果。Step 6: Use the saved optimal model to test the test set to obtain the classification result of the pipeline defect picture.
附图说明Description of drawings
图1是本发明的流程图Fig. 1 is the flow chart of the present invention
图2是本发明的网络结构图Fig. 2 is the network structure diagram of the present invention
图3是CBAM的结构图Figure 3 is the structure diagram of CBAM
具体实施方式Detailed ways
为了使本发明目的、技术方案及优点更加清楚明白,以下参照附图并举实例,对本发明进行详细说明。显然,所描述的实施仅是本发明的一部分实施例,而不是所有实施例的穷举。并且在不冲突的情况下,本说明中的实施及实施例中的特征可以互相结合。In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below with reference to the accompanying drawings and examples. Obviously, the described implementations are only some of the embodiments of the present invention and are not exhaustive of all embodiments. Also, the features of the implementations and examples in this description may be combined with each other without conflict.
本发明的处理步骤包括:数据准备及处理、建立训练集验证集测试集、训练卷积神经网络、采用训练好的网络模型进行缺陷自动分类等主要步骤。The processing steps of the present invention include: data preparation and processing, establishment of training set validation set test set, training convolutional neural network, using the trained network model for automatic defect classification and other major steps.
步骤1:数据准备及处理。采用python程序对获得的排水管道缺陷检测报告提取管道内部缺陷图片,并根据报告内容依据缺陷类型对图片进行分类。选取图片质量较好的变形、腐蚀、结垢、错口、沉积、渗漏以及破裂等七类图片。Step 1: Data preparation and processing. The python program is used to extract the pictures of the internal defects of the pipeline from the obtained drainage pipe defect detection report, and the pictures are classified according to the defect type according to the report content. Select seven types of pictures with better picture quality, such as deformation, corrosion, scaling, misalignment, deposition, leakage and cracking.
步骤2:将选取的变形、腐蚀、结垢、错口、沉积、渗漏等缺陷类型的七类图片进行数据集划分,分别划分为训练集、验证集和测试集,划分比例为3∶1∶1.Step 2: Divide the selected seven types of pictures of defect types such as deformation, corrosion, scaling, misalignment, deposition, and leakage into data sets, and divide them into training sets, validation sets and test sets, with a division ratio of 3:1 : 1.
步骤3:搭建搭建注意力机制模块,采用的注意力机制结构为CBAM模块。该模块的输入为卷积层的输出O∈RC×H×W,其中C为Feature map的通道数,H和W分别为Feature map的高和宽。该注意力机制模块可以分为2部分,第一部分为通道注意力模块,第二部分为空间注意力模块。Step 3: Build the attention mechanism module, and the attention mechanism structure adopted is the CBAM module. The input of this module is the output of the convolutional layer O∈R C×H×W , where C is the number of channels of the feature map, and H and W are the height and width of the feature map, respectively. The attention mechanism module can be divided into two parts, the first part is the channel attention module, and the second part is the spatial attention module.
第一部分将输入O经过通道注意力模块AC(O)∈RC×1×1,得到中间输出O1∈RC×H×W。The first part passes the input O through the channel attention module A C (O)∈R C×1×1 , and obtains the intermediate output O 1 ∈ R C×H×W .
该部分可分为以下3步:This part can be divided into the following 3 steps:
(1)先将输入分别进行全局平均池化GloAvgPool和全局最大池化GloMaxPool,然后将结果分别通过两个全连接层Dense1和Dense2,得到两个相同维度的输出d1∈RC×1×1和d2∈RC×1×1,即:(1) First, perform global average pooling GloAvgPool and global maximum pooling GloMaxPool respectively, and then pass the results through two fully connected layers Dense 1 and Dense 2 to obtain two outputs of the same dimension d 1 ∈ R C×1 ×1 and d 2 ∈ R C×1×1 , namely:
d1=Dense2(Dense1(GloAvgPool(O)))d 1 = Dense 2 (Dense 1 (GloAvgPool(O)))
d2=Dense2(Dense1(GloMaxPool(O)))d 2 = Dense 2 (Dense 1 (GloMaxPool(O)))
其中Dense1的结点个数为r表示缩放系数,在本实验中r=8。Dense2的结点个数为C。The number of nodes in Dense 1 is r represents the scaling factor, in this experiment r=8. The number of nodes in Dense 2 is C.
(2)将d1和d2相加,相加得到的结果送入sigmoid函数,得到通道注意力权重AC(O)∈RC×1×1。计算公式如下:(2) Add d 1 and d 2 , and send the result of the addition to the sigmoid function to obtain the channel attention weight A C (O)∈R C×1×1 . Calculated as follows:
AC(O)=Sigmoid(d1+d2)A C (O)=Sigmoid(d 1 +d 2 )
(3)将输入O与通道注意力权重AC(O)∈RC×1×1进行逐元素乘法,最终得到第一部分的输出O1∈RC×H×W。表示逐元素乘法,则计算公式如下:(3) Perform element-wise multiplication of the input O and the channel attention weight A C (O)∈R C×1×1 , and finally obtain the output O 1 ∈ R C×H×W of the first part. Represents element-wise multiplication, and the calculation formula is as follows:
第二部分将获得的中间结果O1经过空间注意力模块AS(O1)∈R1×H×W最终得到输出Oa∈RC×H×W。该部分可分为以下4步:The second part passes the obtained intermediate result O 1 through the spatial attention module A S (O 1 )∈R 1×H×W and finally obtains the output O a ∈R C×H×W . This part can be divided into the following 4 steps:
(1)将输入分别在通道维度进行平均池化ChanAvgPool和最大池化ChanMaxPool,然后将得到的结果进行Concatenate。计算公式如下:(1) Perform average pooling ChanAvgPool and max pooling ChanMaxPool on the input channel dimension, and then concatenate the obtained results. Calculated as follows:
dc=[ChanAvgPool(O1);ChanMaxPool(O1)]d c = [ChanAvgPool(O 1 ); ChanMaxPool(O 1 )]
(2)得到的结果dc经过一个卷积层,该卷积层有一个滤波器且滤波器大小为7×7,然后将卷积层的输出送入sigmoid函数,得到空间注意力权重AS(O1)∈R1×H×W。(2) The obtained result dc passes through a convolutional layer, which has a filter and the filter size is 7×7, and then sends the output of the convolutional layer to the sigmoid function to obtain the spatial attention weight A S (O 1 )∈R 1×H×W .
AS(O1)=Sigmoid(Con2D7×7(dc))A S (O 1 )=Sigmoid(Con2D 7×7 (d c ))
(3)将中间结果O1与空间注意力权重AS(O1)∈R1×H×W进行逐元素乘法,最终得到输出Oa∈RC×H×W。计算公式如下:(3) Perform element-wise multiplication of the intermediate result O 1 and the spatial attention weight A S (O 1 )∈R 1×H×W , and finally obtain the output O a ∈R C×H×W . Calculated as follows:
步骤4:搭建基于注意力机制的卷积神经网络模型,该卷积网络去掉VGG16网络的最后3个卷积层,又在基础上添加了若干CBAM模块。模型总体网络结构如下所示:Step 4: Build a convolutional neural network model based on the attention mechanism. The convolutional network removes the last three convolutional layers of the VGG16 network, and adds several CBAM modules on the basis. The overall network structure of the model is as follows:
第一卷积层,卷积核大小为3*3,总共64个滤波器,步幅stride=1。The first convolution layer, the convolution kernel size is 3*3, a total of 64 filters, stride=1.
第一注意力模块,CBAM模块,缩放系数r=8。The first attention module, the CBAM module, has a scaling factor r=8.
第二卷积层,卷积核大小为3*3,总共64个滤波器,步幅stride=1。The second convolution layer, the convolution kernel size is 3*3, a total of 64 filters, stride=1.
第一最大池化层,池化大小为2*2,步幅stride=2。The first maximum pooling layer, the pooling size is 2*2, and the stride=2.
第三卷积层,卷积核大小为3*3,总共128个滤波器,步幅stride=1。The third convolutional layer, the convolution kernel size is 3*3, a total of 128 filters, stride=1.
第二注意力模块,CBAM模块,缩放系数r=8。The second attention module, the CBAM module, has a scaling factor r=8.
第四卷积层,卷积核大小为3*3,总共128个滤波器,步幅stride=1。The fourth convolutional layer, the convolution kernel size is 3*3, a total of 128 filters, stride=1.
第二最大池化层,池化大小为2*2,步幅stride=2。The second maximum pooling layer, the pooling size is 2*2, and the stride=2.
第五卷积层,卷积核大小为3*3,总共256个滤波器,步幅stride=1。The fifth convolutional layer, the convolution kernel size is 3*3, a total of 256 filters, stride=1.
第三注意力模块,CBAM模块,缩放系数r=8。The third attention module, the CBAM module, has a scaling factor r=8.
第六卷积层,卷积核大小为3*3,总共256个滤波器,步幅stride=1。The sixth convolutional layer, the convolution kernel size is 3*3, a total of 256 filters, stride=1.
第四注意力模块,CBAM模块,缩放系数r=8。The fourth attention module, the CBAM module, has a scaling factor r=8.
第七卷积层,卷积核大小为3*3,总共256个滤波器,步幅stride=1。The seventh convolutional layer, the convolution kernel size is 3*3, a total of 256 filters, stride=1.
第三最大池化层,池化大小为2*2,步幅stride=2。The third maximum pooling layer, the pooling size is 2*2, and the stride=2.
第八卷积层,卷积核大小为3*3,总共512个滤波器,步幅stride=1。The eighth convolutional layer, the convolution kernel size is 3*3, a total of 512 filters, stride=1.
第五注意力模块,CBAM模块,缩放系数r=8。The fifth attention module, the CBAM module, has a scaling factor r=8.
第九卷积层,卷积核大小为3*3,总共512个滤波器,步幅stride=1。The ninth convolutional layer, the convolution kernel size is 3*3, a total of 512 filters, stride=1.
第六注意力模块,CBAM模块,缩放系数r=8。The sixth attention module, the CBAM module, has a scaling factor r=8.
第十卷积层,卷积核大小为3*3,总共512个滤波器,步幅stride=1。The tenth convolution layer, the convolution kernel size is 3*3, a total of 512 filters, stride=1.
第四最大池化层,池化大小为2*2,步幅stride=2。The fourth maximum pooling layer, the pooling size is 2*2, and the stride=2.
第一全连接层,节点个数为4096个。The first fully connected layer has 4096 nodes.
第二全连接层,节点个数为4096个。The second fully connected layer has 4096 nodes.
Softmax层,最终输出该图像对应7个异常类别的概率。The Softmax layer finally outputs the probability that the image corresponds to 7 abnormal categories.
步骤5:进行卷积神经网络模型的训练,并保存最优模型权重。Step 5: Train the convolutional neural network model and save the optimal model weights.
步骤6:采用保存的最优模型权重进行管道缺陷图片的自动分类。Step 6: Use the saved optimal model weights for automatic classification of pipeline defect pictures.
上述网络结构以TensorFlow为后台,通过Keras深度学习库搭建。使用的语言是Python。在本实施例中,通过Keras深度学习库中的函数模型作为整体结构,按照库中的卷积网络层的写法构建卷积层、最大池化层、全连接层、Softmax层、Add函数、Multiply函数等卷积神经网络结构和内部操作。The above network structure uses TensorFlow as the background and is built through the Keras deep learning library. The language used is Python. In this embodiment, the function model in the Keras deep learning library is used as the overall structure, and the convolutional layer, the maximum pooling layer, the fully connected layer, the Softmax layer, the Add function, the Multiply layer are constructed according to the writing method of the convolutional network layer in the library. Convolutional neural network structure and internal operations such as functions.
本发明实施例所提供的管道异常类型检测方法在获取到待识别图像之后,无需用户手动定义特征再进行分类,直接利用预先训练得到的深度学习网络即可判定待识别图像的类别。而且由于该网络中加入了注意力机制模块,网络在训练过程中就可以逐渐提取到不同缺陷图片的特有特征,使网络对管道缺陷图片的识别能力大幅提高,可以较为准确地实现管道缺陷的自动检测分类,具有良好的应用价值。The pipeline abnormality type detection method provided by the embodiment of the present invention does not require the user to manually define features for classification after acquiring the image to be recognized, and directly uses the pre-trained deep learning network to determine the type of the image to be recognized. And because the attention mechanism module is added to the network, the network can gradually extract the unique features of different defect pictures during the training process, which greatly improves the network's ability to identify pipeline defect pictures, and can more accurately realize the automatic detection of pipeline defects. Detection and classification, with good application value.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910810653.9A CN110826588A (en) | 2019-08-29 | 2019-08-29 | Drainage pipeline defect detection method based on attention mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910810653.9A CN110826588A (en) | 2019-08-29 | 2019-08-29 | Drainage pipeline defect detection method based on attention mechanism |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110826588A true CN110826588A (en) | 2020-02-21 |
Family
ID=69547856
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910810653.9A Pending CN110826588A (en) | 2019-08-29 | 2019-08-29 | Drainage pipeline defect detection method based on attention mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110826588A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111458148A (en) * | 2020-04-26 | 2020-07-28 | 上海电机学院 | CBAM-based convolutional neural network rolling bearing fault diagnosis method |
CN111784645A (en) * | 2020-06-15 | 2020-10-16 | 北京科技大学 | A method for detecting cracks in a filled pipeline |
CN112241681A (en) * | 2020-09-15 | 2021-01-19 | 天津大学 | Liquid leakage detection method based on three-frame difference method and VGG-16 |
CN112364783A (en) * | 2020-11-13 | 2021-02-12 | 诸暨思看科技有限公司 | Part detection method and device and computer readable storage medium |
CN112884709A (en) * | 2021-01-18 | 2021-06-01 | 燕山大学 | Yoov 3 strip steel surface defect detection and classification method introducing attention mechanism |
CN112990391A (en) * | 2021-05-20 | 2021-06-18 | 四川大学 | Feature fusion based defect classification and identification system of convolutional neural network |
CN113111828A (en) * | 2021-04-23 | 2021-07-13 | 中国科学院宁波材料技术与工程研究所 | Three-dimensional defect detection method and system for bearing |
CN113362320A (en) * | 2021-07-07 | 2021-09-07 | 北京工业大学 | Wafer surface defect mode detection method based on deep attention network |
CN113421252A (en) * | 2021-07-07 | 2021-09-21 | 南京思飞捷软件科技有限公司 | Actual detection method for vehicle body welding defects based on improved convolutional neural network |
CN116363441A (en) * | 2023-05-31 | 2023-06-30 | 克拉玛依市百事达技术开发有限公司 | Pipeline corrosion detection system with marking function |
CN118051829A (en) * | 2024-04-16 | 2024-05-17 | 山东建筑大学 | Fault diagnosis method, system, medium and equipment for water chilling unit |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007024746A (en) * | 2005-07-20 | 2007-02-01 | Kitakyushu Foundation For The Advancement Of Industry Science & Technology | Method and apparatus for detecting and discriminating defects inside a tube |
US20160163035A1 (en) * | 2014-12-03 | 2016-06-09 | Kla-Tencor Corporation | Automatic Defect Classification Without Sampling and Feature Selection |
CN108038850A (en) * | 2017-12-08 | 2018-05-15 | 天津大学 | A kind of drainage pipeline Exception Type automatic testing method based on deep learning |
WO2019085793A1 (en) * | 2017-11-01 | 2019-05-09 | 腾讯科技(深圳)有限公司 | Image classification method, computer device and computer readable storage medium |
CN109800770A (en) * | 2018-12-28 | 2019-05-24 | 广州海昇计算机科技有限公司 | A kind of method, system and device of real-time target detection |
CN110084210A (en) * | 2019-04-30 | 2019-08-02 | 电子科技大学 | The multiple dimensioned Ship Detection of SAR image based on attention pyramid network |
-
2019
- 2019-08-29 CN CN201910810653.9A patent/CN110826588A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007024746A (en) * | 2005-07-20 | 2007-02-01 | Kitakyushu Foundation For The Advancement Of Industry Science & Technology | Method and apparatus for detecting and discriminating defects inside a tube |
US20160163035A1 (en) * | 2014-12-03 | 2016-06-09 | Kla-Tencor Corporation | Automatic Defect Classification Without Sampling and Feature Selection |
WO2019085793A1 (en) * | 2017-11-01 | 2019-05-09 | 腾讯科技(深圳)有限公司 | Image classification method, computer device and computer readable storage medium |
CN108038850A (en) * | 2017-12-08 | 2018-05-15 | 天津大学 | A kind of drainage pipeline Exception Type automatic testing method based on deep learning |
CN109800770A (en) * | 2018-12-28 | 2019-05-24 | 广州海昇计算机科技有限公司 | A kind of method, system and device of real-time target detection |
CN110084210A (en) * | 2019-04-30 | 2019-08-02 | 电子科技大学 | The multiple dimensioned Ship Detection of SAR image based on attention pyramid network |
Non-Patent Citations (2)
Title |
---|
SANGHYUN WOO ET AL.: "CBAM: Convolutional Block Attention Module", pages 1 - 17 * |
蒋柱武 等: "《给排水管道工程》", vol. 1, 上海:同济大学出版社, pages: 298 - 300 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111458148A (en) * | 2020-04-26 | 2020-07-28 | 上海电机学院 | CBAM-based convolutional neural network rolling bearing fault diagnosis method |
CN111784645A (en) * | 2020-06-15 | 2020-10-16 | 北京科技大学 | A method for detecting cracks in a filled pipeline |
CN111784645B (en) * | 2020-06-15 | 2023-08-22 | 北京科技大学 | Filling pipeline crack detection method |
CN112241681A (en) * | 2020-09-15 | 2021-01-19 | 天津大学 | Liquid leakage detection method based on three-frame difference method and VGG-16 |
CN112364783A (en) * | 2020-11-13 | 2021-02-12 | 诸暨思看科技有限公司 | Part detection method and device and computer readable storage medium |
CN112884709A (en) * | 2021-01-18 | 2021-06-01 | 燕山大学 | Yoov 3 strip steel surface defect detection and classification method introducing attention mechanism |
CN113111828A (en) * | 2021-04-23 | 2021-07-13 | 中国科学院宁波材料技术与工程研究所 | Three-dimensional defect detection method and system for bearing |
CN112990391A (en) * | 2021-05-20 | 2021-06-18 | 四川大学 | Feature fusion based defect classification and identification system of convolutional neural network |
CN113362320A (en) * | 2021-07-07 | 2021-09-07 | 北京工业大学 | Wafer surface defect mode detection method based on deep attention network |
CN113421252A (en) * | 2021-07-07 | 2021-09-21 | 南京思飞捷软件科技有限公司 | Actual detection method for vehicle body welding defects based on improved convolutional neural network |
CN113421252B (en) * | 2021-07-07 | 2024-04-19 | 南京思飞捷软件科技有限公司 | Improved convolutional neural network-based vehicle body welding defect detection method |
CN113362320B (en) * | 2021-07-07 | 2024-05-28 | 北京工业大学 | Wafer surface defect mode detection method based on deep attention network |
CN116363441A (en) * | 2023-05-31 | 2023-06-30 | 克拉玛依市百事达技术开发有限公司 | Pipeline corrosion detection system with marking function |
CN116363441B (en) * | 2023-05-31 | 2023-08-08 | 克拉玛依市百事达技术开发有限公司 | Pipeline corrosion detection system with marking function |
CN118051829A (en) * | 2024-04-16 | 2024-05-17 | 山东建筑大学 | Fault diagnosis method, system, medium and equipment for water chilling unit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110826588A (en) | Drainage pipeline defect detection method based on attention mechanism | |
US20210319265A1 (en) | Method for segmentation of underground drainage pipeline defects based on full convolutional neural network | |
CN109934811B (en) | Optical element surface defect detection method based on deep learning | |
CN112070134B (en) | Power equipment image classification method, device, power equipment and storage medium | |
CN108038850A (en) | A kind of drainage pipeline Exception Type automatic testing method based on deep learning | |
CN110555831B (en) | Deep learning-based drainage pipeline defect segmentation method | |
CN110927171A (en) | A method for detecting defects on the chamfered surface of bearing rollers based on machine vision | |
CN115823508A (en) | Air-ground integrated pipe network safety monitoring method and system | |
CN108334902A (en) | A kind of track train equipment room smog fireproof monitoring method based on deep learning | |
CN114332075A (en) | Rapid structural defect identification and classification method based on lightweight deep learning model | |
CN116166966B (en) | Water quality degradation event detection method based on multi-mode data fusion | |
CN114399665A (en) | Method, device, equipment and storage medium for identifying defect types of external thermal insulation layer of external wall | |
CN119006469A (en) | Automatic detection method and system for surface defects of substrate glass based on machine vision | |
CN117422681A (en) | PCB surface defect detection method based on improved YOLOv8 algorithm | |
CN110852318A (en) | Drainage pipeline defect accurate positioning method and system | |
CN114549414A (en) | Abnormal change detection method and system for track data | |
CN118705555A (en) | A method and device for monitoring water supply network leakage based on deep learning model | |
WO2021237682A1 (en) | Display panel detection device and detection method, electronic device, and readable medium | |
CN110070520B (en) | Pavement crack detection model construction and detection method based on deep neural network | |
CN117808789A (en) | Method and system for detecting cracks of existing building glass curtain wall | |
Kumar et al. | Leveraging visualization techniques to develop improved deep neural network architecture for sewer defect identification | |
CN111985497B (en) | Crane operation identification method and system under overhead transmission line | |
CN113298021A (en) | Mining area transport vehicle head and tail identification method and system based on convolutional neural network | |
CN118052809B (en) | Zero sample point cloud anomaly detection method and system considering prompt learning | |
CN118297918B (en) | Underground drainage pipe defect detection method, device and computer equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200221 |
|
RJ01 | Rejection of invention patent application after publication |