CN108520114A - A kind of textile cloth defect detection model and its training method and application - Google Patents

A kind of textile cloth defect detection model and its training method and application Download PDF

Info

Publication number
CN108520114A
CN108520114A CN201810238038.0A CN201810238038A CN108520114A CN 108520114 A CN108520114 A CN 108520114A CN 201810238038 A CN201810238038 A CN 201810238038A CN 108520114 A CN108520114 A CN 108520114A
Authority
CN
China
Prior art keywords
textile cloth
defect detection
detection model
prediction block
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810238038.0A
Other languages
Chinese (zh)
Other versions
CN108520114B (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201810238038.0A priority Critical patent/CN108520114B/en
Publication of CN108520114A publication Critical patent/CN108520114A/en
Application granted granted Critical
Publication of CN108520114B publication Critical patent/CN108520114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N2201/00Features of devices classified in G01N21/00
    • G01N2201/12Circuits of general importance; Signal processing
    • G01N2201/129Using chemometrical methods
    • G01N2201/1296Using chemometrical methods using neural networks

Abstract

The invention discloses a kind of textile cloth defect detection model and its training method and applications, and wherein training method includes collecting sample textile cloth defect image, establishes data set, and textile cloth defect detection model is established based on YOLOv2;It is clustered using dimension before training pattern, in training pattern, carries out direct coordinate prediction, penalty values calculating, backpropagation, obtain current network weight parameter;The network weight parameter of textile cloth defect detection model is updated using current network weight parameter, then utilizes training set to carry out multiple network weight and calculates and update, and obtains optimal network weight parameter to get to trained textile cloth defect detection model.Then textile cloth image is acquired in real time, is detected using trained textile cloth defect detection model, is obtained the defect detection result of textile cloth image.High, the real-time, versatility using the textile cloth defect detection model progress fault accuracy rate of the present invention.

Description

A kind of textile cloth defect detection model and its training method and application
Technical field
The invention belongs to deep learnings and technical field of computer vision, are examined more particularly, to a kind of textile cloth fault Survey model and its training method and application.
Background technology
In the production and development of the textile industry in the world, the quality testing to textile cloth is always one very important Link.But in the quality testing of traditional textile cloth, due to not good automatic detection tool, most scheme is also It is to go to make a decision by artificial vision, however on the one hand this scheme depends on artificial qualification, another aspect worker long Time service is easy fatigue, and accuracy is difficult to ensure.With the output of textile cloth and the sharp increase of speed of production, manually vision The method demand for being not suitable with Modern Textile Industry more, urgent need to seek it is a kind of automatic, accurately, quickly carry out quality or The method of defect detection.Currently, domestic have the detection method based on statistics to the detection method of textile cloth fault, based on frequency domain Detection method, based on model, and the method based on machine vision, but since the fault type of textile cloth is more, texture Complexity, often operand is big for these methods, and speed is slow, and is usually only capable of detecting for certain certain types of faults.
It can be seen that there are accuracys rate is low, real-time is poor and does not have versatility for the detection method of existing textile cloth fault The technical issues of.
Invention content
For the disadvantages described above or Improvement requirement of the prior art, the present invention provides a kind of textile cloth defect detection model and Its training method and application, thus solving the detection method of existing textile cloth fault, that there are accuracys rate is low, real-time is poor and does not have There is the technical issues of versatility.
To achieve the above object, according to one aspect of the present invention, a kind of instruction of textile cloth defect detection model is provided Practice method, including:
(1) collecting sample textile cloth defect image, to sample textile cloth defect image be marked to obtain fault classification and Include the true frame of fault, and then establish data set, textile cloth defect detection model is established based on YOLOv2;
(2) dimension cluster is carried out to the true frame that data are concentrated, obtains fixed frame, fixed frame is applied to textile cloth fault Detection model is predicted to obtain prediction block using direct coordinate, and being based on prediction block using loss function carries out penalty values calculating, obtains It predicts error, carries out backpropagation using prediction error, obtain current network weight parameter;
(3) the network weight parameter for utilizing current network weight parameter update textile cloth defect detection model, then utilizes Training set carries out multiple network weight and calculates and update, obtains optimal network weight parameter to get to trained weaving FABRIC DEFECTS Point detection model.
Further, sample textile cloth defect image includes:It is disconnected through image, staplings image, broken hole image, foreign matter image, Greasy dirt image and folding line image.
Further, textile cloth defect detection model be based on YOLOv2 frames, 32 layers in total, including 23 Convolutional layers of Conv1~Conv23,5 Maxpool layers of Max1~Max5, two Route layers of Route1~ Route2, a Reorg layers of Reorg1, a Softmax layers of Softmax1, the cascade side of the textile cloth defect detection model Formula be Convl be sequentially connected Max1, Conv2, Max2, Conv3~Conv5, Max3, Conv6~Conv8, Max4, Conv9~ Conv13, Max5, Conv14~Conv20, Route1, Conv21, Reorg1, Route2, Conv22, Conv23 and Softmax1。
Further, Conv1~Conv22 in textile cloth defect detection model carries out batch normalizing before carrying out convolution Change, Conv1~Conv22 uses leaky-ReLU activation primitives after carrying out convolution;Conv23 is not criticized before convolution Normalization uses linear activation primitives after convolution.
Further, textile cloth defect detection model uses multiple dimensioned training in the training process.
Further, step (2) includes:
(2-1) carries out dimension for the true frame in data set and clusters to obtain cluster frame, utilizes cluster frame and true frame Hand over and than IOU (box, centroid) obtain distance metric centre deviation value d (box, centroid)=1-IOU (box, Centroid), when distance metric centre deviation value is less than or equal to metric threshold, the width for obtaining fixed frame is high;Metric threshold is 10-6
Fixed frame is applied to textile cloth defect detection model by (2-2), and pre- measured center phase is obtained according to the wide height of fixed frame After parameter and the high relative parameter of width, predict to obtain the centre coordinate of prediction block and the width height of prediction block using direct coordinate;
(2-3) is obtained using the high progress costing bio disturbance of width of centre coordinate of the loss function based on prediction block and prediction block It predicts error, carries out backpropagation using prediction error, obtain current network weight parameter.
Further, direct coordinate is predicted as:
bx=σ (tx)+cx
by=σ (ty)+cy
Wherein, (bx, by) be prediction block centre coordinate, bwAnd bhThe respectively width and height of prediction block, (tx, ty) it is prediction Center relative parameter, twAnd thRespectively predict the high relative parameter of width, σ (tx) and σ (ty) it is its institute of prediction block center deviation respectively Distance horizontally and vertically in the upper left corners cell, cxAnd cyRespectively cell where fixed frame center is spun with sample The distance horizontally and vertically in the woven fabric defect image upper left corner, pwAnd phThe respectively width and height of fixed frame.
Further, loss function is:
Wherein, loss is prediction error, and the first row formula of loss function indicates to include fault and the net not comprising fault The confidence level of lattice is lost,Include the confidence level of fault, C for i-th of gridiWhether to have fault, C in i-th of gridiFor 1 or 0,Indicate the prediction block for not including fault in j prediction block in i grid of traversal,Indicate i grid of traversal In j prediction block in include the prediction block of fault;Second row formula of loss function indicates loss and the gradient of class prediction,For the class label of i-th of grid forecasting, pi(c) it is the true class label of i-th of grid, the third line of loss function is public Formula indicates the frame information gradient of prediction block, wiAnd hiIndicate the width and height of true frame in i-th of grid,WithIndicate i-th The width and height of prediction block, (x in a gridi, yi) indicate the centre coordinate of true frame in i-th of grid,Indicate i-th The fourth line formula of the centre coordinate of prediction block in a grid, loss function indicates the gradient not comprising fault prediction block, (pjx, pjy) indicate the centre coordinate for not including j-th of prediction block of fault, pjwAnd pjhIndicate j-th of prediction block not comprising fault Wide and high, l.w and l.h are 13, l.n 5, λnoobj=1, λobj=5, λclass=1, λcoord=1.
It is another aspect of this invention to provide that a kind of textile cloth defect detection model is provided, the textile cloth defect detection Model is trained to obtain by a kind of above-mentioned training method of textile cloth defect detection model.
It is another aspect of this invention to provide that a kind of application of textile cloth defect detection model is provided, including:Acquisition in real time Textile cloth image is detected using trained textile cloth defect detection model, obtains the defect detection knot of textile cloth image Fruit.
In general, through the invention it is contemplated above technical scheme is compared with the prior art, can obtain down and show Beneficial effect:
(1) training method of a kind of textile cloth defect detection model proposed by the invention is based on deep learning frame YOLOv2 builds textile cloth defect detection model, it is extracted and merged to characteristics of image by multilayer convolution operation, and Fixed frame, dimension cluster, direct coordinate has been used to predict that multiple dimensioned training, batch normalization carries out the network optimization, improves and trains effect Fruit, and the accuracy rate in training process can be monitored in real time, the data such as loss function value.
(2) it when carrying out defect detection using the trained textile cloth defect detection model of the present invention, can effectively detect Go out the disconnected warp in textile cloth, staplings, broken hole, foreign matter, folding line, the common defects such as greasy dirt improve the accuracy of detection method, real When property and versatility.Meanwhile detection speed is fast, 12.5ms is only needed per pictures, precision is high, reaches 96% or more.
(3) present invention is without using traditional Euclidean distance function, but using the friendship of cluster frame and true frame and compares IOU (box, centroid) obtains distance metric centre deviation value d (box, centroid)=1-IOU (box, centroid), thus The data of obtained fixed frame are more acurrate, improve the accuracy rate of follow-up training pattern, and then improve the accurate of defect detection Rate.
(4) the convolutional layer Convolutional of textile cloth defect detection model of the present invention extracts figure by convolution algorithm The edge feature of picture, as the convolution number of plies is more, the characteristics of image of acquisition is more accurate, but excessive convolutional layer can also increase fortune Calculation amount, even results in over-fitting.So the present invention is arranged 23 Convolutional layers, can make while ensureing accurate Operand is smaller, also relate to Maxpool layers in textile cloth defect detection model of the present invention, Route layers, Reorg layers, Softmax layers.Wherein, Maxpool layers by down-sampling, can effectively reduce data volume, and retain the useful spy of image Sign.Route layers are called routing layer, can be by several layers of merging features to, being conducive to extract together and merge multilayer feature. The size of the Reorg layers of characteristic pattern that the size of input layer can be matched to output achievees the purpose that adjust size.
Description of the drawings
Fig. 1 is a kind of applicating flow chart of textile cloth defect detection model provided in an embodiment of the present invention;
Fig. 2 (a) is the change curve for the loss that the embodiment of the present invention 1 provides;
Fig. 2 (b) is the change curve for the IOU that the embodiment of the present invention 1 provides;
Fig. 3 (a) is detection result figure of the textile cloth defect detection model to disconnected warp of the offer of the embodiment of the present invention 1;
Fig. 3 (b) is detection result figure of the textile cloth defect detection model to staplings of the offer of the embodiment of the present invention 1;
Fig. 3 (c) is detection result figure of the textile cloth defect detection model to broken hole of the offer of the embodiment of the present invention 1;
Fig. 3 (d) is detection result figure of the textile cloth defect detection model to foreign matter of the offer of the embodiment of the present invention 1;
Fig. 3 (e) is detection result figure of the textile cloth defect detection model to greasy dirt of the offer of the embodiment of the present invention 1;
Fig. 3 (f) is detection result figure of the textile cloth defect detection model to folding line of the offer of the embodiment of the present invention 1.
Specific implementation mode
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.As long as in addition, technical characteristic involved in the various embodiments of the present invention described below It does not constitute a conflict with each other and can be combined with each other.
As shown in Figure 1, a kind of application of textile cloth defect detection model, including:
(1) collecting sample textile cloth defect image, including:Break through image, staplings image, broken hole image, foreign matter image, oil Dirty image and folding line image.It is marked to obtain fault classification and true frame comprising fault to sample textile cloth defect image, And then data set is established, textile cloth defect detection model is established based on YOLOv2;Textile cloth defect detection model is based on YOLOv2 Frame, 32 layers in total, including 23 Convolutional layers of Conv1~Conv23,5 Maxpool layers of Max1~Max5, two A Route layers of Route1~Route2, a Reorg layers of Reorg1, a Softmax layers of Softmax1, the weaving FABRIC DEFECTS Point detection model cascade system be Conv1 be sequentially connected Max1, Conv2, Max2, Conv3~Conv5, Max3, Conv6~ Conv8, Max4, Conv9~Conv13, Max5, Conv14~Conv20, Route1, Conv21, Reorg1, Route2, Conv22, Conv23 and Softmax1.Conv1~Conv22 in textile cloth defect detection model is carried out before carrying out convolution Normalization is criticized, Conv1~Conv22 uses leaky-ReLU activation primitives after carrying out convolution;Conv23 does not have before convolution Batch normalization is carried out, linear activation primitives are used after convolution.
(2) dimension cluster is carried out to the true frame that data are concentrated, obtains fixed frame, fixed frame is applied to textile cloth fault Detection model is predicted to obtain prediction block using direct coordinate, and being based on prediction block using loss function carries out penalty values calculating, obtains It predicts error, carries out backpropagation using prediction error, obtain current network weight parameter;Including:
(2-1) carries out dimension for the true frame in data set and clusters to obtain cluster frame, utilizes cluster frame and true frame Hand over and than IOU (box, centroid) obtain distance metric centre deviation value d (box, centroid)=1-IOU (box, Centroid), when distance metric centre deviation value is less than or equal to metric threshold, the width for obtaining fixed frame is high;Metric threshold is 10-6
Fixed frame is applied to textile cloth defect detection model by (2-2), and pre- measured center phase is obtained according to the wide height of fixed frame After parameter and the high relative parameter of width, predict to obtain the centre coordinate of prediction block and the width height of prediction block using direct coordinate;
(2-3) is obtained using the high progress costing bio disturbance of width of centre coordinate of the loss function based on prediction block and prediction block It predicts error, carries out backpropagation using prediction error, obtain current network weight parameter.
Direct coordinate is predicted as:
bx=σ (tx)+cx
by=σ (ty)+cy
Wherein, (bx, by) be prediction block centre coordinate, bwAnd bhThe respectively width and height of prediction block, (tx, ty) it is prediction Center relative parameter, twAnd thRespectively predict the high relative parameter of width, σ (tx) and σ (ty) it is its institute of prediction block center deviation respectively Distance horizontally and vertically in the upper left corners cell, cxAnd cyRespectively cell where fixed frame center is spun with sample The distance horizontally and vertically in the woven fabric defect image upper left corner, pwAnd phThe respectively width and height of fixed frame.
Further, loss function is:
Wherein, loss is prediction error, and the first row formula of loss function indicates to include fault and the net not comprising fault The confidence level of lattice is lost,Include the confidence level of fault, C for i-th of gridiWhether to have fault, C in i-th of gridiIt is 1 Or 0,Indicate the prediction block for not including fault in j prediction block in i grid of traversal,Indicate i net of traversal Include the prediction block of fault in j prediction block in lattice;Second row formula of loss function indicates loss and the ladder of class prediction Degree,For the class label of i-th of grid forecasting, pi(c) it is the true class label of i-th of grid, the third line of loss function Formula indicates the frame information gradient of prediction block, wiAnd hiIndicate the width and height of true frame in i-th of grid,WithIndicate the The width and height of prediction block, (x in i gridi, yi) indicate the centre coordinate of true frame in i-th of grid,Indicate the The fourth line formula of the centre coordinate of prediction block in i grid, loss function only exists before 12800 samples, calculates to super It has crossed the sample number and has just removed this, the fourth line formula of loss function indicates the gradient not comprising fault prediction block, (pjx, pjy) indicate the centre coordinate for not including j-th of prediction block of fault, pjwAnd pjhIndicate j-th of prediction block not comprising fault Wide and high, l.w and l.h are 13, l.n 5, λnoobj=1, λobj=5, λclass=1, λcoord=1.
(3) the network weight parameter for utilizing current network weight parameter update textile cloth defect detection model, then utilizes Training set carries out multiple network weight and calculates and update, obtains optimal network weight parameter to get to trained weaving FABRIC DEFECTS Point detection model;Textile cloth defect detection model uses multiple dimensioned training in the training process.
(4) textile cloth image is acquired in real time, is detected, is weaved using trained textile cloth defect detection model The defect detection result of cloth image.
Embodiment 1
Convolutional neural networks used in the present invention can receive the input of arbitrary pixel image in principle, it is contemplated that Small fault can be distorted after the too big image of pixel can lead to resize, and the too small image of pixel can lead to certain feature extractions not again It arrives, the reference pixel that official provides is 416 × 416, and the embodiment of the present invention 1 is big as possible in view of the range of one-off recognition cloth And the adequacy of feature extraction, so using 1216 × 1020 pixel size.
A kind of application of textile cloth defect detection model, including:
(1) it includes disconnected warp, staplings, broken hole, foreign matter, greasy dirt, six class fault of folding line to use industrial camera to acquire and choose For image as sample textile cloth defect image, sample textile cloth defect image is the triple channel that the resolution ratio of jpg formats is 96dpi Coloured image, pixel are 1216 × 1020;Newly-built two files are training set file train and test set file Test is respectively intended to storage training set and test set image;Randomly select it is a large amount of and equivalent comprising disconnected warp, staplings, broken hole, Sundries, greasy dirt, six class fault of folding line image deposit training set file train in, this example have chosen comprising disconnected warp, staplings, Each 1000 per class fault of broken hole, sundries, greasy dirt, folding line, in total 6000 images;Then, it is training to randomly select quantity The image comprising disconnected warp, staplings, broken hole, sundries, greasy dirt, six class fault of folding line for collecting the 10% of folder image is stored in test set File test, this example have chosen include disconnected warp, staplings, broken hole, sundries, greasy dirt, folding line per class fault each 100, in total 600 images finally create a file and are named as JPEGImages, by training set file train and test set text All pictures in part folder test all copy to file JPEGImages and are numbered, and save as XXXX.jpg, wherein XXXX is 4-digit number number, the picture number in training set from the picture number in 0000~5999, test set from 6000~ 6599, and need to record the number of the number of image and image in test set in training set in the process;New folder Annotations;Then, the labelimg softwares of application image marking software, this example selection mark image, mark file The fault classification of picture and defect regions in JPEGImages, by labelimg Software Create XXXX.xml label files, XXXX For picture number, and all in deposit file Annotations;Then new folder ImageSets is created a subdirectory Main, and train.txt is created wherein, val.txt documents are stored in the path of all training set pictures in train.txt, The path of all test set pictures is stored in val.txt, format YYY/JPEGImages/XXXX.jpg, wherein YYY are indicated Path where JPEGImages files, XXXX indicate picture number;By file JPEGImages, Annotations, All data in tri- files of ImageSets construct the required VOC data sets of the present invention jointly.
Textile cloth defect detection model be based on YOLOv2 frames, 32 layers in total, including 23 Convolutional layers Conv1~Conv23,5 Maxpool layers of Max1~Max5, two Route layers of Route1~Route2, one Reorg layers Reorg1, a Softmax layers of Softmax1, the cascade system of the textile cloth defect detection model are sequentially connected for Conv1 Max1, Conv2, Max2, Conv3~Conv5, Max3, Conv6~Conv8, Max4, Conv9~Conv13, Max5, Conv14 ~Conv20, Route1, Conv21, Reorg1, Route2, Conv22, Conv23 and Softmax1.Textile cloth defect detection mould Conv1~Conv22 in type carries out batch normalization before carrying out convolution, and Conv1~Conv22 is used after carrying out convolution Leaky-ReLU activation primitives;Conv23 does not carry out batch normalization before convolution, and linear activation primitives are used after convolution.
At Conv1 layers:The image size of input is 416 × 416 × 3, convolution kernel be 3 × 3, totally 32, step-length 1;
At Max1 layers:The image size of input is 416 × 416 × 32, and core size is 2 × 2, step-length 2;
At Conv2 layers:The image size of input is 208 × 208 × 32, convolution kernel be 3 × 3, totally 64, step-length 1;
At Max2 layers:The image size of input is 208 × 208 × 64, and core size is 2 × 2, step-length 2;
At Conv3 layers:The image size of input is 104 × 104 × 64, convolution kernel be 3 × 3, totally 128, step-length 1;
At Conv4 layers:The image size of input is 104 × 104 × 128, convolution kernel be 1 × 1, totally 64, step-length 1;
At Conv5 layers:The image size of input is 104 × 104 × 64, convolution kernel be 3 × 3, totally 128, step-length 1;
At Max3 layers:The image size of input is 104 × 104 × 128, and core size is 2 × 2, step-length 2;
At Conv6 layers:The image size of input is 52 × 52 × 128, convolution kernel be 3 × 3, totally 256, step-length 1;
At Conv7 layers:The image size of input is 52 × 52 × 256, convolution kernel be 1 × 1, totally 128, step-length 1;
At Conv8 layers:The image size of input is 52 × 52 × 128, convolution kernel be 3 × 3, totally 256, step-length 1;
At Max4 layers:The image size of input is 52 × 52 × 256, and core size is 2 × 2, step-length 2;
At Conv9 layers:The image size of input is 26 × 26 × 256, convolution kernel be 3 × 3, totally 512, step-length 1;
At Conv10 layers:The image size of input is 26 × 26 × 512, convolution kernel be 1 × 1, totally 256, step-length 1;
At Conv11 layers:The image size of input is 26 × 26 × 256, convolution kernel be 3 × 3, totally 512, step-length 1;
At Conv12 layers:The image size of input is 26 × 26 × 512, convolution kernel be 1 × 1, totally 256, step-length 1;
At Conv13 layers:The image size of input is 26 × 26 × 256, convolution kernel be 3 × 3, totally 512, step-length 1;
At Max5 layers:The image size of input is 26 × 26 × 512, and core size is 2 × 2, step-length 2;
At Conv14 layers:The image size of input is 13 × 13 × 512, convolution kernel be 3 × 3, totally 1024, step-length 1;
At Conv15 layers:The image size of input is 13 × 13 × 1024, convolution kernel be 1 × 1, totally 512, step-length 1;
At Conv16 layers:The image size of input is 13 × 13 × 512, convolution kernel be 3 × 3, totally 1024, step-length 1;
At Conv17 layers:The image size of input is 13 × 13 × 1024, convolution kernel be 1 × 1, totally 512, step-length 1;
At Conv18 layers:The image size of input is 13 × 13 × 512, convolution kernel be 3 × 3, totally 1024, step-length 1;
At Conv19 layers:The image size of input is 13 × 13 × 1024, and convolution kernel is 3 × 3, and totally 1024, step-length is 1;
At Conv20 layers:The image size of input is 13 × 13 × 1024, and convolution kernel is 3 × 3, and totally 1024, step-length is 1;
At Route1 layers:Combine the feature of Conv13 layers of output;
At Conv21 layers:The image size of input is 26 × 26 × 512, convolution kernel be 1 × 1, totally 64, step-length 1;
At Reorg1 layers:The image modification size that upper layer is obtained, step-length 2, input picture are 26 × 26 × 64, output Image 13 × 13 × 256;
At Route2 layers:The characteristic pattern of the characteristic pattern and Conv20 layers of output of Reorg1 outputs is combined, output image is big Small is 13 × 13 × 1280;
At Conv22 layers:The image size of input is 13 × 13 × 1280, and convolution kernel is 3 × 3, and totally 1024, step-length is 1;
At Conv23 layers:The image size of input is 13 × 13 × 1024, convolution kernel be 1 × 1, totally 55, step-length 1;
Classified according to 13 × 13 × 55 characteristic pattern of input at softmax layers, 55 characteristic patterns of final choice are Because of the k=5 of definition, then 5 fixed frames are selected to predict, and each fixed frame needs to predict 6 kinds of classifications, 4 frame parameters, And a confidence level, so 55=5 × (6+4+1).
Maxpool layers of pond mode is maximum value pond, and sampling core is 2, step-length 2.
The leaky-ReLU activation primitives, the activation formula of the function has been used to be in Conv1~Conv22 convolutional layers:
F (x)=α x, (x < 0)
F (x)=x, (x >=0)
Wherein, α=0.1;It can be effectively improved the case where easily leading to neuron " necrosis " of ReLU activation primitives, and The linear activation primitives of linear are used after Conv23 convolutional layers, in order to classify in linear classification layer.
Dimension cluster is to carry out K-means to the true frame of training sample using K-means clustering methods in machine learning Cluster is high from the width for the number and fixed frame for statistically obtaining fixed frame.The cluster centre k=5 of use, the width at five centers A height of (1.3221,1.73145), (3.19275,4.00944), (5.05587,8.09892), (9.47112,4.84053), (11.2364,10.0071), wide and high maximum are 13.
Multiple dimensioned training refer to the convolutional neural networks often pass through in the training process 10 batches of training will change it is defeated The resolution ratio for entering image, the new resolution ratio of random selection is trained in { 320,352,384 ... 608 } range.
In above-mentioned model, grader interstitial content is 6 in Softmax layers, and class number 0,1, and 2,3,4,5 is corresponding disconnected respectively Through, the output result of staplings, broken hole, foreign matter, greasy dirt, six class fault of folding line.If six class faults are not detected, nothing is represented Fault.
(2) using the data set in VOC formats, inside the XXXX.xml label files in Annotations< object>With<bndbox>Information, which extracts and converts frame information to central point, widens high information, obtains YOLOv2 frames The input label type that frame needs, format are illustrated as:<object-class><x><y><width><height>, preserve all Label information be XXXX.txt, create a Labels file be packed into all XXXX.txt files.Wherein, object- Class indicates that fault classification, x, y indicate that fault center position, width and height indicate that fault is wide and high, and XXXX is indicated Picture number.Then, the textile cloth defect detection model and VOC of the convolutional neural networks based on YOLOv2 frames of foundation are utilized The data set of format and all XXXX.txt files carry out the training of model.
The parameter configuration of model training is:The image width=416 of input, height=416, triple channel.Per a batch point 8 groups, totally 64 images be trained, 80200 batches in total.Meanwhile in order to enable the sample of training is more abundant, for each iteration Training, YOLOv2 can be based on angle (angle), and saturation degree (saturation) exposes (exposure), and tone (hue) generates New training picture.Meanwhile the learning rate of setting is 0.001, learning rate adjustable strategies are steppings, batch be equal to 40000, It is changed when 60000, the mode of variation is the numerical value being multiplied by successively in scales.Meanwhile the network is also provided with shake (jitter) more data are generated, prevent over-fitting on the one hand.
It can check current training batch and progress in real time in the training process, average loss value (avg_ can be observed Loss when) and image hands over and is desired value than the value of (IOU), deconditioning.As shown in Fig. 2 (a) and 2 (b), the embodiment of the present invention After training by 80200 batches, average loss value (avg_loss) is handed over and is reached than (IOU) in 2.0 or so fluctuations, image 0.8 or more, obtain trained detection network.
In trained detection network, the test of test set is carried out under the different total batches of training, in total batch of training The secondary recall rate (Recall) at 10000 times is 83.39%, and rate of precision (Precision) is 83.60%, and image is handed over and compared (IOU) it is 64.65%;Recall rate (Recall) when the total batch of training is at 20000 times is 93.85%, rate of precision (Precision) it is 92.82%, image is handed over and is 75.04% than (IOU);Recall rate when the total batch of training is at 30000 times (Recall) it is 95.82%, rate of precision (Precision) is 91.97%, and image is handed over and is 77.36% than (IOU);In training Total recall rate (Recall) of the batch at 40000 times is 96.19%, and rate of precision (Precision) is 92.98%, and image is handed over And than (IOU) it is 79.30%;Recall rate (Recall) when the total batch of training is at 50000 times is 96.43%, rate of precision (Precision) it is 94.23%, image is handed over and is 80.59% than (IOU);Recall rate when the total batch of training is at 60000 times (Recall) it is 96.68%, rate of precision (Precision) is 94.13%, and image is handed over and is 80.46% than (IOU);In training Total recall rate (Recall) of the batch at 70000 times is 96.31%, and rate of precision (Precision) is 93.88%, and image is handed over And than (IOU) it is 80.13%;Recall rate (Recall) when the total batch of training is at 80000 times is 96.31%, rate of precision (Precision) it is 94.22%, image is handed over and is 80.59% than (IOU);As can be seen that this model is valuing recall rate (Recall) when, training batch be 60000 when, effect is best, thus this model final choice training batch be 60000 when Weight.
(3) textile cloth image is acquired in real time, utilizes the weaving of the trained convolutional neural networks based on YOLOv2 frames Cloth fault detection model is detected, and obtains the defect detection of textile cloth image as a result, partial results are as shown in figure 3, Fig. 3 (a), It is to break to pass through (warp-lacking) that Fig. 3 (b), Fig. 3 (c), Fig. 3 (d), Fig. 3 (e), Fig. 3 (f) correspond to fault type respectively, staplings (weft-lacking), broken hole (hole), foreign matter (sundries), greasy dirt (oil), the testing result of folding line (crease).
As can be seen that the present invention is taken time and effort for traditional artificial defect detection and efficiency is low and existing automatic Detection method is complicated, and complexity is high, it is difficult to which industrially practical drawback establishes a kind of textile cloth based on YOLOv2 Defect detection model and method, the detection model all have prodigious advantage in accuracy and real-time.Identification is accurate, every The defects identification of image only needs 12.5ms or so, substantially increases the performance of existing detection method.
As it will be easily appreciated by one skilled in the art that the foregoing is merely illustrative of the preferred embodiments of the present invention, not to The limitation present invention, all within the spirits and principles of the present invention made by all any modification, equivalent and improvement etc., should all include Within protection scope of the present invention.

Claims (10)

1. a kind of training method of textile cloth defect detection model, which is characterized in that including:
(1) collecting sample textile cloth defect image, to sample textile cloth defect image be marked to obtain fault classification and comprising The true frame of fault, and then data set is established, textile cloth defect detection model is established based on YOLOv2;
(2) dimension cluster is carried out to the true frame that data are concentrated, obtains fixed frame, fixed frame is applied to textile cloth defect detection Model is predicted to obtain prediction block using direct coordinate, and being based on prediction block using loss function carries out penalty values calculating, is predicted Error carries out backpropagation using prediction error, obtains current network weight parameter;
(3) the network weight parameter of current network weight parameter update textile cloth defect detection model is utilized, training is then utilized Collection carries out multiple network weight and calculates and update, and obtains optimal network weight parameter and is examined to get to trained textile cloth fault Survey model.
2. a kind of training method of textile cloth defect detection model as described in claim 1, which is characterized in that the sample is spun Woven fabric defect image includes:Break through image, staplings image, broken hole image, foreign matter image, greasy dirt image and folding line image.
3. a kind of training method of textile cloth defect detection model as claimed in claim 1 or 2, which is characterized in that the spinning Woven fabric defect detection model be based on YOLOv2 frames, 32 layers in total, including 23 Convolutional layers of Conv1~Conv23, 5 Maxpool layers of Max1~Max5, two Route layers of Route1~Route2, a Reorg layers of Reorg1, one Softmax layers of Softmax1, the cascade system of the textile cloth defect detection model be Conv1 be sequentially connected Max1, Conv2, Max2, Conv3~Conv5, Max3, Conv6~Conv8, Max4, Conv9~Conv13, Max5, Conv14~Conv20, Route1, Conv21, Reorg1, Route2, Conv22, Conv23 and Softmax1.
4. such as a kind of training method for textile cloth defect detection model that claim 3 is stated, which is characterized in that the weaving FABRIC DEFECTS Conv1~Conv22 in point detection model carries out batch normalization before carrying out convolution, and Conv1~Conv22 is carrying out convolution Leaky-ReLU activation primitives are used afterwards;Conv23 does not carry out batch normalization before convolution, and linear is used after convolution Activation primitive.
5. a kind of training method of textile cloth defect detection model as claimed in claim 1 or 2, which is characterized in that the spinning Woven fabric defect detection model uses multiple dimensioned training in the training process.
6. a kind of training method of textile cloth defect detection model as claimed in claim 1 or 2, which is characterized in that the step Suddenly (2) include:
(2-1) carries out dimension for the true frame in data set and clusters to obtain cluster frame, using cluster frame and true frame friendship simultaneously Than IOU (box, centroid) obtain distance metric centre deviation value d (box, centroid)=1-IOU (box, Centroid), when distance metric centre deviation value is less than or equal to metric threshold, the width for obtaining fixed frame is high;
Fixed frame is applied to textile cloth defect detection model by (2-2), and the opposite ginseng of pre- measured center is obtained according to the wide height of fixed frame After number and the high relative parameter of width, predict to obtain the centre coordinate of prediction block and the width height of prediction block using direct coordinate;
(2-3) is predicted using the high progress costing bio disturbance of width of centre coordinate of the loss function based on prediction block and prediction block Error carries out backpropagation using prediction error, obtains current network weight parameter.
7. a kind of training method of textile cloth defect detection model as claimed in claim 6, which is characterized in that the direct seat Mark is predicted as:
bx=σ (tx)+cx
by=σ (ty)+cy
Wherein, (bx, by) be prediction block centre coordinate, bwAnd bhThe respectively width and height of prediction block, (tx, ty) it is pre- measured center Relative parameter, twAnd thRespectively predict the high relative parameter of width, σ (tx) and σ (ty) it is its place of prediction block center deviation respectively The distance horizontally and vertically in the upper left corners cell, cxAnd cyRespectively cell where fixed frame center weaves with sample The distance horizontally and vertically in the cloth defect image upper left corner, pwAnd phThe respectively width and height of fixed frame.
8. a kind of training method of textile cloth defect detection model as claimed in claim 6, which is characterized in that the loss letter Number is:
Wherein, loss is prediction error, and the first row formula of loss function indicates to include fault and the grid not comprising fault Confidence level is lost,Include the confidence level of fault, C for i-th of gridiWhether to have fault, C in i-th of gridiIt is 1 or 0,Indicate the prediction block for not including fault in j prediction block in i grid of traversal,It indicates in i grid of traversal J prediction block in include the prediction block of fault;Second row formula of loss function indicates loss and the gradient of class prediction,For the class label of i-th of grid forecasting, pi(c) it is the true class label of i-th of grid, the third line of loss function is public Formula indicates the frame information gradient of prediction block, wiAnd hiIndicate the width and height of true frame in i-th of grid,WithIndicate i-th The width and height of prediction block, (x in a gridi, yi) indicate the centre coordinate of true frame in i-th of grid,Indicate i-th The fourth line formula of the centre coordinate of prediction block in a grid, loss function indicates the gradient not comprising fault prediction block, (pjx, pjy) indicate the centre coordinate for not including j-th of prediction block of fault, pjwAnd pjhIndicate j-th of prediction block not comprising fault Wide and high, l.w and l.h are 13, l.n 5, λnoobj=1, λobj=5, λclass=1, λcoord=1.
9. a kind of textile cloth defect detection model, which is characterized in that the textile cloth defect detection model is appointed by claim 1-8 A kind of training method of textile cloth defect detection model described in one trains to obtain.
10. a kind of application of textile cloth defect detection model as claimed in claim 9, which is characterized in that including:Acquisition in real time Textile cloth image is detected using trained textile cloth defect detection model, obtains the defect detection knot of textile cloth image Fruit.
CN201810238038.0A 2018-03-21 2018-03-21 Textile fabric defect detection model and training method and application thereof Active CN108520114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810238038.0A CN108520114B (en) 2018-03-21 2018-03-21 Textile fabric defect detection model and training method and application thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810238038.0A CN108520114B (en) 2018-03-21 2018-03-21 Textile fabric defect detection model and training method and application thereof

Publications (2)

Publication Number Publication Date
CN108520114A true CN108520114A (en) 2018-09-11
CN108520114B CN108520114B (en) 2020-05-19

Family

ID=63432938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810238038.0A Active CN108520114B (en) 2018-03-21 2018-03-21 Textile fabric defect detection model and training method and application thereof

Country Status (1)

Country Link
CN (1) CN108520114B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460761A (en) * 2018-10-17 2019-03-12 福州大学 Bank card number detection and recognition methods based on dimension cluster and multi-scale prediction
CN109615610A (en) * 2018-11-13 2019-04-12 浙江师范大学 A kind of medical band-aid flaw detection method based on YOLO v2-tiny
CN110197208A (en) * 2019-05-14 2019-09-03 江苏理工学院 A kind of textile flaw intelligent measurement classification method and device
CN110310259A (en) * 2019-06-19 2019-10-08 江南大学 It is a kind of that flaw detection method is tied based on the wood for improving YOLOv3 algorithm
CN111191648A (en) * 2019-12-30 2020-05-22 飞天诚信科技股份有限公司 Method and device for image recognition based on deep learning network
CN111402226A (en) * 2020-03-13 2020-07-10 浙江工业大学 Surface defect detection method based on cascade convolution neural network
CN111553898A (en) * 2020-04-27 2020-08-18 东华大学 Fabric defect detection method based on convolutional neural network
CN111724377A (en) * 2020-06-22 2020-09-29 创新奇智(上海)科技有限公司 Broken yarn detection method, broken yarn detection device, electronic equipment, storage medium and shutdown system
CN111881774A (en) * 2020-07-07 2020-11-03 上海艾豚科技有限公司 Method and system for identifying foreign matters in textile raw materials
CN112036541A (en) * 2020-10-16 2020-12-04 西安工程大学 Fabric defect detection method based on genetic algorithm optimization neural network
CN112215824A (en) * 2020-10-16 2021-01-12 南通大学 YOLO-v 3-based cloth cover defect detection and auxiliary device and method
CN112270252A (en) * 2020-10-26 2021-01-26 西安工程大学 Multi-vehicle target identification method for improving YOLOv2 model
CN113870870A (en) * 2021-12-02 2021-12-31 自然资源部第一海洋研究所 Convolutional neural network-based real-time recognition method for marine mammal vocalization
CN114372968A (en) * 2021-12-31 2022-04-19 江南大学 Defect detection method combining attention mechanism and adaptive memory fusion network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107123107A (en) * 2017-03-24 2017-09-01 广东工业大学 Cloth defect inspection method based on neutral net deep learning
US9760806B1 (en) * 2016-05-11 2017-09-12 TCL Research America Inc. Method and system for vision-centric deep-learning-based road situation analysis
CN107169956A (en) * 2017-04-28 2017-09-15 西安工程大学 Yarn dyed fabric defect detection method based on convolutional neural networks
CN107369155A (en) * 2017-07-24 2017-11-21 广东工业大学 A kind of cloth surface defect detection method and its system based on machine vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9760806B1 (en) * 2016-05-11 2017-09-12 TCL Research America Inc. Method and system for vision-centric deep-learning-based road situation analysis
CN107123107A (en) * 2017-03-24 2017-09-01 广东工业大学 Cloth defect inspection method based on neutral net deep learning
CN107169956A (en) * 2017-04-28 2017-09-15 西安工程大学 Yarn dyed fabric defect detection method based on convolutional neural networks
CN107369155A (en) * 2017-07-24 2017-11-21 广东工业大学 A kind of cloth surface defect detection method and its system based on machine vision

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JUN-FENG JING, ET AL: "基于回归的深度学习的织染布疵点检测的研究", 《TEXTILE BIOENGINEERING AND INFORMATICS SYMPOSIUM PROCEEDINGS (TBIS 2017)》 *
习自: "室内监控场景的对象检测与行为分析方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
张瑞林 等: "基于改进YOLOv2网络的遗留物检测算法", 《浙江理工大学学报(自然科学版)》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460761A (en) * 2018-10-17 2019-03-12 福州大学 Bank card number detection and recognition methods based on dimension cluster and multi-scale prediction
CN109615610A (en) * 2018-11-13 2019-04-12 浙江师范大学 A kind of medical band-aid flaw detection method based on YOLO v2-tiny
CN110197208A (en) * 2019-05-14 2019-09-03 江苏理工学院 A kind of textile flaw intelligent measurement classification method and device
CN110310259B (en) * 2019-06-19 2021-07-27 江南大学 Improved YOLOv3 algorithm-based knot defect detection method
CN110310259A (en) * 2019-06-19 2019-10-08 江南大学 It is a kind of that flaw detection method is tied based on the wood for improving YOLOv3 algorithm
CN111191648A (en) * 2019-12-30 2020-05-22 飞天诚信科技股份有限公司 Method and device for image recognition based on deep learning network
CN111191648B (en) * 2019-12-30 2023-07-14 飞天诚信科技股份有限公司 Method and device for image recognition based on deep learning network
CN111402226A (en) * 2020-03-13 2020-07-10 浙江工业大学 Surface defect detection method based on cascade convolution neural network
CN111553898A (en) * 2020-04-27 2020-08-18 东华大学 Fabric defect detection method based on convolutional neural network
CN111724377A (en) * 2020-06-22 2020-09-29 创新奇智(上海)科技有限公司 Broken yarn detection method, broken yarn detection device, electronic equipment, storage medium and shutdown system
CN111881774A (en) * 2020-07-07 2020-11-03 上海艾豚科技有限公司 Method and system for identifying foreign matters in textile raw materials
CN112036541A (en) * 2020-10-16 2020-12-04 西安工程大学 Fabric defect detection method based on genetic algorithm optimization neural network
CN112215824A (en) * 2020-10-16 2021-01-12 南通大学 YOLO-v 3-based cloth cover defect detection and auxiliary device and method
CN112036541B (en) * 2020-10-16 2023-11-17 西安工程大学 Fabric defect detection method based on genetic algorithm optimization neural network
CN112270252A (en) * 2020-10-26 2021-01-26 西安工程大学 Multi-vehicle target identification method for improving YOLOv2 model
CN113870870A (en) * 2021-12-02 2021-12-31 自然资源部第一海洋研究所 Convolutional neural network-based real-time recognition method for marine mammal vocalization
CN114372968A (en) * 2021-12-31 2022-04-19 江南大学 Defect detection method combining attention mechanism and adaptive memory fusion network
CN114372968B (en) * 2021-12-31 2022-12-27 江南大学 Defect detection method combining attention mechanism and adaptive memory fusion network

Also Published As

Publication number Publication date
CN108520114B (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN108520114A (en) A kind of textile cloth defect detection model and its training method and application
CN107016405B (en) A kind of pest image classification method based on classification prediction convolutional neural networks
CN108830285A (en) A kind of object detection method of the reinforcement study based on Faster-RCNN
CN109711474A (en) A kind of aluminium material surface defects detection algorithm based on deep learning
CN110263705A (en) Towards two phase of remote sensing technology field high-resolution remote sensing image change detecting method
CN106991666B (en) A kind of disease geo-radar image recognition methods suitable for more size pictorial informations
CN113392775B (en) Sugarcane seedling automatic identification and counting method based on deep neural network
CN110276386A (en) A kind of apple grading method and system based on machine vision
CN107437092A (en) The sorting algorithm of retina OCT image based on Three dimensional convolution neutral net
CN107346420A (en) Text detection localization method under a kind of natural scene based on deep learning
CN108334847A (en) A kind of face identification method based on deep learning under real scene
CN111368690B (en) Deep learning-based video image ship detection method and system under influence of sea waves
CN106996935B (en) A kind of multi-level fuzzy judgment Fabric Defects Inspection detection method and system
CN109523520A (en) A kind of chromosome automatic counting method based on deep learning
CN109670528A (en) The data extending method for blocking strategy at random based on paired samples towards pedestrian&#39;s weight identification mission
CN110084165A (en) The intelligent recognition and method for early warning of anomalous event under the open scene of power domain based on edge calculations
CN109446925A (en) A kind of electric device maintenance algorithm based on convolutional neural networks
CN108596203A (en) Optimization method of the pond layer in parallel to pantograph carbon slide surface abrasion detection model
CN107316066A (en) Image classification method and system based on multi-path convolutional neural networks
CN109978918A (en) A kind of trajectory track method, apparatus and storage medium
CN110287806A (en) A kind of traffic sign recognition method based on improvement SSD network
CN110889838A (en) Fabric defect detection method and device
CN109063649A (en) Pedestrian&#39;s recognition methods again of residual error network is aligned based on twin pedestrian
CN106408030A (en) SAR image classification method based on middle lamella semantic attribute and convolution neural network
CN109711401A (en) A kind of Method for text detection in natural scene image based on Faster Rcnn

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