CN113870265B - Industrial part surface defect detection method - Google Patents

Industrial part surface defect detection method Download PDF

Info

Publication number
CN113870265B
CN113870265B CN202111466606.0A CN202111466606A CN113870265B CN 113870265 B CN113870265 B CN 113870265B CN 202111466606 A CN202111466606 A CN 202111466606A CN 113870265 B CN113870265 B CN 113870265B
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.)
Active
Application number
CN202111466606.0A
Other languages
Chinese (zh)
Other versions
CN113870265A (en
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.)
Mianyang Polytechnic
Zhejiang Sci Tech University ZSTU
Original Assignee
Mianyang Polytechnic
Zhejiang Sci Tech University ZSTU
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 Mianyang Polytechnic, Zhejiang Sci Tech University ZSTU filed Critical Mianyang Polytechnic
Priority to CN202111466606.0A priority Critical patent/CN113870265B/en
Publication of CN113870265A publication Critical patent/CN113870265A/en
Application granted granted Critical
Publication of CN113870265B publication Critical patent/CN113870265B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; 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

Industrial part surface defect detection method
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:
precision: precision =
Figure 542228DEST_PATH_IMAGE001
The recall ratio is as follows: call =
Figure 752630DEST_PATH_IMAGE002
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:
Figure 308376DEST_PATH_IMAGE003
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 subject to a 3 x 3 convolution operationNormalizing the weight by an activation function sigma (Sigmoid), improving the generalization capability of the model and obtaining a spatial weight coefficient MsFIG. 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:
Figure 578820DEST_PATH_IMAGE004
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:
precision: precision =
Figure 610230DEST_PATH_IMAGE001
The recall ratio is as follows: call =
Figure 379648DEST_PATH_IMAGE002
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 (9)

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 dividing 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;
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 first 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 provide the output feature graphs to the front end of the nth feature extraction layer after passing through a feature fusion module.
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 as claimed in claim 1, wherein the feature extraction layer comprises a pooling layer, a convolution layer and an activation function connected in sequence.
4. The method as claimed in claim 1, 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.
5. The method for detecting the surface defects of the industrial part according to claim 4, 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.
6. The method for detecting surface defects of industrial parts according to claim 5, 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.
7. The method for detecting surface defects of industrial parts according to claim 4, wherein the global channel attention enhancing portion comprises a channel module and a fusion module;
the method for re-calibrating the channel characteristics 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.
8. The method for detecting the surface defects of the industrial parts according to claim 1, 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.
9. 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:
precision: precision =
Figure 318493DEST_PATH_IMAGE002
The recall ratio is as follows: call =
Figure 563530DEST_PATH_IMAGE004
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.
CN202111466606.0A 2021-12-03 2021-12-03 Industrial part surface defect detection method Active CN113870265B (en)

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 CN113870265A (en) 2021-12-31
CN113870265B true 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 (2)

* Cited by examiner, † Cited by third party
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
CN113240665A (en) * 2021-06-04 2021-08-10 同济大学 Industrial automatic surface defect detection method based on deep learning

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112884709A (en) * 2021-01-18 2021-06-01 燕山大学 Yoov 3 strip steel surface defect detection and classification method introducing attention mechanism
CN112884760B (en) * 2021-03-17 2023-09-26 东南大学 Intelligent detection method for multi-type diseases of near-water bridge 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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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
CN113240665A (en) * 2021-06-04 2021-08-10 同济大学 Industrial automatic surface defect detection method based on deep learning

Also Published As

Publication number Publication date
CN113870265A (en) 2021-12-31

Similar Documents

Publication Publication Date Title
CN109977808B (en) Wafer surface defect mode detection and analysis method
CN113239930A (en) Method, system and device for identifying defects of cellophane and storage medium
CN105389593A (en) Image object recognition method based on SURF
CN114372955A (en) Casting defect X-ray diagram automatic identification method based on improved neural network
CN111476307B (en) Lithium battery surface defect detection method based on depth field adaptation
CN107563274A (en) A kind of vehicle checking method and method of counting of the video based on confrontation e-learning
CN112001253A (en) Coal dust particle image identification method based on improved Fast R-CNN
CN113643268A (en) Industrial product defect quality inspection method and device based on deep learning and storage medium
US20230298152A1 (en) Method for analyzing minor defect based on progressive segmentation network
CN111338950A (en) Software defect feature selection method based on spectral clustering
CN111833310A (en) Surface defect classification method based on neural network architecture search
CN110874576B (en) Pedestrian re-identification method based on typical correlation analysis fusion characteristics
WO2023108514A1 (en) Spectral peak automatic detection and reconstruction method and system in tea near-infrared spectral analysis
CN110633739A (en) Polarizer defect image real-time classification method based on parallel module deep learning
CN116883393B (en) Metal surface defect detection method based on anchor frame-free target detection algorithm
CN114187272A (en) Industrial part surface defect detection method based on deep learning
CN113870265B (en) Industrial part surface defect detection method
CN114067171A (en) Image recognition precision improving method and system for overcoming small data training set
CN113838040A (en) Detection method for defect area of color texture fabric
CN113157561A (en) Defect prediction method for numerical control system software module
CN114062305B (en) Single grain variety identification method and system based on near infrared spectrum and 1D-In-Resnet network
CN116228682A (en) Radiographic image weld defect identification method based on multi-branch convolutional neural network
CN116958645A (en) Scratch identification method for full-automatic integrated automobile paint repair
CN115661042A (en) Hierarchical classification defect detection method based on attention mechanism guidance
CN114119562B (en) Brake disc outer surface defect detection method and system based on deep learning

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