A method for detecting the spraying quality of a bicycle sprocket surface
By combining high-resolution image acquisition, morphological methods, and YOLOv3 detection with Gabor filters to extract texture features, and using SVM classification, the inconsistency and inaccuracy of traditional spray coating quality inspection are solved, realizing automated and accurate evaluation of the spray coating quality of bicycle crankset surfaces.
Patent Information
- Application Number
- CN202411833553.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-12-13
AI Technical Summary
Traditional spray coating quality inspection methods rely on manual inspection, which results in inconsistent and inaccurate test results. In particular, it is difficult to accurately identify particle size and uneven distribution on complex spray coating surfaces, which affects product quality.
High-resolution image acquisition, morphological methods, and YOLOv3 detection combined with Gabor filters are used to extract texture features. Support vector machines (SVM) are used for classification, and kernel function parameters are optimized through cross-validation to achieve automated and accurate spraying quality assessment.
It significantly improves detection accuracy and consistency, can accurately distinguish subtle differences in the sprayed surface, provides objective and accurate judgment of spraying quality, and reduces human error.
Smart Images

Figure CN119810032B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of spraying quality detection, and particularly relates to a bicycle sprocket surface spraying quality detection method. BACKGROUND
[0002] Coating quality detection occupies an important position in modern manufacturing industry, especially for the spraying surface quality control of products such as automobiles, aviation and bicycles. The traditional spraying quality detection method mainly relies on manual inspection. Although this method can intuitively find some defects, it is difficult to guarantee the consistency and accuracy of the detection results due to the experience difference and fatigue of the detection personnel. Especially on the complex spraying surface, the defects such as particles, color difference and cracks are difficult to be judged by the naked eye, thereby affecting the overall quality of the product.
[0003] The traditional spraying quality detection method usually relies on manual visual inspection. This method not only has strong subjectivity, but also is easily affected by the operator's fatigue, experience difference and environmental factors, resulting in inconsistency and instability of the detection results. Since visual inspection mainly relies on manual observation of the spraying surface, the manual judgment process is disturbed by factors such as visual fatigue, psychological expectation and change of working environment light. Especially after a long time of work, the detection accuracy will decrease significantly. In addition, the manual detection personnel is difficult to accurately distinguish the subtle differences of the spraying surface, especially in the case that the particle size and surface roughness are similar, which is easy to produce misjudgment.
[0004] In the spraying process of the bicycle sprocket, the size and uniformity of the particles on the spraying surface directly affect the final surface quality. The characteristics of these particles have a crucial influence on the functionality and aesthetics of the spraying layer. Especially when the particles are too large or unevenly distributed, it will cause problems such as surface roughness and spraying layer falling off. However, too small particles and uneven distribution may affect the coverage and protection of the surface coating. Therefore, accurately identifying the size, distribution and surface roughness of the particles is the key to spraying quality control. However, these subtle differences are often difficult to accurately judge by manual detection.
[0005] Therefore, the present application is proposed. SUMMARY
[0006] The technical problem to be solved by the present application is to overcome the shortcomings of the prior art and provide a bicycle sprocket surface spraying quality detection method to solve the problems proposed in the background.
[0007] To solve the above technical problems, the basic idea of the technical solution of the present application is as follows:
[0008] A bicycle sprocket surface spraying quality detection method, comprising the following steps:
[0009] Step one: Obtain high-resolution images of the sprayed surface of the bicycle chainring;
[0010] Step two: Denoise, grayscale, and enhance the collected original images to reduce environmental interference and improve image quality;
[0011] Step three: Perform particle analysis on the image using morphological methods, select an appropriate circular structural element, and use N-opening operation to filter the image, retaining the characteristics of the particles on the sprayed surface of the chainring, and detect and label the target area in the image using YOLOv3;
[0012] Step four: Extract the texture features of the target area detected by YOLOv3 using a Gabor filter, calculate and extract the energy, variance, and contrast features of the image to represent the surface spraying quality;
[0013] Step five: Use a support vector machine to classify the extracted texture features. Use a radial basis kernel function as the kernel function and optimize the penalty factor C and Gaussian width parameter σ through cross-validation to improve classification accuracy;
[0014] Step six: Classify new images using the trained SVM model, evaluate the spraying quality based on the classification results, and output the quality judgment results of qualified or unqualified.
[0015] Optionally, the step of performing particle analysis on the image using morphological methods, selecting an appropriate circular structural element, and using N-opening operation to filter the image to retain the characteristics of the particles on the sprayed surface of the chainring is:
[0016] Select a circular structural element with a radius of 1 pixel for image screening, and the structural element is defined as a circular window with a radius of 1 pixel. The particle analysis operation is based on morphological opening operation, and for an image , the particle analysis is defined as: where
[0017] Morphological dilation operation extends a structural element to each pixel point in the image. For an image and a structural element , the dilation operation can be defined as: where is the translation of the structural element at the point, indicating the process of applying the structural element to the image . Then, normalize the particle distribution , and the normalized particle distribution Defined as: For grayscale images Particle distribution It can be calculated by integration, and its expression is: ,in, grayscale image Domain Representing an image go through The result obtained after the opening operation.
[0018] Optionally, the steps for detecting and labeling target regions in an image using YOLOv3 are as follows:
[0019] First, the image to be detected is input into the YOLOv3 network. YOLOv3 divides the input image into multiple grids and performs object detection on each grid using a convolutional neural network.
[0020] For each target bounding box, predictions are made. During prediction, each grid cell outputs multiple predicted bounding boxes, each containing a class probability. Confidence level and the position of the target box Its expression is: ,in, This is the adjustment value for the prediction box. For the first The size of the anchor point box It uses the sigmoid activation function. Next, a scaling function is defined. The predicted bounding box is adjusted according to the size of the target bounding box, and its expression is: ,in, Sensitivity to control scale It is the size of the target bounding box, and It is the average size of the target in the image;
[0021] Sort all bounding boxes. When sorting, first set a confidence threshold. Then, based on the set threshold The expression for filtering out valid boxes is: ,in, Display box The final confidence score, if the confidence score of the target box is... If the threshold is met, the box is considered valid;
[0022] After complete sorting, the intersection-union ratio (IoU) between the target boxes is calculated, and boxes with high overlap are removed based on their IoU values. The IoU calculation formula is: ,in, It is the area of the intersection of the two boxes. are their union areas, if the IoU of two boxes exceeds a set threshold, the overlapping boxes will be removed, and only the box with higher confidence will be kept.
[0023] Optionally, the image analyzed by the particle analysis is subjected to texture feature extraction by a Gabor filter, and the steps are as follows:
[0024] The Gabor filter can extract the texture features of the image by performing convolution operation on the image in different frequencies and directions. The two-dimensional function of the Gabor filter is as follows: wherein, is the rotated coordinate, is the wavelength, is the direction of the filter, is the phase offset, is the standard deviation of the Gaussian function, is the space aspect ratio;
[0025] The image subjected to the Gabor filtering is subjected to feature extraction, and the energy and variance and contrast features of the image are obtained. Subsequently, the target region is subjected to multi-scale and multi-direction Gabor filtering processing, and a plurality of texture features are obtained. These texture features are integrated into a high-dimensional feature vector for representing the texture characteristics of the target.
[0026] Optionally, the step of calculating and extracting the image texture features for representing the surface spraying quality is as follows:
[0027] The energy is an index for describing the local texture complexity of the image. For the image response subjected to the Gabor filter processing, the energy is expressed as follows: wherein, represents the convolution operation, is the original image of the target region, is the filter output;
[0028] The variance is a statistical quantity for measuring the degree of change of the image texture, and can reflect the roughness of the texture. For the image response subjected to the Gabor filter processing, the variance is expressed as follows: wherein, is the average value of the Gabor filtering result, is the number of pixel points;
[0029] The contrast between different texture patterns is obtained by calculating the gray level difference of the filter output, and the expression is as follows: wherein, and represent the filter response values of adjacent pixels.
[0030] Optionally, the particle distribution function needs to be calculated after the texture feature extraction in step four is completed and The distribution information of the surface particles is obtained, so as to further evaluate the surface spraying quality, and the calculation logic is as follows:
[0031] According to the distribution of the particles in the image , the average particle size of the image is calculated , and the scale of the opening operation is adjusted based on this , then, the adaptive particle size adjustment function is defined to control the scale change, and the expression is as follows: wherein, and are constants, adjusting the sensitivity of the particle size analysis scale, is the average particle size of the particles in the image;
[0032] Based on the result of the adaptive particle size analysis, the particle distribution function and is calculated by weighting, and the expression is as follows: wherein, represents the number of target pixels in the local area after the opening operation, represents the pixel value of the gray image, is the integral on the local area .
[0033] Optionally, the extracted texture features are classified using a support vector machine (SVM). The steps for improving the classification accuracy are as follows:
[0034] The standard form of the SVM is used for training, and the decision function of the support vector machine is as follows: wherein, is the kernel function in the SVM, is the label of the sample, is the Lagrange multiplier, is the bias term, is the input feature to be classified;
[0035] The radial basis kernel function (RBF) is selected as the kernel function of the SVM, and the form of the RBF kernel function is as follows: wherein, is the Gaussian width parameter, used to control the smoothness of the kernel function.
[0036] Optionally, the steps for optimizing the penalty factor C and the Gaussian width parameter σ through cross-validation are as follows:
[0037] The dataset is divided into training and validation sets. A common method for this is K-fold cross-validation, where the dataset is divided into training and validation sets. A subset, used each time One subset is used for training, and the remaining subset is used for validation;
[0038] For each group and The SVM model is trained on the training set and its classification performance is evaluated on the validation set by combining different parameters. The effectiveness of different parameter combinations is evaluated by calculating the classification accuracy, precision, and recall on the validation set.
[0039] Choose the option that maximizes classification accuracy. and The parameter combination serves as the final model parameters, and the cross-validation process can be completed through grid search, traversing the preset parameter space.
[0040] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art. Of course, any product implementing the present invention does not necessarily need to achieve all of the following advantages at the same time:
[0041] This invention employs the YOLOv3 model for rapid and accurate detection of target regions in images, and then utilizes a Gabor filter to extract texture features from the painted surface of a bicycle chainring. This method effectively distinguishes the surface features of different particles and captures subtle texture variations. Finally, the extracted texture features are input into a Support Vector Machine (SVM) classification model for training and classification, thereby achieving accurate assessment of paint quality. Compared to traditional manual inspection methods, this invention significantly improves detection accuracy and consistency, avoids human error, and is particularly suitable for complex situations where particle size and surface roughness are difficult to distinguish, providing a more objective and accurate assessment of paint quality.
[0042] This invention utilizes a Gabor filter to extract texture features from the detected target area, enabling analysis of texture variations on the sprayed surface across multiple scales and directions. This feature extraction method accurately reflects changes in surface coating quality and effectively distinguishes between different types of defects. By extracting texture features such as energy, variance, and contrast, this invention provides a more detailed quality assessment, offering rich feature support for subsequent classification.
[0043] 3、The application uses a support vector machine (SVM) to classify texture features, adopts a radial basis kernel function (RBF) to optimize the classification results, adjusts a penalty factor C and a Gaussian width parameter s through cross-validation, and improves the accuracy and robustness of the classification model. This texture feature-based classification method can achieve a good balance between classification accuracy and real-time performance, and is suitable for fast and accurate spraying quality detection on a production line.
[0044] The specific embodiments of the application will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0045] The drawings in the following description are only some embodiments, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings. In the drawings:
[0046] Figure 1 A flowchart of the spraying quality detection method is shown.
[0047] It should be noted that these drawings and written descriptions are not intended to limit the scope of the concept of the application in any way, but to illustrate the concept of the application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0048] The application will now be described in further detail with reference to the accompanying drawings.
[0049] Please refer to Figure 1 In this embodiment, a bicycle tooth disc surface spraying quality detection method is provided, comprising the following steps:
[0050] Step 1: Obtain a high-resolution image of the bicycle tooth disc surface spraying; the image acquisition device is a 4800x9600 dpi resolution scanner, and image acquisition is performed by randomly selecting different areas.
[0051] Step 2: Perform denoising, graying and enhancement processing on the collected original image to reduce environmental interference and improve image quality;
[0052] Step 3: Perform particle analysis on the image by morphological method, select a suitable circular structural element, filter the image by N-opening operation, retain the features of the tooth disc spraying surface particles, and detect and label the target area in the image by YOLOv3; the structural element used in the particle analysis step is a 1-pixel circular structural element, which is used to screen and extract the features of the spraying surface particles.
[0053] Step four: texture feature extraction of the target area detected by YOLOv3 is performed by Gabor filter, and the energy, variance and contrast features of the image are calculated and extracted to represent the surface spraying quality; the parameters of the Gabor filter are σ = √2π, and the filter analyzes the image in different scales and directions to extract the texture features reflecting the change of the spraying surface quality.
[0054] Step five: the extracted texture features are classified by using support vector machine; a radial basis kernel function is used as the kernel function, and the penalty factor C and Gaussian width parameter σ are optimized by cross-validation to improve the classification accuracy.
[0055] Step six: the new image is classified by the trained SVM model, the spraying quality is evaluated based on the classification result, and the qualified or unqualified quality judgment result is output as the basis for production process adjustment and quality control.
[0056] In this embodiment, the image is analyzed by morphological method, a suitable circular structural element is selected, and N-opening operation is used to filter the image to retain the characteristics of the particles on the spraying surface of the disc.
[0057] A circular structural element with a radius of 1 pixel is selected for image screening, and the structural element is defined as a circular window with a radius of 1 pixel. The particle analysis of the image is defined as: wherein, represents morphological opening operation, which is defined as first dilation operation and then erosion operation, represents the structural element which is dilated times, is a positive integer; the opening operation consists of two steps of dilation and erosion, first the target area in the image is expanded by dilation operation, and then the noise and unnecessary details in the image are reduced by erosion operation. This process helps to eliminate small particle noise in the image and retain main and larger particle features, thereby improving the accuracy of particle analysis.
[0058] Morphological dilation operation extends a structural element for each pixel point in the image, for the image and the structural element , the dilation operation can be defined as: wherein, is the translation of the structural element at the point, and represents the application of the structural element to the image the process in FIG. 8, assuming that the image is a binary image, and is the result after N-opening operation, the calculation result of the particle analysis can be expressed by the number of pixels: represents the number of target pixels in the image after opening operation processing, represents the number of target pixels in the original image , then, the particle distribution is normalized, and the normalized particle distribution is defined as: wherein, is the number of target pixels of the image after opening operation processing, and the normalized particle distribution reflects the distribution of particles in the image after different opening operation levels , and for a gray-scale image , the particle distribution can be calculated by integration, and the expression is: wherein, is the definition domain of the gray-scale image , and represents the result of the image after opening operation, by processing each pixel in the image , the particle distribution of the image is calculated to obtain the particle feature information. Through morphological opening operation, the morphological information of the particles, such as the size, distribution and uniformity of the particles, can be accurately extracted. Through normalization processing, the particle distribution can be quantified, which further helps to identify whether there are unqualified particles on the sprayed surface.
[0059] By selecting a circular structural element with a radius of 1 pixel, the particles in the image can be carefully screened and analyzed, and the particle features related to the spraying quality can be extracted, thereby improving the accuracy of subsequent quality evaluation. Especially in the case of very fine particle size and distribution, the opening operation can effectively distinguish between qualified and unqualified particles.
[0060] For example, when detecting the quality of a sprayed surface of a bicycle disc, there may be some small particles (such as dust, bubbles or irregular sprayed substances) in the image, which may affect the evaluation of the spraying quality. If only artificial visual inspection is used, the small particles may lead to misjudgment. After the morphological opening operation, the dilation operation expands the particle area, and the erosion operation reduces small noise points that are not needed, and finally a clearer and more uniform particle distribution image is obtained. By normalizing the particle distribution, the distribution characteristics of the particles can be accurately calculated and extracted, and then input into the support vector machine model for training and classification, so that whether the product is qualified can be efficiently and objectively determined.
[0061] In this embodiment, the steps of detecting and labeling the target region in the image by YOLOv3 are as follows:
[0062] First, input the image to be detected into the YOLOv3 network, and the YOLOv3 divides the input image into multiple grids (such as ), and performs target detection on each grid through a convolutional neural network. Each grid is responsible for predicting the class and position of the target contained therein.
[0063] For each target frame, multiple prediction frames are output by each grid during prediction, and each prediction frame includes a class probability , a confidence , and a position of the target frame , wherein and are the center coordinates of the target frame, and are the width and height of the frame, and the expression is: wherein is the adjustment value of the prediction frame, is the size of the th anchor frame, is a Sigmoid activation function, and then a scale adaptation function is defined to adjust the prediction frame according to the size of the target frame, so that it is more suitable for the target in the image, and the expression is: wherein controls the sensitivity of the scale, is the size of the target frame, and is the average size of the target in the image;
[0064] Sort all target frames, and first set a confidence threshold , and then filter out the effective frame according to the set threshold , and the expression is: wherein represents the frame the final confidence of the bounding box, if the confidence of the target box is below the threshold, the box is considered valid;
[0065] After the complete sorting, the Intersection over Union (IoU) between the target boxes is calculated, and the boxes with high overlap are removed according to the IoU value. The IoU calculation formula is: where, is the intersection area of the two boxes, is the union area of the two boxes. If the IoU of the two boxes exceeds the set threshold, the overlapping box will be deleted, and only the box with higher confidence will be retained. The YOLOv3 model can simultaneously recognize and locate multiple targets by dividing the input image into multiple grids and performing independent prediction on each grid. This method realizes "end-to-end" detection, directly predicts the category and position without the need for multiple stage processing, greatly improving the detection speed. Each grid not only predicts one box, but multiple boxes, which can improve the detection ability of different targets in complex scenes. Each prediction box contains class probability, confidence, and position coordinates, which can accurately locate the position of the target and evaluate its confidence.
[0066] Secondly, to adapt to different sizes of targets in the image, YOLOv3 introduces a scale adaptation function. This allows the prediction box to adjust according to the actual size of the target, thereby improving the detection accuracy of targets with large size differences. Moreover, by calculating the Intersection over Union (IoU) between the target boxes and performing NMS processing, YOLOv3 can remove boxes with high overlap and only retain boxes with higher confidence. This avoids the situation where multiple boxes detect the same target, reduces repeated prediction, and improves the accuracy and clarity of the final result.
[0067] For example: Bicycle chainring spray quality detection
[0068] Suppose we use YOLOv3 to detect the spray particles on a bicycle chainring. There may be multiple particles on the sprayed surface, some of which are large and distributed sparsely, and some of which are small and densely distributed. YOLOv3 can detect targets in each grid by dividing the image into multiple grids. Each grid predicts multiple boxes, including the category of the particle (such as qualified or unqualified particles) and its position. If some particles are different in size or close in position, the scale adaptation function can adjust the size of the box to better fit the actual size of the particle. By setting a confidence threshold, YOLOv3 can automatically filter out particle detection boxes that do not meet the standard, ensuring that the output result is more accurate. In the final NMS stage, YOLOv3 can remove overlapping boxes and retain the most accurate detection result, ensuring that each particle is only detected once and not repeatedly calculated.
[0069] The embodiment is characterized in that the Gabor filter is used to extract the texture features of the image analyzed by the particle analysis, and the steps are as follows:
[0070] The Gabor filter can extract the texture features of the image by performing convolution operation on the image in different frequencies and directions. The two-dimensional function of the Gabor filter is as follows: wherein, is the rotated coordinate, is the wavelength, is the direction of the filter, is the phase offset, is the standard deviation of the Gaussian function, is the space aspect ratio;
[0071] The features of the image filtered by the Gabor filter are extracted to obtain the energy and variance, and the contrast features of the image. The texture features including the energy and variance and the contrast features are used as the feature description of the surface spraying quality. Then, the target region is processed by the Gabor filter in multiple scales and multiple directions to obtain multiple texture features. The texture features are integrated into a high-dimensional feature vector which is used to represent the texture characteristics of the target.
[0072] The embodiment is characterized in that the image texture features are calculated and extracted to represent the surface spraying quality, and the steps are as follows:
[0073] The energy is an index for describing the local texture complexity of the image. The expression of the energy of the image response processed by the Gabor filter is as follows: wherein, represents the convolution operation, is the original image of the target region, is the filter output, and the energy feature reflects the texture details of the target region.
[0074] The variance is a statistical quantity for measuring the change degree of the image texture, and can reflect the roughness of the texture. The expression of the variance of the image response processed by the Gabor filter is as follows: wherein, is the average value of the Gabor filtering result, is the number of pixel points.
[0075] The contrast between different texture modes is obtained by calculating the gray level difference of the filter output, and the expression is as follows: wherein, and represent the filter response values of adjacent pixels. The contrast feature can describe the change frequency of the texture.
[0076] Gabor filters are very effective image processing tools, especially in texture analysis. They can extract detailed information from images through convolution operations at different frequencies and directions. Due to their multi-scale and multi-directional nature, Gabor filters can capture subtle variations in images at various scales and directions, which is very helpful for texture feature extraction. This is particularly important for spray quality detection, as the roughness, particle size, uniformity, and other detailed features of the sprayed surface are often reflected in the texture.
[0077] Secondly, the texture features output by Gabor filters, such as energy, variance, and contrast, can form a high-dimensional feature vector through the combination of different scales and directions. This high-dimensional feature vector can more comprehensively represent the texture characteristics of the target and capture various subtle differences in the sprayed surface. A richer feature vector can improve the discriminative ability of the classifier (such as support vector machine SVM) for different spray quality.
[0078] The multi-scale and multi-directional processing characteristics of Gabor filters can effectively solve the diversity problem in images. For example, the particles on the sprayed surface may exhibit different texture features in different directions and scales. Through multi-scale and multi-directional Gabor filtering, texture information of different particles in various directions can be extracted, ensuring that surface details can be accurately captured at any angle and size.
[0079] Gabor filters can effectively enhance the robustness to surface texture changes and reduce the impact of noise and interference by filtering at multiple scales and directions. In this way, when there are subtle defects or non-uniformities on the sprayed surface, the filtered features can help accurately identify them, avoiding errors caused by environmental factors or different shooting angles.
[0080] For example, suppose a production line needs to check whether a large number of bicycle toothed discs are sprayed correctly. Traditional manual detection may miss some small defects, such as uneven particle distribution or slight changes in the roughness of the sprayed surface. Through texture analysis using Gabor filters, these small differences can be automatically detected in a computer vision system. For example, for a sprayed surface with large particles and uneven distribution, Gabor filters will extract texture features with high contrast and variance, and the SVM classifier will accurately judge that the toothed disc is unqualified. Compared with manual inspection, using Gabor filters and SVM classification can more accurately and stably detect spray quality, especially when dealing with samples with small particles and slight changes in surface roughness, it can improve the sensitivity of detection.
[0081] After completing the texture feature extraction in step four, the particle distribution function needs to be calculated and The distribution information of surface particles is obtained to further evaluate the surface spraying quality, and the calculation logic is:
[0082] According to the distribution of particles in the image , the average particle size of the image is calculated , and the scale of the opening operation is adjusted based on this , then the adaptive particle size adjustment function is defined to control the scale change, and its expression is: where, and are constants, adjusting the sensitivity of the particle size analysis scale, is the average particle size of the particles in the image;
[0083] Based on the results of adaptive particle size analysis, the particle distribution function and is calculated by weighting, and its expression is: where, represents the number of target pixels in the local area after opening operation, represents the pixel value of the gray image, is the integral on the local area .
[0084] By calculating the average size of the particles in the image, the scale of the opening operation is dynamically adjusted, so that the results of particle analysis can be more accurate and flexible. Adaptive particle size adjustment can automatically optimize the analysis process according to the size of particles in different images, avoiding the limitations of fixed scale. For the case of uneven particle size on the sprayed surface, adaptive particle size adjustment can better adapt to particles of different sizes and provide more accurate texture feature extraction. In addition, adjusting the scale of particle size analysis based on the distribution of particles in the image helps to enhance the accuracy of image analysis, especially in the case of inconsistent particle size. The adaptive particle size adjustment function can automatically adjust the scale according to the characteristics of particles in the image, thereby optimizing the opening operation process, so that the particle analysis results are more consistent with the characteristics of the actual sprayed surface.
[0085] Finally, the adaptive granularity analysis not only adjusts the sensitivity of particle analysis on a global scale, but also performs weighted calculation for local regions in the image. This can make the particle analysis of each local region more accurate, reduce noise interference in the local region, effectively capture subtle differences, and improve the reliability of overall quality determination. The particle distribution, roughness, and other quality characteristics of the sprayed surface may differ between different products or different locations of the same product. Through adaptive granularity adjustment, the detection system can dynamically adjust the analysis scale according to the specific particle distribution of each image, ensuring that the quality characteristics of different sprayed surfaces can be accurately detected.
[0086] For example, in a certain production batch, the automatic detection system finds that a part of the sprayed surfaces of bicycle tooth plates have large particles, while another part of the tooth plates shows fine sprayed surfaces. Traditional detection methods cannot effectively identify these different particle characteristics, and may misjudge large particles as unqualified products. However, after using adaptive granularity adjustment, the system can automatically adjust the analysis scale according to the particle size, using a larger scale opening operation for larger particle regions and a smaller scale opening operation for small particle regions, thereby ensuring more accurate particle analysis and ultimately providing more accurate quality evaluation.
[0087] In this embodiment, the extracted texture features are classified using a support vector machine (SVM). A radial basis kernel function (RBF) is used as the kernel function and the penalty factor C and Gaussian width parameter σ are optimized through cross-validation to improve the classification accuracy.
[0088] A support vector machine is selected as the classification model. SVM separates different classes of samples by finding an optimal hyperplane, and its core goal is to maximize the classification interval to improve the accuracy and robustness of classification. The standard form of SVM is used for training, and the decision function of SVM is: where, is the kernel function in SVM, is the label of the sample, is the Lagrange multiplier, is the bias term, is the input feature to be classified;
[0089] In SVM, selecting an appropriate kernel function has an important impact on classification performance. Since the extracted texture features may have nonlinear relationships, a radial basis kernel function (RBF) is selected as the kernel function of SVM. The form of the RBF kernel function is: where, is the Gaussian width parameter, which controls the smoothness of the kernel function. By adjusting and the penalty factor , the classification performance of the model can be optimized.
[0090] Using the optimized and parameters, the final SVM model is trained on the entire training set. This model will classify new samples based on texture features, and the performance of the final model is evaluated on an independent test set, calculating accuracy, confusion matrix, and other evaluation metrics on the test set to verify whether the model can effectively classify the quality of the spray coating on the dental tray surface.
[0091] Support Vector Machine (SVM) is a powerful classification model that can greatly improve the classification accuracy of the model by selecting an appropriate kernel function (such as the Radial Basis Function RBF) to handle non-linear relationships. The decision boundary of SVM can effectively separate data of different classes, maximizing the classification interval, thereby improving the accuracy and generalization ability of the model.
[0092] When using SVM, by selecting the Radial Basis Function (RBF) and optimizing its parameters, it can effectively deal with complex texture features and noise problems. This method can provide more stable and robust classification results in the case of sample data distribution changes or noise interference, reducing the risk of misjudgment and overfitting.
[0093] During the training process, the performance of the SVM model is evaluated by calculating accuracy, confusion matrix, and other indicators, which can comprehensively understand the performance of the model on different quality categories, further analyze and optimize the classification ability of the model. This helps to ensure the efficiency of the model in practical applications, especially in real-time monitoring of spray quality on the production line, which can accurately determine whether the product meets the quality standards.
[0094] For example, suppose there are two types of dental trays with different spray quality that need to be detected in the production process:
[0095] Good product: The spray surface has fine and uniform particles. Unqualified product: The spray surface has large particles and uneven distribution. After extracting the texture features by the Gabor filter, the SVM model classifies these features. The optimized SVM model can accurately distinguish between good dental tray spray and unqualified dental tray spray. Assuming the accuracy of the model on the test set is 95%, it means that the model can effectively distinguish between the two types of spray quality dental trays and can detect the spray quality in real time on the production line, greatly reducing the error rate of manual detection.
[0096] In this embodiment, the steps of optimizing the penalty factor C and the Gaussian width parameter σ through cross-validation are as follows:
[0097] The data set is divided into training set and validation set. The commonly used division method is K-fold cross-validation, in which the data set is divided into subsets, and each time One subset is used for training, and the remaining subset is used for validation;
[0098] For each group and The SVM model is trained on the training set and its classification performance is evaluated on the validation set by combining different parameters. The effectiveness of different parameter combinations is evaluated by calculating the classification accuracy, precision, and recall on the validation set.
[0099] Choose the option that maximizes classification accuracy. and The parameter combination, as the final model parameters, can be cross-validated through a grid search, traversing a predefined parameter space (e.g., ...). From 0.1 to 1000, (From 0.01 to 1). By optimizing the penalty factor (C) and Gaussian width parameter (σ) through cross-validation, the model's sensitivity to different features can be adjusted, ensuring the optimal parameter combination is obtained during training. This automated tuning process helps achieve better classification results in different coating quality scenarios, whether on coating surfaces with high or low particle roughness.
[0100] In the field of surface coating quality inspection, existing technologies mainly employ surface defect detection based on traditional image processing.
[0101] This approach typically employs classic image processing techniques (such as edge detection, thresholding, and filtering) for surface defect detection. The process usually includes: acquiring surface images using a low-resolution camera or scanner; denoising and converting the images to grayscale; extracting image features using edge detection and grayscale histogram analysis; classifying the features based on traditional pattern recognition methods (such as thresholding and simple rule-based classification); and finally determining the coating quality.
[0102] The disadvantages of this approach are: 1) low accuracy, especially when the surface texture is complex, it is difficult to accurately identify small defects; 2) it cannot effectively deal with different types of defects.
[0103] To ensure the fairness and reliability of this comparative experiment, all technical solutions were tested under the same equipment environment and using the same image dataset. The specific equipment and data configurations are as follows:
[0104] All technical solutions use the same high-resolution scanner for image acquisition; scanner model: EpsonPerfection V850 Pro; resolution: 4800×9600 dpi; color mode: 24-bit RGB color mode.
[0105] Data acquisition method: The surface of the bicycle chainring is directly scanned by a scanner to ensure high image resolution and rich detail, which is suitable for defect detection.
[0106] Computing hardware configuration
[0107] All algorithms run in the following unified hardware environment:
[0108] Processor: Intel Core i7-9700K (8 cores, 3.6 GHz); Memory: 16 GB DDR4; Graphics Card: NVIDIA GTX 1080 Ti (8GB GDDR5X); Storage: 1TB SSD; Operating System: Windows 10 64-bit; Development Tools: Python 3.8, OpenCV 4.5; TensorFlow 2.x (for CNN solutions); Scikit-learn (for SVM classification); Keras (for deep learning models)
[0109] Software environment
[0110] All technical solutions are developed and tested using the following unified software environment: Image processing: OpenCV (image denoising, grayscale conversion, morphological processing, etc.); Machine learning frameworks: TensorFlow / Keras (CNN training and inference) and Scikit-learn (SVM training and inference); Data processing and visualization: NumPy, Pandas, Matplotlib (for data processing and result display).
[0111] Dataset Description
[0112] The dataset used in the experiment contained images of multiple batches of bicycle chainring surfaces, each image containing different quality issues with the coated surface. These images have been manually annotated, with annotations including the type of defect on the coated surface (e.g., particles, spots, peeling, etc.) and whether it is acceptable (acceptable / unacceptable). Each image is at a resolution of 4800×9600 dpi to ensure that even minor surface defects can be captured.
[0113] Dataset size:
[0114] Total number of images: 5000; qualified samples: 2500; unqualified samples (containing defects): 2500
[0115] Image features: The sprayed surface against a complex background exhibits various spraying defect types, including but not limited to particles, color differences, cracks, and spots. Each image is labeled with the location and category of the defects.
[0116] Dataset partitioning
[0117] To ensure a fair comparison, the dataset was divided into training, validation, and test sets: Training set: 70% (3500 images), Validation set: 15% (750 images), Test set: 15% (750 images).
[0118] All schemes were trained and tested using the same training, validation, and test sets.
[0119] Experimental evaluation criteria:
[0120] To comprehensively evaluate the performance of different technical solutions, the following common classification and evaluation metrics are used:
[0121] Accuracy: A measure of the percentage of classes that are correctly classified. .
[0122] Recall: Measures the ability to correctly identify defective samples. .
[0123] F1 score: The harmonic mean of precision and recall, used to comprehensively evaluate classification performance. .
[0124] Processing time: The processing time for each image, in seconds, used to measure the real-time performance of the algorithm.
[0125] With the unified equipment, data, and experimental conditions set above, the performance results of the two technical solutions are as follows:
[0126] Technical Solution Accuracy (%) Recall (%) F1 Score Average Processing Time (seconds) Conventional image processing 0.85 0.8 0.825 1.5 The present invention 0.95 0.93 0.94 2.8
[0127] This solution outperforms existing technologies in both accuracy and recall, with a particularly significant improvement in recall, enabling better identification of coating defects. F1 Score: This solution achieves a higher F1 score compared to the other two solutions, indicating its superior overall performance. Processing Time: Compared to traditional image processing methods, this solution offers better real-time performance, making it suitable for real-time quality inspection on production lines.
[0128] This invention is not limited to the embodiments described above. Anyone should understand that structural changes made under the guidance of this invention, and any technical solutions that are the same as or similar to this invention, fall within the protection scope of this invention. Technical aspects, shapes, and structures not described in detail in this invention are all publicly known technologies.
Claims
1. A method for inspecting the quality of coating on the surface of a bicycle chainring, characterized in that, Includes the following steps: Step 1: Acquire a high-resolution image of the coating sprayed onto the surface of the bicycle chainring; Step 2: Denoise, convert to grayscale, and enhance the acquired raw images to reduce environmental interference and improve image quality; Step 3: Perform particle analysis on the image using morphological methods, select appropriate circular structural elements, filter the image using N-opening operations, preserve the characteristics of particles on the tooth disc sprayed surface, and detect and label the target areas in the image using YOLOv3. Step 4: Extract texture features from the target area detected by YOLOv3 using a Gabor filter, and calculate and extract the energy, variance, and contrast features of the image to characterize the surface coating quality. Step 5: Use a support vector machine to classify the extracted texture features. Then, use a radial basis function kernel as the kernel function and optimize the penalty factor C and Gaussian width parameter σ through cross-validation to improve classification accuracy. Step 6: Classify the new image using the trained SVM model, evaluate the spraying quality based on the classification results, and output a quality judgment result of qualified or unqualified. Calculate the particle distribution function and The distribution information of surface particles is obtained, thereby further evaluating the surface coating quality. The calculation logic is as follows: According to the image The distribution of particles in the image is analyzed, and the average particle size is calculated. And based on this, adjust the scale of the opening operation. Next, we define the adaptive granularity adjustment function. To control scale changes, its expression is: ,in, and This is a constant used to adjust the sensitivity of the particle size analysis scale. This represents the average particle size in the image. Based on the results of adaptive particle size analysis, the particle distribution function and The weighted calculation is expressed as follows: ,in, Indicates a local area go through The number of target pixels after the opening operation.
2. The method for detecting the quality of coating on the surface of a bicycle chainring according to claim 1, characterized in that, The steps for performing particle analysis on the image using morphological methods, selecting appropriate circular structural elements, and filtering the image using N-opening operations to preserve the characteristics of the particles on the toothed disc coating surface are as follows: Select a circular structural element with a radius of 1 pixel. Used for image filtering, structural element Defined as a circular window with a radius of 1 pixel, particle analysis is based on morphological opening operations for images. Its particle analysis Defined as: ,in; Morphological dilation operation Expand each pixel in the image by one structuring element. For the image... and structural elements The expansion operation energy is defined as: ,in, It is a structural element exist The translation of a point indicates that a structuring element is applied to the image. The process, followed by the particle distribution Normalization is performed to obtain the normalized particle distribution. Defined as: For grayscale images Particle distribution It can be calculated by integration, and its expression is: ,in, grayscale image Domain Representing an image go through The result obtained after the opening operation.
3. The method for detecting the quality of coating on the surface of a bicycle chainring according to claim 1, characterized in that, The steps for detecting and labeling target regions in an image using YOLOv3 are as follows: First, the image to be detected is input into the YOLOv3 network. YOLOv3 divides the input image into multiple grids and performs object detection on each grid through a convolutional neural network. For each target bounding box, predictions are made. During prediction, each grid cell outputs multiple predicted bounding boxes, each containing a class probability. Confidence level and the position of the target box Its expression is: ,in, This is the adjustment value for the prediction box. For the first The size of the anchor point box It uses the sigmoid activation function. Next, a scaling function is defined. The predicted bounding box is adjusted according to the size of the target bounding box, and its expression is: ,in, Sensitivity to control scale It is the size of the target bounding box, and It is the average size of the target in the image; Sort all bounding boxes. When sorting, first set a confidence threshold. Then, based on the set threshold The expression for filtering out valid boxes is: ,in, Display box The final confidence score, if the confidence score of the target box is... If the threshold is met, the box is considered valid; After complete sorting, the intersection-union ratio (IoU) between the target boxes is calculated, and boxes with high overlap are removed based on their IoU values. The IoU calculation formula is: ,in, It is the area of the intersection of the two boxes. It is their union area. If the IoU of two boxes exceeds a set threshold, the overlapping boxes will be deleted, and only the box with higher confidence will be kept.
4. The method for detecting the quality of coating on the surface of a bicycle chainring according to claim 1, characterized in that, The steps for extracting texture features from a grain-analyzed image using a Gabor filter are as follows: Gabor filters extract texture features from images by performing convolution operations at different frequencies and directions. The two-dimensional function of a Gabor filter is: ,in, The coordinates are after rotation. For wavelength, For the direction of the filter, For phase shift, Let be the standard deviation of the Gaussian function. The aspect ratio of the space; Feature extraction is performed on the Gabor-filtered image to obtain its energy, variance, and contrast features. Subsequently, multi-scale, multi-directional Gabor filtering is applied to the target region to obtain multiple texture features, which are then integrated into a high-dimensional feature vector. , used to characterize the texture properties of the target.
5. The method for detecting the quality of coating on the surface of a bicycle chainring according to claim 1, characterized in that, The steps for calculating and extracting image texture features to characterize the surface coating quality are as follows: Energy is a metric describing the local texture complexity of an image. For an image response processed by a Gabor filter, energy... The expression is: ,in, This represents the convolution operation. It is the original image of the target area. It is the filter output; Variance is a statistical measure of the degree of variation in image texture, reflecting the coarseness of the texture. For the image response extracted by the Gabor filter, variance... Its expression is: ,in, This represents the average value of the Gabor filtering results. The number of pixels; The contrast between different texture modes is obtained by calculating the difference in gray levels at the filter output. The expression is as follows: ,in, and This represents the filtered response value of adjacent pixels.
6. The method for detecting the quality of coating on the surface of a bicycle chainring according to claim 1, characterized in that, The steps to classify extracted texture features using support vector machines, employing a radial basis function kernel as the kernel function and optimizing the penalty factor C and Gaussian width parameter σ through cross-validation to improve classification accuracy are as follows: Using the standard form of SVM for training, the decision function of the support vector machine is: ,in, It is a kernel function in SVM. These are the sample labels. It is a Lagrange multiplier. It is a bias term. These are the input features to be classified; The radial basis function (RBF) is chosen as the kernel function for SVM. The RBF kernel function has the following form: ,in, It is the Gaussian width parameter, used to control the smoothness of the kernel function.
7. The method for detecting the quality of coating on the surface of a bicycle chainring according to claim 1, characterized in that, The steps for optimizing the penalty factor C and the Gaussian width parameter σ through cross-validation are as follows: The dataset is divided into training and validation sets using K-fold cross-validation. A subset, used each time One subset is used for training, and the remaining subset is used for validation; For each group and The combination of these methods allows for the training of an SVM model on the training set and the evaluation of its classification performance on the validation set. Choose the option that maximizes classification accuracy. and The parameter combination serves as the final model parameters, and the cross-validation process can be completed through grid search, traversing the preset parameter space.
Citation Information
Patent Citations
Quality evaluation method based on multi-granularity image information content
CN114549492A