Tire X-ray Defect Image Classification Method Based on K-means Algorithm

By using pre-trained VGG16 features and K-means clustering for tire defect classification, the method addresses misclassification issues in X-ray images, enhancing defect visibility and achieving high accuracy without extensive training data, thus improving tire defect detection efficiency.

CN114627322BActive Publication Date: 2025-07-15ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210410114.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-07-15
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

The prior art cannot realize full coverage detection of tire internal defects, and X-ray detection images are susceptible to noise interference, resulting in low accuracy in defect classification, and convolutional neural network training requires a large number of labeled images and is time-consuming.

Method used

Using transfer learning method, the pre-trained VGG16 network is used to extract tire defect image features, and unsupervised classification is combined with the K-means algorithm. Image preprocessing is performed through adaptive histogram equalization with limited contrast to enhance the contrast between defects and background.

Benefits of technology

It improves the accuracy of tire defect classification, reduces training time, and achieves efficient unsupervised classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114627322B_ABST
    Figure CN114627322B_ABST
Patent Text Reader

Abstract

A tire X-ray defect image classification method based on the K-means algorithm includes the following steps: 1) Preprocessing of the tire dataset; 2) Transferring the VGG16 network model for image feature extraction; 3) Using the K-means clustering algorithm to assign class labels to each image, and using the average accuracy and confusion matrix to evaluate the classification effect of the model. In the present invention, the image is preprocessed by contrast-limited adaptive histogram equalization, so that the image intensity distribution is wider and the contrast between the defect and background information is obvious; then the pre-trained VGG16 network is introduced to learn the tire image features, reducing the process of training the model from scratch. Finally, the unsupervised K-means method is used to classify the tire data, which does not require labeled training data and has a fast training speed and high classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image classification, and particularly relates to a method for classifying tire X-ray defect images based on the K-means algorithm. Background Art

[0002] With the development of China's economic technology and the improvement of people's living quality, automobiles have become essential means of transportation for every family. As a major component of automobiles, the tire industry has also witnessed great development. The continuous increase in automobile demand has led to the continuous expansion of the tire industry scale. Due to the limitations of existing production equipment and technology, different defects will occur during tire production, which can be classified into split seams, jumper wires, foreign objects, etc. according to different causes. Some product defects can be solved through technological improvements, but due to technological limitations, the occurrence of defects is often inevitable during the tire manufacturing process.

[0003] Traditional detection methods achieve the detection of internal tire defects by manually cutting products. This method can only achieve sampling detection of products, cannot achieve full coverage detection, and also causes waste of products. In addition to traditional cutting inspections, non-destructive testing technologies have been applied to defect detection. After comparative analysis, it is found that most non-destructive testing technologies are not applicable to non-destructive detection of tire defects, while X-ray detection meets the requirements of tire non-destructive detection. At the same time, X-ray detection has an imaging function, and the image data has the characteristics of intuitive representation and easy observation.

[0004] Although the images formed under X-rays can visualize the internal defects of tires, accompanied by problems such as a large amount of image noise and complex backgrounds, it is easy to misjudge defects as noise during the detection process, which has a great impact on the classification accuracy of different defects. Therefore, developing an efficient classification method is the primary problem for improving the classification accuracy of tire defects. Convolutional Neural Network (CNN) has exceeded human performance in classifying images due to its powerful feature extraction ability. However, training a CNN network usually requires a very large labeled image training set, which is a time-consuming and difficult task. Considering these limitations, transfer learning can be introduced into tire defect classification, that is, the intermediate layer of the VGG16 network trained on the ImageNet dataset is used to extract the feature information of tire defect images. The essential features of each obtained image are used to assist the tire defect image classification task.

[0005] The present invention provides the following technical solutions:

[0006] A method for classifying tire X-ray defect images based on the K-means algorithm, comprising the following steps:

[0007] 1) Dataset preprocessing: Collect a dataset of tire images. Divide the collected tire dataset into four categories according to the types of tire defects, namely split defects, jumper defects, foreign object defects, and normal tires. Perform contrast-limited adaptive histogram equalization on each image.

[0008] 2) Network model migration: Pretrain the image feature extraction model VGG16 network on the ImageNet dataset, and then migrate the pre-trained VGG16 network to extract the defect features of different types of tire images.

[0009] 3) Build a defect classification model: After the VGG16 network extracts the tire defect image features, use the K-means clustering algorithm to assign class labels to each tire image, and use the average accuracy and confusion matrix to evaluate the classification effect of the model.

[0010] Furthermore, the specific process of step 1) is as follows:

[0011] Uniformly scale the images according to the defect location information, and then preprocess each image through contrast-limited adaptive histogram equalization, so that the image intensity distribution is wider and the defects are more obvious, achieving the effect of image enhancement.

[0012] Furthermore, the specific steps of the contrast-limited adaptive histogram equalization algorithm are as follows:

[0013] a) Divide the original image into r sub-regions of size m×n. Each sub-region is continuous and non-overlapping. The values of m and n determine the degree of detail enhancement of the image. The larger the values, the stronger the enhancement effect.

[0014] b) Evenly distribute the number of pixels in each sub-region to each gray level, and the average value N aver The calculation formula is as follows:

[0015]

[0016] In the formula: N gray is the number of gray levels in the sub-region; is the number of pixels in the x-axis direction of the sub-region; is the number of pixels in the y-axis direction of the sub-region;

[0017] Limit the number of pixels in each gray level not to exceed N aver times of the average value N clip Then the actual shear limit value N CL The calculation formula is as follows:

[0018] N CL = N clip ·N aver

[0019] Where N clip is the truncation limit coefficient, which means restricting the number of pixels included in each gray level not to exceed N clip times the average number of pixels;

[0020] c) Clip the gray level histogram of each sub-block, and redistribute the redundant number of pixels to the gray levels of each histogram. Let the total number of clipped pixels be N∑ clip , and obtain the evenly distributed clipped pixels N acp for each gray level. The calculation formula of N acp is as follows:

[0021]

[0022] The redistribution process is represented by the following method:

[0023] if H(i)>H CL , H(i) = N CL ;

[0024] else if H(i)+H acp ≥N CL ,

[0025] H(i) = N CL ;

[0026] else H(i) = H(i)+N acp .

[0027] Where: H(i) is the number of pixels of the i-th gray level in the original area;

[0028] After distribution, the number of remaining pixels is N LP , and the calculation formula of the step value of the distributed pixels is as follows:

[0029]

[0030] Circularly distribute the remaining pixels from the minimum gray level according to the above step value until the pixels are 0, and finally obtain a new histogram.

[0031] d) Perform histogram equalization on the gray level histogram of each cropped sub-region;

[0032] e) Take the center point of each sub-block as a reference point, obtain its gray value, and perform gray level linear interpolation on each pixel in the image by using the method of bilinear interpolation. The mapping of each pixel point is determined by the mapping of the corresponding area of a group of adjacent reference points.

[0033] Furthermore, the specific process of step 2) is as follows:

[0034] Input the preprocessed dataset in step 1) into the input layer of the VGG16 network. Multiple intermediate layers in the network can be used as feature representations of the image. Use it as a signal processor to generate a feature descriptor for each tire image. Finally, use unsupervised clustering to classify the defects.

[0035] Furthermore, the specific process of step 3) is as follows:

[0036] Use the K-means algorithm to assign class labels to each tire image data. Take the tire images after defect feature extraction by the VGG16 network in step 2) as the sample set. For the given sample set, divide the sample set into K clusters according to the distance between samples. The number of clusters is selected after visualizing the data. The specific steps of the algorithm are as follows:

[0037] Let the dataset be X = {x1, x2, ···, x i , ···, x n}, the number of clusters formed by clustering is K, and the cluster centers are C = {c1, c2, ···, c j , ···, c k}.

[0038] a) Randomly select K samples from the dataset as the cluster centers;

[0039] b) Calculate the distance between each sample x i (i = 1, 2, ···, n) in the dataset and the cluster center c j (j = 1, 2, ···, k). The calculation formula for the distance is as follows:

[0040]

[0041] In the formula: m is the dimension of the sample;

[0042] c) Calculate the distance from each sample to the cluster center, find the minimum distance, and assign the sample to the corresponding cluster;

[0043] d) Recalculate and update the cluster centers. The calculation formula is as follows:

[0044]

[0045] Then, calculate the result of the objective function. The calculation formula is as follows:

[0046]

[0047] e) Judge the cluster centers and the objective function, and assign all images to the corresponding cluster centers.

[0048] Further, in step 3), the formula for the mean average precision (mAP) of each category is as follows:

[0049]

[0050]

[0051] In the formula: the classification accuracy of each category is calculated through AP; TP represents the number of data correctly classified, and FP represents the number of data misclassified; q represents the number of categories; mAP represents the average of the classification accuracies of all categories; this formula represents the proportion of correctly classified samples in all categories to the total number of samples, and the closer the value is to 100%, the better the classification effect.

[0052] Further, in step 3), the confusion matrix is represented in the form of a matrix with b rows and b columns, where each column represents a predicted category, and the total number of each column represents the number of data predicted as that category. Each row represents the true category of the data, and the total number of data in each row represents the number of data instances of that category.

[0053] By adopting the above technologies, compared with the prior art, the beneficial effects of the present invention are as follows:

[0054] The present invention preprocesses the image through contrast-limited adaptive histogram equalization, making the image intensity distribution wider and the contrast between defects and background information more obvious; then introduces the pre-trained VGG16 network to learn the tire image features, reducing the process of training the model from scratch; finally, uses the unsupervised K-means method to classify the tire data, which does not require labeled training data and has a fast training speed and high classification accuracy. Brief Description of the Drawings

[0055] Figure 1 is the overall framework diagram of the present invention;

[0056] Figure 2 is the comparison diagram before and after the preprocessing of the dataset of the present invention;

[0057] Figure 3 is the structure diagram of the VGG16 model;

[0058] Figure 4 is the confusion matrix of the classification result of the model of the present invention; Detailed Embodiments

[0059] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings of the specification and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0060] On the contrary, the present invention covers any alternatives, modifications, equivalent methods, and solutions that are defined by the claims and fall within the spirit and scope of the present invention. Further, in order to enable the public to better understand the present invention, in the following detailed description of the present invention, some specific details are described in detail. Those skilled in the art can fully understand the present invention without the description of these details.

[0061] Referring to Figures 1 to 4 , a tire X-ray defect image classification method based on the K-means algorithm, the method comprising the following steps:

[0062] (1) Dataset preprocessing: The original size of the tire dataset is 20,000×2000 pixels. After regularization, it is divided into four categories, namely split defect, jumper defect, foreign object defect, and normal tire, with 80 pictures in each category. In order to accelerate model training and achieve the effect of image enhancement, each picture is preprocessed by contrast-limited adaptive histogram equalization.

[0063] The specific approach is to uniformly scale the images to 224×224 pixels according to the defect location information. On the one hand, it can accelerate the feature extraction speed. On the other hand, since the weight parameters of the neural network are related to the size of the training images, the network can only process images of the same dimension, and the training data size corresponding to the VGG16 network is 224×224 pixels. Further, in order to enhance the contrast between the defects and the background information, each picture is preprocessed by contrast-limited adaptive histogram equalization, making the image intensity distribution wider and the defects more obvious, achieving the effect of image enhancement. The comparison of the images before and after preprocessing is as Figure 2 shown.

[0064] The steps of the contrast-limited adaptive histogram equalization algorithm are as follows:

[0065] a) Divide the original image into r fixed sub-regions of size m×n. Each sub-region is continuous and non-overlapping with each other. The values of m and n determine the degree of detail enhancement of the image. The larger the values, the stronger the enhancement effect;

[0066] b) Evenly distribute the number of pixels in each sub-region to each gray level, with the average value N aver The calculation formula is as follows:

[0067]

[0068] In the formula: N gray is the number of gray levels in the sub-region; is the number of pixels in the x-axis direction of the sub-region; is the number of pixels in the y-axis direction of the sub-region;

[0069] Limit the number of pixels included in each gray level not to exceed the average value N aver times of N clip times, then the actual shear limit value N CL can be:

[0070] N CL = N clip ·N aver

[0071] where N clip is the clipping limit coefficient, which means limiting the number of pixels included in each gray level not to exceed N clip times of the average number of pixels;

[0072] c) Clip the gray level histogram of each sub-block, and redistribute the redundant number of pixels to the gray levels of each histogram. Let the total number of clipped pixels be N∑ clip , then the evenly distributed clipped pixels N acp for each gray level are obtained as follows:

[0073]

[0074] Specifically, the redistribution process can be represented by the following method:

[0075] if H(i) > H CL , H(i) = N CL ;

[0076] else if H(i) + H acp ≥ N CL ,

[0077] H(i) = N CL ;

[0078] else H(i) = H(i) + N acp .

[0079] where: H(i) is the number of pixels of the i-th gray level in the original area.

[0080] After the distribution, the remaining number of pixels is N LP , and the step value of the distributed pixels is as follows:

[0081]

[0082] Circularly distribute the remaining pixels from the minimum gray level according to the above step value until the pixels are 0, and finally obtain a new histogram.

[0083] d) Perform histogram equalization on the gray level histogram of each cropped sub-region;

[0084] e) Take the center point of each sub-block as a reference point, obtain its grayscale value, perform grayscale linear interpolation on each pixel in the image, and use the bilinear interpolation method. The mapping of each pixel point is determined by the mappings of the corresponding regions of its adjacent 4 reference points.

[0085] 2) Network model migration: Migrate the VGG16 network, an image feature extraction model pre-trained on the ImageNet dataset, to the present invention. Use it to extract image feature information to assist in the classification task of tire defect images. VGG16 is a neural network structure that includes 13 convolutional layers and 3 fully connected layers. The size of the convolutional kernel is 3×3, the stride is 1, and the image is compressed through max pooling to reduce the spatial size of the data, speed up the training speed, and control overfitting to a certain extent. Its model structure is shown in Figure 3 .

[0086] The specific approach is to preprocess the dataset and perform size cropping to form a new dataset. Input the new dataset into the input layer of the VGG16 network. Multiple intermediate layers in the network can be used for image feature representation. After comparative experiments, in the present invention, we used the fc2 layer. Use the fc2 layer as a signal processor to generate a feature descriptor for each tire image, and finally classify the defects using an unsupervised clustering method.

[0087] 3) Construct a defect classification model: After the VGG16 network extracts the features of tire defect images, use the K-means algorithm to assign class labels to each image, and use the average accuracy rate and confusion matrix to evaluate the classification effect of the model.

[0088] The specific approach is to use the K-means clustering algorithm to assign class labels to each image data. K-means is an unsupervised clustering algorithm that solves through iteration. For a given sample set, divide the sample set into K clusters according to the distance between samples, making the points within the clusters as close as possible, while making the distance between clusters as large as possible. The number of clusters can be selected after visualizing the data. In the present invention, K is selected as 5. The specific steps of the algorithm are as follows:

[0089] Let the dataset be X = {x1, x2, ···, x i , ···, x n}, and the number of clusters formed by clustering is K, and the cluster centers are C = {c1, c2, ···, c j , ···, c k}.

[0090] a) Randomly select K samples from the dataset as cluster centers.

[0091] b) Calculate each sample x in the dataset i(i = 1, 2, ···, n) and the cluster center c j (j = 1, 2, ···, k), the distance formula is as follows:

[0092]

[0093] In the formula: m is the dimension of the sample.

[0094] c) Calculate the distance from each sample to the cluster center, find the minimum distance and assign the sample to the corresponding cluster.

[0095] d) Recalculate and update the cluster center, and the calculation formula is as follows:

[0096]

[0097] Then, calculate the result of the objective function, and the calculation formula is as follows:

[0098]

[0099] e) Judge the cluster center and the objective function, and assign all images to the corresponding cluster center.

[0100] After assigning class labels to each image through the K - means clustering algorithm, the average accuracy rate and the confusion matrix are used to evaluate the classification effect of the model.

[0101] a) Average accuracy rate

[0102] The formula for the average accuracy rate (mAP) of each class is as follows:

[0103]

[0104]

[0105] In the formula: Calculate the classification accuracy rate of each class through AP; TP represents the number of correctly classified data, FP represents the number of misclassified data; q represents the number of classes; mAP represents the average of the classification accuracy rates of each class; this formula represents the proportion of correctly classified samples in all classes to the total number of samples, and the closer the value is to 100%, the better the classification effect. After classifying the four classes of the tire dataset through the above method, the average classification accuracy rate is 95.9%. The principle of this method is easy to understand and can achieve a relatively high classification accuracy rate.

[0106] b) Confusion matrix

[0107] The confusion matrix is represented in the form of a b - row and b - column matrix, where each column represents a predicted class, and the total number of each column represents the number of data predicted as this class. Each row represents the true class of the data, and the total number of each row represents the number of data instances of this class. For exampleFigure 4 As shown, the classification effect of each category can be seen more intuitively through the confusion matrix.

Claims

1. A tire X-ray defect image classification method based on the K-means algorithm, characterized in that: It includes the following steps: 1) Dataset preprocessing: Collect a dataset of tire images. According to the types of tire defects, the collected tire dataset is divided into four categories, namely split defects, jumper defects, foreign object defects, and normal tires. Perform contrast-limited adaptive histogram equalization processing on each picture; 2) Network model migration: Pretrain the image feature extraction model VGG16 network on the ImageNet dataset, and migrate the pre-trained VGG16 network to extract defect features of different types of tire images; 3) Build a defect classification model: After the VGG16 network extracts the tire defect image features, use the K-means clustering algorithm to assign class labels to each tire image, and use the average accuracy rate and confusion matrix to evaluate the classification effect of the model; The specific process of step 3) is as follows: Use the K-means algorithm to assign class labels to each tire image data. Take the tire images after extracting defect features through the VGG16 network in step 2) as the sample set. For the given sample set, divide the sample set into K clusters according to the distance between samples. The number of clusters is selected after visualizing the data. The specific steps of the algorithm are as follows: Let the data set be \(X = \{x_1, x_2, \ldots, x\) i , \ldots, x\) n \}, the number of clusters formed be \(K\), and the cluster centers be \(C=\{c_1, c_2, \ldots, c\) j , \ldots, c\) k \}; a) Randomly select K samples from the dataset as the clustering centers; b) Calculate the distance between each sample x in the dataset i and the cluster center c j , where i = 1, 2, …, n, j = 1, 2, …, k; the formula for calculating the distance is as follows: Where: m is the dimension of the sample; c) Calculate the distance from each sample to the clustering center, find the minimum distance and assign the sample to the corresponding cluster; d) Recalculate and update the clustering centers, and the calculation formula is as follows: Then, calculate the result of the objective function, and the calculation formula is as follows: e) Judge the clustering centers and the objective function, and assign all images to the corresponding clustering centers; In step 3), the formula for the mean average precision mAP of each category is as follows: Where: Calculate the classification accuracy rate of each category through AP; TP represents the number of correctly classified data, FP represents the number of misclassified data; q represents the number of categories; mAP represents the average of the classification accuracy rates of each category; this formula represents the proportion of correctly classified samples in all categories to the total number of samples. The closer the value is to 100%, the better the classification effect; In step 3), the confusion matrix is represented in the form of a matrix with b rows and b columns. Each column represents a predicted category, and the total number of each column represents the number of data predicted as this category; each row represents the true category of the data, and the total number of data in each row represents the number of data instances of this category.

2. The tire X-ray defect image classification method based on the K-means algorithm according to claim 1, wherein The specific process of step 1) is as follows: Uniformly scale the image according to the defect location information. Then, preprocess each image through contrast-limited adaptive histogram equalization to make the image intensity distribution wider and the defects more obvious, achieving the effect of image enhancement.

3. The tire X-ray defect image classification method based on the K-means algorithm according to claim 2, characterized in that, The specific steps of the contrast-limited adaptive histogram equalization algorithm are as follows: a) Divide the original image into r sub-regions with a size of m×n. Each sub-region is continuous and non-overlapping. The values of m and n determine the degree of detail enhancement of the image. The larger the values, the stronger the enhancement effect; b) Evenly distribute the number of pixels in each sub-region to each gray level, with the average value N aver The calculation formula is as follows: Where: N gray is the number of gray levels in the sub-region; is the number of pixels in the x-axis direction of the sub-region; is the number of pixels in the y-axis direction of the sub-region; Limit the number of pixels included in each gray level to not exceed the average value N aver times N clip times, then the actual shear limit value N CL has the following calculation formula: N CL = N clip · N aver where N clip is the truncation limit coefficient, which means that the number of pixels included in each gray level is limited to no more than N clip times the average number of pixels; c) Clip the grayscale histogram of each sub-block, and redistribute the number of redundant pixels to the gray levels of each histogram. Let the total number of clipped pixels be N∑ clip to obtain the evenly distributed clipped pixels N for each gray level acp N acp The calculation formula for N is as follows: After distribution, the number of remaining pixels is N LP , and the calculation formula for the step value of the allocated pixels is as follows: For the remaining pixels, start from the minimum gray level and cycle and assign them to pixels as 0 according to the above step value, and finally obtain a new histogram; d) Perform histogram equalization on the grayscale histogram of each cropped sub-region; e) Take the center point of each sub-block as a reference point, obtain its grayscale value, and perform grayscale linear interpolation on each pixel in the image using the bilinear interpolation method. The mapping of each pixel point is determined by the mapping of the corresponding region of a group of adjacent reference points.

4. The tire X-ray defect image classification method based on the K-means algorithm according to claim 3, wherein, The specific process of step 2) is as follows: Input the preprocessed dataset in step 1) into the input layer of the VGG16 network. Multiple intermediate layers in the network can be used as feature representations of the image. Use it as a signal processor to generate a feature descriptor for each tire image, and finally classify the defects using an unsupervised clustering method.

Citation Information

Patent Citations

  • An ancient font classification method based on a convolutional neural network

    CN109800754A

  • Weld defect identification and positioning method and system based on deep learning network

    CN113034478A