CN117911840A - Deep learning method for detecting surface defects of filter screen - Google Patents

Deep learning method for detecting surface defects of filter screen Download PDF

Info

Publication number
CN117911840A
CN117911840A CN202410318017.5A CN202410318017A CN117911840A CN 117911840 A CN117911840 A CN 117911840A CN 202410318017 A CN202410318017 A CN 202410318017A CN 117911840 A CN117911840 A CN 117911840A
Authority
CN
China
Prior art keywords
filter screen
network
feature
yolov
module
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
CN202410318017.5A
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.)
Henan Institute of Science and Technology
Original Assignee
Henan Institute 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 Henan Institute of Science and Technology filed Critical Henan Institute of Science and Technology
Priority to CN202410318017.5A priority Critical patent/CN117911840A/en
Publication of CN117911840A publication Critical patent/CN117911840A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention provides a deep learning method for detecting surface defects of a filter screen, which comprises the following steps: adding an attention mechanism SE module to the last layer of the backbone network of YOLOv network algorithm, wherein the attention mechanism SE module is used for adaptively adjusting and correcting the feature weights in the feature extraction process; introducing a characteristic pyramid network BiFPN module into a neck network of YOLOv network algorithm, and removing the original path aggregation network PANet structure of YOLOv network algorithm to obtain an optimized YOLOv network algorithm; training an optimized YOLOv network algorithm through the filter screen surface defect dataset, and obtaining a YOLOv target detection network for detecting the surface defects of the filter screen. The attention mechanism SE and the pyramid network BiFPN module are added in YOLOv network algorithm, so that defects on the surface of the filter screen can be accurately detected.

Description

Deep learning method for detecting surface defects of filter screen
Technical Field
The invention relates to a technology for detecting surface defects of a filter screen, in particular to a deep learning method for detecting the surface defects of the filter screen.
Background
The filter screen part is a key component in the automobile air bag generator and is used for reducing the temperature of fuel gas and filtering residues, and the quality of the filter screen part is critical in the production process and directly influences the evacuation safety of an air bag system. However, in the actual production process, various defects may be generated on the surface of the filter screen due to the influence of manufacturing equipment, process flow and field environment, and these defects may directly affect the impact and burn effect of the rapidly expanding gas in the generator on the airbag when the automobile airbag is deployed. How to accurately and efficiently identify the surface defects of the filter screen, improve the production efficiency and have important significance for improving the manufacturing industry. The traditional detection method for the surface defects of the filter screen is mainly realized by manual detection, has obvious defects of time and labor waste, and excessively depends on manual subjective judgment, so that the detection efficiency is low, the reliability is poor, and the phenomena of missing detection and false detection are easy to occur.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a deep learning method for detecting the surface defects of a filter screen, and aims to realize rapid, accurate and high-speed detection of the surface defects of the filter screen.
A deep learning method for detecting surface defects of a filter screen comprises the following steps:
Step 1: adding an attention mechanism SE module to the last layer of the backbone network of YOLOv network algorithm, wherein the attention mechanism SE module is used for adaptively adjusting and correcting the feature weights in the feature extraction process;
Step 2: introducing a characteristic pyramid network BiFPN module into a neck network of YOLOv network algorithm, and removing the original path aggregation network PANet structure of YOLOv network algorithm to obtain an optimized YOLOv network algorithm;
Step 3: training an optimized YOLOv network algorithm through the filter screen surface defect dataset, and obtaining a YOLOv target detection network for detecting the surface defects of the filter screen.
The method further comprises the following steps: the filter screen surface defect data set comprises the steps of collecting different defect types of a filter screen through a visual device, manufacturing the filter screen data set, marking the filter screen data set through LabelImg, generating a txt file at the same time, and carrying out the marking according to 8: the ratio of 2 randomly divides the screen dataset and corresponding. Txt file into a training set and a validation set.
The method further comprises the following steps: the attention mechanism SE module comprises a compression part and an excitation part, wherein the compression part is used for compressing the spatial information in the input characteristic diagram and compressing H multiplied by W multiplied by C into 1 multiplied by C, namely, the 1 multiplied by C characteristic diagram is obtained by using global average pooling in the spatial dimension; the excitation section is used for combining the learned attention information with the input features and obtaining a feature map U with channel attention.
The method further comprises the following steps: compression operation output of compression sectionIs generated by narrowing the spatial dimension h×w of the feature map U, that is:
wherein, Is a compression function.
The method further comprises the following steps: the weight vector s of the excitation portion is:
wherein, As an excitation function,/>For extrusion output and as excitation input,/>For channel mapping relation,/>Is the reduction rate of the channel;
The output of the attention mechanism SE module carries out weight assignment on the feature map U through the weight vector s to obtain the feature map
=/>
Wherein,,/>Is the index quantity/>And feature map/>The channel multiplication between them and the channel multiplication between them,C is a positive integer.
The method further comprises the following steps: the feature pyramid network BiFPN module feature fusion of the third layer is:
wherein, Representing third layer input features,/>Is a third layer intermediate feature and is convolved by a fourth layer input feature and a third layer input feature,/>Is a third layer output feature and is convolved by a third layer input feature and a third layer intermediate feature,/>Representing the fourth layer input features,/>Output features for the second layer,/>For convolution operations,/>Is an upsampling or downsampling operation,/>A learnable weight representing the i-th input feature, wherein/>(I=1, 2) and/>(I=1, 2, 3) are weight parameters distinguishing different feature degrees,/>=0.0001。
The invention has the beneficial effects that: the attention mechanism SE and the pyramid network BiFPN module are added in YOLOv network algorithm, so that defects on the surface of the filter screen can be accurately detected.
Drawings
FIG. 1 is a flow chart of the invention;
FIG. 2 is a schematic diagram of an attention mechanism SE module according to the present invention;
FIG. 3 is a backbone network architecture for adding an attention mechanism SE module to YOLOv network algorithms;
FIG. 4 is a schematic diagram of the structure of a feature pyramid network BiFPN module;
FIG. 5 is a network architecture for adding a feature pyramid network BiFPN module to the YOLOv network algorithm;
fig. 6 is a schematic structural view of the visual inspection automation device.
Detailed Description
The present invention will be described in detail with reference to the accompanying drawings. Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention. The terms left, middle, right, upper, lower, etc. in the embodiments of the present invention are merely relative concepts or references to the normal use state of the product, and should not be construed as limiting.
A deep learning method for detecting surface defects of a filter screen, as shown in fig. 1, comprises the following steps:
Step 1: as shown in fig. 2 and fig. 3, an attention mechanism SE module is added at the last layer of the backbone network of YOLOv network algorithm, and the attention mechanism SE module is used for adaptively adjusting and correcting feature weights in the feature extraction process; the method comprises the following steps: in the feature extraction process, the attention mechanism SE module can simulate the interdependence relationship among channels and adaptively recalibrate the feature response of the channels; the attention mechanism SE module comprises a compression part and an excitation part, wherein the compression part is used for compressing the spatial information in the input characteristic diagram and compressing H multiplied by W multiplied by C into 1 multiplied by C, namely, the 1 multiplied by C characteristic diagram is obtained by using global average pooling in the spatial dimension; the excitation part is used for combining the learned attention information with the input characteristics and obtaining a characteristic diagram U with channel attention;
The attention mechanism SE module reduces the dimension of the input image through global average pooling, and then learns global information through a feedforward network and obtains the corresponding weight of each feature map; finally, multiplying the obtained corresponding weight with the original feature map to obtain final feature information; meanwhile, comparing with the attention mechanism SimAM without channel, selecting the attention mechanism suitable for the invention, and the result is shown in table 1;
Compression operation output of compression section Is generated by narrowing the spatial dimension h×w of the feature map U, that is:
wherein, Is a compression function;
The weight vector s of the excitation portion is:
wherein, Representing a ReLU nonlinear activation function,/>As an excitation function,/>For extrusion output and as excitation input,/>For channel mapping relation,/>Is the reduction rate of the channel;
The output of the attention mechanism SE module carries out weight assignment on the feature map U through the weight vector s to obtain the feature map
=/>
Wherein,,/>Is the index quantity/>And feature map/>The channel multiplication between them and the channel multiplication between them,C is a positive integer.
Step 2: referring to fig. 4 and fig. 5, a feature pyramid network BiFPN module is introduced into a neck network of YOLOv network algorithm, and the original path aggregation network PANet structure of YOLOv network algorithm is removed, so as to obtain an optimized YOLOv network algorithm; the method comprises the following steps: after the backbone network extracts the input image, the input image is output to the detection part after being processed by the neck network, in order to better fuse the characteristic information, the characteristic pyramid network BiFPN module combines the deep and shallow characteristic fusion in two directions of top down and bottom up, and the same layer is repeated for a plurality of times so as to realize the characteristic fusion of higher layers; the feature pyramid network BiFPN module feature fusion of the third layer is:
wherein, Representing third layer input features,/>Is a third layer intermediate feature and is convolved by a fourth layer input feature and a third layer input feature,/>Is a third layer output feature and is convolved by a third layer input feature and a third layer intermediate feature,/>Representing the fourth layer input features,/>Output features for the second layer,/>For convolution operations,/>Is an upsampling or downsampling operation,/>A learnable weight representing the i-th input feature, wherein/>(I=1, 2) and/>(I=1, 2, 3) is a weight parameter distinguishing different feature degrees,/>=0.0001 Represents a small value to avoid numerical instability.
Comparing the YOLOv algorithm optimized in the text with 3 main stream target detection algorithms such as Faster R-CNN, YOLOv5 and YOLOv, and taking four parameters of Precision, recall, mAP@0.5 and mAP@0.5:0.95 as evaluation indexes; the performance of different networks to detect surface defects of the filter screen on the data set is shown in table 2;
Step 3: training an optimized YOLOv network algorithm through a filter screen surface defect dataset, and obtaining a YOLOv target detection network for filter screen surface defect detection; wherein, the filter screen surface defect dataset includes collecting different defect categories of filter screen and making the filter screen dataset through vision device under different environment, rethread LabelImg carries out marking process to the filter screen dataset, produces simultaneously. Txt file, and according to 8: the ratio of 2 randomly divides the screen dataset and corresponding. Txt file into a training set and a validation set.
The deep learning method for detecting the surface defects of the filter screen is applied to visual detection automation equipment, as shown in fig. 6, the visual detection automation equipment comprises a filter screen feeding module 18, a filter screen inner and outer diameter detection module 10, a filter screen inner surface detection module 12, a filter screen outer surface detection module 13 and a filter screen weighing module 14, wherein the filter screen feeding module 18 is used for conveying the filter screen to a filter screen pick-up station through a conveying belt 181, then the filter screen feeding module 18 is grabbed and rotated to the filter screen inner and outer diameter detection station through a mechanical claw 11, the filter screen inner and outer diameter detection module 10 is used for detecting whether the inner diameter errors of the filter screen are in a qualified interval, the filter screen inner surface detection module 12 is used for detecting the inner surface conditions of the filter screen, the filter screen outer surface detection module 13 is used for detecting the outer surface conditions of the filter screen, the filter screen weighing module 14 is used for detecting whether the weight of the filter screen is in the qualified interval, the industrial control screen 15 is used for displaying the running condition of the visual detection automation equipment, counting the quantity of various types of defective products and the change of the filter screen qualification rate in real time, and the printer 16 is used for printing and detecting various data of the filter screen; the gigabit Ethernet industrial linear array camera is selected, the model is MV-CL042-91GM, the light source 131 adopts linear array scanning industrial visual light source, the placing station of the filter screen is designed as a rotating station, and the complete image of the surface of the filter screen can be acquired by matching with the linear array camera; the lifting mechanism 121 is used for controlling the lifting of the area-array camera 122 so as to avoid collision with the mechanical claw when the camera does not need scanning; as shown in fig. 1, the feeding mechanism 133 is used to control the linear motion of the wire sweep camera 132 so as to adjust the distance between the wire sweep camera 132 and the filter screen.
According to the technical scheme, a production line of a certain production filter screen workshop is taken as an application background for illustration. 1000 products were randomly produced and 3 mainstream algorithms, such as Faster R-CNN, YOLOv5 and YOLOv, were used to compare with the improved algorithm of the present invention. The experiment is carried out under the conditions of Win10 operating system platform, 2.11GHz main frequency Intel i7 processor, 16GB memory and python3.8 development environment, the training class is 5, the iteration times are set to 300epoch, the batch size is set to 8, and the precision rate (P), the recall rate (R), the Average Precision (AP) and the average precision average value (mAP) are used as performance evaluation indexes; the results are shown in FIG. 3; where P represents the correct ratio among all the results predicted as positive samples; r represents the ratio of all positive samples that is correctly predicted; the PR curve is a curve formed by taking Recall as an abscissa and Precision as an ordinate, the larger the area at the lower left side of the PR graph is, the better the effect of the model on the data set is, the surrounding area is the average Precision AP, and the average value of each type of Precision is represented; the mAP represents the average value of the APs of each class,The larger the value is, the better the performance of the model is, and the specific calculation formula of each index is as follows:
in the formula, TP represents the number of predicted positive samples in the real positive samples; FP represents the number of positive samples predicted in the real negative samples; FN represents the number of positive samples that are predicted to be negative, Representing the total number of detection categories,/>Representing class index,/>Represents the/>Category/>Value, when/>Time,/>
Comparing the YOLOv network algorithm optimized in the text with 3 main stream target detection algorithms such as Faster R-CNN, YOLOv5 and YOLOv, and the like, and taking four parameters of Precision, recall, mAP@0.5 and mAP@0.5:0.95 as evaluation indexes, wherein the performances of detecting the surface defects of the filter screen on a data set of different networks are shown in a table 1.
For fair comparison, the YOLOv algorithm is kept consistent with YOLOv network algorithm training parameters, such as training batch, iteration number. The improved YOLOv network algorithm is improved by 12.8%, 2% and 5.1% on mAP@0.5 compared with the fast R-CNN, yolov5 and YOLOv7 respectively; in mAP@0.5:0.95, the improved YOLOv algorithm is respectively improved by 4.8%, 0.5% and 5.1% compared with the Faster R-CNN, YOLOv5 and YOLOv7, so that the algorithm detection precision is improved, and meanwhile, the filter screen surface detection efficiency is further improved.
The foregoing has shown and described the basic principles, principal features and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, and that the above embodiments and descriptions are merely illustrative of the principles of the present invention, and various changes and modifications may be made without departing from the spirit and scope of the invention, which is defined in the appended claims. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (6)

1. A deep learning method for detecting surface defects of a filter screen is characterized by comprising the following steps of: the method comprises the following steps:
Step 1: adding an attention mechanism SE module to the last layer of the backbone network of YOLOv network algorithm, wherein the attention mechanism SE module is used for adaptively adjusting and correcting the feature weights in the feature extraction process;
Step 2: introducing a characteristic pyramid network BiFPN module into a neck network of YOLOv network algorithm, and removing the original path aggregation network PANet structure of YOLOv network algorithm to obtain an optimized YOLOv network algorithm;
Step 3: training an optimized YOLOv network algorithm through the filter screen surface defect dataset, and obtaining a YOLOv target detection network for detecting the surface defects of the filter screen.
2. The deep learning method for detecting surface defects of a filter screen according to claim 1, wherein: the filter screen surface defect data set comprises the steps of collecting different defect types of a filter screen through a visual device, manufacturing the filter screen data set, marking the filter screen data set through LabelImg, generating a txt file at the same time, and carrying out the marking according to 8: the ratio of 2 randomly divides the screen dataset and corresponding. Txt file into a training set and a validation set.
3. The deep learning method for detecting surface defects of a filter screen according to claim 1, wherein: the attention mechanism SE module comprises a compression part and an excitation part, wherein the compression part is used for compressing the spatial information in the input characteristic diagram and compressing H multiplied by W multiplied by C into 1 multiplied by C, namely, the 1 multiplied by C characteristic diagram is obtained by using global average pooling in the spatial dimension; the excitation section is used for combining the learned attention information with the input features and obtaining a feature map U with channel attention.
4. A deep learning method for screen surface defect detection as claimed in claim 3, wherein: compression operation output of compression sectionIs generated by narrowing the spatial dimension h×w of the feature map U, that is:
wherein, Is a compression function.
5. A deep learning method for screen surface defect detection as claimed in claim 3, wherein: the weight vector s of the excitation portion is:
wherein, As an excitation function,/>For extrusion output and as excitation input,/>For channel mapping relation,/>Is the reduction rate of the channel;
The output of the attention mechanism SE module carries out weight assignment on the feature map U through the weight vector s to obtain the feature map
=/>
Wherein,,/>Is the index quantity/>And feature map/>The channel multiplication between them and the channel multiplication between them,C is a positive integer.
6. The deep learning method for detecting surface defects of a filter screen according to claim 1, wherein: the feature pyramid network BiFPN module feature fusion of the third layer is:
wherein, Representing third layer input features,/>Is a third layer intermediate feature and is convolved by a fourth layer input feature and a third layer input feature,/>Is a third layer output feature and is convolved by a third layer input feature and a third layer intermediate feature,/>Representing the fourth layer input features,/>Output features for the second layer,/>For convolution operations,/>Is an upsampling or downsampling operation,/>A learnable weight representing the i-th input feature, wherein/>(I=1, 2) and/>(I=1, 2, 3) are weight parameters distinguishing different feature degrees,/>=0.0001。
CN202410318017.5A 2024-03-20 2024-03-20 Deep learning method for detecting surface defects of filter screen Pending CN117911840A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410318017.5A CN117911840A (en) 2024-03-20 2024-03-20 Deep learning method for detecting surface defects of filter screen

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410318017.5A CN117911840A (en) 2024-03-20 2024-03-20 Deep learning method for detecting surface defects of filter screen

Publications (1)

Publication Number Publication Date
CN117911840A true CN117911840A (en) 2024-04-19

Family

ID=90690941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410318017.5A Pending CN117911840A (en) 2024-03-20 2024-03-20 Deep learning method for detecting surface defects of filter screen

Country Status (1)

Country Link
CN (1) CN117911840A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112396002A (en) * 2020-11-20 2021-02-23 重庆邮电大学 Lightweight remote sensing target detection method based on SE-YOLOv3
CN115205274A (en) * 2022-07-26 2022-10-18 西南石油大学 Cloth flaw detection method based on lightweight cascade network
CN115496738A (en) * 2022-09-30 2022-12-20 湖南科技大学 Magnetic tile defect detection method based on Transformer and SE
CN115829999A (en) * 2022-12-22 2023-03-21 国网新疆电力有限公司信息通信公司 Insulator defect detection model generation method, device, equipment and storage medium
CN116503318A (en) * 2023-02-15 2023-07-28 陕西科技大学 Aerial insulator multi-defect detection method, system and equipment integrating CAT-BiFPN and attention mechanism
CN116523875A (en) * 2023-05-04 2023-08-01 合肥工业大学 Insulator defect detection method based on FPGA pretreatment and improved YOLOv5
CN116664558A (en) * 2023-07-28 2023-08-29 广东石油化工学院 Method, system and computer equipment for detecting surface defects of steel
US20230281972A1 (en) * 2022-05-13 2023-09-07 Nanjing University Of Aeronautics And Astronautics Few-shot defect detection method based on metric learning
CN117152691A (en) * 2023-09-05 2023-12-01 长江大学 Infrared ship target detection method based on improved yolov7
CN117173133A (en) * 2023-09-05 2023-12-05 西安建筑科技大学 Glass bead defect detection algorithm based on Ghostnet and attention mechanism
CN117372684A (en) * 2023-11-13 2024-01-09 南京邮电大学 Target detection method based on improved YOLOv5s network model

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112396002A (en) * 2020-11-20 2021-02-23 重庆邮电大学 Lightweight remote sensing target detection method based on SE-YOLOv3
US20230281972A1 (en) * 2022-05-13 2023-09-07 Nanjing University Of Aeronautics And Astronautics Few-shot defect detection method based on metric learning
CN115205274A (en) * 2022-07-26 2022-10-18 西南石油大学 Cloth flaw detection method based on lightweight cascade network
CN115496738A (en) * 2022-09-30 2022-12-20 湖南科技大学 Magnetic tile defect detection method based on Transformer and SE
CN115829999A (en) * 2022-12-22 2023-03-21 国网新疆电力有限公司信息通信公司 Insulator defect detection model generation method, device, equipment and storage medium
CN116503318A (en) * 2023-02-15 2023-07-28 陕西科技大学 Aerial insulator multi-defect detection method, system and equipment integrating CAT-BiFPN and attention mechanism
CN116523875A (en) * 2023-05-04 2023-08-01 合肥工业大学 Insulator defect detection method based on FPGA pretreatment and improved YOLOv5
CN116664558A (en) * 2023-07-28 2023-08-29 广东石油化工学院 Method, system and computer equipment for detecting surface defects of steel
CN117152691A (en) * 2023-09-05 2023-12-01 长江大学 Infrared ship target detection method based on improved yolov7
CN117173133A (en) * 2023-09-05 2023-12-05 西安建筑科技大学 Glass bead defect detection algorithm based on Ghostnet and attention mechanism
CN117372684A (en) * 2023-11-13 2024-01-09 南京邮电大学 Target detection method based on improved YOLOv5s network model

Similar Documents

Publication Publication Date Title
WO2022236876A1 (en) Cellophane defect recognition method, system and apparatus, and storage medium
CN110660046B (en) Industrial product defect image classification method based on lightweight deep neural network
CN107123111A (en) A kind of depth residual error net structure method for mobile phone screen defects detection
CN113222982A (en) Wafer surface defect detection method and system based on improved YOLO network
CN113034483A (en) Cigarette defect detection method based on deep migration learning
CN110348503A (en) A kind of apple quality detection method based on convolutional neural networks
CN112907561A (en) Notebook appearance flaw detection method based on deep learning
CN115861190A (en) Comparison learning-based unsupervised defect detection method for photovoltaic module
CN115631411A (en) Method for detecting damage of insulator in different environments based on STEN network
CN115375635A (en) Wafer defect identification method
CN112102242A (en) PCB component detection method based on lightweight network
CN116309313A (en) Battery surface welding defect detection method
CN117911840A (en) Deep learning method for detecting surface defects of filter screen
CN110910021A (en) Method for monitoring online defects based on support vector machine
CN114596273B (en) Intelligent detection method for multiple defects of ceramic substrate by using YOLOV4 network
CN114820619A (en) Tuber plant sorting method, system, computer device and storage medium
CN111951264B (en) Cigarette package abnormity detection and positioning method based on deep learning
CN114638809A (en) Multi-scale micro-defect detection method based on PA-MLFPN workpiece surface
CN113450344A (en) Strip steel surface defect detection method and system
CN113008998A (en) Hidden engineering internal defect judgment method based on PCNN
CN113870265B (en) Industrial part surface defect detection method
CN111415325A (en) Copper foil substrate defect detection method based on convolutional neural network
CN112200762A (en) Diode glass bulb defect detection method
CN113610184B (en) Wood texture classification method based on transfer learning
CN115222738B (en) Online learning abnormity detection method and system based on feature migration

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