CN109145985A - A kind of detection and classification method of Fabric Defects Inspection - Google Patents
A kind of detection and classification method of Fabric Defects Inspection Download PDFInfo
- Publication number
- CN109145985A CN109145985A CN201810955230.1A CN201810955230A CN109145985A CN 109145985 A CN109145985 A CN 109145985A CN 201810955230 A CN201810955230 A CN 201810955230A CN 109145985 A CN109145985 A CN 109145985A
- Authority
- CN
- China
- Prior art keywords
- cloth
- image
- defects
- detection
- defect
- 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
Links
- 230000007547 defect Effects 0.000 title claims abstract description 130
- 239000004744 fabric Substances 0.000 title claims abstract description 123
- 238000001514 detection method Methods 0.000 title claims abstract description 60
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000007689 inspection Methods 0.000 title abstract description 12
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 11
- 238000007639 printing Methods 0.000 claims abstract description 4
- 238000013527 convolutional neural network Methods 0.000 claims description 24
- 238000001914 filtration Methods 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 10
- 239000013598 vector Substances 0.000 claims description 10
- 238000011176 pooling Methods 0.000 claims description 9
- 238000007781 pre-processing Methods 0.000 claims description 9
- 238000012360 testing method Methods 0.000 claims description 9
- 230000006870 function Effects 0.000 claims description 8
- 238000012549 training Methods 0.000 claims description 8
- 230000000877 morphologic effect Effects 0.000 claims description 6
- 238000000605 extraction Methods 0.000 claims description 5
- 238000013461 design Methods 0.000 claims description 4
- 230000011218 segmentation Effects 0.000 claims description 4
- 230000007797 corrosion Effects 0.000 claims description 3
- 238000005260 corrosion Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 claims description 3
- 230000004927 fusion Effects 0.000 claims description 3
- 230000004044 response Effects 0.000 claims description 3
- 238000005070 sampling Methods 0.000 claims description 3
- 230000000903 blocking effect Effects 0.000 claims description 2
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000004519 manufacturing process Methods 0.000 abstract description 6
- 230000008901 benefit Effects 0.000 abstract description 4
- 238000005516 engineering process Methods 0.000 abstract description 2
- 238000012797 qualification Methods 0.000 abstract 1
- 239000004753 textile Substances 0.000 description 18
- 238000004364 calculation method Methods 0.000 description 5
- 230000009466 transformation Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 230000001537 neural effect Effects 0.000 description 3
- 230000007480 spreading Effects 0.000 description 3
- 238000003892 spreading Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 238000004804 winding Methods 0.000 description 2
- 230000032683 aging Effects 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000007635 classification algorithm Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000000428 dust Substances 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000004438 eyesight Effects 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 238000011179 visual inspection Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/8851—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/8851—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
- G01N2021/8887—Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Evolutionary Biology (AREA)
- Molecular Biology (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Biophysics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Biomedical Technology (AREA)
- Computing Systems (AREA)
- Signal Processing (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Treatment Of Fiber Materials (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
The invention discloses a kind of detection of Fabric Defects Inspection and classification methods, comprising: initialization feeding starts detection system;The single frames input picture for obtaining cloth, is handled image according to the cloth detection algorithm frame based on multithreading;Judge in input picture with the presence or absence of fault, and if it exists, then classify to fault, and Fabric Defects Inspection data are saved in local data base, send defect position data into control system, mark fault;If it does not exist, then image or printing examining report are handled again;Defect position is marked in control system control ink-jet printer;If detection does not complete, reacquire image and image is pre-processed, if detection is completed, prints examining report, manually consult examining report;The method improves the efficiency and accuracy of Fabric Defects Inspection detection, reduces Fabric Defects Inspection detection to the dependence of artificial technology's qualification, reduces production cost, improve the economic benefit of enterprise.
Description
Technical Field
The invention relates to the technical field of visual detection, in particular to a method for detecting and classifying cloth defects.
Background
China is a large country for textile production and export, and the textile industry is the backbone industry of national economy in China. However, in recent years, with the globalization of economy and transformation and upgrade of traditional industries, the industrial basic advantages of textile industry in China have gradually weakened. Currently, the textile industry in China is facing competition of developed countries such as Europe and America at a high-end technical level and countries such as southeast Asia and India at a low-end cheap labor force. Developed countries rely on mature technology and brand, perfect the whole industrial chain, and firmly occupy the high-end market; and other developing countries also occupy most of the low-end markets by virtue of low-cost labor and preferential import and export customs duty.
Due to the fact that the textile industry is poor in working environment, high in working intensity and low in salary treatment, and the aging speed of the population of China is accelerated, the textile industry of China faces the dilemma of labor shortage and capacity shortage. Therefore, in the key period of the transformation and upgrading of the industry in China, the manufacturing industry development planning of the 'Chinese manufacturing 2025' proposed by the ministry of industry and informatization in the future ten years takes the textile industry as the key direction of the future industry upgrading, the traditional processing and labor modes are slowly eliminated, and the novel textile industry which is energy-saving, emission-reducing and industrial automation is vigorously advocated.
In the textile industry, cloth defects directly affect the grading of cloth. The cloth is divided into superior quality, first quality, second quality and inferior quality according to the quality, the price difference of the cloth with different grades is large, generally, the price of the second quality is about 50% of that of the first quality, so the fabric defects seriously affect the economic income of the textile industry. Therefore, the detection of cloth defects is particularly important in the quality control of textiles. For a long time, the quality detection of the cloth is mainly completed manually, and the detection speed is about 15-20 meters per minute. Because manual detection seriously depends on the inspection and proficiency of cloth inspecting personnel, the stability and consistency of evaluation standards are poor, and the phenomena of false detection and missed detection are frequently generated. Even a skilled cloth inspector can only find about 70% of the defects as investigated. In addition, the defects of the cloth are tedious to detect, and the eyesight of cloth inspection workers is seriously damaged, so that the automatic cloth inspection system is a necessary way for improving the production efficiency, saving the labor cost and upgrading the transformation of the industry in the textile industry.
At present, although the quantity of textile industry in China is large, the degree of automation is still not high, particularly in the aspects of cloth defect detection and automatic feeding and discharging, and semi-automatic cloth inspecting machines are mostly adopted for cloth defect detection, namely, the modes of automatic transmission, cutting, manual visual inspection and manual marking are adopted. A textile mill with ten looms needs to be equipped with 2 semi-automatic cloth inspectors and 4 professional technical workers, and the cost is calculated to be about 50 ten thousand per year, so that most small and medium-sized textile enterprises cannot accept the high cost. With the rapid issue of the 3C industry, the adoption of a camera to proxy human eyes for visual detection of cloth defects becomes an inevitable trend in the development of the textile industry. At present, cloth defect detection is always a hot research direction at home and abroad.
It is seen that improvements and enhancements to the prior art are needed.
Disclosure of Invention
In view of the defects of the prior art, the invention aims to provide a method for detecting defects of cloth based on Gabor wavelets and a method for classifying the defects based on a convolutional neural network, and aims to solve the problems that manual inspection efficiency of the cloth is low, cost is high, and inspection omission easily occurs in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a cloth defect detecting and classifying method comprises the following steps:
s001, initializing feeding and starting a detection system;
s002, acquiring a single-frame input image of the cloth, and processing the image according to a multi-thread-based cloth detection algorithm framework;
s003, judging whether the input image has defects, if so, classifying the defects, storing the cloth defect data into a local database, sending the defect position data to a control system, and executing the step S004; if not, go to step S005;
s004, controlling an ink-jet printer to mark the positions of the defects by a control system;
and S005, if the detection is not finished, re-executing the step S002 to enter the next cycle operation, and if the detection is finished, printing a detection report and manually consulting the detection report.
In the method for detecting and classifying the cloth defects, the cloth defects are detected based on a Gabor wavelet feature extraction method, and the defects are classified based on a convolutional neural network.
In the method for detecting and classifying the cloth defects, after a single frame image of the cloth is acquired in the detection of the cloth defects, the following operations are sequentially executed:
dividing the acquired single cloth frame image into a plurality of sub-images;
image preprocessing, namely preprocessing external noise of each sub-image by adopting a 5 multiplied by 5 mask mean value filtering method or a median value filtering method;
extracting features, namely, extracting the features of the preprocessed sub-images through a multi-scale and multidirectional Gabor filter bank;
reducing the dimension of the characteristic, namely reducing the dimension of the energy characteristic diagram passing through the Gabor filter bank, gridding the cloth subimage obtained by preprocessing, wherein the gridding granularity is 8 multiplied by 8, and taking the mean value of the characteristic vectors obtained by Gabor conversion of each pixel point in each grid as the characteristic vector of the cloth subimage grid;
data fusion, namely normalizing the local energy estimation graphs of the responses of the filters in the Gabor filter bank and fusing the normalized local energy estimation graphs into a single image;
performing binarization on the image, separating and binarizing the defect area from the fused image background by an OTSU Otsu method, and performing defect segmentation;
and (3) morphological processing, namely removing noise spots from the segmented image by using a morphological method, and performing expansion or corrosion operation on the defect area in the image to make the defect area more obvious.
In the method for detecting and classifying the cloth defects, the image blocking comprises decomposing the acquired single-frame image of the cloth with the size of 4096 x 1024 into sub-images with the size of 256 x 256.
In the method for detecting and classifying the cloth defects, the Gabor filter bank comprises a Gabor filter bank with 3 dimensions and 6 directions.
In the method for detecting and classifying cloth defects, the classification of the defects comprises:
sample marking, namely collecting a plurality of pieces of cloth containing various defects and a plurality of pieces of cloth without defects, marking the types of the defects by using a method for detecting the defects of the cloth, and respectively setting labels according to the types of the defects and the pieces of cloth without the defects;
the network structure design is characterized in that 11 layers of convolutional neural networks are arranged, wherein the first layer is an input layer, the second, fourth and sixth layers are convolutional layers, the third, fifth and seventh layers are pooling layers, the eighth, ninth and tenth layers are connecting layers, and the eleventh layer is an output layer;
off-line learning, inputting the image of the marked cloth sample into an input layer of a convolutional neural network, training a convolutional neural network model, adopting a momentum random gradient descent algorithm, adjusting model parameters, calculating a network training error by adopting a Cross Entropy (Cross-Entropy) loss function, setting a learning rate to be 0.01, setting a weight to be 0.0005, using a batch-size to be 64, setting a momentum factor to be 0.9, and setting a dropout discarding rate to be 0.3;
and (3) carrying out online detection, namely inputting the collected test sample image into an input layer of the convolutional neural network, identifying the test sample image through a mature convolutional neural network model, and outputting a result.
In the method for detecting and classifying the cloth defects, a convolution kernel of 3 x 3 is adopted in the convolution neural network, the step length is set to be 1, 0 pixel is extended at the edge, and the sampling window of a pooling layer is 2 x 2.
In the cloth defect detection and classification method, the convolution layers are activated by using a ReLU function, each convolution layer comprises 2 convolution units, and the convolution units are connected by using dropout layers.
In the method for detecting and classifying the cloth defects, a softmax regression classifier is adopted as the output of a whole convolutional neural network model in the network structure design.
Has the advantages that:
the invention provides a cloth defect detection and classification method, wherein the cloth defect detection adaptively detects various defects existing in cloth through Gabor wavelet, and improves the real-time performance of an algorithm on the premise of meeting the requirements of accuracy and universality; the classification method adopts the convolutional neural network to carry out autonomous learning on various defects, avoids the influence of manual interference, and has good characteristic learning capability and stronger robustness; the method improves the efficiency and accuracy of detecting the cloth defects, reduces the dependence of the cloth defects on the skill level of the manual technique, reduces the production cost and improves the economic benefit of enterprises.
Drawings
Fig. 1 is a flowchart of the method for detecting and classifying cloth defects according to the present invention.
Figure 2 is a flow chart of the cloth defect detection algorithm.
Figure 3 is a flow chart of the cloth defect classification algorithm.
Fig. 4 is a diagram of the cloth defect detection effect.
Detailed Description
The present invention provides a method for detecting and classifying cloth defects, which is described in further detail below with reference to the accompanying drawings and examples in order to make the objects, technical solutions and effects of the present invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1-4, the present invention provides a method for detecting and classifying defects of cloth, comprising:
s001, initializing feeding, and manually winding cloth by leading a cloth head to sequentially pass through a material passing and edge spreading roller, a material passing and edge spreading roller and a winding and edge spreading pipe wheel by a worker; starting a detection system;
s002, acquiring a single-frame input image of the cloth, and processing the image according to a multi-thread-based cloth detection algorithm framework;
s003, judging whether the input image has defects, if so, classifying the defects, storing the cloth defect data into a local database, sending the defect position data to a control system, and executing the step S004; if not, go to step S005;
s004, controlling an ink-jet printer to mark the positions of the defects by a control system;
and S005, if the detection is not finished, re-executing the step S002 to enter the next cycle operation, and if the detection is finished, printing a detection report and manually consulting the detection report. If the detection result needs to be verified, a manual cloth inspecting machine can be added to verify the detection result.
As shown in fig. 2, in particular, the detection of the cloth defects is based on a Gabor wavelet feature extraction method, and the classification of the defects is based on a convolutional neural network.
Further, in the detection of the cloth defects, after a single frame image of the cloth is acquired, the following operations are sequentially performed:
dividing the acquired single cloth frame image into a plurality of sub-images;
in one embodiment, the size of 4096 × 1024 image collected by the camera is decomposed into 256 × 256 sub-images, which reduces the data amount of a single image and greatly reduces the amount of calculation.
Image preprocessing, namely processing surface noise, adding 30 white noise to an image, and comparing the processing effects of mean filtering and median filtering, wherein the mean filtering adopts a neighborhood average method, the median filtering selects a square window, and both the mean filtering and the median filtering adopt a 5 multiplied by 5 mask for preprocessing;
and (3) feature extraction, namely filtering the preprocessed sub-images through a self-adaptive Gabor filter bank to obtain filtered images in all directions and scales. By analyzing the texture period and the frequency spectrum characteristics of the cloth to be detected, the Gabor filter bank is preferably a 3-scale 6-direction Gabor filter bank, the cloth is subjected to characteristic extraction in multiple frequency bands and multiple directions, the number of filters is reduced as far as possible on the premise of ensuring the detection precision, and the detection speed is improved;
performing convolution operation on an input image I (x, y) and the real parts and the imaginary parts of 18 Gabor filters respectively, wherein the calculation mode is shown as formula (1), and obtaining a filtered image:
(1)
wherein,representing the filtered image, p representing the number of scales of the filter bank, q representing the number of directions of the filter bank;is the real part of the Gabor filter,for the imaginary part of the filter, "+" denotes the convolution operation.
Wherein the 3 center frequencies are respectively f1=1/8, f2=1/4, f3= 1/2; the 6 rotation angles are 0, pi/6, 2 pi/6, 3 pi/6, 4 pi/6 and 5 pi/6 respectively. The convolution kernel size is 9 × 9.
After the sub-images are processed after being filtered, the normal texture of the cloth is inhibited, the energy of the defect area is enhanced, then the energy information of each pixel in the filtered image is obtained, and the calculation mode is shown as formula (2):
(2)
wherein E represents the energy of each pixel in the filtered image,which represents the image after the filtering, is,
m × N represents an image size.
Reducing dimension of the features, namely, reducing dimension of the energy feature map passing through the Gabor filter bank, wherein after the sub-image with the size of 256 multiplied by 256 passes through 18 Gabor filters, the dimension of the Gabor feature of the image is 1179648 (256 multiplied by 18), if the feature vector with high dimension is directly subjected to subsequent processing, the operation amount is very large, and the operation efficiency is influenced; moreover, the feature vector with too high dimension contains a large amount of redundant information, which affects the detection accuracy, so that the dimension reduction of the high-dimensional Gabor feature vector obtained through Gabor transformation is required. Gridding the cloth subimages obtained by preprocessing, wherein the gridding granularity is 8 multiplied by 8, taking the mean value of the feature vector obtained by Gabor transformation of each pixel point in each grid as the feature vector of the cloth subimage grid, and reducing the dimension of the feature vector to 18432 (32 multiplied by 18), thereby greatly reducing the operation amount;
data fusion, namely normalizing the local energy estimation graphs of the responses of the filters in the Gabor filter bank and fusing the normalized local energy estimation graphs into a single image; the Gabor filter bank designed by the invention decomposes a plurality of 256 multiplied by 256 sub-images into 18 filter images with 3 scales and 6 directions, each filter image contains energy information of partial defects, and the filter images in all scales and all directions are fused into a single image, so that all information of various defects is integrated, thereby describing the frequency characteristics of various defects, enhancing the energy of various defect regions and distinguishing the defect regions from normal textures.
Firstly, a detection algorithm fuses filtering images with different scales in the same direction through an arithmetic mean value, and the calculation method is as shown in formula (3):
(3)
wherein, p =3,representing a Gabor filtered image,the images fused by arithmetic mean are shown. And p is the filter bank scale index and takes the values of 0, 1 and 2.
And then fusing the images in different directions through a geometric mean value, as shown in a formula (4), obtaining an image containing all information of the defects:
(4)
where Q =6, S (x, y) represents the image fused by the geometric mean, and Q represents the filter bank direction index, and takes values of 0, 1, 2, 3, and 4.
Performing image binarization, namely obtaining an image containing comprehensive information of the defects after image data in the 3-dimension 6-direction is fused, then separating the defect area from the background of the fused image by an OTSU Otsu method (maximum inter-class variance method), performing binarization, and performing defect segmentation; in one embodiment, a defect pixel corresponds to a logical "1" appearing as white, and a normal texture corresponds to a logical "0" appearing as black; a large number of experiments prove that the algorithm has a good segmentation effect and can clearly distinguish the defects.
And (3) morphological processing, namely removing noise spots from the segmented image by using a morphological method, and performing expansion or corrosion operation on the defect area in the image to make the defect area more obvious.
As shown in fig. 3, in the method for detecting and classifying a cloth defect, the classification of the defect includes:
sample marking, namely collecting a plurality of pieces of cloth containing various defects and a plurality of pieces of cloth without defects, marking the types of the defects by using a method for detecting the defects of the cloth, and respectively setting labels according to the types of the defects and the pieces of cloth without the defects;
in one embodiment, cloth with 20 types of defect samples is selected in a textile mill, wherein the cloth comprises 15000 pieces of cloth such as broken warps, broken wefts, broken holes, oil stains, flying needles and the like, and 1000 pieces of normal cloth without defects, 256 images of the cloth are obtained through the detection method, the defect parts are marked by using marking software, the defect images are uniformly divided into 32 x 32 sizes, and labels are set, wherein the label names are defect types or normal cloth; a total of 2100 specimens from the above 21 categories (including normal piece goods, 100 specimens from each category of defects) were also selected for experimental testing.
The network structure design is characterized in that 11 layers of convolutional neural networks are arranged, wherein the first layer is an input layer, the second, fourth and sixth layers are convolutional layers, the third, fifth and seventh layers are pooling layers, the convolutional layers and the pooling layers are overlapped for three times, the eighth, ninth and tenth layers are connecting layers, and the eleventh layer is an output layer; the convolutional neural network adopts a convolution kernel of 3 multiplied by 3, the step length is set to be 1 so as to obtain detailed characteristic information, the edge is expanded by 0 pixel, the pooling layer adopts a maximum pooling method, and the sampling window is 2 multiplied by 2.
Wherein, the input layer is RGB three-channel cloth image of 32 x 32, 3 convolution layers are respectively: c1, C2, and C3, all activated using a ReLU function (Rectified Linear Unit). The 3 pooling layers are respectively: p1, P2 and P3. Each large convolution layer CX comprises 2 small convolution units C1-1 and C1-2, the small convolution units are connected by a dropout layer, and the dropout layer is added to reduce the calculation amount of the network and effectively control overfitting. The number of the characteristic graphs is consistent with the number of the convolution layers. The 3 fully-connected layers are respectively F1, F2 and F3, wherein F1 contains 1024 implicit neural nodes, F2 contains 512 implicit neural nodes, F3 contains 21 implicit neural nodes, and the network finally adopts a Softmax regression classifier as the output of the whole convolution model.
The network structure is shown in table 1, maps representing the profile and 1 representing the step size.
TABLE 1 network configuration of convolutional model structure for identifying cloth defects
Offline learning, namely inputting the marked 15000 images of 32 × 32 cloth defect samples and 1000 images of defect-free cloth samples into an input layer of a convolutional neural network, training a convolutional neural network model, adopting a momentum stochastic gradient descent algorithm, adjusting model parameters, adopting a Cross Entropy (Cross-Entropy) loss function to calculate a network training error, setting a learning rate to be 0.01, setting a weight to be 0.0005, using a batch-size to be 64, setting a momentum factor to be 0.9, and setting a dropoff rate to be 0.3; the network parameter settings are shown in table 2.
Table 2 cloth defect identification convolution model structure network parameter settings
Wherein the Cross Entropy loss function (Cross-Entropy) is of the form:
(5)
wherein,andrepresenting the simulated and actual values of the training sample. The smaller the loss function, the better the model training and the more convergent the results.
And (3) performing on-line inspection, and selecting ten cloth defects of slubs, flying needles, broken needles, lack of warps, skip yarns, dust, stains, dense roads, lack of wefts and broken holes and normal cloth as actual test samples. Wherein 100 pieces of defect samples of each type and 100 pieces of normal cloth are 1100 pieces in total, the images of the collected test samples are input into an input layer of a convolutional neural network, the images of the test samples are identified through a mature convolutional neural network model, and results are output; the test result shows that the accuracy of the result obtained by adopting the classification mode reaches 99.5 percent, and the quality and the efficiency of cloth inspection in the textile industry are greatly improved.
It should be understood that equivalents and modifications of the technical solution and inventive concept thereof may occur to those skilled in the art, and all such modifications and alterations should fall within the scope of the appended claims.
Claims (9)
1. A method for detecting and classifying cloth defects, comprising:
s001, initializing feeding and starting a detection system;
s002, acquiring a single-frame input image of the cloth, and processing the image according to a multi-thread-based cloth detection algorithm framework;
s003, judging whether the input image has defects, if so, classifying the defects, storing the cloth defect data into a local database, sending the defect position data to a control system, and executing the step S004; if not, go to step S005;
s004, controlling an ink-jet printer to mark the positions of the defects by a control system;
and S005, if the detection is not finished, re-executing the step S002 to enter the next cycle operation, and if the detection is finished, printing a detection report and manually consulting the detection report.
2. A cloth defect detection and classification method according to claim 1, characterized in that said cloth defect detection is based on a Gabor wavelet feature extraction method and said defect classification is based on a convolutional neural network.
3. A method of detecting and classifying cloth defects according to claim 1, wherein in said detecting of cloth defects, after acquiring a single frame image of cloth, the following operations are performed in sequence:
dividing the acquired single cloth frame image into a plurality of sub-images;
image preprocessing, namely preprocessing external noise of each sub-image by adopting a 5 multiplied by 5 mask mean value filtering method or a median value filtering method;
extracting features, namely, extracting the features of the preprocessed sub-images through a multi-scale and multidirectional Gabor filter bank;
reducing the dimension of the characteristic, namely reducing the dimension of the energy characteristic diagram passing through the Gabor filter bank, gridding the cloth subimage obtained by preprocessing, wherein the gridding granularity is 8 multiplied by 8, and taking the mean value of the characteristic vectors obtained by Gabor conversion of each pixel point in each grid as the characteristic vector of the cloth subimage grid;
data fusion, namely normalizing the local energy estimation graphs of the responses of the filters in the Gabor filter bank and fusing the normalized local energy estimation graphs into a single image;
performing binarization on the image, separating and binarizing the defect area from the fused image background by an OTSU Otsu method, and performing defect segmentation;
and (3) morphological processing, namely removing noise spots from the segmented image by using a morphological method, and performing expansion or corrosion operation on the defect area in the image to make the defect area more obvious.
4. A cloth defect detection and classification method according to claim 3, characterized in that said image blocking comprises decomposing a single frame image of the acquired cloth of 4096 x 1024 size into sub-images of 256 x 256 size.
5. A cloth defect detection and classification method as defined in claim 3, characterized in that said Gabor filter bank comprises a 3-scale 6-direction Gabor filter bank.
6. A method of detecting and classifying cloth defects according to claim 2 and characterized in that said classification of defects comprises:
sample marking, namely collecting a plurality of pieces of cloth containing various defects and a plurality of pieces of cloth without defects, marking the types of the defects by using a method for detecting the defects of the cloth, and respectively setting labels according to the types of the defects and the pieces of cloth without the defects;
the network structure design is characterized in that 11 layers of convolutional neural networks are arranged, wherein the first layer is an input layer, the second, fourth and sixth layers are convolutional layers, the third, fifth and seventh layers are pooling layers, the eighth, ninth and tenth layers are connecting layers, and the eleventh layer is an output layer;
off-line learning, inputting the image of the marked cloth sample into an input layer of a convolutional neural network, training a convolutional neural network model, adopting a momentum random gradient descent algorithm, adjusting model parameters, calculating a network training error by adopting a Cross Entropy (Cross-Entropy) loss function, setting a learning rate to be 0.01, setting a weight to be 0.0005, using a batch-size to be 64, setting a momentum factor to be 0.9, and setting a dropout discarding rate to be 0.3;
and (3) carrying out online detection, namely inputting the collected test sample image into an input layer of the convolutional neural network, identifying the test sample image through a mature convolutional neural network model, and outputting a result.
7. A cloth defect detection and classification method according to claim 6, characterized in that a convolution kernel of 3 x 3 is used in said convolutional neural network, the step size is set to 1, the edge is extended by 0 pixels, and the sampling window of the pooling layer is 2 x 2.
8. A method of detecting and classifying cloth defects according to claim 6, characterized in that said convolutional layers are activated using the ReLU function, each convolutional layer comprising 2 convolutional units, which are concatenated using dropout layers.
9. A method of detecting and classifying cloth defects according to claim 6 and wherein said network architecture is designed with a softmax regression classifier as the output of the entire convolutional neural network model.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810955230.1A CN109145985A (en) | 2018-08-21 | 2018-08-21 | A kind of detection and classification method of Fabric Defects Inspection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810955230.1A CN109145985A (en) | 2018-08-21 | 2018-08-21 | A kind of detection and classification method of Fabric Defects Inspection |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109145985A true CN109145985A (en) | 2019-01-04 |
Family
ID=64790713
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810955230.1A Pending CN109145985A (en) | 2018-08-21 | 2018-08-21 | A kind of detection and classification method of Fabric Defects Inspection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109145985A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109858536A (en) * | 2019-01-22 | 2019-06-07 | 江苏恒力化纤股份有限公司 | A method of the offline automatic detection long filament silk end of reel bar silk |
CN110415222A (en) * | 2019-07-16 | 2019-11-05 | 东华大学 | A kind of spinning cake side face defects recognition methods based on textural characteristics |
CN110570397A (en) * | 2019-08-13 | 2019-12-13 | 创新奇智(重庆)科技有限公司 | Method for detecting ready-made clothes printing defects based on deep learning template matching algorithm |
CN111337506A (en) * | 2020-03-30 | 2020-06-26 | 河南科技学院 | Intelligent device for clothes quality inspection |
CN112082998A (en) * | 2019-06-14 | 2020-12-15 | 绍兴庞纳微电子科技有限公司 | Online detection method and device for broken hole defects and long defects of knitted fabrics |
CN112098409A (en) * | 2020-09-17 | 2020-12-18 | 国网河南省电力公司濮阳供电公司 | Hydrophobicity live-line testing method for composite insulator of power transmission line |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102879401A (en) * | 2012-09-07 | 2013-01-16 | 西安工程大学 | Method for automatically detecting and classifying textile flaws based on pattern recognition and image processing |
CN106970090A (en) * | 2017-04-27 | 2017-07-21 | 佛山市南海区广工大数控装备协同创新研究院 | Embryo cloth defective vision detection device and method |
CN107369155A (en) * | 2017-07-24 | 2017-11-21 | 广东工业大学 | A kind of cloth surface defect detection method and its system based on machine vision |
CN107402221A (en) * | 2017-08-08 | 2017-11-28 | 广东工业大学 | A kind of defects of display panel recognition methods and system based on machine vision |
-
2018
- 2018-08-21 CN CN201810955230.1A patent/CN109145985A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102879401A (en) * | 2012-09-07 | 2013-01-16 | 西安工程大学 | Method for automatically detecting and classifying textile flaws based on pattern recognition and image processing |
CN106970090A (en) * | 2017-04-27 | 2017-07-21 | 佛山市南海区广工大数控装备协同创新研究院 | Embryo cloth defective vision detection device and method |
CN107369155A (en) * | 2017-07-24 | 2017-11-21 | 广东工业大学 | A kind of cloth surface defect detection method and its system based on machine vision |
CN107402221A (en) * | 2017-08-08 | 2017-11-28 | 广东工业大学 | A kind of defects of display panel recognition methods and system based on machine vision |
Non-Patent Citations (2)
Title |
---|
邹超: "《布匹疵点在线检测系统研究》", 《中国博士学位论文全文数据库 信息科技辑》 * |
高广帅: "《基于低秩稀疏矩阵分解的织物疵点检测算法研究》", 《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109858536A (en) * | 2019-01-22 | 2019-06-07 | 江苏恒力化纤股份有限公司 | A method of the offline automatic detection long filament silk end of reel bar silk |
CN112082998A (en) * | 2019-06-14 | 2020-12-15 | 绍兴庞纳微电子科技有限公司 | Online detection method and device for broken hole defects and long defects of knitted fabrics |
CN110415222A (en) * | 2019-07-16 | 2019-11-05 | 东华大学 | A kind of spinning cake side face defects recognition methods based on textural characteristics |
CN110570397A (en) * | 2019-08-13 | 2019-12-13 | 创新奇智(重庆)科技有限公司 | Method for detecting ready-made clothes printing defects based on deep learning template matching algorithm |
CN111337506A (en) * | 2020-03-30 | 2020-06-26 | 河南科技学院 | Intelligent device for clothes quality inspection |
CN112098409A (en) * | 2020-09-17 | 2020-12-18 | 国网河南省电力公司濮阳供电公司 | Hydrophobicity live-line testing method for composite insulator of power transmission line |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109145985A (en) | A kind of detection and classification method of Fabric Defects Inspection | |
Silvestre-Blanes et al. | A public fabric database for defect detection methods and results | |
CN110349126B (en) | Convolutional neural network-based marked steel plate surface defect detection method | |
CN111402226A (en) | Surface defect detection method based on cascade convolution neural network | |
CN108090494B (en) | Textile defect identification method based on Gabor filter and support vector machine | |
CN111311542A (en) | Product quality detection method and device | |
CN108765412A (en) | A kind of steel strip surface defect sorting technique | |
CN108364291A (en) | Grey cloth rapid detection method based on computer vision technique | |
CN107369155A (en) | A kind of cloth surface defect detection method and its system based on machine vision | |
CN110335262A (en) | A kind of printed matter automatic defect classification method in machine vision | |
CN116823817B (en) | Textile jacquard defect detection method and system based on deep learning | |
CN101739570A (en) | Cotton foreign fiber online classifying method and system | |
CN101482927B (en) | Foreign fiber fuzzy classification system and method based on automatic vision detection | |
CN110349125A (en) | A kind of LED chip open defect detection method and system based on machine vision | |
CN114445365A (en) | Banknote printing quality inspection method based on deep learning algorithm | |
CN111861990A (en) | Method, system and storage medium for detecting bad appearance of product | |
CN113962929A (en) | Photovoltaic cell assembly defect detection method and system and photovoltaic cell assembly production line | |
CN116228651A (en) | Cloth defect detection method, system, equipment and medium | |
CN111127448A (en) | Model and method for detecting air spring fault based on isolated forest | |
Shiau et al. | Classifying web defects with a back-propagation neural network by color image processing | |
CN117115138A (en) | Intelligent control system and method in clothing production process | |
CN110570397B (en) | Method for detecting ready-made clothes printing defects based on deep learning template matching algorithm | |
CN115266732B (en) | Carbon fiber tow defect detection method based on machine vision | |
CN116029979A (en) | Cloth flaw visual detection method based on improved Yolov4 | |
CN111402225A (en) | Cloth folding false detection defect discrimination method |
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: 20190104 |
|
RJ01 | Rejection of invention patent application after publication |