Method for detecting surface spraying quality of bicycle crankset

Through high-resolution image processing and deep learning technology, combined with morphological analysis and texture feature extraction, the problem of inconsistency and accuracy of detection results in the quality inspection of surface spraying of bicycle discs is solved, and the spray quality evaluation with higher accuracy and consistency is achieved.

CN119810032AActive Publication Date: 2025-04-11XINGTAI LUNFENG VEHICLE MATERIALS CO LTD

Patent Information

Application Number
CN202411833553.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-11
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

The prior art has problems of inconsistency and poor accuracy in the quality of surface spraying of bicycle discs, especially in the case of uneven particle size and distribution, which are difficult to accurately judge.

Method used

High-resolution image acquisition and processing technology are used to perform particle analysis and object detection through morphological methods and YOLOv3 model, texture features are extracted in combination with Gabor filter, and classification is used with a support vector machine to achieve accurate evaluation of spray quality.

Benefits of technology

It significantly improves detection accuracy and consistency, reduces artificial errors, can accurately distinguish the surface characteristics and texture changes of different particles, and provides a more objective and accurate judgment of spray quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810032A_ABST
    Figure CN119810032A_ABST
Patent Text Reader

Abstract

The invention discloses a bicycle chain wheel surface spraying quality detection method, which is characterized in that a target area of an image is rapidly and accurately detected through a YOLOv3 model, and then texture feature information of a bicycle chain wheel spraying surface is extracted by using a Gabor filter. The method can effectively distinguish surface features of different particles and capture fine texture changes. And finally, inputting the extracted texture features into a support vector machine (SVM) classification model for training and classification, thereby realizing accurate evaluation of the spraying quality. Compared with a traditional manual detection method, the method has the advantages that the detection precision and consistency are remarkably improved, personal errors are avoided, the method is particularly suitable for the complex situation that the particle size and the surface roughness are difficult to distinguish, and more objective and accurate spraying quality judgment is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of spraying quality detection, and in particular relates to a method for detecting the spraying quality of a bicycle crankset surface. Background Art

[0002] Coating quality inspection plays an important role in modern manufacturing, especially for the quality control of sprayed surfaces of products such as automobiles, aviation and bicycles. Traditional spraying quality inspection methods mostly rely on manual inspection. Although this method can intuitively find some defects, it is often difficult to ensure the consistency and accuracy of the inspection results due to differences in experience and fatigue of inspectors. Especially on complex sprayed surfaces, defects such as particles, color difference, and cracks are often difficult to judge by the naked eye, thus affecting the overall quality of the product.

[0003] Traditional spraying quality inspection methods usually rely on manual visual inspection, which is not only highly subjective, but also easily affected by operator fatigue, experience differences and environmental factors, resulting in inconsistent and unstable test results. Since visual inspection mainly relies on manual observation of the sprayed surface, the manual judgment process will be disturbed by factors such as visual fatigue, psychological expectations, and changes in working environment light. Especially after working for a long time, the detection accuracy will drop significantly. In addition, it is difficult for manual inspectors to accurately distinguish the subtle differences in the sprayed surface, especially when parameters such as particle size and surface roughness are similar, which can easily lead to misjudgment.

[0004] During the spraying process of bicycle cranksets, the size and distribution uniformity of the particles on the spraying surface directly affect the final surface quality. The characteristics of these particles have a crucial impact on the functionality and aesthetics of the spray coating. In particular, when the particles are too large or unevenly distributed, it will cause problems such as surface roughness and spray coating shedding, while when the particles are too small and unevenly distributed, it 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 through manual inspection.

[0005] In view of this, the present invention is proposed. Summary of the invention

[0006] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a method for detecting the surface spraying quality of a bicycle crankset, thereby solving the problems raised in the above-mentioned background technology.

[0007] In order to solve the above technical problems, the basic concept of the technical solution adopted by the present invention is:

[0008] A method for detecting the surface spraying quality of a bicycle crankset comprises the following steps:

[0009] Step 1: Obtain a high-resolution image of the spray coating on the surface of the bicycle crankset;

[0010] Step 2: De-noise, grayscale and enhance the collected original image to reduce environmental interference and improve image quality;

[0011] Step 3: Use morphological methods to analyze the particles in the image, select appropriate circular structural elements, filter the image using N-open operations, retain the characteristics of the particles on the surface of the tooth plate spray, and detect and mark the target area in the image through YOLOv3;

[0012] Step 4: Use Gabor filter to extract texture features of the target area detected by YOLOv3, calculate and extract the energy, variance, and contrast features of the image to characterize the surface spraying quality;

[0013] Step 5: Use support vector machine to classify the extracted texture features. Use radial basis kernel function as kernel function and optimize penalty factor C and Gaussian width parameter σ through cross validation to improve classification accuracy;

[0014] Step 6: Classify the new image through the trained SVM model, evaluate the spraying quality based on the classification results, and output the qualified or unqualified quality judgment results.

[0015] Optionally, the steps of performing particle analysis on the image by using a morphological method, selecting a suitable circular structure element, filtering the image by using an N-open operation, and retaining the characteristics of the particles on the surface of the toothed disc spray are as follows:

[0016] A circular structure element E with a radius of 1 pixel is selected for image screening. The structure element E is defined as a circular window whose size is a circle with a radius of 1 pixel. The particle analysis operation is based on morphological opening operation. For image A, its particle analysis ψ n (A) is defined as: in;

[0017] Morphological dilation operation Expand a structural element for each pixel in the image. For image A and structural element E, the expansion operation can be defined as: Among them, E z is the translation of the structural element E at point z, which represents the process of applying the structural element to image A. Next, the particle distribution F A (n) is normalized, and the normalized particle distribution F A (n) is defined as: For the grayscale image g, the particle distribution F g (n) can be calculated by integration, and its expression is: Where L is the grayscale image g domain, ψ n g(x) represents the result obtained after n-opening operations on image g.

[0018] Optionally, the steps of detecting and labeling the target area in the image by YOLOv3 are:

[0019] First, the image to be detected is input into the YOLOv3 network. YOLOv3 divides the input image into multiple grids and performs target detection on each grid through a convolutional neural network.

[0020] Each target box is predicted. During the prediction, each grid will output multiple prediction boxes, each of which includes the category probability p class , Confidence And the position of the target box (x, y, w, h), its expression is: in, is the adjustment value of the prediction box, a j is the size of the jth anchor box, σ(·) is the Sigmoid activation function, and then a scale adaptation function f(s) is defined to adjust the prediction box according to the size of the target box. Its expression is: Among them, α controls the sensitivity of scale, s is the size of the target box, and is the average size of objects in the image;

[0021] All target boxes are sorted. When sorting, first, the confidence threshold θ is set, and then the valid boxes are filtered out according to the set threshold θ. The expression is: Among them, p final (xi) represents frame x i The final confidence of the target box is p final If the value is greater than the threshold, the frame is considered valid;

[0022] 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: Among them, |x∩y| is the intersection area of ​​the two boxes, and |x∩y| is their union area. If the IoU of two boxes exceeds the set threshold, the overlapping box will be deleted and only the box with higher confidence will be retained.

[0023] Optionally, the steps of extracting texture features from the particle analyzed image by using a Gabor filter are as follows:

[0024] The Gabor filter can extract the texture features of the image by performing convolution operations on the image at different frequencies and directions. The two-dimensional function of the Gabor filter is: Where (x′, y′) is the rotated coordinate, λ is the wavelength, θ is the direction of the filter, ψ is the phase shift, σ is the standard deviation of the Gaussian function, and γ is the spatial aspect ratio;

[0025] The Gabor filtered image is subjected to feature extraction to obtain the energy, variance and contrast features of the image. Subsequently, multiple texture features are obtained by performing multi-scale and multi-directional Gabor filtering on the target area. These texture features are integrated into a high-dimensional feature vector F to characterize the texture characteristics of the target.

[0026] Optionally, the steps of calculating and extracting image texture features for characterizing the surface spraying quality are:

[0027] Energy is an indicator that describes the complexity of local texture of an image. For the image response after being processed by the Gabor filter, the expression of energy E is: Among them, * represents the convolution operation, g(x, y) is the original image of the target area, and g λ,θ (x, y) is the filter output;

[0028] Variance is a statistic that measures the degree of change in image texture and can reflect the roughness of the texture. For the image response extracted by the Gabor filter, the variance V λ,θ Its expression is: Among them, μ λ,θ is the average value of Gabor filtering results, N is the number of pixels;

[0029] The contrast between different texture patterns is obtained by calculating the grayscale difference of the filter output, which is expressed as: Among them, g λ,θ (i) and g λ,θ (i-1) represents the filter response value of the adjacent pixel.

[0030] Optionally, after completing the texture feature extraction in step 4, it is also necessary to calculate the particle distribution function F A (n) and F G (n) Obtain the distribution information of surface particles to further evaluate the surface spraying quality. The calculation logic is:

[0031] According to the distribution of particles in image A, calculate the average particle size n of the image avg , and based on this, adjust the scale n of the open operation. Then, define the adaptive granularity adjustment function f(n) to control the scale change, and its expression is Among them, γ and β are constants that adjust the sensitivity of the particle size analysis scale, n avg is the average particle size of particles in the image;

[0032] Based on the results of adaptive particle size analysis, the particle distribution function F A (n) and F G (n) is weighted and its expression is: Among them, Ω[ψ n (A(x))] represents the number of target pixels after n-opening operation in the local area x, g(x) represents the pixel value of the grayscale image, is the local area L x The points on .

[0033] Optionally, a support vector machine (SVM) is used to classify the extracted texture features. The steps of using a radial basis kernel function (RBF) as a kernel function and optimizing the penalty factor C and the Gaussian width parameter σ through cross-validation to improve the classification accuracy are:

[0034] Using the standard form of SVM for training, the decision function of the support vector machine is: Among them, K(x i , x) is the kernel function in SVM, y i is the label of the sample, α i is the Lagrange multiplier, b is the bias term, and x is the input feature to be classified;

[0035] The radial basis kernel function (RBF) is selected as the kernel function of SVM. The form of the RBF kernel function is: Among them, σ is the Gaussian width parameter, which is used to control the smoothness of the kernel function.

[0036] Optionally, the steps for optimizing the penalty factor C and Gaussian width parameter σ by cross-validation are:

[0037] Divide the dataset into training set and validation set. A common division method is K-fold cross validation, where the dataset is divided into K subsets, K-1 subsets are used for training each time, and the remaining subset is used for validation;

[0038] For each combination of C and σ, train the SVM model on the training set and evaluate its classification performance on the validation set. The effects of different parameter combinations are evaluated by calculating the classification accuracy, precision, recall and other indicators on the validation set.

[0039] The C and σ parameter combination that can maximize the classification accuracy is selected as the final model parameter. The cross-validation process can be completed through grid search, traversing the preset parameter space.

[0040] After 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 the advantages described below at the same time:

[0041] 1. Use the YOLOv3 model to quickly and accurately detect the target area of ​​the image, and then use the Gabor filter to extract the texture feature information of the spray surface of the bicycle crankset. This method can effectively distinguish the surface features of different particles and capture subtle texture changes. Finally, the extracted texture features are input into the support vector machine (SVM) classification model for training and classification, thereby achieving an accurate assessment of the spray quality. Compared with traditional manual detection methods, the present invention significantly improves detection accuracy and consistency, avoids human errors, and is particularly suitable for complex situations where particle size and surface roughness are difficult to distinguish, providing a more objective and accurate spray quality judgment.

[0042] 2. The present invention uses Gabor filter to extract texture features of the detected target area, and can analyze the texture changes of the sprayed surface in multiple scales and directions. This feature extraction method can accurately reflect the changes in the surface spraying quality and effectively distinguish different types of defects. Through the extracted texture features such as energy, variance, contrast, etc., the present invention can provide a more detailed quality assessment and provide rich feature support for subsequent classification.

[0043] 3. The present invention uses support vector machine (SVM) to classify texture features and adopts radial basis kernel function (RBF) to optimize the classification results. The penalty factor C and Gaussian width parameter σ are adjusted by cross-validation to improve the accuracy and robustness of the classification model. This classification method based on texture features can achieve a good balance between classification accuracy and real-time performance, and is suitable for fast and accurate spray quality detection on the production line.

[0044] The specific implementation modes of the present invention are further described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The drawings described below are only some embodiments. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0046] Figure 1 The figure is a flow chart of the spraying quality inspection method.

[0047] It should be noted that these drawings and textual descriptions are not intended to limit the conceptual scope of the present invention in any way, but are intended to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0048] The present invention will now be described in further detail with reference to the accompanying drawings.

[0049] See also Figure 1As shown, in this embodiment, a method for detecting the surface spraying quality of a bicycle crankset is provided, comprising the following steps:

[0050] Step 1: Obtain a high-resolution image of the spray coating on the surface of the bicycle crankset; the image acquisition device is a scanner with a resolution of 4800×9600 dpi, and the image is acquired by randomly selecting different areas.

[0051] Step 2: De-noise, grayscale and enhance the collected original image to reduce environmental interference and improve image quality;

[0052] Step 3: Perform particle analysis on the image through morphological methods, select appropriate circular structure elements, filter the image using N-open operation, retain the characteristics of the particles on the surface of the toothed disc spray, and detect and mark the target area in the image through YOLOv3; the structure element used in the particle analysis step is a circular structure element with a radius of 1 pixel, which is used to screen and extract the characteristics of the particles on the spray surface.

[0053] Step 4: Use Gabor filter to extract texture features of the target area detected by YOLOv3, calculate and extract the energy, variance, and contrast features of the image to characterize the surface spraying quality; the parameter of the Gabor filter is σ=√2π, and the filter analyzes the image at different scales and directions to extract texture features that can reflect the changes in the quality of the sprayed surface.

[0054] Step 5: Use support vector machine to classify the extracted texture features. Use radial basis kernel function as kernel function and optimize penalty factor C and Gaussian width parameter σ through cross validation to improve classification accuracy;

[0055] Step 6: Classify the new image through the trained SVM model, evaluate the spraying quality based on the classification results, and output the qualified or unqualified quality judgment results as the basis for production process adjustment and quality control.

[0056] In this embodiment, the steps of performing particle analysis on the image by using a morphological method, selecting a suitable circular structure element, filtering the image by using an N-open operation, and retaining the characteristics of the particles on the surface of the tooth plate spray are as follows:

[0057] A circular structure element E with a radius of 1 pixel is selected for image screening. The structure element E is defined as a circular window whose size is a circle with a radius of 1 pixel. The particle analysis operation is based on morphological opening operation. For image A, its particle analysis ψ n (A) is defined as: in, represents the morphological opening operation, which is defined as a dilation operation followed by an erosion operation. nIt represents the result of the structural element E being expanded n times, where n is a positive integer. The opening operation consists of two steps: expansion and erosion. First, the target area in the image is expanded by the expansion operation, and then the noise and unnecessary details in the image are reduced by the erosion operation. This process helps to eliminate small particle noise in the image and retain the main, larger particle features, thereby improving the accuracy of particle analysis.

[0058] Morphological dilation operation Expand a structural element for each pixel in the image. For image A and structural element E, the expansion operation can be defined as: Among them, E z is the translation of the structural element E at point z, which represents the process of applying the structural element to image A. Assume that image A is a binary image and ψ n (A) is the result obtained after N-open operation. The calculation result of particle analysis can be expressed in terms of the number of pixels: Ω[ψ n (A)] represents the number of target pixels in the image after n-open operation, Ω(A) represents the number of target pixels in the original image A, and then, the particle distribution F A (n) is normalized, and the normalized particle distribution F A (n) is defined as: Among them, Ω[ψ 1 (A)] is the target pixel number obtained after the image is processed by 1-open operation. The normalized particle distribution F A (n) reflects the distribution of particles in the image after different opening operation levels n. For grayscale image g, particle distribution F g (n) can be calculated by integration, and its expression is: Where L is the grayscale image g domain, ψ n g(x) represents the result obtained after n-opening of image g. By processing each pixel in image g, the particle distribution of the image is calculated to obtain the particle feature information. Through morphological opening, the morphological information of particles, such as particle size, distribution and uniformity, 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 spray 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 assessment. Especially when the particle size and distribution are very fine, the opening operation can effectively distinguish between qualified and unqualified particles.

[0060] For example: when testing the quality of the spray surface of a bicycle crankset, there may be some tiny particles (such as dust, bubbles or irregular spray materials) in the image, which may affect the evaluation of the spray quality. If only manual visual inspection is used, misjudgment may occur due to the tiny size of the particles. After the morphological opening operation is adopted, the expansion operation will expand the area of ​​these particles, and the corrosion operation will reduce the unnecessary small noise points, and finally a clearer and more uniform particle distribution image will be obtained. By normalizing the particle distribution, the distribution characteristics of the particles can be accurately calculated and extracted, and then they can be input into the support vector machine model for training and classification, so as to efficiently and objectively determine whether the product is qualified.

[0061] In this embodiment, the steps of detecting and marking the target area in the image by YOLOv3 are as follows:

[0062] First, the image to be detected is input into the YOLOv3 network, which divides the input image into multiple grids (such as S×S grids) and performs object detection on each grid through a convolutional neural network. Each grid is responsible for predicting the category and location of the target it contains.

[0063] Each target box is predicted. During the prediction, each grid will output multiple prediction boxes, each of which includes the category probability p class , Confidence And the position of the target box (x, y, w, h), where x and y are the center coordinates of the target box, and w and h are the width and height of the box. The expression is: in, is the adjustment value of the prediction box, a j is the size of the jth anchor box, σ(·) is the Sigmoid activation function, and then a scale adaptation function f(s) is defined to adjust the prediction box according to the size of the target box to make it more suitable for the target in the image. Its expression is: Among them, α controls the sensitivity of scale, s is the size of the target box, and is the average size of objects in the image;

[0064] All target boxes are sorted. When sorting, first, the confidence threshold θ is set, and then the valid boxes are filtered out according to the set threshold θ. The expression is: Among them, p final (x i ) represents the box x i The final confidence of the target box is p final If the value is greater than the threshold, the frame 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: Among them, |x∩y| is the intersection area of ​​the two boxes, and |x∩y| is their union area. If the IoU of the two boxes exceeds the set threshold, the overlapping boxes will be deleted and only the boxes with higher confidence will be retained. The YOLOv3 model can simultaneously identify and locate multiple targets by dividing the input image into multiple grids and making independent predictions for each grid. This method implements "end-to-end" detection, directly predicting categories and locations without going through multiple stages of processing, greatly improving the detection speed. Each grid predicts not only one box, but multiple boxes, which can improve the detection ability of different targets in complex scenes. Each predicted box contains category probability, confidence, and location coordinates, which can accurately locate the location of the target and evaluate its confidence at the same time.

[0066] Secondly, in order to adapt to objects of different sizes in the image, YOLOv3 introduces a scale adaptation function. This allows the prediction box to be adjusted according to the actual size of the object, thereby improving the detection accuracy of objects with large size differences. In addition, 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 object, reduces repeated predictions, and improves the accuracy and clarity of the final result.

[0067] Example: Bicycle chainring spray quality inspection

[0068] Suppose we use YOLOv3 to detect spray particles on a bicycle crankset. There may be multiple particles on the spray surface, some of which are large and sparsely distributed, while others are small and densely distributed. YOLOv3 can detect targets in each grid by dividing the image into multiple grids. Each grid predicts multiple boxes, which include the category of the particle (such as qualified particles or unqualified particles) and its location. If some particles are of different sizes or close in location, the size of the box can be adjusted through the scale adaptation function to better fit the actual size of the particle. By setting the confidence threshold, YOLOv3 can automatically filter out particle detection boxes that do not meet the standards to ensure that the output results are more accurate. In the final NMS stage, YOLOv3 can remove overlapping boxes and retain the most accurate detection results, thereby ensuring that each particle is detected only once and is not counted repeatedly.

[0069] In this embodiment, the steps of extracting texture features from the image after particle analysis by using a Gabor filter are as follows:

[0070] The Gabor filter can extract the texture features of the image by performing convolution operations on the image at different frequencies and directions. The two-dimensional function of the Gabor filter is: Where (x′, y′) is the rotated coordinate, λ is the wavelength, θ is the direction of the filter, ψ is the phase shift, σ is the standard deviation of the Gaussian function, and is the spatial aspect ratio;

[0071] The image after Gabor filtering is subjected to feature extraction to obtain the energy, variance and contrast features of the image. Texture features include energy, variance and contrast features, which are used as feature descriptions of surface spraying quality. Subsequently, multiple texture features are obtained by performing multi-scale and multi-directional Gabor filtering on the target area. These texture features are integrated into a high-dimensional feature vector F to characterize the texture characteristics of the target.

[0072] In this embodiment, the steps of calculating and extracting image texture features for characterizing the surface spraying quality are as follows:

[0073] Energy is an indicator that describes the complexity of local texture of an image. For the image response after being processed by the Gabor filter, the expression of energy E is: Among them, * represents the convolution operation, g(x, y) is the original image of the target area, and g λ,θ (x, y) is the filter output, and the energy feature reflects the texture details of the target area;

[0074] Variance is a statistic that measures the degree of change in image texture and can reflect the roughness of the texture. For the image response extracted by the Gabor filter, the variance V λ·θ Its expression is: Among them, μ λ,θ is the average value of Gabor filtering results, N is the number of pixels;

[0075] The contrast between different texture patterns is obtained by calculating the grayscale difference of the filter output, which is expressed as: Among them, g λ,θ (i) and g λ,θ (i-1) represents the filter response value of the adjacent pixel. The contrast feature can describe the frequency of texture changes.

[0076] Gabor filter is a very effective image processing tool, especially in texture analysis. It can extract detailed information in the image through convolution operations of different frequencies and directions. Due to the multi-scale and multi-directional characteristics of the Gabor filter itself, it can capture subtle changes in various scales and directions in the image, which is very helpful for texture feature extraction. This is particularly important for spray quality inspection, because the detailed features of the spray surface such as roughness, particle size, uniformity, etc. are usually reflected in the texture.

[0077] Secondly, the texture features output by the Gabor filter, 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 characterize the texture characteristics of the target and capture various subtle differences in the sprayed surface. Richer feature vectors can improve the ability of classifiers (such as support vector machines SVM) to distinguish different spraying qualities.

[0078] The multi-scale and multi-directional processing characteristics of Gabor filters can effectively solve the diversity problems existing in images. For example, particles on a sprayed surface may show different texture characteristics at different directions and scales. Through multi-scale and multi-directional Gabor filtering, the 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 flaws or non-uniformities on the sprayed surface, the filtered features can help accurately identify them and avoid errors caused by environmental factors or different shooting angles.

[0080] For example: suppose that on a production line, inspectors need to check whether a large number of bicycle cranksets are sprayed properly. Traditional manual inspection may miss some minor defects, such as uneven particle distribution or slight changes in the roughness of the sprayed surface. Texture analysis through Gabor filters can automatically detect these minor differences in computer vision systems. For example, for a sprayed surface, if there are large particles on the surface and the particles are unevenly distributed, the Gabor filter will extract texture features with high contrast and variance, and the SVM classifier will be able to accurately judge that the crankset is unqualified. Compared with manual inspection, the method of using Gabor filters and SVM classification can perform spray quality inspection more accurately and stably, especially when dealing with samples with fine particles and small changes in surface roughness, which can improve the sensitivity of detection.

[0081] In this embodiment, after completing the texture feature extraction in step 4, it is also necessary to calculate the particle distribution function F A (n) and F G (n) Obtain the distribution information of surface particles to further evaluate the surface spraying quality. The calculation logic is:

[0082] According to the distribution of particles in image A, calculate the average particle size n of the image avg , and based on this, adjust the scale n of the open operation. Then, define the adaptive granularity adjustment function f(n) to control the scale change, and its expression is: Among them, γ and β are constants that adjust the sensitivity of the particle size analysis scale, n avg is the average particle size of particles in the image;

[0083] Based on the results of adaptive particle size analysis, the particle distribution function F A (n) and F G (n) is weighted and its expression is: Among them, Ω[ψ n (A(x))] represents the number of target pixels after n-opening operation in the local area x, g(x) represents the pixel value of the grayscale image, is the local area L x The points on .

[0084] By calculating the average size of the particles in the image, the scale of the opening operation is dynamically adjusted, making the results of the particle analysis more accurate and flexible. Adaptive particle size adjustment can automatically optimize the analysis process according to the particle size of different images, avoiding the limitations of fixed scales. For the uneven particle size of 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 sizes. The adaptive particle size adjustment function can automatically adjust the scale according to the particle characteristics in the image, thereby optimizing the opening operation process and making the particle analysis results more consistent with the characteristics of the actual sprayed surface.

[0085] Finally, adaptive particle size analysis can not only adjust the sensitivity of particle analysis on a global scale, but also perform weighted calculations on local areas in the image. This can make the particle analysis of each local area more accurate, reduce noise interference in the local area, and effectively capture subtle differences, thereby improving the reliability of overall quality judgment. The quality characteristics of the sprayed surface, such as particle distribution and roughness, may vary for different products or different locations of the same product. Through adaptive particle size 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 production batch, the automatic inspection system found that some bicycle cranksets had large particles on the spray surface, while other cranksets had a fine spray surface. Traditional inspection methods cannot effectively identify these different particle characteristics and may misjudge large particles as substandard products. However, with adaptive particle size adjustment, the system can automatically adjust the analysis scale according to the particle size, using a larger scale opening operation for larger particle areas and a smaller scale opening operation for fine particle areas, thereby ensuring more precise particle analysis and ultimately providing more accurate quality assessment.

[0087] In this embodiment, a support vector machine (SVM) is used to classify the extracted texture features. The radial basis kernel function (RBF) is used as the kernel function and the penalty factor C and the Gaussian width parameter σ are optimized through cross-validation to improve the classification accuracy.

[0088] Select support vector machine as the classification model. SVM separates samples of different categories by finding an optimal hyperplane. Its core goal is to maximize the classification interval to improve the accuracy and robustness of classification. Use the standard form of SVM for training. The decision function of the support vector machine is: Among them, K(x i , x) is the kernel function in SVM, y i is the label of the sample, α i is the Lagrange multiplier, b is the bias term, and x is the input feature to be classified;

[0089] In SVM, choosing a suitable kernel function has an important impact on classification performance. Since the extracted texture features may have a nonlinear relationship, the radial basis kernel function (RBF) is selected as the kernel function of SVM. The form of the RBF kernel function is: Among them, σ is the Gaussian width parameter, which is used to control the smoothness of the kernel function. By adjusting σ and the penalty factor C, the classification performance of the model can be optimized.

[0090] The final SVM model is trained on the entire training set using the optimized C and σ parameters. The model will classify new samples based on texture features, evaluate the performance of the final model on an independent test set, calculate the accuracy, confusion matrix and other evaluation indicators on the test set, and verify whether the model can effectively classify the surface spray quality of the tooth plate.

[0091] Support vector machine (SVM) is a powerful classification model. By selecting a suitable kernel function (such as radial basis kernel function RBF) to handle nonlinear relationships, the classification accuracy of the model can be greatly improved. The decision boundary of SVM can effectively separate different categories of data and maximize the classification interval, thereby improving the accuracy and generalization ability of the model.

[0092] When using SVM, by selecting the radial basis kernel function (RBF) and optimizing its parameters, complex texture features and noise problems can be effectively dealt with. This method can provide more stable and robust classification results when the sample data distribution changes or there is noise interference, reducing the risk of misjudgment and overfitting.

[0093] During the training process, the performance of the SVM model is evaluated by calculating indicators such as accuracy and confusion matrix, which can fully understand the performance of the model in different quality categories and further analyze and optimize the classification ability of the model. This helps to ensure the efficiency of the model in practical applications, especially when monitoring the spraying quality in real time on the production line, and accurately determine whether the product meets the quality standards.

[0094] For example: Suppose during the production process, there are two types of toothed discs with different coating qualities that need to be tested:

[0095] Qualified products: The particles on the spraying surface are small and uniform. Unqualified products: The particles on the spraying surface are large and unevenly distributed. After the texture features are extracted by the Gabor filter, the SVM model classifies these features. The optimized SVM model can accurately distinguish between qualified and unqualified tooth disc spraying. Assuming that the accuracy of the model on the test set is 95%, it means that the model can effectively distinguish between the two types of tooth discs with different spraying qualities, and can detect the spraying quality in real time on the production line, greatly reducing the error rate of manual inspection.

[0096] In this embodiment, the steps of optimizing the penalty factor C and the Gaussian width parameter σ through cross-validation are:

[0097] Divide the dataset into training set and validation set. A common division method is K-fold cross validation, where the dataset is divided into K subsets, K-1 subsets are used for training each time, and the remaining subset is used for validation;

[0098] For each combination of C and σ, train the SVM model on the training set and evaluate its classification performance on the validation set. The effects of different parameter combinations are evaluated by calculating the classification accuracy, precision, recall and other indicators on the validation set.

[0099] The C and σ parameter combination that maximizes the classification accuracy is selected as the final model parameter. The cross-validation process can be completed through grid search, traversing the preset parameter space (for example, C from 0.1 to 1000, σ from 0.01 to 1). By optimizing the penalty factor (C) and Gaussian width parameter (σ) through cross-validation, the sensitivity of the model to different features can be adjusted to ensure the optimal parameter combination during training. This automated tuning process helps to achieve better classification results in different spray quality scenarios, whether on spray surfaces with high or low particle roughness.

[0100] In the field of surface spraying quality inspection, the existing technology mainly adopts surface defect detection based on traditional image processing.

[0101] This solution usually uses classic image processing techniques (such as edge detection, threshold segmentation, filtering, etc.) to detect surface defects. The processing flow usually includes: using a low-resolution camera or scanner to collect surface images. De-noising and grayscale processing of the image. Extracting image features through edge detection, grayscale histogram analysis and other methods. Classifying features based on traditional pattern recognition methods (such as threshold determination, simple rule classification) and finally determining the spraying quality.

[0102] The disadvantages of this solution 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 in the same equipment environment and used the same image dataset. The following are the specific equipment and data configurations:

[0104] All technical solutions use the same high-resolution scanner for image acquisition; Scanner model: EpsonPerfection V850 Pro; Resolution: 4800×9600dpi; Color mode: 24-bit RGB color mode

[0105] Acquisition method: Scan the surface of the bicycle chainring directly with a scanner to ensure high image resolution and rich details, suitable for defect detection.

[0106] Computing hardware configuration

[0107] All algorithms are run on the following unified hardware environment:

[0108] Processor: Intel Core i7-9700K (8 cores, 3.6GHz); Memory: 16GB DDR4; Graphics card: NVIDIA GTX1080Ti (8GB GDDR5X); Storage: 1TB SSD (solid state drive); 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 experimented using the following unified software environment: Image processing: OpenCV (image denoising, grayscale, morphological processing, etc.); Machine learning framework: 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 contains images collected from multiple batches of bicycle crankset surfaces, each of which contains different quality issues of the sprayed surface. These images have been manually annotated, including the type of defects on the sprayed surface (such as particles, spots, shedding, etc.) and whether they are qualified (qualified / unqualified). The resolution of each image is 4800×9600dpi to ensure that tiny 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: Various types of spray defects on the spray surface with complex background, including but not limited to particles, color difference, cracks, spots, etc. The defect location and category are marked in each image

[0116] Dataset Partitioning

[0117] In order to conduct fair comparative experiments, the dataset is divided into training set, validation set and test set: training set: 70% (3500 images), validation set: 15% (750 images), test set: 15% (750 images)

[0118] All schemes use the same training set, validation set, and test set for training and testing.

[0119] Experimental evaluation criteria:

[0120] In order to comprehensively evaluate the performance of different technical solutions, the following common classification evaluation indicators are used:

[0121] Accuracy: measures the proportion of correct classifications.

[0122] Recall: measures the ability to correctly identify defective samples.

[0123]

[0124] F1 score: The harmonic mean of precision and recall, which comprehensively evaluates classification performance.

[0125]

[0126] Processing time: The processing time of each image in seconds, which is used to measure the real-time performance of the algorithm.

[0127] With the unified equipment, data and experimental conditions mentioned above, the performance results of the two technical solutions are as follows:

[0128]

[0129] This solution has shown better results than existing technical solutions in terms of accuracy and recall rate, especially the significant improvement in recall rate, which can better identify spraying defects. F1 score: The F1 score of this solution is improved compared with the other two solutions, indicating that it has the best overall performance. Processing time: Compared with traditional image processing methods, this solution has better real-time performance and is suitable for real-time quality inspection of production lines.

[0130] The present invention is not limited to the above-mentioned embodiments. Anyone should be aware that any structural changes made under the enlightenment of the present invention, and any technical solutions that are the same or similar to the present invention, fall within the protection scope of the present invention. The technology, shape, and structural parts not described in detail in the present invention are all well-known technologies.

Claims

1. A method for detecting the surface spraying quality of a bicycle crankset, characterized in that: The following steps are involved: Step 1: Obtain a high-resolution image of the spray coating on the surface of the bicycle crankset; Step 2: De-noise, grayscale and enhance the collected original image to reduce environmental interference and improve image quality; Step 3: Use morphological methods to analyze the particles in the image, select appropriate circular structural elements, filter the image using N-open operations, retain the characteristics of the particles on the surface of the tooth plate spray, and detect and mark the target area in the image through YOLOv3; Step 4: Use Gabor filter to extract texture features of the target area detected by YOLOv3, calculate and extract the energy, variance, and contrast features of the image to characterize the surface spraying quality; Step 5: Use support vector machine to classify the extracted texture features. Then, use radial basis kernel function as kernel function and optimize penalty factor C and Gaussian width parameter σ through cross validation to improve classification accuracy. Step 6: Classify the new image through the trained SVM model, evaluate the spraying quality based on the classification results, and output the qualified or unqualified quality judgment results.

2. A method for detecting the surface spraying quality of a bicycle crankset according to claim 1, characterized in that: The steps of analyzing the particles of the image by morphological method, selecting the appropriate circular structure element, filtering the image by N-open operation, and retaining the characteristics of the particles on the surface of the tooth plate spray are as follows: A circular structure element E with a radius of 1 pixel is selected for image screening. The structure element E is defined as a circular window whose size is a circle with a radius of 1 pixel. The particle analysis operation is based on morphological opening operation. For image A, its particle analysis ψ n (A) is defined as: in; Morphological dilation operation Expand a structural element for each pixel in the image. For image A and structural element E, the expansion operation can be defined as: Among them, E z is the translation of the structural element E at point z, which represents the process of applying the structural element to image A. Next, the particle distribution F A (n) is normalized, and the normalized particle distribution F A (n) is defined as: For the grayscale image g, the particle distribution F g (n) can be calculated by integration, and its expression is: Where L is the grayscale image g domain, ψ n g(x) represents the result obtained after n-opening operations on image g.

3. A method for detecting the surface spraying quality of a bicycle crankset according to claim 1, characterized in that: The steps to detect and mark the target area in the image through YOLOv3 are: First, the image to be detected is input into the YOLOv3 network. YOLOv3 divides the input image into multiple grids and performs target detection on each grid through a convolutional neural network. Each target box is predicted. During the prediction, each grid will output multiple prediction boxes, each of which includes the category probability p class , Confidence And the position of the target box (x, y, w, h), its expression is: in, is the adjustment value of the prediction box, a j is the size of the jth anchor box, σ(·) is the Sigmoid activation function, and then a scale adaptation function f(s) is defined to adjust the prediction box according to the size of the target box. Its expression is: Among them, α controls the sensitivity of scale, s is the size of the target box, and is the average size of objects in the image; All target boxes are sorted. When sorting, first, the confidence threshold θ is set, and then the valid boxes are filtered out according to the set threshold θ. The expression is: Among them, p final (x i ) represents the box x i The final confidence of the target box is p final If the value is greater than the threshold, the frame is considered valid; 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: Among them, |x∩y| is the intersection area of ​​the two boxes, and |x∩y| is their union area. If the IoU of two boxes exceeds the set threshold, the overlapping box will be deleted and only the box with higher confidence will be retained.

4. A method for detecting the surface spraying quality of a bicycle crankset according to claim 1, characterized in that: The steps of extracting texture features from the particle analyzed image by Gabor filter are as follows: The Gabor filter can extract the texture features of the image by performing convolution operations on the image at different frequencies and directions. The two-dimensional function of the Gabor filter is: Where (x′, y′) is the rotated coordinate, λ is the wavelength, θ is the direction of the filter, ψ is the phase shift, σ is the standard deviation of the Gaussian function, and γ is the spatial aspect ratio; Feature extraction is performed on the Gabor filtered image to obtain the energy, variance and contrast features of the image. Subsequently, multi-scale and multi-directional Gabor filtering is performed on the target area to obtain multiple texture features, which are integrated into a high-dimensional feature vector F to characterize the texture characteristics of the target.

5. A method for detecting the surface spraying quality of a bicycle crankset according to claim 1, characterized in that: The steps to calculate and extract image texture features for characterizing surface spraying quality are as follows: Energy is an indicator that describes the complexity of local texture of an image. For the image response after being processed by the Gabor filter, the expression of energy E is: Among them, * represents the convolution operation, g(x, y) is the original image of the target area, and g λ,θ (x, y) is the filter output; Variance is a statistic that measures the degree of change in image texture and can reflect the roughness of the texture. For the image response extracted by the Gabor filter, the variance V λ,θ Its expression is: Among them, μ λ,θ is the average value of Gabor filtering results, N is the number of pixels; The contrast between different texture patterns is obtained by calculating the grayscale difference of the filter output, which is expressed as: Among them, g λ,θ (i) and g λ,θ (i-1) represents the filter response value of the adjacent pixel.

6. A method for detecting the surface spraying quality of a bicycle crankset according to claim 1, characterized in that: After completing the texture feature extraction in step 4, it is also necessary to calculate the particle distribution function F A (n) and F G (n) Obtain the distribution information of surface particles to further evaluate the surface spraying quality. The calculation logic is: According to the distribution of particles in image A, calculate the average particle size n of the image avg , and based on this, adjust the scale n of the open operation. Then, define the adaptive granularity adjustment function f(n) to control the scale change, and its expression is: Among them, γ and β are constants that adjust the sensitivity of the particle size analysis scale, n avg is the average particle size of particles in the image; Based on the results of adaptive particle size analysis, the particle distribution function F A (n) and F G (n) is weighted and its expression is: Among them, Ω[ψ n (A(x))] represents the number of target pixels after n-opening operation in the local area x, g(x) represents the pixel value of the grayscale image, is the local area L x The points on .

7. A method for detecting the surface spraying quality of a bicycle crankset according to claim 1, characterized in that: The steps of using support vector machine to classify the extracted texture features, using radial basis kernel function as kernel function and optimizing 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: Among them, K(x i , x) is the kernel function in SVM, y i is the label of the sample, α i is the Lagrange multiplier, b is the bias term, and x is the input feature to be classified; The radial basis kernel function (RBF) is selected as the kernel function of SVM. The form of the RBF kernel function is: Among them, σ is the Gaussian width parameter, which is used to control the smoothness of the kernel function.

8. A method for detecting the surface spraying quality of a bicycle crankset according to claim 1, characterized in that: The steps to optimize the penalty factor C and Gaussian width parameter σ through cross-validation are: The dataset is divided into a training set and a validation set. The division method is K-fold cross validation, where the dataset is divided into K subsets, K-1 subsets are used for training each time, and the remaining subset is used for validation; For each combination of C and σ, the SVM model is trained on the training set and its classification performance is evaluated on the validation set; The C and σ parameter combination that can maximize the classification accuracy is selected as the final model parameter. 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

  • Brain glioma CT focus area feature extraction method

    CN118097165A

  • Medical image analysis system based on artificial intelligence

    CN118570204A

  • Vacuum machine package sealing performance detection system based on convolutional neural network

    CN118761014A

Cited By

  • Slag salvaging control method and slag salvaging device for medium-sized metal cast ingot

    CN120411088A