CN114154552A - Method, device, medium and equipment for detecting grading and color separation of ceramic tiles - Google Patents
Method, device, medium and equipment for detecting grading and color separation of ceramic tiles Download PDFInfo
- Publication number
- CN114154552A CN114154552A CN202111230747.2A CN202111230747A CN114154552A CN 114154552 A CN114154552 A CN 114154552A CN 202111230747 A CN202111230747 A CN 202111230747A CN 114154552 A CN114154552 A CN 114154552A
- Authority
- CN
- China
- Prior art keywords
- tile
- image
- layer
- color separation
- grading
- 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
- 239000000919 ceramic Substances 0.000 title claims abstract description 63
- 238000000926 separation method Methods 0.000 title claims abstract description 63
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000001514 detection method Methods 0.000 claims abstract description 76
- 238000012549 training Methods 0.000 claims abstract description 36
- 238000013527 convolutional neural network Methods 0.000 claims abstract description 29
- 238000007781 pre-processing Methods 0.000 claims abstract description 28
- 238000012360 testing method Methods 0.000 claims abstract description 15
- 238000011176 pooling Methods 0.000 claims description 43
- 230000007547 defect Effects 0.000 claims description 36
- 238000012545 processing Methods 0.000 claims description 22
- 238000003708 edge detection Methods 0.000 claims description 21
- 230000000877 morphologic effect Effects 0.000 claims description 21
- 238000009826 distribution Methods 0.000 claims description 18
- 230000006870 function Effects 0.000 claims description 14
- 238000001914 filtration Methods 0.000 claims description 13
- 238000004422 calculation algorithm Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 7
- 230000009466 transformation Effects 0.000 claims description 7
- 230000003628 erosive effect Effects 0.000 claims description 6
- 238000013507 mapping Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 4
- 238000003860 storage Methods 0.000 claims description 4
- 230000008859 change Effects 0.000 claims description 3
- 238000004519 manufacturing process Methods 0.000 abstract description 10
- 230000004044 response Effects 0.000 abstract description 5
- 230000000694 effects Effects 0.000 description 5
- 238000012795 verification Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000004913 activation Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000002790 cross-validation Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 238000011423 initialization method Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 206010036872 Prolonged labour Diseases 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 239000011449 brick Substances 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000005034 decoration Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000010339 dilation Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000009394 selective breeding Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 239000004575 stone Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a method, a device, a medium and equipment for detecting the grading and color separation of a ceramic tile; the method comprises the following steps: acquiring a tile image to be identified; preprocessing the tile image; inputting the preprocessed tile image into a tile grading and color separation detection network model, and outputting the tile grade type by the tile grading and color separation detection network model; the tile grading and color separation detection network model is obtained by training and testing an initial convolutional neural network model. The method comprises the steps of carrying out grading and color separation detection on ceramic tiles based on a convolutional neural network model, and carrying out grade type division on the quality of the ceramic tiles; the human resources can be saved and the detection efficiency can be improved; the operation speed is high, and the response requirement of a high-speed production line can be met; the classification accuracy is high, and errors in manual classification can be avoided.
Description
Technical Field
The invention relates to the technical field of tile detection, in particular to a tile grading and color separation detection method, a device, a medium and equipment.
Background
Along with the development of decoration industry, the demand for ceramic tiles is gradually increased, and the quality requirement for the ceramic tiles is higher and higher. In the production process of the ceramic tile, due to the fact that the manufacturing process is improper and collision is caused in the conveying process, surface defects such as cracks, stains, scratches, pinholes, cavities and uneven colors of the ceramic tile and geometric defects such as unqualified sizes, uneven surfaces and edge breakage occur. The method is an important link in the ceramic tile manufacturing process, but is mainly completed manually at present.
The tile grading and color separation currently depends on artificial sense to carry out subjective judgment, and human visual sense can be influenced by other factors, so that great uncertainty exists; each detection personnel has long labor time, and in the face of a high-speed production line with various tiles of 30pcs/min or even faster, the production line continuously compares the tiles with standard sample tiles, and selects out the tiles with surface defects or geometric defects, so that the working intensity is high, the fatigue is easy, the eye sensitivity can be reduced after a long time, and the accuracy is reduced.
In recent years, the development of artificial intelligence technology has been rapidly advanced, and the artificial intelligence technology has become the most hot point in the technical field. The method makes great progress in the fields of target detection, intelligent robots, significance detection and the like. The powerful learning ability and feature extraction ability based on deep learning in a large amount of data have been applied to industrial product detection. The intelligent detection equipment replaces the manual work to carry out the tile grading and color separation detection is inevitable in the industry development, and the artificial intelligence technology replaces the traditional machine vision technology to be inevitable in the tile grading and color separation detection development.
The convolutional neural network model is a foundation stone which can achieve breakthrough results in the field of computer vision through deep learning in recent years, has high accuracy in the problem of image recognition, and has a method applied to the field of tile surface detection at present. For example, the Chinese invention patent "a tile surface defect identification method based on a convolutional neural network model and active learning" (publication number: CN108038853A) includes the following steps: acquiring and preprocessing a surface image of a ceramic tile containing defects; establishing a training set; building and training a convolutional neural network model; actively learning; model iteration is carried out; and (5) online detection. The method is based on a convolutional neural network model and active learning, avoids artificial selection of features through the convolutional neural network model, reduces the artificial marking amount of a sample by combining the active learning, and realizes the identification of the surface defect type of the ceramic tile. However, the method only identifies the type of the defect on the surface of the ceramic tile, does not perform grade division on the quality of the ceramic tile, does not perform grading and color separation detection on the ceramic tile, and cannot solve the technical problem of automation of grading and color separation detection of the ceramic tile.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention aims to provide a method, a device, a medium and equipment for detecting the grading and color separation of ceramic tiles; the method comprises the steps of carrying out grading and color separation detection on ceramic tiles based on a convolutional neural network model, and carrying out grade type division on the quality of the ceramic tiles; the human resources can be saved and the detection efficiency can be improved; the operation speed is high, and the response requirement of a high-speed production line can be met; the classification accuracy is high, and errors in manual classification can be avoided.
In order to achieve the purpose, the invention is realized by the following technical scheme: a tile grading and color separation detection method is characterized by comprising the following steps: the method comprises the following steps:
acquiring a tile image to be identified; preprocessing the tile image;
inputting the preprocessed tile image into a tile grading and color separation detection network model, and outputting the tile grade type by the tile grading and color separation detection network model; the tile grading and color separation detection network model is obtained by training and testing an initial convolutional neural network model;
the method for preprocessing the tile image comprises the following steps:
carrying out gray level transformation on the tile image to obtain an initial gray level image;
carrying out median filtering processing on the initial gray level image to obtain a filtered gray level image so as to remove noise;
carrying out histogram equalization processing on the filtered gray level image to obtain an equalized image so as to improve the contrast, thereby increasing the uniformity degree of gray level distribution, increasing the contrast definition of the defect outline and the ceramic tile background and increasing the contrast of the ceramic tile patterns and the ceramic tile background;
and (3) adopting a multi-scale morphological edge detection algorithm to separate the tile patterns and the defect outline from the tile background to obtain an edge image with complete tile patterns and defect outline.
The method comprises the steps of carrying out grading and color separation detection on the ceramic tiles based on a convolutional neural network model, and carrying out grade type division on the ceramic tile quality; the human resources can be saved and the detection efficiency can be improved; the operation speed is high, and the response requirement of a high-speed production line can be met; the classification accuracy is high, and errors in manual classification can be avoided.
Preprocessing the tile image is beneficial to eliminating or reducing noise, improving contrast, smoothing or sharpening the image, and the like. The initial gray level image obtained by performing gray level conversion on the tile image has the advantages of small memory occupation, high operation speed, more convenient processing and the like. The median filtering is to sort the pixel values in the range and replace the pixel values of the noise points with the median values, which has good effect on removing the noise. The histogram equalization is utilized to perform equalization processing on the image, so that the image contrast is improved, the gray distribution is more uniform, the contrast between the defect outline and the background is clearer, and the contrast between the pattern and the background is larger.
Preferably, in the preprocessing of the tile image, the histogram equalization processing refers to:
setting the filtering gray level image to 0-255 original gray levels;
calculating the histogram distribution probability P (i) of the original gray level i:
wherein N is the total number of pixels of the filtered gray image, NiThe total number of pixels of the original gray level i in the filtered gray image;
calculating histogram probability accumulated value S (i) of original gray level i:
calculating an equalized gray level SS (i) in an equalized image corresponding to the original gray level i:
SS(i)=int{[max(pix)-min(pix)]*S(i)+0.5};
wherein pix refers to the gray value in the filtered gray image;
and mapping the equalized gray levels SS (i) to the equalized images one by one according to the corresponding relation between the equalized gray levels SS (i) and the gray levels of the gray images and the equalized images found in the previous step of the original gray level i, and finishing the pixel mapping of the equalized images.
Preferably, in the multi-scale morphological edge detection algorithm, a morphological dilation edge detection operator E is adoptedd(x, y) and morphological erosion edge detection operator Ee(x,y):
Ed(x,y)=(f·g)(x,y)-f(x,y);
Ee(x,y)=f(x,y)-(fog)(x,y);
Wherein x and y respectively represent the abscissa and the ordinate of the pixel point; (f · g) (x, y) represents the image morphology closure operation; (fog) (x, y) represents the image morphology opening operation; f (x, y) represents an input image;
taking a square structural element { gi|i=1,2,...5},giIs (2i +1) × (2i +1) pixels; detecting operator E of morphological expansion edged(x, y) and morphological erosion edge detection operator Ee(x, y) combining to obtain a multi-scale edge detection operator:
preferably, the tile grading and color separation detection network model comprises a first module, a second module, a third module and a fourth module which are connected in sequence;
the first module includes convolutional layer C1 and max-pooling layer F1;
the second module includes convolutional layer C21, convolutional layer C22, and max-pooling layer F2;
the third module comprises four parallel routes, respectively: a first line, a second line, a third line and a fourth line; the first circuit comprises a convolution layer C31; the second circuit comprises a convolutional layer C32 and a convolutional layer C33; the third circuit comprises a convolutional layer C34 and a convolutional layer C35; the fourth line comprises a maximum pooling layer F31 and a convolutional layer C36; connecting the four parallel lines in the channel dimension, and inputting the four parallel lines to the maximum pooling layer F32;
the fourth module includes convolutional layer C41, convolutional layer C42, global average pooling layer F4, and a fully-connected layer; the global average pooling layer F4 changes the height and width of each channel to 1 to change the output to a two-dimensional array; the output of the full connection layer is the type of the ceramic tile grade and is marked as { y1,y2,...,ydD is the number of the grade types of the ceramic tiles;
the tile class type is transformed into a probability distribution with a positive sum of 1 using the softmax function:
Find outThe maximum value of (2) is set as the output tile grade type corresponding to the maximum value.
Preferably, in the first module, the convolutional layer C1 is a 3 × 3 convolutional layer with 64 channels output and a step size of 2; the maximum pooling layer F1 is a 3 × 3 maximum pooling layer with stride 2;
in the second module, convolutional layer C21 is a 1 × 1 convolutional layer with 64 channels output; the convolutional layer C22 is a 3 × 3 convolutional layer with 192 channels output; the maximum pooling layer F2 is a 3 × 3 maximum pooling layer with stride 2;
in the third module, route one convolutional layer C31 is a 1 × 1 convolutional layer with 128 channels output; the convolution layer C32 of the second circuit is a 1 × 1 convolution layer with 128-channel output, and the convolution layer C33 is a 3 × 3 convolution layer with 192-channel output; the convolution layer C34 of the circuit three is a 1 × 1 convolution layer with 32-channel output, and the convolution layer C35 is a 5 × 5 convolution layer with 96-channel output; the maximum pooling layer F31 of line four is a 3 × 3 maximum pooling layer with stride 1; convolutional layer C36 is a 1 × 1 convolutional layer with 64 channels output; the maximum pooling layer is a 3 × 3 maximum pooling layer with a stride of 2;
in the fourth module, convolutional layer C41 is a 1 × 1 convolutional layer with 512 channels output; convolutional layer C42 is a 3 × 3 convolutional layer with 1024 channels output.
Preferably, the training and testing process of the initial convolutional neural network model includes the following steps:
collecting a plurality of ceramic tile images; classifying the tile image into m tile grades according to tile color differences and defect conditions in the tile image; the ceramic tile grade comprises qualified products and unqualified products, wherein the qualified products comprise first-class products, second-class products, first-class products, m-1 products and the like; respectively marking the ceramic tile grades to the corresponding ceramic tile images;
preprocessing the tile image;
and training and testing the initial convolutional neural network model by adopting the preprocessed ceramic tile image.
Preferably, in the training process, a cross entropy loss function is used for training, and a small batch of random gradient descent algorithm is adopted to continuously iterate model parameters to optimize the loss function.
A tile grading and color separation detection device, comprising:
the image acquisition module is used for acquiring a tile image to be identified;
the preprocessing module is used for preprocessing the tile image;
the detection module is used for inputting the tile image output by the preprocessing module into the tile grading and color separation detection network model, and the tile grading and color separation detection network model outputs the tile grade type; the tile grading and color separation detection network model is obtained by training and testing an initial convolutional neural network model;
in the preprocessing module, the tile image is preprocessed, and the method comprises the following steps:
carrying out gray level transformation on the tile image to obtain an initial gray level image;
carrying out median filtering processing on the initial gray level image to obtain a filtered gray level image so as to remove noise;
carrying out histogram equalization processing on the filtered gray level image to obtain an equalized image so as to improve the contrast, thereby increasing the uniformity degree of gray level distribution, increasing the contrast definition of the defect outline and the ceramic tile background and increasing the contrast of the ceramic tile patterns and the ceramic tile background;
and (3) adopting a multi-scale morphological edge detection algorithm to separate the tile patterns and the defect outline from the tile background to obtain an edge image with complete tile patterns and defect outline.
A storage medium storing a computer program which, when executed by a processor, causes the processor to execute the tile gradation color separation detection method.
A computing device comprises a processor and a memory for storing a program executable by the processor, and is characterized in that the processor realizes the tile grading and color separation detection method when executing the program stored in the memory.
Compared with the prior art, the invention has the following advantages and beneficial effects:
1. the method comprises the steps of carrying out grading and color separation detection on the ceramic tiles based on a convolutional neural network model, and carrying out grade type division on the ceramic tile quality; the human resources can be saved and the detection efficiency can be improved; the operation speed is high, and the response requirement of a high-speed production line can be met; the classification accuracy is high, and errors in manual classification can be avoided;
2. the invention is beneficial to eliminating or reducing noise, improving contrast, smoothing or sharpening the image and the like by preprocessing the tile image; the initial gray level image obtained by performing gray level conversion on the tile image has the advantages of less memory occupation, high operation speed, more convenient processing and the like; the median filtering is to sort the pixel values in the range and replace the pixel value of the noise point with the middle value, which has good effect on removing the noise; the histogram equalization is utilized to perform equalization processing on the image, so that the image contrast is improved, the gray distribution is more uniform, the contrast between the defect outline and the background is clearer, and the contrast between the pattern and the background is larger.
Drawings
FIG. 1 is a flow chart of a tile grading and color separation detection method of the present invention;
fig. 2 is a schematic structural diagram of a tile grading and color separation detection network model in the tile grading and color separation detection method of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Examples
As shown in fig. 1, the tile grading and color separation detection method of the present embodiment includes the following steps:
s1, acquiring a tile image to be recognized; and preprocessing the tile image.
The pretreatment specifically comprises the following steps:
s11, carrying out gray scale transformation on the tile image to obtain an initial gray scale image; the range of gray scale values may be set to 0-255;
the initial gray level image obtained by performing gray level transformation on the tile image has the advantages of less memory occupation, high operation speed, more convenient processing and the like;
s12, carrying out median filtering processing on the initial gray level image to obtain a filtered gray level image so as to remove noise; the median filtering processing template is preferably 3 x 3; after 9 pixel points in the neighborhood are sorted, a median value is taken, and the median value is used for replacing the pixel value of the kernel center;
the detection method needs defects with high identification degree and the outline can not accurately extract outline information due to the reasons that the difference between the defects and background gray scale is small, light reflection is uneven, cracks are degraded and the like, and when the outline is extracted from a subsequent picture with noise, high-frequency noise and edge information are retained together to interfere judgment of a result, so that the detection method is particularly important for noise removal; the median filtering is to sort the pixel values in the range and replace the pixel value of the noise point with the middle value, which has good effect on removing the noise;
s13, carrying out histogram equalization processing on the filtered gray level image to obtain an equalized image so as to improve the contrast, thereby increasing the uniformity degree of gray level distribution, increasing the contrast definition of the defect outline and the tile background and increasing the contrast of the tile pattern and the tile background;
specifically, the histogram equalization processing means:
setting the filtering gray level image to 0-255 original gray levels;
calculating the histogram distribution probability P (i) of the original gray level i:
wherein N is the total number of pixels of the filtered gray image, NiThe total number of pixels of the original gray level i in the filtered gray image;
calculating histogram probability accumulated value S (i) of original gray level i:
calculating an equalized gray level SS (i) in an equalized image corresponding to the original gray level i:
SS(i)=int{[max(pix)-min(pix)]*S(i)+0.5};
wherein pix refers to the gray value in the filtered gray image;
and mapping the equalized gray levels SS (i) to the ith pixels of the equalized image one by one according to the corresponding relation between the equalized gray levels SS (i) and the original gray level i, thereby completing the pixel mapping of the equalized image.
Because the brick surface defect and the pattern are similar to the background color, the gray scale difference is not large, the image of the ceramic tile is concentrated in a small section of gray scale, the whole is bright or dark, and the contrast is low. The histogram equalization is utilized to perform equalization processing on the image, so that the image contrast is improved, the gray distribution is more uniform, the contrast between the defect outline and the background is clearer, and the contrast between the pattern and the background is larger.
S14, adopting a multi-scale morphological edge detection algorithm to the equalized image to separate the tile pattern and the defect outline from the tile background to obtain an edge image with complete tile pattern and defect outline;
in the multi-scale morphological edge detection algorithm, a morphological expansion edge detection operator E is adoptedd(x, y) and morphological erosion edge detection operator Ee(x,y):
Ed(x,y)=(f·g)(x,y)-f(x,y);
Ee(x,y)=f(x,y)-(fog)(x,y);
Wherein x and y respectively represent the abscissa and the ordinate of the pixel point; (f · g) (x, y) represents the image morphology closure operation; (fog) (x, y) represents the image morphology opening operation; f (x, y) represents an input image;
taking a square structural element { gi|i=1,2,...5},giIs (2i +1) × (2i +1) pixels; detecting operator E of morphological expansion edged(x, y) and morphological erosion edge detection operator Ee(x, y) combining to obtain a multi-scale edge detection operator:
s2, inputting the preprocessed tile image into a tile grading and color separation detection network model, and outputting the tile grade type by the tile grading and color separation detection network model; the tile grading and color separation detection network model is obtained by training and testing an initial convolutional neural network model.
The tile grading and color separation detection network model is shown in fig. 2 and comprises a first module, a second module, a third module and a fourth module which are connected in sequence;
the first module includes convolutional layer C1 and max-pooling layer F1; the convolutional layer C1 is a 3 × 3 convolutional layer with 64 channels of output and the step length is 2; the maximum pooling layer F1 is a 3 × 3 maximum pooling layer with stride 2;
the second module includes convolutional layer C21, convolutional layer C22, and max-pooling layer F2; convolutional layer C21 is a 1 × 1 convolutional layer with 64 channels output; the convolutional layer C22 is a 3 × 3 convolutional layer with 192 channels output; the maximum pooling layer F2 is a 3 × 3 maximum pooling layer with stride 2;
the third module comprises four parallel routes, respectively: a first line, a second line, a third line and a fourth line; the first circuit comprises a convolution layer C31; the second circuit comprises a convolutional layer C32 and a convolutional layer C33; the third circuit comprises a convolutional layer C34 and a convolutional layer C35; the fourth line comprises a maximum pooling layer F31 and a convolutional layer C36; connecting the four parallel lines in the channel dimension, and inputting the four parallel lines to the maximum pooling layer F32;
route one convolutional layer C31 is a 128 channel output 1 × 1 convolutional layer; the convolution layer C32 of the second circuit is a 1 × 1 convolution layer with 128-channel output, and the convolution layer C33 is a 3 × 3 convolution layer with 192-channel output; the convolution layer C34 of the circuit three is a 1 × 1 convolution layer with 32-channel output, and the convolution layer C35 is a 5 × 5 convolution layer with 96-channel output; the maximum pooling layer F31 of line four is a 3 × 3 maximum pooling layer with stride 1; convolutional layer C36 is a 1 × 1 convolutional layer with 64 channels output; the maximum pooling layer is a 3 × 3 maximum pooling layer with a stride of 2; the number of output channels of the third module is 128+192+96+ 64-480;
the third module adopts convolution kernel energies of different sizes to enable the neural network to sense fields of different sizes, and finally, the convolution kernel energies are spliced together to fuse features of different sizes; adding 1 × 1 convolution kernels to the 3 × 3 and 5 × 5 convolution kernel routes to reduce the amount of computation;
the fourth module includes convolutional layer C41, convolutional layer C42, global average pooling layer F4, and a fully-connected layer; convolutional layer C41 is a 1 × 1 convolutional layer with 512 channels output; convolutional layer C42 is a 3 × 3 convolutional layer with 1024 channels output. The global average pooling layer F4 changes the height and width of each channel to 1 to change the output to a two-dimensional array; the output of the full connection layer is the type of the ceramic tile grade and is marked as { y1,y2,...,ydD is the number of the grade types of the ceramic tiles;
each convolution layer of all the modules uses a ReLU function as an activation function; the ReLU activation function is used because the ReLU calculation is simpler, exponentiation operation is not needed, and the ReLU activation function enables a model to be easier to train under different parameter initialization methods;
the 3 x3 maximum pooling layer with step of 2 is used between each module to reduce the width and height of the output; the tile class type is transformed into a probability distribution with a positive sum of 1 using the softmax function:
Find outThe maximum value of (2) is set as the output tile grade type corresponding to the maximum value.
The training and testing process for the initial convolutional neural network model means that the method comprises the following steps:
x1, collecting a plurality of tile images as a data set, and classifying the tile images into m tile grades according to tile color differences and defect conditions in the tile images; the ceramic tile grade comprises qualified products and unqualified products, wherein the qualified products comprise first-class products, second-class products, first-class products, m-1 products and the like; respectively marking the ceramic tile grades to the corresponding ceramic tile images; for example: using an industrial camera with ultrahigh resolution to obtain 1000 ceramic tile images of first-class products, second-class products and unqualified products which are artificially detected; performing operations of clockwise rotation by 90 degrees, 180 degrees and 270 degrees, up-down turning operations and left-right turning operations on all the tile images to generate new tile images, and keeping the new tile images consistent with the tile grade types of the original tile images so as to expand the data set;
the operation of expanding the data set can be used for training more data volume during the training of the subsequent neural network model, so that overfitting can be better reduced, and the trained neural network model is more robust;
x2, preprocessing a tile image;
x3, training and testing the initial convolutional neural network model by adopting the preprocessed ceramic tile image:
x31, determining four hyper-parameters, namely the sample number batch _ size of the training data set read each time, the iteration cycle number num _ epochs, the learning rate lr and the parameter k in the k-fold cross validation;
x32, randomly disordering the pre-processed tile image;
x33, training a convolutional neural network model by adopting a k-fold cross validation method; all samples which can be used for the training set by using the k-fold cross validation can be necessarily used as training data, and meanwhile, the samples can be also inevitably used as a primary test set, so that the training data set can be better utilized;
dividing the data set into k noncoincident subdata sets, and then performing model training and verification for k times; training the model using the k-1 dataset each time, verifying the model using the remaining one of the subdata sets, the subdata set used to verify the model each time being different in the k training and verification;
x34, initializing parameters of the convolutional neural network model by using an Xavier random initialization method;
assuming that the input number of a fully-connected layer is a and the output number is b, Xavier random initialization will randomly sample each element of the weight parameter in the layer to be uniformly distributedIn view of, model parametersAfter the number is initialized, the variance of each layer of output is not influenced by the number of the input of the layer, and the variance of each layer of gradient is not influenced by the number of the output of the layer;
x35, inputting a training set and a verification set into the initialized convolutional neural network model for training; respectively averaging k training errors and verification errors;
x36, modifying the four superparameters of batch _ size, num _ epochs, lr and k for multiple times, and circularly executing the steps X32-X35; determining an optimal model parameter according to the calculated training error and the verification error;
x37, testing the effect of the trained convolutional neural network model: acquiring any 300 tile images by using the industrial camera with ultrahigh resolution again without marking the tile grade types; preprocessing the tile image, inputting the tile image obtained after preprocessing to a trained convolutional neural network model to obtain a grading and color separation detection result, and checking whether the accuracy of the grading and color separation detection result is ideal or not; and in an undesirable situation, the step X36 is executed again, and parameter tuning is carried out again until the convolutional neural network model with an ideal effect is trained.
Training is performed using a cross entropy loss function, with the goal of predicting the probability distribution of tile gradesProbability distribution y of tile grade labels as close to reality as possible(i)Cross entropy (with subscripts therein)Is a vector y(i)Elements other than 0, i.e. 1) are commonly used as a measure of the difference between the two probability distributions; assuming that the number of samples of the training data set is n, the cross entropy loss function is determinedMeaning as follows:(where Θ represents a model parameter);
in the training process, a small batch of random gradient descent algorithm is adopted to continuously iterate model parameters to optimize a loss function.
The method comprises the steps of carrying out grading and color separation detection on the ceramic tiles based on a convolutional neural network model, and carrying out grade type division on the ceramic tile quality; the human resources can be saved and the detection efficiency can be improved; the operation speed is high, and the response requirement of a high-speed production line can be met; the classification accuracy is high, and errors in manual classification can be avoided.
In order to implement the above tile grading and color separation detection method, this embodiment further provides a tile grading and color separation detection device, including:
the image acquisition module is used for acquiring a tile image to be identified;
the preprocessing module is used for preprocessing the tile image;
the detection module is used for inputting the tile image output by the preprocessing module into the tile grading and color separation detection network model, and the tile grading and color separation detection network model outputs the tile grade type; the tile grading and color separation detection network model is obtained by training and testing an initial convolutional neural network model;
in the preprocessing module, the tile image is preprocessed, and the method comprises the following steps:
carrying out gray level transformation on the tile image to obtain an initial gray level image;
carrying out median filtering processing on the initial gray level image to obtain a filtered gray level image so as to remove noise;
carrying out histogram equalization processing on the filtered gray level image to obtain an equalized image so as to improve the contrast, thereby increasing the uniformity degree of gray level distribution, increasing the contrast definition of the defect outline and the ceramic tile background and increasing the contrast of the ceramic tile patterns and the ceramic tile background;
and (3) adopting a multi-scale morphological edge detection algorithm to separate the tile patterns and the defect outline from the tile background to obtain an edge image with complete tile patterns and defect outline.
Example two
A storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the tile gradation color separation detection method according to the first embodiment.
EXAMPLE III
The computing device of the embodiment comprises a processor and a memory for storing a program executable by the processor, wherein when the processor executes the program stored in the memory, the tile grading and color separation detection method of the embodiment is implemented.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.
Claims (10)
1. A tile grading and color separation detection method is characterized by comprising the following steps: the method comprises the following steps:
acquiring a tile image to be identified; preprocessing the tile image;
inputting the preprocessed tile image into a tile grading and color separation detection network model, and outputting the tile grade type by the tile grading and color separation detection network model; the tile grading and color separation detection network model is obtained by training and testing an initial convolutional neural network model;
the method for preprocessing the tile image comprises the following steps:
carrying out gray level transformation on the tile image to obtain an initial gray level image;
carrying out median filtering processing on the initial gray level image to obtain a filtered gray level image so as to remove noise;
carrying out histogram equalization processing on the filtered gray level image to obtain an equalized image so as to improve the contrast, thereby increasing the uniformity degree of gray level distribution, increasing the contrast definition of the defect outline and the ceramic tile background and increasing the contrast of the ceramic tile patterns and the ceramic tile background;
and (3) adopting a multi-scale morphological edge detection algorithm to separate the tile patterns and the defect outline from the tile background to obtain an edge image with complete tile patterns and defect outline.
2. The tile grading and color separation detection method according to claim 1, wherein: in the preprocessing of the tile image, the histogram equalization processing means:
setting the filtering gray level image to 0-255 original gray levels;
calculating the histogram distribution probability P (i) of the original gray level i:
wherein N is the total number of pixels of the filtered gray image, NiThe total number of pixels of the original gray level i in the filtered gray image;
calculating histogram probability accumulated value S (i) of original gray level i:
calculating an equalized gray level SS (i) in an equalized image corresponding to the original gray level i:
SS(i)=int{[max(pix)-min(pix)]*S(i)+0.5};
wherein pix refers to the gray value in the filtered gray image;
and mapping the equalized gray levels SS (i) to the equalized images one by one according to the corresponding relation between the equalized gray levels SS (i) and the original gray level i, thereby completing the pixel mapping of the equalized images.
3. The tile grading and color separation detection method according to claim 1, wherein: in the multi-scale morphological edge detection algorithm, a morphological expansion edge detection operator E is adoptedd(x, y) and morphological erosion edge detection operator Ee(x,y):
Ed(x,y)=(f·g)(x,y)-f(x,y);
Ee(x,y)=f(x,y)-(fog)(x,y);
Wherein x and y respectively represent the abscissa and the ordinate of the pixel point; (f · g) (x, y) represents the image morphology closure operation; (fog) (x, y) represents the image morphology opening operation; f (x, y) represents an input image;
taking a square structural element { gi1, 2,. 5}, the size of gi being (2i +1) × (2i +1) pixels; detecting operator E of morphological expansion edged(x, y) and morphological erosion edge detection operator Ee(x, y) combining to obtain a multi-scale edge detection operator:
4. the tile grading and color separation detection method according to claim 1, wherein: the ceramic tile grading and color separation detection network model comprises a first module, a second module, a third module and a fourth module which are connected in sequence;
the first module includes convolutional layer C1 and max-pooling layer F1;
the second module includes convolutional layer C21, convolutional layer C22, and max-pooling layer F2;
the third module comprises four parallel routes, respectively: a first line, a second line, a third line and a fourth line; the first circuit comprises a convolution layer C31; the second circuit comprises a convolutional layer C32 and a convolutional layer C33; the third circuit comprises a convolutional layer C34 and a convolutional layer C35; the fourth line comprises a maximum pooling layer F31 and a convolutional layer C36; connecting the four parallel lines in the channel dimension, and inputting the four parallel lines to the maximum pooling layer F32;
the fourth module comprises a rollA buildup layer C41, a buildup layer C42, a global average pooling layer F4, and a full-connect layer; the global average pooling layer F4 changes the height and width of each channel to 1 to change the output to a two-dimensional array; the output of the full connection layer is the type of the ceramic tile grade and is marked as { y1,y2,...,ydD is the number of the grade types of the ceramic tiles;
the tile class type is transformed into a probability distribution with a positive sum of 1 using the softmax function:
5. The tile grading and color separation detection method according to claim 4, wherein: in the first module, the convolution layer C1 is a 3 × 3 convolution layer with 64-channel output and the step length is 2; the maximum pooling layer F1 is a 3 × 3 maximum pooling layer with stride 2;
in the second module, convolutional layer C21 is a 1 × 1 convolutional layer with 64 channels output; the convolutional layer C22 is a 3 × 3 convolutional layer with 192 channels output; the maximum pooling layer F2 is a 3 × 3 maximum pooling layer with stride 2;
in the third module, route one convolutional layer C31 is a 1 × 1 convolutional layer with 128 channels output; the convolution layer C32 of the second circuit is a 1 × 1 convolution layer with 128-channel output, and the convolution layer C33 is a 3 × 3 convolution layer with 192-channel output; the convolution layer C34 of the circuit three is a 1 × 1 convolution layer with 32-channel output, and the convolution layer C35 is a 5 × 5 convolution layer with 96-channel output; the maximum pooling layer F31 of line four is a 3 × 3 maximum pooling layer with stride 1; convolutional layer C36 is a 1 × 1 convolutional layer with 64 channels output; the maximum pooling layer is a 3 × 3 maximum pooling layer with a stride of 2;
in the fourth module, convolutional layer C41 is a 1 × 1 convolutional layer with 512 channels output; convolutional layer C42 is a 3 × 3 convolutional layer with 1024 channels output.
6. The tile grading and color separation detection method according to claim 4, wherein: the training and testing process for the initial convolutional neural network model comprises the following steps:
collecting a plurality of ceramic tile images; classifying the tile image into m tile grades according to tile color differences and defect conditions in the tile image; the ceramic tile grade comprises qualified products and unqualified products, wherein the qualified products comprise first-class products, second-class products, first-class products, m-1 products and the like; respectively marking the ceramic tile grades to the corresponding ceramic tile images;
preprocessing the tile image;
and training and testing the initial convolutional neural network model by adopting the preprocessed ceramic tile image.
7. The tile grading and color separation detection method according to claim 6, wherein: in the training process, a cross entropy loss function is used for training, and a small batch of random gradient descent algorithm is adopted to continuously iterate model parameters to optimize the loss function.
8. A tile grading and color separation detection device, comprising:
the image acquisition module is used for acquiring a tile image to be identified;
the preprocessing module is used for preprocessing the tile image;
the detection module is used for inputting the tile image output by the preprocessing module into the tile grading and color separation detection network model, and the tile grading and color separation detection network model outputs the tile grade type; the tile grading and color separation detection network model is obtained by training and testing an initial convolutional neural network model;
in the preprocessing module, the tile image is preprocessed, and the method comprises the following steps:
carrying out gray level transformation on the tile image to obtain an initial gray level image;
carrying out median filtering processing on the initial gray level image to obtain a filtered gray level image so as to remove noise;
carrying out histogram equalization processing on the filtered gray level image to obtain an equalized image so as to improve the contrast, thereby increasing the uniformity degree of gray level distribution, increasing the contrast definition of the defect outline and the ceramic tile background and increasing the contrast of the ceramic tile patterns and the ceramic tile background;
and (3) adopting a multi-scale morphological edge detection algorithm to separate the tile patterns and the defect outline from the tile background to obtain an edge image with complete tile patterns and defect outline.
9. A storage medium, wherein the storage medium stores a computer program which, when executed by a processor, causes the processor to perform the tile gradation color separation detection method of any one of claims 1 to 7.
10. A computing device comprising a processor and a memory for storing a processor-executable program, wherein the processor, when executing the program stored in the memory, implements the tile gradation color separation detection method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111230747.2A CN114154552A (en) | 2021-10-22 | 2021-10-22 | Method, device, medium and equipment for detecting grading and color separation of ceramic tiles |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111230747.2A CN114154552A (en) | 2021-10-22 | 2021-10-22 | Method, device, medium and equipment for detecting grading and color separation of ceramic tiles |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114154552A true CN114154552A (en) | 2022-03-08 |
Family
ID=80458476
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111230747.2A Pending CN114154552A (en) | 2021-10-22 | 2021-10-22 | Method, device, medium and equipment for detecting grading and color separation of ceramic tiles |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114154552A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114782418A (en) * | 2022-06-16 | 2022-07-22 | 深圳市信润富联数字科技有限公司 | Detection method and device for ceramic tile surface defects and storage medium |
WO2024093040A1 (en) * | 2022-10-31 | 2024-05-10 | 科达制造股份有限公司 | Ceramic machining system and tile classification process |
-
2021
- 2021-10-22 CN CN202111230747.2A patent/CN114154552A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114782418A (en) * | 2022-06-16 | 2022-07-22 | 深圳市信润富联数字科技有限公司 | Detection method and device for ceramic tile surface defects and storage medium |
CN114782418B (en) * | 2022-06-16 | 2022-09-16 | 深圳市信润富联数字科技有限公司 | Detection method and device for ceramic tile surface defects and storage medium |
WO2024093040A1 (en) * | 2022-10-31 | 2024-05-10 | 科达制造股份有限公司 | Ceramic machining system and tile classification process |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113538433B (en) | Mechanical casting defect detection method and system based on artificial intelligence | |
CN109376792B (en) | Photovoltaic cell appearance defect classification method based on multi-channel residual error neural network | |
CN113160192B (en) | Visual sense-based snow pressing vehicle appearance defect detection method and device under complex background | |
CN108918536B (en) | Tire mold surface character defect detection method, device, equipment and storage medium | |
CN113592845A (en) | Defect detection method and device for battery coating and storage medium | |
CN111862194B (en) | Deep learning plant growth model analysis method and system based on computer vision | |
CN114154552A (en) | Method, device, medium and equipment for detecting grading and color separation of ceramic tiles | |
CN105427275B (en) | Crop field environment wheat head method of counting and device | |
CN107945150A (en) | The image processing method and system of gene sequencing | |
CN114910480B (en) | Wafer surface defect detection method based on machine vision | |
CN111798447B (en) | Deep learning plasticized material defect detection method based on fast RCNN | |
CN101140216A (en) | Gas-liquid two-phase flow type recognition method based on digital graphic processing technique | |
CN106023098B (en) | Image mending method based on the more dictionary learnings of tensor structure and sparse coding | |
CN114723708A (en) | Handicraft appearance defect detection method based on unsupervised image segmentation | |
CN110781913B (en) | Zipper cloth belt defect detection method | |
CN115082477B (en) | Semiconductor wafer processing quality detection method based on light reflection removing effect | |
CN116152242B (en) | Visual detection system of natural leather defect for basketball | |
CN117392042A (en) | Defect detection method, defect detection apparatus, and storage medium | |
CN112991271A (en) | Aluminum profile surface defect visual detection method based on improved yolov3 | |
CN114897825A (en) | Solid wood floor sorting method and system based on computer vision | |
CN117036243A (en) | Method, device, equipment and storage medium for detecting surface defects of shaving board | |
CN115880699A (en) | Food packaging bag detection method and system | |
CN113421223B (en) | Industrial product surface defect detection method based on deep learning and Gaussian mixture | |
CN117522864B (en) | European pine plate surface flaw detection method based on machine vision | |
CN114565607A (en) | Fabric defect image segmentation method based on neural network |
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 |