CN113870265A - Industrial part surface defect detection method - Google Patents
Industrial part surface defect detection method Download PDFInfo
- Publication number
- CN113870265A CN113870265A CN202111466606.0A CN202111466606A CN113870265A CN 113870265 A CN113870265 A CN 113870265A CN 202111466606 A CN202111466606 A CN 202111466606A CN 113870265 A CN113870265 A CN 113870265A
- Authority
- CN
- China
- Prior art keywords
- feature
- channel
- attention
- spatial
- industrial
- 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.)
- Granted
Links
- 230000007547 defect Effects 0.000 title claims abstract description 36
- 238000001514 detection method Methods 0.000 title claims abstract description 20
- 238000000605 extraction Methods 0.000 claims abstract description 47
- 238000000034 method Methods 0.000 claims abstract description 30
- 230000002708 enhancing effect Effects 0.000 claims abstract description 24
- 238000012549 training Methods 0.000 claims abstract description 19
- 238000004519 manufacturing process Methods 0.000 claims abstract description 10
- 230000002950 deficient Effects 0.000 claims abstract description 7
- 238000000638 solvent extraction Methods 0.000 claims abstract description 4
- 238000012545 processing Methods 0.000 claims description 24
- 238000010586 diagram Methods 0.000 claims description 23
- 230000004913 activation Effects 0.000 claims description 19
- 230000004927 fusion Effects 0.000 claims description 17
- 238000011176 pooling Methods 0.000 claims description 17
- 230000009467 reduction Effects 0.000 claims description 11
- 238000012360 testing method Methods 0.000 claims description 9
- 230000001965 increasing effect Effects 0.000 claims description 8
- 238000010606 normalization Methods 0.000 claims description 7
- 238000011156 evaluation Methods 0.000 claims description 6
- 230000003247 decreasing effect Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 description 16
- 238000000513 principal component analysis Methods 0.000 description 7
- 239000000047 product Substances 0.000 description 7
- 238000005457 optimization Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 238000007689 inspection Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 239000013589 supplement Substances 0.000 description 2
- 230000003321 amplification Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 239000004576 sand Substances 0.000 description 1
- 230000009528 severe injury Effects 0.000 description 1
Images
Classifications
-
- 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
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F18/2135—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/253—Fusion techniques of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention belongs to the technical field of industrial detection, and discloses a method for detecting surface defects of industrial parts, which comprises the following steps: collecting a data set for manufacturing industrial parts; enhancing and partitioning the data set; training by utilizing a data set, and establishing an industrial part feature extraction model; and identifying the industrial part image by using the industrial part feature extraction model, and identifying the surface defects of the industrial part. The method can accurately and quickly distinguish qualified parts and defective parts, improve the recognition rate of the surface defect detection of the industrial parts, and simultaneously improve the speed of model training and recognition.
Description
Technical Field
The invention belongs to the technical field of industrial detection, and particularly relates to a method for detecting surface defects of an industrial part.
Background
With the deep fusion of the new generation information technology and the manufacturing industry, the manufacturing industry is greatly changed, and the change from the quantity amplification to the quality improvement is gradually carried out. The product with high added value and high profit is produced by improving the product quality, and the jump of the product competitiveness can be realized. The thinking of improving the product quality includes quality enhancement inspection, technical level improvement, production specification and the like, wherein the quality enhancement inspection is the most common mode in the manufacturing industry.
Industrial part surface defects not only detract from the aesthetics and comfort of the product, but can also cause severe damage to the performance of the product. Therefore, surface defect inspection of industrial parts must be covered in multiple stages of production, both in the final stage before shipment and in the middle joints of production. If an effective defect detection system is lacked, the judgment of the quality of industrial parts can be wrong, and serious safety accidents can be caused.
The existing industrial part surface defect detection method adopting deep learning needs to use a large number of samples to train a model, the category of the industrial part surface defect is difficult to exhaust, and a large number of marking works need to be carried out manually. The existing detection method is low in accuracy, and the model training and recognition speed is low.
Disclosure of Invention
In order to solve the problems, the invention provides a method for detecting the surface defects of the industrial parts, which can accurately and quickly distinguish qualified parts and defective parts, improve the recognition rate of the surface defect detection of the industrial parts, and simultaneously improve the speed of model training and recognition.
In order to achieve the purpose, the invention adopts the technical scheme that: a method for detecting surface defects of industrial parts comprises the following steps:
s10, collecting a data set for manufacturing industrial parts;
s20 enhancing and partitioning the data set;
s30, training by using a data set, and establishing an industrial part feature extraction model;
s40, identifying the industrial part image by using the industrial part feature extraction model, and identifying the surface defects of the industrial part.
Further, the data set is enhanced, a positive sample with the standard of qualified industrial parts is expanded, and the proportion of the positive sample is increased; images of the data set are divided into a training set and a test set.
Furthermore, the industrial part feature extraction model comprises a normalization processing layer, n feature extraction layers, a dimensionality reduction layer and a clustering layer which are sequentially connected in series, the feature extraction layers which are sequentially connected in series enable an input image to sequentially carry out feature graphs with progressively decreasing length and width and progressively increasing channel number, the rear ends of the front n-1 feature extraction layers are connected to respective attention feature enhancement modules, and the attention feature enhancement modules of the feature extraction layers respectively carry out feature recalibration on output feature graphs of the feature extraction layers and then supply the output feature graphs to the front end of the nth feature extraction layer after passing through the feature fusion module.
Further, the feature extraction layer comprises a pooling layer, a convolution layer and an activation function which are connected in sequence.
Further, the attention feature enhancing module adopts a spatial channel attention feature enhancing module, and the spatial channel attention feature enhancing module comprises a local spatial attention enhancing part and a global channel attention enhancing part which are connected in sequence.
Further, the local spatial attention enhancing part comprises a plurality of spatial attention processing units connected in parallel with each other, and the plurality of spatial attention processing units connected in parallel with each other adopt different convolution sizes;
the spatial attention processing unit firstly performs convolution processing on the input feature map to generate a feature map with unchanged size and reduced channel number, wherein the reduced channel number is in the same proportion with the number of the spatial attention processing units; then the feature map is transmitted to a channel superposition unit through a space module;
the feature maps output by the plurality of spatial attention processing units are sent to the channel superposition unit to form a new feature map, and then the new feature map is input to the global channel attention enhancement part. The operation reduces the parameter quantity and improves the model training and testing speed. Spatial features of different scales can be integrated and loss of detail information is reduced.
Further, the processing in the space module includes the steps of:
performing spatial global average pooling operation on the feature map to obtain spatial feature information;
normalizing the weight through convolution operation and an activation function to obtain a spatial weight coefficient;
and multiplying the spatial weight coefficient and the corresponding characteristic diagram according to the channel to obtain the characteristic diagram calibrated by the spatial characteristic.
Further, the global channel attention enhancing part comprises a channel module and a fusion module;
the method for carrying out channel characteristic recalibration on the characteristic diagram by utilizing the channel module comprises the following steps:
performing global average pooling on each channel of the input feature map to obtain a channel global information feature map;
compressing the characteristic diagram through the convolutional layer and an activation function, and recovering the characteristic diagram through the convolutional layer, so that the nonlinear degree is increased, and the parameters are reduced;
obtaining a plurality of channel weight parameters through activation function normalization, weighting the weight parameters on the input feature map according to channels, and obtaining a feature map calibrated through channel feature re-calibration;
adding the feature map input by the local spatial attention enhancement part and the feature map output subjected to channel feature recalibration by using a fusion module, and obtaining a final feature recalibration feature map by using a ReLU activation function; not only deepens the network depth, but also supplements the detail information of the output characteristic diagram.
Further, a dimensionality reduction layer in the model adopts PCA to reduce the dimensionality of the extracted features; and a clustering layer in the model adopts a Meanshift algorithm to perform unsupervised clustering on the data subjected to PCA dimension reduction.
Further, the method also comprises a step S50 of evaluating the industrial part feature extraction model: inputting the test set into an industrial part feature extraction model to obtain a detection result, and evaluating the precision and the real-time performance of the detection result;
taking the accuracy rate and the recall rate as the evaluation indexes of the model accuracy;
the evaluation index is calculated as follows:
TP is a positive sample that is determined to have no defects and is actually a positive sample; FP is a positive sample determined to have no defects and is actually a negative sample; FN is a negative sample that is determined to be defective and is actually a negative sample.
The beneficial effects of the technical scheme are as follows:
the method uses small data to perform model training, partially marks samples, uses a feature fusion and space channel feature enhancement module to improve the model and extract the characteristics of industrial parts, and simultaneously adopts a Meanshift algorithm to establish a classification model after analyzing the distribution condition of positive and negative samples, thereby realizing semi-supervised learning. The invention can achieve higher detection precision under the condition of carrying out model training on a small number of samples. The method for judging the industrial parts can accurately and quickly distinguish qualified parts and defective parts, reduces misjudgment, and effectively prevents or reduces defective products from flowing into the market, thereby reducing safety accidents and improving the identification rate of surface defect detection of the industrial parts.
The spatial channel feature enhancement module not only has channel attention but also has spatial attention, enhances the feature characterization capability in two dimensions, simultaneously retains detailed information as much as possible, integrates feature map information by utilizing convolutions of different sizes to obtain a plurality of feature maps, respectively performs spatial attention matching on the plurality of feature maps, then forms a new feature map by channel stacking, and then performs channel attention matching. According to the invention, the plurality of spatial attention processing units which are connected in parallel are arranged, the channel attention is enabled to be effective by compressing the spatial dimension, the spatial dimension compression is carried out on each feature map by adopting a pooling method, important clues with distinguishing features can be collected, a more effective attention channel is deduced, and meanwhile, the spatial attention is generated by utilizing the spatial relationship among the features. While using the inter-channel relationships between the feature maps to generate the channel attention map, since each channel of the feature map is considered a feature detector, the channel attention is very helpful in the question of "whether there is a flaw" given the input industrial part. According to the model disclosed by the invention, after the spatial channel feature enhancement module is arranged at each feature extraction layer and then input into the last feature extraction layer, the detection precision can be effectively improved and the calculation efficiency can be improved.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting surface defects of an industrial part according to the present invention;
FIG. 2 is a schematic diagram of an industrial part feature extraction model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an attention feature enhancement module according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a space module in an embodiment of the invention;
FIG. 5 is a schematic diagram of a channel module in an embodiment of the invention;
fig. 6 is a schematic diagram of a feature fusion module in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described with reference to the accompanying drawings.
In this embodiment, referring to fig. 1, the present invention provides a method for detecting surface defects of an industrial part, including the steps of:
s10, collecting a data set for manufacturing industrial parts;
s20 enhancing and partitioning the data set;
s30, training by using a data set, and establishing an industrial part feature extraction model;
s40, identifying the industrial part image by using the industrial part feature extraction model, and identifying the surface defects of the industrial part.
As an optimization scheme of the above embodiment, the data set is enhanced, the positive samples with the standard of being qualified industrial parts are expanded, and the proportion of the positive samples is increased, so that the proportion of the positive samples to the negative samples is about 10: 1; images of the data set are divided into a training set and a test set, and data are divided into the training set and the test set according to a ratio of 4: 1.
As an optimization scheme of the above embodiment, as shown in fig. 2, the industrial part feature extraction model includes a normalization processing layer, n feature extraction layers, a dimensionality reduction layer, and a clustering layer, which are sequentially connected in series, the feature extraction layers sequentially connected in series enable an input image to sequentially perform feature maps with decreasing length and width and increasing channel number, the rear ends of the first n-1 feature extraction layers are all connected to respective attention feature enhancement modules, and the attention feature enhancement modules of the feature extraction layers perform feature recalibration on output feature maps of the feature extraction layers respectively, and then provide the output feature maps of the feature extraction layers to the front end of the nth feature extraction layer through the feature fusion module.
3 feature extraction layers which are connected in series in sequence can be adopted, feature graphs of each feature extraction layer are respectively F2, F3 and F4, corresponding attention feature enhancement modules are introduced for feature recalibration, and then feature fusion is carried out on the feature graphs to serve as input of a subsequent network.
As an optimization scheme of the above embodiment, the feature extraction layer includes a pooling layer, a convolution layer, and an activation function, which are connected in sequence.
As an optimization scheme of the above embodiment, as shown in fig. 3, the attention feature enhancing module adopts a spatial channel attention feature enhancing module, and the spatial channel attention feature enhancing module includes a local spatial attention enhancing part and a global channel attention enhancing part which are connected in sequence.
The local spatial attention enhancing part comprises a plurality of spatial attention processing units which are connected in parallel, wherein the plurality of spatial attention processing units which are connected in parallel adopt different convolution sizes;
the spatial attention processing unit firstly performs convolution processing on the input feature map to generate a feature map with unchanged size and reduced channel number, wherein the reduced channel number is in the same proportion with the number of the spatial attention processing units; then the feature map is transmitted to a channel superposition unit through a space module;
the feature maps output by the plurality of spatial attention processing units are sent to the channel superposition unit to form a new feature map, and then the new feature map is input to the global channel attention enhancement part.
As shown in fig. 4, the process in the space module includes the steps of:
performing spatial global average pooling operation on the feature map to obtain spatial feature information;
normalizing the weight through convolution operation and an activation function to obtain a spatial weight coefficient;
and multiplying the spatial weight coefficient and the corresponding characteristic diagram according to the channel to obtain the characteristic diagram calibrated by the spatial characteristic.
In a specific implementation, the local spatial attention part first performs 1 × 1 convolution on the input feature map (H × W × C) to generate a feature map (H × W × C/4) with a constant size and a reduced number of channels. The operation reduces the parameter quantity and improves the model training and testing speed. And in order to improve the robustness of the model, BN and ReLU operations are carried out after the convolution is finished, and finally the compressed characteristic diagram is obtained. In order to integrate spatial features of different scales and reduce loss of detail information, the compression operation is carried out four times, the four times are different in convolution size for compressing channels and are respectively 1,3,5 and 7, and finally, a feature map { R } with four scales of H multiplied by W multiplied by C/4 is obtained1, R2, R3, R4}. The four characteristic maps are respectively subjected to spatial attention matching, and the formula is as follows:
firstly, a feature map R isiPerforming a spatially global average pooling operation, Rs i,avgObtaining the spatial characteristic information of H multiplied by W multiplied by 1;
then, the weights are normalized through 3 multiplied by 3 convolution operation and an activation function sigma (Sigmoid), the generalization capability of the model is improved, and a space weight coefficient M is obtainedsFIG. 4 '<' > shows a spatial weight coefficient MsAnd corresponding characteristic diagram RiAnd multiplying according to the channels to obtain four new characteristic graphs subjected to spatial characteristic recalibration. In fig. 3, 'o' indicates that a new feature F (H × W × C) is formed by stacking new four features through channels.
Wherein, as shown in fig. 5, the global channel attention enhancing part comprises a channel module and a fusion module;
the method for carrying out channel characteristic recalibration on the characteristic diagram by utilizing the channel module comprises the following steps:
performing global average pooling on each channel of the input feature map to obtain a channel global information feature map;
compressing the feature map through the convolutional layer and an activation function, and recovering the feature map through the convolutional layer;
obtaining a plurality of channel weight parameters through activation function normalization, weighting the weight parameters on the input feature map according to channels, and obtaining a feature map calibrated through channel feature re-calibration;
and adding the feature map input by the local spatial attention enhancement part and the feature map output subjected to channel feature recalibration by using a fusion module, and obtaining a final feature recalibration feature map by using a ReLU activation function.
In specific implementation, the channel characteristic recalibration formula can be as follows:
firstly, each channel of an input feature map F is subjected to global average pooling, namely Fc avgObtaining a 1 multiplied by C channel global information characteristic diagram;
then compressing the characteristic diagram into 1 × 1 × C/16 through a 1 × 1 convolutional layer and a δ (ReLU) activation function, recovering the 1 × 1 × C characteristic diagram through the 1 × 1 convolutional layer, increasing the degree of nonlinearity and decreasing the parameters, then normalizing through a σ (Sigmoid) function to obtain C channel weight parameters, and weighting the weight parameters to the input characteristic diagram according to the channels.
As shown in [ ] [ ] in fig. 3, the feature map input by the local spatial attention enhancement part is added to the feature map output after channel feature recalibration, and a final feature recalibration feature map is obtained through the ReLU activation function, which not only deepens the network depth, but also supplements the detail information of the output feature map.
As an optimization scheme of the embodiment, a dimensionality reduction layer in the model reduces the dimensionality of the extracted features by PCA; and a clustering layer in the model adopts a Meanshift algorithm to perform unsupervised clustering on the data subjected to PCA dimension reduction.
As an optimization scheme of the above embodiment, the method further includes step S50 of evaluating the industrial part feature extraction model:
inputting the test set into an industrial part feature extraction model to obtain a detection result, and evaluating the precision and the real-time performance of the detection result;
taking the accuracy rate and the recall rate as the evaluation indexes of the model accuracy;
the evaluation index is calculated as follows:
TP is a positive sample that is determined to have no defects and is actually a positive sample; FP is a positive sample determined to have no defects and is actually a negative sample; FN is a negative sample that is determined to be defective and is actually a negative sample.
The specific embodiment is that the process of training the model by using the training set to obtain the industrial part surface defect detection model based on the feature fusion and spatial channel attention mechanism is as follows:
adjusting the size of an image of a training set to 224 × 3, then carrying out normalization, inputting normalized data into a model, carrying out feature extraction by using the model, carrying out PCA (principal component analysis) dimension reduction on the extracted features, then carrying out model training on the dimension-reduced features by using Meanshift, and finally carrying out data classification and correction to finally obtain the model of the industrial part surface defect detection method based on feature fusion and spatial channel attention mechanism.
The extraction of the features of the industrial part feature extraction model comprises the following steps, as shown in fig. 2:
(1) the 224 x 3 images were normalized, and we obtained a profile F1 after 64 convolutions of 3 x 3, followed by 64 convolutions of 3 x 64, in a pooling layer of 1 by 2, stride = 2.
(2) F1 was sequentially convolved with 128 3 × 64, followed by 128 convolutions with 3 × 128, followed by 1 pooling layer of size 2 × 2 and stride =2, to obtain a signature F2.
(3) F2 was sequentially subjected to 256 convolutions of 3 × 128, 256 convolutions of 3 × 256, and 1 pooling layer of 2 × 2 and stride =2, to obtain a characteristic pattern F3.
(4) F3 was convolved with 512 × 3 × 256, followed by 512 convolutions with 3 × 512, followed by 1 pooling layer with 2 × 2 and stride =2, to obtain a signature F4.
(5) As shown in fig. 3, F2, F3, and F4 are respectively subjected to feature re-calibration by the attention feature enhancement module. The specific process is that F2 obtains four feature maps with the same size through 4 convolutions with the sizes of 1,3,5 and 7, then the feature maps pass through a space module respectively, then the 4 feature maps are subjected to channel connection to obtain a feature map with the same scale as that of the input feature map F2, and then the feature recalibration is completed through a channel module. The characteristic recalibration procedures of F3 and F4 are similar to F2.
(6) As shown in fig. 6, the feature fusion is performed on F2, F3, and F4 after feature re-calibration, specifically, the process is that F2 is subjected to 256 convolutions of 3 × 128 and stride =4, and then normalized by an L2 norm function and a ReLU activation function, which is more beneficial to subsequent feature fusion, and finally, a feature map with the same size as that of F4 and with the number of channels reduced by half is obtained. F3 was subjected to the same treatment, and finally, channels of the treated F2, F3 and F4 were superimposed, to obtain a 28 × 1024 characteristic pattern F4'.
(7) F4' was convolved with 512 × 3 × 512, followed by 512 convolutions with 3 × 512, followed by 1 pooling layer with 2 × 2, stride =2, to obtain a signature F5.
(8) The feature of F5 is subjected to flatten, and the feature F6 is obtained by using PCA dimension reduction.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.
Claims (10)
1. A method for detecting surface defects of industrial parts is characterized by comprising the following steps:
s10, collecting a data set for manufacturing industrial parts;
s20 enhancing and partitioning the data set;
s30, training by using a data set, and establishing an industrial part feature extraction model;
s40, identifying the industrial part image by using the industrial part feature extraction model, and identifying the surface defects of the industrial part.
2. The method for detecting the surface defects of the industrial parts, according to the claim 1, is characterized in that the data set is enhanced, a positive sample with a standard of qualified industrial parts is expanded, and the proportion of the positive sample is increased; images of the data set are divided into a training set and a test set.
3. The method for detecting the surface defects of the industrial part as claimed in claim 1, wherein the industrial part feature extraction model comprises a normalization processing layer, n feature extraction layers, a dimensionality reduction layer and a clustering layer which are sequentially connected in series, the feature extraction layers sequentially connected in series enable an input image to sequentially perform feature maps with progressively decreasing length and width and progressively increasing channel number, the rear ends of the first n-1 feature extraction layers are respectively connected to respective attention feature enhancement modules, and the attention feature enhancement modules of the feature extraction layers respectively perform feature re-calibration on output feature maps of the feature extraction layers and then provide the feature re-calibration results to the front end of the nth feature extraction layer after passing through a feature fusion module.
4. The method as claimed in claim 3, wherein the feature extraction layer comprises a pooling layer, a convolution layer and an activation function which are connected in sequence.
5. The method as claimed in claim 3, wherein the attention feature enhancing module is a spatial channel attention feature enhancing module, and the spatial channel attention feature enhancing module comprises a local spatial attention enhancing part and a global channel attention enhancing part which are connected in sequence.
6. The method for detecting the surface defects of the industrial part according to claim 5, wherein the local spatial attention enhancement part comprises a plurality of spatial attention processing units which are connected in parallel, and the plurality of spatial attention processing units which are connected in parallel adopt different convolution sizes;
the spatial attention processing unit firstly performs convolution processing on the input feature map to generate a feature map with unchanged size and reduced channel number, wherein the reduced channel number is in the same proportion with the number of the spatial attention processing units; then the feature map is transmitted to a channel superposition unit through a space module;
the feature maps output by the plurality of spatial attention processing units are sent to the channel superposition unit to form a new feature map, and then the new feature map is input to the global channel attention enhancement part.
7. The method for detecting surface defects of industrial parts according to claim 6, wherein the processing in the space module comprises the steps of:
performing spatial global average pooling operation on the feature map to obtain spatial feature information;
normalizing the weight through convolution operation and an activation function to obtain a spatial weight coefficient;
and multiplying the spatial weight coefficient and the corresponding characteristic diagram according to the channel to obtain the characteristic diagram calibrated by the spatial characteristic.
8. The method for detecting surface defects of industrial parts according to claim 5, wherein the global channel attention enhancing part comprises a channel module and a fusion module;
the method for carrying out channel characteristic recalibration on the characteristic diagram by utilizing the channel module comprises the following steps:
performing global average pooling on each channel of the input feature map to obtain a channel global information feature map;
compressing the feature map through the convolutional layer and an activation function, and recovering the feature map through the convolutional layer;
obtaining a plurality of channel weight parameters through activation function normalization, weighting the weight parameters on the input feature map according to channels, and obtaining a feature map calibrated through channel feature re-calibration;
and adding the feature map input by the local space attention enhancement part and the feature map output subjected to channel feature recalibration by using a fusion module, and obtaining a final feature recalibration feature map by using an activation function.
9. The method for detecting the surface defects of the industrial parts according to claim 3, wherein a dimensionality reduction layer in the model adopts PCA to reduce the dimensionality of the extracted features; and a clustering layer in the model adopts a Meanshift algorithm to perform unsupervised clustering on the data subjected to PCA dimension reduction.
10. The method for detecting the surface defect of the industrial part as claimed in claim 2, further comprising the step of evaluating the industrial part feature extraction model by step S50: inputting the test set into an industrial part feature extraction model to obtain a detection result, and evaluating the precision and the real-time performance of the detection result; taking the accuracy rate and the recall rate as the evaluation indexes of the model accuracy;
the evaluation index is calculated as follows:
TP is a positive sample that is determined to have no defects and is actually a positive sample; FP is a positive sample determined to have no defects and is actually a negative sample; FN is a negative sample that is determined to be defective and is actually a negative sample.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111466606.0A CN113870265B (en) | 2021-12-03 | 2021-12-03 | Industrial part surface defect detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111466606.0A CN113870265B (en) | 2021-12-03 | 2021-12-03 | Industrial part surface defect detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113870265A true CN113870265A (en) | 2021-12-31 |
CN113870265B CN113870265B (en) | 2022-02-22 |
Family
ID=78985700
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111466606.0A Active CN113870265B (en) | 2021-12-03 | 2021-12-03 | Industrial part surface defect detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113870265B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110532955A (en) * | 2019-08-30 | 2019-12-03 | 中国科学院宁波材料技术与工程研究所 | Example dividing method and device based on feature attention and son up-sampling |
CN112085677A (en) * | 2020-09-01 | 2020-12-15 | 深圳先进技术研究院 | Image processing method, system and computer storage medium |
CN112884709A (en) * | 2021-01-18 | 2021-06-01 | 燕山大学 | Yoov 3 strip steel surface defect detection and classification method introducing attention mechanism |
CN112884760A (en) * | 2021-03-17 | 2021-06-01 | 东南大学 | Near-water bridge multi-type disease intelligent detection method and unmanned ship equipment |
CN113205019A (en) * | 2021-04-22 | 2021-08-03 | 上海电力大学 | Method for detecting defective insulator |
CN113240665A (en) * | 2021-06-04 | 2021-08-10 | 同济大学 | Industrial automatic surface defect detection method based on deep learning |
CN113378672A (en) * | 2021-05-31 | 2021-09-10 | 扬州大学 | Multi-target detection method for defects of power transmission line based on improved YOLOv3 |
-
2021
- 2021-12-03 CN CN202111466606.0A patent/CN113870265B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110532955A (en) * | 2019-08-30 | 2019-12-03 | 中国科学院宁波材料技术与工程研究所 | Example dividing method and device based on feature attention and son up-sampling |
CN112085677A (en) * | 2020-09-01 | 2020-12-15 | 深圳先进技术研究院 | Image processing method, system and computer storage medium |
CN112884709A (en) * | 2021-01-18 | 2021-06-01 | 燕山大学 | Yoov 3 strip steel surface defect detection and classification method introducing attention mechanism |
CN112884760A (en) * | 2021-03-17 | 2021-06-01 | 东南大学 | Near-water bridge multi-type disease intelligent detection method and unmanned ship equipment |
CN113205019A (en) * | 2021-04-22 | 2021-08-03 | 上海电力大学 | Method for detecting defective insulator |
CN113378672A (en) * | 2021-05-31 | 2021-09-10 | 扬州大学 | Multi-target detection method for defects of power transmission line based on improved YOLOv3 |
CN113240665A (en) * | 2021-06-04 | 2021-08-10 | 同济大学 | Industrial automatic surface defect detection method based on deep learning |
Non-Patent Citations (6)
Title |
---|
LEHAI ZHONG等: "Integration Between Cascade Region-Based Convolutional Neural Network and Bi-Directional Feature Pyramid Network for Live Object Tracking and Detection", 《TRAITEMENT DU SIGNAL》 * |
WANG GAIHUA等: "A Serial-Parallel Self-Attention Network Joint With Multi-Scale Dilated Convolution", 《IEEE ACCESS》 * |
宋荣: "复杂交通场景下的行人检测技术研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 * |
李春贺: "基于注意力机制的矿工危险行为检测算法研究", 《煤矿安全》 * |
江培营等: "基于注意力机制和深度学习的钢板表面缺陷图像分类", 《计算机应用与软件》 * |
黄友等: "基于改进级联金字塔网络的人体骨架提取算法", 《智能计算机与应用》 * |
Also Published As
Publication number | Publication date |
---|---|
CN113870265B (en) | 2022-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109977808B (en) | Wafer surface defect mode detection and analysis method | |
CN109035233B (en) | Visual attention network system and workpiece surface defect detection method | |
CN113239930B (en) | Glass paper defect identification method, system, device and storage medium | |
CN111476307B (en) | Lithium battery surface defect detection method based on depth field adaptation | |
CN113379686B (en) | PCB defect detection method and device | |
CN112819748B (en) | Training method and device for strip steel surface defect recognition model | |
CN113643268A (en) | Industrial product defect quality inspection method and device based on deep learning and storage medium | |
CN111833310B (en) | Surface defect classification method based on neural network architecture search | |
CN111914902B (en) | Traditional Chinese medicine identification and surface defect detection method based on deep neural network | |
CN111415353A (en) | Detection structure and detection method for fastener burr defects based on ResNet58 network | |
CN112001253A (en) | Coal dust particle image identification method based on improved Fast R-CNN | |
CN110874576B (en) | Pedestrian re-identification method based on typical correlation analysis fusion characteristics | |
CN116883393B (en) | Metal surface defect detection method based on anchor frame-free target detection algorithm | |
CN112364899A (en) | Abrasive grain ferrographic image intelligent identification method based on virtual image and transfer learning | |
CN117911350A (en) | PCB surface defect detection method based on improvement YOLOv-tiny | |
CN116486224A (en) | Heat exchanger tube orifice image recognition algorithm based on improved U-Net | |
CN114119500A (en) | Yarn dyed fabric defect area detection method based on generation countermeasure network | |
CN110633739A (en) | Polarizer defect image real-time classification method based on parallel module deep learning | |
CN114187272A (en) | Industrial part surface defect detection method based on deep learning | |
CN114170634A (en) | Gesture image feature extraction method based on DenseNet network improvement | |
CN105824785A (en) | Rapid abnormal point detection method based on penalized regression | |
CN117893497A (en) | Wood board surface defect detection method based on improved Yolov-tiny network | |
CN113870265B (en) | Industrial part surface defect detection method | |
CN113157561A (en) | Defect prediction method for numerical control system software module | |
CN116958645A (en) | Scratch identification method for full-automatic integrated automobile paint repair |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |