CN111402226A - Surface defect detection method based on cascade convolution neural network - Google Patents

Surface defect detection method based on cascade convolution neural network Download PDF

Info

Publication number
CN111402226A
CN111402226A CN202010173891.6A CN202010173891A CN111402226A CN 111402226 A CN111402226 A CN 111402226A CN 202010173891 A CN202010173891 A CN 202010173891A CN 111402226 A CN111402226 A CN 111402226A
Authority
CN
China
Prior art keywords
network
convolution
defect detection
defects
cnn
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
CN202010173891.6A
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.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
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 Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN202010173891.6A priority Critical patent/CN111402226A/en
Publication of CN111402226A publication Critical patent/CN111402226A/en
Pending legal-status Critical Current

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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Geometry (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a surface defect detection method based on a Cascade convolution neural network, which is used for constructing a defect detection network based on Cascade R-CNN (Cascade R-CNN), and detecting an image of a product to be detected, which is acquired by an industrial camera in real time, by using the trained and optimized defect detection network. According to the invention, Cascade R-CNN is improved into a defect detection network, the defect region and the defect characteristics do not need to be manually extracted, classification is carried out while the defects are positioned, the Cascade R-CNN is used as a basic detection network framework, the excellent detection performance of the Cascade R-CNN enables the defects to be more advantageous in positioning and classification accuracy, and the ResNeXt is used for enhancing the characteristic extraction capability; the FPN is used for detecting the tiny defects, the deformable convolution and the increase of the anchor point frame are used for adapting to various shapes and scales of the defects, the defects have a large enough receptive field, the detection effect of various extreme defects is improved, the threshold value of non-maximum suppression is adjusted, and the detection accuracy is further improved.

Description

Surface defect detection method based on cascade convolution neural network
Technical Field
The invention belongs to the application of a deep learning technology in the field of machine vision detection, and particularly relates to a surface defect detection method based on a cascade convolution neural network.
Background
Surface defects generated in the production process of industrial products seriously affect the quality of the products, and how to detect the surface defects to control the quality of the products is always a great problem for production enterprises. China, as a large manufacturing country, is highly favored by foreign consumers due to low labor cost and relatively low cost of industrial products. However, as the quality of the labor in China rises, the population dividends are gradually disappearing, and many enterprises are under great pressure of high quality standards and high labor cost in the future. The defect detection of products is a link which consumes more labor cost in industrial production in China, for example, in the textile industry, the detection speed is usually only 5-10m/min by means of manual cloth inspection, visual fatigue is inevitably generated after workers work for a period of time in a highly concentrated mode, many defects can be missed, the missing rate can reach more than 30%, and the defect detection method is difficult to adapt to high-speed production requirements. In recent years, with the rapid development of optical technology, digital circuit technology and image processing technology, machine vision has been widely applied in the field of industrial surface defect detection, and automatic detection of product defects has become a necessary trend.
The current research aiming at defect detection relates to a plurality of production fields, and mainly comprises products such as cloth, leather, plastics, metals, paper, glass and the like, the traditional defect detection method mainly comprises that a gray level co-occurrence matrix cloth defect detection method based on image partitioning is proposed by Min-Min, the cloth defect detection method based on gray level co-occurrence matrix and visual information researches [ D ] Jiangsu university, 2018.) although the detection effect is good, the method has the problems of low positioning precision, incapability of classifying defect categories and the like, the Hefu et al proposes a leather surface detection method based on reconstruction (see Hefu strong, Queen and Kong, the leather surface detection method based on wavelet reconstruction [ J ]. Instrument and Meter report, 2006,27(S1): 316-.
Since 2012 the Deep Neural network AlexNet was successful, excellent classification Networks such as VGG-NET, inclusion, ResNet, densenetet, resenext (see Xie S, Ross G, Piotr D, et al. aggregate Detection result transfer for Deep Neural Networks C// IEEE Computer Vision & Pattern Recognition,2017:1492 + 1500.), the research of target Detection algorithms also enters a new stage, the current convolutional Neural network target Detection and identification methods mainly include ① a target Detection and identification method based on regional suggestions, including R-CNN, Fast R-CNN, C-CNN (see caji Z, n. cassave R-n: devint R-cno: No. 7: No. 5,517. No. 7, No. 5, No. 7, No. 5, No. 3, No. 2, No. 5, No. 2, No. 3, No. 5, No. 2, No. 7, No. 3, No. 2, No. 7, No. 3, No. 7, No. 2, No. 7, No. 2, No. 3, No. 2, No. 3, No. 2, No. 3, No. 5, No. 2, No. 3, No. 2, No. 7, no.
Disclosure of Invention
Aiming at the problems that the existing method is low in product defect identification accuracy, multiple in parameters, poor in robustness and incapable of considering both classification and positioning, the invention provides a surface defect detection method based on a cascade convolution neural network, which specifically comprises the following three parts: defect detection network construction, network training and defect detection based on Cascade R-CNN.
(1) Constructing a defect detection network based on Cascade R-CNN;
the defect detection network is obtained by modifying on the basis of a Cascade convolution neural network Cascade R-CNN, and the specific network structure modification comprises the following two aspects:
(1-1) alternative feature extraction network
The original Cascade R-CNN adopts a residual error network ResNet as a feature extraction network thereof. ResNet is a network provided for solving the problem that after a deep convolutional neural network reaches a certain depth, the number of layers is increased one by one, and further performance improvement cannot be brought. ResNeXt is another classification network with excellent performance after ResNet, and the most important characteristic is that the concept of 'cardinality', namely the branch number of a unit block, is provided in the form of packet convolution. Equation (1) gives a mathematical model of the renex structure, where C is the number of branches, x, y are inputs and outputs, and ti (x) represents the stacked structure of three convolutional layers in a single branch. The method is the same as ResNet, the original input is directly attached to the output of the convolutional layer, model degradation of a deep network is guaranteed not to occur during training, the advantages of an increment network are absorbed, a single convolutional layer in ResNet is split into a plurality of convolutional branches, the outputs of all the branches are added together, and the performance of the network is further improved.
Figure BDA0002410144880000041
On the ImageNet data set, the errors of ReNeXt with the same layer number on top1 and top5 are smaller than that of ResNet, and the two parameters are similar in quantity and have a small difference in inference speed.
Therefore, in consideration of the excellent performance of ResNeXt, the invention uses ResNeXt to replace ResNet as a characteristic extraction network of Cascade R-CNN so as to obtain better defect detection effect.
(1-2) feature-added pyramid Structure
Identifying target objects of different sizes and different dimensions is a challenging task in computer vision. After the original Cascade R-CNN network is subjected to convolutional neural network feature extraction processing, only the last layer of feature map is taken as a final feature set, and the Cascade R-CNN network has the advantages that the calculation is simple, the calculation power and the memory size of a computer are not excessively high, but only single-dimension information can be extracted by using the mode, only feature extraction is carried out on local image blocks, the high-resolution feature map is discarded, and the high-resolution feature is very important for small target detection.
In the defect images of various products, the size difference of the defects is larger, and a plurality of smaller defects are contained, so that the detection effect is improved by adding a characteristic Pyramid (FPN) structure. The idea of the FPN structure is to use the output of each layer of feature extraction network as a feature map for prediction, and perform an operation of adding the feature map of each resolution to the feature map of the previous resolution through upsampling. Through the connection, the feature maps used by each layer are fused with features with different resolutions and different semantic strengths, and the fused feature maps respectively detect the objects with the corresponding resolution, so that each layer is ensured to have proper resolution and strong semantic features. Meanwhile, because the structure is only added with cross-layer connection on the basis of the original network, the additional time and the calculation amount are hardly increased in the practical application.
(1-3) substitution of convolution kernels
The traditional standard convolution kernel has a fixed geometric structure, and the geometric structure of a convolution network built by the traditional standard convolution kernel in a laminated mode is also fixed, so that the traditional standard convolution kernel does not have the capability of modeling geometric deformation. For example, in order to identify objects with different sizes in the same image, ideally, the network needs to have a receptive field with a corresponding size at a position corresponding to each object, however, the size of the receptive field of the standard convolution kernel at any position of the image is the same, and only depends on network parameters such as the size of the convolution kernel, the step size, the network depth and the like which are set in advance, and cannot be adjusted in a self-adaptive manner according to the image content, so that the accuracy is limited.
The deformable convolution is proposed to solve the problem that the regular lattice sampling in the standard convolution causes the network to be difficult to adapt to the geometric deformation. As shown in formula (2), p0Is the center point of the current convolution window, p0+pnRepresenting each sample point in a standard convolution window, R defining the size of the convolution kernel, w being the coefficient in the convolution kernel, the principle of deformable convolution is to add an offset variable △ p to the position of each sample point in the standard convolution kernelnThrough the variables, the convolution kernel can be randomly sampled near the current position and is not limited to the previous regular lattice point, the offset is obtained through network learning, and after the offset is added, the size and the position of the deformable convolution kernel can be identified according to the current requirementThe image content of (a) is dynamically adjusted to accommodate various scale transformations, aspect ratios and rotations of the object.
Figure BDA0002410144880000061
When the deformable convolution is used for sampling the defect picture, the sampling points can be adjusted according to the shape and the proportion of the defects during network training, the perception field range of the defects is ensured, the standard convolution kernel of 3 35 3 × 3 in each cell block of the ResNeXt network is replaced by the deformable convolution kernel of 3 × 3, so that the network can adapt to the defects with various proportions and shapes, and the detection effect is improved.
(1-4) increasing the Anchor Box ratio
The Region suggestion network (RPN) is an important innovation point of the Faster R-CNN, and the Cascade R-CNN is proposed based on the fast R-CNN, so that the RPN is reserved for selecting and positioning candidate regions. The principle of the RPN network is similar to a two-class target detector, and in the training stage, for each central point on the common feature map, the RPN calculates k possible regions of different sizes corresponding to the original image at the point, and the rectangular frames corresponding to the regions are called anchor points. After calculating and comparing with the actually labeled target frame, a part of all anchor point frames are screened out to be used as positive samples, and a part of anchor point frames are used as negative samples and are simultaneously used for training the whole RPN. In the inference stage, the RPN calculates candidate frames containing the foreground target on the basis of the generated anchor point frames, and selects out candidate frames with higher quality and sends the candidate frames into a subsequent network for classification and positioning correction. Thus, the setting of the size of the dimensions of the anchor block is crucial, and if the anchor block is not adjusted correctly, the detection network will never know the presence of certain small, large or irregular objects and will never have the opportunity to detect them, resulting in a reduction in the detection accuracy of the network.
In the original RPN network, two parameters are set for generating anchor frames, which are respectively [0.5,1,2] representing the aspect ratio of the generated anchor frame and [8,16,32] representing the scales of the generated anchor frame, and after two are combined, 9 anchor frames with different sizes can be generated. In all kinds of defects, the shapes of some defects are not always regular, and the maximum length-width ratio can reach dozens; some defects are often fine although they have a single shape. If the 9 anchor blocks given in the original RPN network are completely followed, it is difficult for the network to adapt to the various extreme scales of defects. Increasing the diversity of the anchor boxes will help to detect defects of multiple scales, so the invention increases the proportional number of the anchor boxes on the original basis. Aiming at the detection of the defects with extreme scales, adding a larger proportion or a smaller proportion, wherein the larger proportion is used for detecting transverse slender defects and the value range is [10,50 ]; the smaller proportion is used for detecting longitudinal slender defects, the value range is [0.02,0.1], and specific values can be set according to the characteristics of the product defects; wherein a defect in the cross direction is a defect along the warp with a shape similar to "|", and a defect in the down direction is a defect along the weft with a shape similar to "one".
In general, a Cascade R-CNN based fault detection network comprises:
(1) the ResNeXt network is used as a feature extraction network and is totally divided into 5 convolution parts, each convolution part is formed by stacking a plurality of basic convolution cell blocks, each convolution part adopts deformable convolution, an input image generates a feature map after being operated by each convolution part, the resolution of the feature map is reduced by half after each convolution part is operated, and the feature maps output by the last four convolution parts are input to the FPN;
(2) in a feature pyramid FPN, feature graphs output by four parts of a feature extraction network are respectively connected with a 1 × 1 convolutional layer, then are added with a feature graph up-sampling result of the next resolution, and then are connected with a convolutional layer of 3 × 3, and all output new feature graphs of the FPN are sent into an RPN network;
(3) the method comprises the steps that a regional suggestion network RPN is used for generating anchor point frames with different sizes and dimensions on all new feature maps generated by the FPN, the scores and coordinate correction values of the anchor point frames are respectively predicted by two 3 × 3 convolution layers, and the anchor point frames are input into a subsequent cascade network as candidate frames after coordinate correction;
(4) the cascade network is formed by cascading three regional alignment layers ROIAlign and three R-CNN networks, wherein in each R-CNN structure, two full connection layers are arranged firstly, then the outputs of the two full connection layers are respectively input into a classification layer and a regression layer, one is used for prediction classification, the other is used for predicting a target frame correction value, and the output of the regression layer in each R-CNN is fixed to be 7 × 7 size through the regional alignment layer and then is input into the next R-CNN structure for further classification and correction.
(2) Training and optimizing the fault detection network;
(2-1) preparation of data set
When data are produced, sufficient defect sample pictures need to be collected firstly, and then defects of the product are classified according to morphological characteristics according to the detected product characteristics. After the defects are classified, marking all defect pictures by using marking software, and finally making into a data set in a VOC format for subsequent training.
(2-2) model training and evaluation
During network training, if the training period is too small, the network will have an under-fitting phenomenon, and if the training period is too large, the network will have an over-fitting phenomenon, both of which will affect the accuracy of the generated model. Therefore, before network training, a data set needs to be divided into a training set and a test set, wherein the training set is used for network training, and the test set is used for model evaluation after training to judge whether the model meets the use requirement. The invention saves the model parameter of each training period, reads the model parameter files of each period in sequence after all the training periods are finished, and tests on the test set to obtain the mean average precision (mAP) of each model. The higher the mAP is, the better the detection effect of the network is, and finally, the model parameter with the maximum mAP is determined as the finally used network parameter.
(2-3) optimization of non-maximum suppression threshold
When the target detection network carries out reasoning, a target object region in an image often generates a plurality of target boxes with different confidence degrees, the results of the target boxes are mostly redundant, and if the results are output, the accuracy of a model becomes very low. The principle of the method is to select the target frame with the highest confidence in the target object region, and remove all the other results which are relatively large in intersection with the target frame and low in confidence, so as to screen out the optimal detection result. In the defect detection of industrial products, some defects are distributed more densely, and the redundant detection results are removed while the correct areas of the defects are detected. Generally, the set intersection ratio threshold is 0.5, is an empirical parameter, and has a value in the range of (0,1), and is adjustable in accordance with actual conditions. The intersection ratio is more than the redundant data reserved when the intersection ratio is too small, and the accuracy of the model is correspondingly reduced; the more redundant data that is removed when the intersection ratio is too large than the threshold value may affect the detection result of the dense defect. For defect detection, it is very important to select a proper cross-over ratio threshold, and the set thresholds for different product detections are different, so the invention manually adjusts the parameter on the basis of selecting the optimal model parameter in step 2.2, and sets 0.1,0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 and 0.9 in sequence for testing, and the value with the highest mAP value is determined as the threshold value. The threshold and the final network model parameters are used for the next picture defect detection.
(3) Real-time acquisition of images of a product to be inspected using an industrial camera
(4) Detecting images using trained and optimized fault detection networks
(4-1) sending an acquired product image into a trained defect detection network for defect positioning and classification, inputting the image into 5 convolutional layers of a ResNeXt network to extract features, respectively outputting 4 feature maps with different resolution sizes, then conducting up-sampling on the feature maps of each layer through an FPN structure to keep the feature maps of the same lower layer consistent in size, simultaneously processing the feature maps of the lower layer by using a convolutional kernel of 1 × 1 to make the feature maps of the same upper layer same in number, conducting transverse addition on the feature maps of the same upper layer of each layer, conducting convolution by 3 × 3 to eliminate aliasing effect caused by up-sampling to obtain four feature maps of p2, p3, p4 and p5, conducting maximum value pooling operation on the last feature map with the step length of 2 to obtain p6, counting 5 fused feature maps, using RPN on the 5 feature maps to generate frame with different sizes, sending frame classification results of different sizes into a frame of a third layer, and sending the frame of a candidate frame of a CNR-0-class to obtain a final classification frame of a target classification frame, and sending the classification result of a defect classification of a third layer as a target frame, and sending the frame of a classification to a classification frame of a third layer, and sending the final classification frame of a classification of a target frame of a classification.
(4-2) repeating the step (3) to the step (4-1) until the detection of the whole product is completed.
Compared with the prior art, the method has the following beneficial effects:
compared with the traditional detection method, the defect detection method does not need to manually extract defect regions and defect characteristics, and can classify while positioning the defects. Compared with other methods for detecting the defects by using a deep learning technology, the defect detection method has the advantages that the CascadeR-CNN is used as a basic detection network framework, and the defect detection method has excellent detection performance and is more advantageous in defect positioning and classification accuracy. In addition, the invention replaces the feature extraction network with ResNeXt, thereby enhancing the feature extraction capability of the network; aiming at the detection of the fine defects, an FPN structure is added; in order to adapt to various shapes and scales of the defects, deformable convolution and an anchor point frame are introduced to ensure that the defects have enough receptive fields, so that the detection effect of various extreme defects is improved. Finally, in order to remove redundant detection results, the non-maximum suppression threshold is adjusted after network training, so that the detection accuracy is further improved.
Drawings
FIG. 1 is a flow chart of the present invention.
FIG. 2 shows the FPN structure of the present invention.
Figure 3 is a fault detection network architecture of the present invention.
Fig. 4 is a comparison of sampling of defect pictures by standard convolution and deformable convolution, wherein (a) is the former and (b) is the latter.
Fig. 5 is a comparison of the detection effect before and after adjusting the non-maximum threshold, where (a) is the detection effect before adjustment and (b) is the detection effect after adjustment.
FIG. 6 is a diagram illustrating the detection of various cloth defects by the defect detection network of the present invention.
Detailed Description
The embodiment of the defect identification of the invention is a piece of monochromatic cloth, the selected processing platform of the invention is a combination of Intel i9-9900k, NVIDIARTX2080ti and 32G RAM, and the operating system is L inux64 Ubuntu 16.04.
The surface defect detection method based on the cascade convolution neural network as shown in FIG. 1 comprises three parts:
(1) constructing a defect detection network based on Cascade R-CNN;
(2) training and optimizing the fault detection network;
(3) acquiring an image of a product to be detected in real time by using an industrial camera;
(4) and detecting the image by using the trained and optimized defect detection network.
The first part builds a defect detection network based on Cascade R-CNN, and specifically comprises the following steps:
(1-1) alternative feature extraction network
The residual error network ResNet in the original Cascade R-CNN network is replaced by ResNeXt, and particularly a ResNeXt-50(32 × 4d) network is used, in the basic composition unit of the network, the volume integral branch number is 32, and the final output of each unit block is the result of the superposition of the 32 convolution branch results and the addition of the original input.
(1-2) feature-added pyramid Structure
Taking 4 feature maps with different resolutions output by 5 convolution parts of a ResNeXt network as feature sets, as shown in FIG. 2, the network up-samples the feature map of each layer to keep the same size as the feature map of the lower layer, and simultaneously processes the feature map of the lower layer by using a convolution kernel of 1 × 1 to make the same number of channels of the higher layer, and after transversely adding the feature maps of the same higher layer of each layer, performing convolution of 3 × 3 to eliminate aliasing effect brought by up-sampling, so as to obtain four feature maps of p2, p3, p4 and p5, and then obtaining p6 after the last feature map is subjected to maximum value pooling operation with step size of 2, and 5 fused feature maps are counted to form an FPN structure and connected with a subsequent RPN network.
(1-3) substitution of convolution kernels
For defect detection of cloth, offset learning is added into the standard convolution kernel of 3 × 3 in each basic unit of ResNeXt to replace the standard convolution kernel with a deformable convolution kernel of 3 × 3. As shown in FIG. 4, sampling points of the standard convolution kernel easily fall into a non-defect area, so that the sensing field of the cloth defect is insufficient, and the sensing fields of various shape defects can be ensured by using the deformable convolution.
(1-4) increasing the Anchor Box ratio
The invention increases the proportion of the original 3 anchor point frames to 9 anchor point frames. For slender defects, four proportions of 0.05,0.1, 10 and 20 are added, and 0.25 and 4 are added simultaneously so that the set proportions are in a basic equal proportion relation, and the proportion of the anchor frame after adjustment is as follows: and (2) ratios ═ 0.05,0.1,0.25,0.5,1,2,4,10, 20.
The second part of training the network model and optimizing specifically comprises the following steps:
(2-1) preparation of data set
The invention relates to a defect detection method, which belongs to the field of cloth defect detection and has no unified and standard public data set so far, wherein defect pictures adopted by the method are directly shot from a production line, comprise gray cloth defect pictures with different colors and different materials, the total number of the pictures is 1100, and the defects are divided into eight categories, namely heavy warp and heavy weft, broken warp and broken weft, reed marks, spots, broken holes, creases, stain defects and floating warps after the actual production condition is combined. And after the category of the defects is determined, marking the defect pictures by using marking software, and finally making into a data set in a VOC format.
(2-2) model training and evaluation
Before network training, a data set is divided into a training set and a testing set according to the proportion of 4:1, and then training parameters are set, specifically, the training cycle number is as follows: 100, initial learning rate: 0.0025, learning rate attenuation coefficient: 0.0001, and simultaneously setting the model parameters to be saved once every 1 training period. Then, training can be started, and the training can be stopped when the total period of training is finished or the network loss is not changed. After training is finished, model parameter files saved in each period are read in sequence, testing is carried out on the test sets respectively, and mAP is calculated. The model mAP with the training period of 30 is the highest and is used as the final model parameter used in the cloth detection task.
(2-3) optimization of non-maximum suppression threshold
After the final model parameters are determined, modifying the configuration file of the network, respectively selecting 0.1,0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 and 0.9 on the intervals (0 and 1) as intersection ratio thresholds used in a non-maximum suppression algorithm, and testing on a test set, wherein 0.5 is a default threshold set for the original network. After all tests are completed, the model mAP with the threshold value of 0.3 is the highest, the cross-over ratio threshold value in non-maximum value inhibition is finally adjusted to be 0.3, and the cloth defect detection effects before and after adjustment are shown in FIG. 5.
The third and fourth parts specifically include:
(3) capturing an original image of a piece of cloth using an industrial camera
And (4-1) after one cloth image is collected, sending the cloth image into a trained defect detection network to position and classify the defects. The network inputs the image into 5 convolution layers of the ResNeXt network to extract the features, and 4 feature maps with different resolution sizes are output respectively. And then generating 5 feature maps fusing different resolutions and different semantic strengths through an FPN structure, and generating candidate frames with different sizes and different scales by using RPN on the 5 feature maps. And after the candidate frames are obtained, sending the candidate frames into an R-CNN network of the Cascade of the last three layers of Cascade R-CNN, wherein the IOU threshold values of each layer are different and are respectively 0.5, 0.6 and 0.7, the target frames output by each layer are sent to the next layer for training, the frame regression result of the third layer is a predicted defect target frame, namely a defect positioning result, and the classification scores of the three layers are averaged to obtain a final defect classification result.
(4-2) repeating the steps (3) to (4-1) until the detection of the whole piece of cloth is completed, wherein the detection effect of the defects of various types of cloth is shown in figure 6.

Claims (10)

1. A surface defect detection method based on a cascade convolution neural network is characterized in that:
the method comprises the following steps:
step 1: constructing a defect detection network based on Cascade R-CNN;
step 2: training and optimizing the fault detection network;
and step 3: acquiring an image of a product to be detected in real time by using an industrial camera;
and 4, step 4: and detecting the image by using the trained and optimized defect detection network.
2. A method of surface defect detection based on a concatenated convolutional neural network as defined in claim 1, characterized in that: in the step 1, the defect detection network based on Cascade R-CNN comprises the following structures which are matched and arranged in sequence:
(1) the ResNeXt network is used as a feature extraction network, and the output feature graph is input to the FPN;
(2) inputting all output new feature graphs of the feature pyramid FPN and the FPN into an RPN network;
(3) the RPN is used for generating anchor points with different sizes and different dimensions on all new feature maps generated by the FPN, the scores and coordinate correction values of the anchor points are respectively predicted by two 3 × 3 convolution layers, and the anchor points are input into a subsequent cascade network as candidate frames after coordinate correction;
(4) a cascaded network.
3. A method of surface defect detection based on a concatenated convolutional neural network as defined in claim 2, characterized in that: the ResNeXt network comprises 5 convolution parts, each convolution part is formed by stacking a plurality of basic convolution cell blocks, each convolution part adopts deformable convolution, an input image generates a feature map after being operated by each convolution part, the resolution of the feature map is reduced by half after each convolution part, and the feature maps output by the last four convolution parts are all input to the FPN.
4. A method of surface defect detection based on a concatenated convolutional neural network as claimed in claim 3, characterized in that: the ResNeXt network
Figure FDA0002410144870000021
Wherein C is the number of convolution parts, x and y are input and output respectively, and Ti (x) is the stacking structure of convolution unit blocks in a single convolution part.
5. A method according to claim 3, wherein each convolution part in the ResNeXt network uses a deformable convolution kernel of 3 × 3, and the pixel value output after convolution is y (p)0),
Figure FDA0002410144870000022
Wherein p is0Is the center point of the current convolution window, p0+pn△ p for each sample point in the standard convolution windownFor an offset variable added to the position of each sample point in the standard convolution kernel, R is the size of the convolution kernel, and w is the volumeAnd (4) a coefficient in the kernel, wherein x is the pixel value of each pixel point in the current convolution window.
6. The method as claimed in claim 3, wherein the feature pyramid FPN connects feature maps output by four parts in the ResNeXt network with a 1 × 1 convolutional layer respectively, the convolutional result of each convolutional layer is added with the upsampling result of the feature map with the next resolution, finally, a convolutional layer of 3 × 3 is connected to obtain 4 new feature maps, a 5 th feature map of the ResNeXt network is subjected to a maximum pooling operation with a step length of 2 to obtain a 5 th feature map, and all output feature maps of the FPN are input into the RPN network.
7. A method of surface defect detection based on a concatenated convolutional neural network as defined in claim 2, characterized in that: in the RPN, setting parameters for generating an anchor frame, wherein the parameters comprise length-width ratio rates of the generated anchor frame, area scales of the generated anchor frame and proportional quantity of the generated anchor frame; theta 1 is used for detecting transverse elongated defects, theta 1 is in a value range of [10,50], theta 2 is used for detecting longitudinal elongated defects, and theta 2 is in a value range of [0.02,0.1 ].
8. The method for detecting the surface defects based on the cascaded convolutional neural network as claimed in claim 2, wherein the cascaded network comprises three groups of correspondingly arranged regional alignment layer ROI Align and R-CNN networks, each R-CNN network comprises two fully-connected layers, the outputs of the two fully-connected layers are respectively input into a classification layer and a regression layer for prediction classification and target frame correction, and in each R-CNN network, the output of the regression layer is input into the next R-CNN structure for further classification and correction after being fixed to the size of 7 × 7 through the regional alignment layer ROI Align.
9. A method of surface defect detection based on a concatenated convolutional neural network as defined in claim 1, characterized in that: the step 2 comprises the following steps:
step 2.1: acquiring a defect sample picture, classifying and labeling defects according to morphological characteristics corresponding to the variety of a product, and constructing a data set;
step 2.2: dividing a data set into a training set and a testing set;
step 2.3: training the defect detection network by using data of a training set, storing model parameters of each training period, reading model parameter files of each period in sequence after all training periods are finished, testing on the testing set to obtain an average precision mean mAP of each model, and finally selecting a model parameter with the highest mAP as a parameter of the defect detection network;
step 2.4: the non-maxima suppression threshold is optimized.
10. A method of surface defect detection based on a concatenated convolutional neural network as defined in claim 9, which is characterized in that: in the step 2.4, 0.1,0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 and 0.9 are sequentially taken as non-maximum value inhibition thresholds, the model of the defect detection network is respectively tested on the test set, and finally, the maximum mAP threshold is determined as the final threshold.
CN202010173891.6A 2020-03-13 2020-03-13 Surface defect detection method based on cascade convolution neural network Pending CN111402226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010173891.6A CN111402226A (en) 2020-03-13 2020-03-13 Surface defect detection method based on cascade convolution neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010173891.6A CN111402226A (en) 2020-03-13 2020-03-13 Surface defect detection method based on cascade convolution neural network

Publications (1)

Publication Number Publication Date
CN111402226A true CN111402226A (en) 2020-07-10

Family

ID=71430824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010173891.6A Pending CN111402226A (en) 2020-03-13 2020-03-13 Surface defect detection method based on cascade convolution neural network

Country Status (1)

Country Link
CN (1) CN111402226A (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111667030A (en) * 2020-07-13 2020-09-15 华东理工大学 Method, system and storage medium for realizing remote sensing image target detection based on deep neural network
CN111833328A (en) * 2020-07-14 2020-10-27 汪俊 Aircraft engine blade surface defect detection method based on deep learning
CN111914727A (en) * 2020-07-28 2020-11-10 联芯智能(南京)科技有限公司 Small target human body detection method based on balance sampling and nonlinear feature fusion
CN111932482A (en) * 2020-09-25 2020-11-13 平安科技(深圳)有限公司 Method and device for detecting target object in image, electronic equipment and storage medium
CN112036404A (en) * 2020-08-31 2020-12-04 上海大学 Target detection method and system for offshore ship
CN112149636A (en) * 2020-10-23 2020-12-29 北京百度网讯科技有限公司 Method, apparatus, electronic device and storage medium for detecting target object
CN112287854A (en) * 2020-11-02 2021-01-29 湖北大学 Building indoor personnel detection method and system based on deep neural network
CN112308135A (en) * 2020-10-29 2021-02-02 哈尔滨市科佳通用机电股份有限公司 Railway motor car sand spreading pipe loosening fault detection method based on deep learning
CN112418220A (en) * 2020-12-02 2021-02-26 浙江诺诺网络科技有限公司 Single word detection method, device, equipment and medium
CN112418263A (en) * 2020-10-10 2021-02-26 上海鹰瞳医疗科技有限公司 Medical image focus segmentation and labeling method and system
CN112508857A (en) * 2020-11-17 2021-03-16 华南理工大学 Aluminum product surface defect detection method based on improved Cascade R-CNN
CN112508090A (en) * 2020-12-04 2021-03-16 重庆大学 External package defect detection method
CN112508905A (en) * 2020-12-01 2021-03-16 广东电网有限责任公司 Hardware rust image detection method and computer readable storage medium
CN112581522A (en) * 2020-11-30 2021-03-30 平安科技(深圳)有限公司 Method and device for detecting position of target object in image, electronic equipment and storage medium
CN112766340A (en) * 2021-01-11 2021-05-07 中山大学 Depth capsule network image classification method and system based on adaptive spatial mode
CN112949498A (en) * 2021-03-04 2021-06-11 北京联合大学 Target key point detection method based on heterogeneous convolutional neural network
CN113033556A (en) * 2021-03-31 2021-06-25 广东电网有限责任公司 Insulator rapid distinguishing and positioning method and system based on machine vision
CN113066081A (en) * 2021-04-15 2021-07-02 哈尔滨理工大学 Breast tumor molecular subtype detection method based on three-dimensional MRI (magnetic resonance imaging) image
CN113239786A (en) * 2021-05-11 2021-08-10 重庆市地理信息和遥感应用中心 Remote sensing image country villa identification method based on reinforcement learning and feature transformation
CN113469997A (en) * 2021-07-19 2021-10-01 京东科技控股股份有限公司 Method, device, equipment and medium for detecting plane glass
CN113850783A (en) * 2021-09-27 2021-12-28 清华大学深圳国际研究生院 Sea surface ship detection method and system
WO2022262409A1 (en) * 2021-06-15 2022-12-22 无锡锤头鲨智能科技有限公司 Automatic floor sorting method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169956A (en) * 2017-04-28 2017-09-15 西安工程大学 Yarn dyed fabric defect detection method based on convolutional neural networks
CN108520114A (en) * 2018-03-21 2018-09-11 华中科技大学 A kind of textile cloth defect detection model and its training method and application
WO2018165753A1 (en) * 2017-03-14 2018-09-20 University Of Manitoba Structure defect detection using machine learning algorithms
CN109187579A (en) * 2018-09-05 2019-01-11 深圳灵图慧视科技有限公司 Fabric defect detection method and device, computer equipment and computer-readable medium
CN109613006A (en) * 2018-12-22 2019-04-12 中原工学院 A kind of fabric defect detection method based on end-to-end neural network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018165753A1 (en) * 2017-03-14 2018-09-20 University Of Manitoba Structure defect detection using machine learning algorithms
CN107169956A (en) * 2017-04-28 2017-09-15 西安工程大学 Yarn dyed fabric defect detection method based on convolutional neural networks
CN108520114A (en) * 2018-03-21 2018-09-11 华中科技大学 A kind of textile cloth defect detection model and its training method and application
CN109187579A (en) * 2018-09-05 2019-01-11 深圳灵图慧视科技有限公司 Fabric defect detection method and device, computer equipment and computer-readable medium
CN109613006A (en) * 2018-12-22 2019-04-12 中原工学院 A kind of fabric defect detection method based on end-to-end neural network

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
AI算法.图哥: "Deformable convolutional Networks详解", 《CSDN》 *
STONE: "Mask-RCNN最详细解读", 《CSDN》 *
ZHAOWEI CAI: "cascade r-cnn High quality object detection and instance segmentation", 《ARXIV》 *
我爱计算视觉: "布匹疵点智能识别方案介绍及baseline(acc:85%左右,mAP:52%左右)", 《阿里云天池》 *

Cited By (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111667030B (en) * 2020-07-13 2023-04-07 华东理工大学 Method, system and storage medium for realizing remote sensing image target detection based on deep neural network
CN111667030A (en) * 2020-07-13 2020-09-15 华东理工大学 Method, system and storage medium for realizing remote sensing image target detection based on deep neural network
CN111833328A (en) * 2020-07-14 2020-10-27 汪俊 Aircraft engine blade surface defect detection method based on deep learning
CN111833328B (en) * 2020-07-14 2023-07-25 汪俊 Aircraft engine blade surface defect detection method based on deep learning
CN111914727A (en) * 2020-07-28 2020-11-10 联芯智能(南京)科技有限公司 Small target human body detection method based on balance sampling and nonlinear feature fusion
CN111914727B (en) * 2020-07-28 2024-04-26 联芯智能(南京)科技有限公司 Small target human body detection method based on balance sampling and nonlinear feature fusion
CN112036404A (en) * 2020-08-31 2020-12-04 上海大学 Target detection method and system for offshore ship
CN112036404B (en) * 2020-08-31 2024-01-02 上海大学 Marine ship target detection method and system
CN111932482A (en) * 2020-09-25 2020-11-13 平安科技(深圳)有限公司 Method and device for detecting target object in image, electronic equipment and storage medium
WO2021189912A1 (en) * 2020-09-25 2021-09-30 平安科技(深圳)有限公司 Method and apparatus for detecting target object in image, and electronic device and storage medium
CN112418263A (en) * 2020-10-10 2021-02-26 上海鹰瞳医疗科技有限公司 Medical image focus segmentation and labeling method and system
CN112149636B (en) * 2020-10-23 2023-07-25 北京百度网讯科技有限公司 Method, device, electronic equipment and storage medium for detecting target object
US11790553B2 (en) 2020-10-23 2023-10-17 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for detecting target object, electronic device and storage medium
EP3989116A1 (en) * 2020-10-23 2022-04-27 Beijing Baidu Netcom Science And Technology Co. Ltd. Method and apparatus for detecting target object, electronic device and storage medium
CN112149636A (en) * 2020-10-23 2020-12-29 北京百度网讯科技有限公司 Method, apparatus, electronic device and storage medium for detecting target object
CN112308135A (en) * 2020-10-29 2021-02-02 哈尔滨市科佳通用机电股份有限公司 Railway motor car sand spreading pipe loosening fault detection method based on deep learning
CN112287854A (en) * 2020-11-02 2021-01-29 湖北大学 Building indoor personnel detection method and system based on deep neural network
CN112508857A (en) * 2020-11-17 2021-03-16 华南理工大学 Aluminum product surface defect detection method based on improved Cascade R-CNN
CN112581522B (en) * 2020-11-30 2024-05-07 平安科技(深圳)有限公司 Method and device for detecting position of target in image, electronic equipment and storage medium
CN112581522A (en) * 2020-11-30 2021-03-30 平安科技(深圳)有限公司 Method and device for detecting position of target object in image, electronic equipment and storage medium
CN112508905A (en) * 2020-12-01 2021-03-16 广东电网有限责任公司 Hardware rust image detection method and computer readable storage medium
CN112418220A (en) * 2020-12-02 2021-02-26 浙江诺诺网络科技有限公司 Single word detection method, device, equipment and medium
CN112508090A (en) * 2020-12-04 2021-03-16 重庆大学 External package defect detection method
CN112766340B (en) * 2021-01-11 2024-06-04 中山大学 Depth capsule network image classification method and system based on self-adaptive spatial mode
CN112766340A (en) * 2021-01-11 2021-05-07 中山大学 Depth capsule network image classification method and system based on adaptive spatial mode
CN112949498A (en) * 2021-03-04 2021-06-11 北京联合大学 Target key point detection method based on heterogeneous convolutional neural network
CN112949498B (en) * 2021-03-04 2023-11-14 北京联合大学 Target key point detection method based on heterogeneous convolutional neural network
CN113033556A (en) * 2021-03-31 2021-06-25 广东电网有限责任公司 Insulator rapid distinguishing and positioning method and system based on machine vision
CN113066081A (en) * 2021-04-15 2021-07-02 哈尔滨理工大学 Breast tumor molecular subtype detection method based on three-dimensional MRI (magnetic resonance imaging) image
CN113239786A (en) * 2021-05-11 2021-08-10 重庆市地理信息和遥感应用中心 Remote sensing image country villa identification method based on reinforcement learning and feature transformation
WO2022262409A1 (en) * 2021-06-15 2022-12-22 无锡锤头鲨智能科技有限公司 Automatic floor sorting method
CN113469997B (en) * 2021-07-19 2024-02-09 京东科技控股股份有限公司 Method, device, equipment and medium for detecting plane glass
CN113469997A (en) * 2021-07-19 2021-10-01 京东科技控股股份有限公司 Method, device, equipment and medium for detecting plane glass
CN113850783B (en) * 2021-09-27 2022-08-30 清华大学深圳国际研究生院 Sea surface ship detection method and system
CN113850783A (en) * 2021-09-27 2021-12-28 清华大学深圳国际研究生院 Sea surface ship detection method and system

Similar Documents

Publication Publication Date Title
CN111402226A (en) Surface defect detection method based on cascade convolution neural network
CN111047655B (en) High-definition camera cloth defect detection method based on convolutional neural network
CN106875373B (en) Mobile phone screen MURA defect detection method based on convolutional neural network pruning algorithm
CN111383209B (en) Unsupervised flaw detection method based on full convolution self-encoder network
CN110473173A (en) A kind of defect inspection method based on deep learning semantic segmentation
CN111814867A (en) Defect detection model training method, defect detection method and related device
CN111223093A (en) AOI defect detection method
CN111951249A (en) Mobile phone light guide plate defect visual detection method based on multitask learning network
CN113505865B (en) Sheet surface defect image recognition processing method based on convolutional neural network
CN112233067A (en) Hot rolled steel coil end face quality detection method and system
CN106355579A (en) Defect detecting method of cigarette carton surface wrinkles
CN110889838A (en) Fabric defect detection method and device
CN115100206B (en) Printing defect identification method for textile with periodic pattern
CN112150460A (en) Detection method, detection system, device, and medium
CN109886931A (en) Gear ring of wheel speed sensor detection method of surface flaw based on BP neural network
CN115830004A (en) Surface defect detection method, device, computer equipment and storage medium
CN112070712B (en) Printing defect detection method based on self-encoder network
CN113205511A (en) Electronic component batch information detection method and system based on deep neural network
CN115775236A (en) Surface tiny defect visual detection method and system based on multi-scale feature fusion
CN110458809B (en) Yarn evenness detection method based on sub-pixel edge detection
CN110633739A (en) Polarizer defect image real-time classification method based on parallel module deep learning
CN117455917A (en) Establishment of false alarm library of etched lead frame and false alarm on-line judging and screening method
CN113763384B (en) Defect detection method and defect detection device in industrial quality inspection
CN115953387A (en) Radiographic image weld defect detection method based on deep learning
CN115546141A (en) Small sample Mini LED defect detection method and system based on multi-dimensional measurement

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200710

RJ01 Rejection of invention patent application after publication