Classification and location method of multiple surface defects of rubber sealing rings

By combining image processing and machine learning algorithms, the multi-type surface defect classification and positioning method of rubber sealing rings solves the problems of insufficient detection accuracy and poor adaptability in the existing technology, achieving efficient and accurate defect detection and positioning, and is suitable for complex industrial environment.

CN117746000BActive Publication Date: 2024-09-27GUANGDONG RUIYONG SEALING PROD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311822151.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2024-09-27
Estimated Expiration
2043-12-27

AI Technical Summary

Technical Problem

The existing technology has insufficient accuracy, difficult positioning, slow processing speed and poor adaptability in the detection of rubber sealing ring defects. It is especially prone to misjudgment or missed determination when detecting complex backgrounds and small defects.

Method used

A multi-type surface defect classification and positioning method for rubber sealing rings is adopted that combines advanced image processing technology, mathematical models and machine learning algorithms, including image preprocessing, Gaussian differential beam detection, direction-sensitive filtering, local feature extraction and multi-scale fusion and SVM model training , achieving accurate defect classification and location by optimizing the loss function.

Benefits of technology

Significantly improves the accuracy and efficiency of rubber sealing ring defect detection, and can accurately identify and locate defects of different sizes and shapes in complex backgrounds. It is suitable for industrial production lines, reducing manual intervention and improving production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117746000B
    Figure CN117746000B
Patent Text Reader

Abstract

The invention discloses a method for classifying and locating multiple types of surface defects of a rubber sealing ring, comprising the following steps: step 1: image preprocessing; step 2: Gaussian differential wire harness detection, on the preprocessed image, to identify the wire harness area where defects may exist; enhance the image features by the Hessian matrix, so as to facilitate the identification of subtle defects; step 3: direction-sensitive filtering, for the image after the wire harness detection, enhance the wire harness texture in a specific direction, further enhance the features in the specific direction in the image, and provide more information for defect classification; step 4: local feature extraction and multi-scale fusion, based on the output of the above steps, extract local features, and combine multi-scale wire harness information to obtain rich feature data, so as to provide input for subsequent classification models; step 5: SVM model training, training a support vector machine model, and improving the accuracy and robustness of the model by optimizing the loss functions of classification and positioning; step 6: category prediction and position regression.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of defect classification and positioning methods, and more specifically, to a method for classifying and positioning multiple types of surface defects of a rubber sealing ring. Background Art

[0002] Rubber seals are indispensable components in many industrial products and mechanical equipment. They play a key role in ensuring sealing and preventing liquid or gas leakage. Therefore, it is very important to ensure the quality of rubber seals, among which defect detection and location are the key links to ensure product quality.

[0003] Defects of rubber seals may include cracks, scratches, dents, bubbles and other types, which are often small and difficult to identify with the naked eye. In addition, the heterogeneity of rubber materials and the complexity of the production process increase the difficulty of detection. Accurately detecting these defects and determining their specific locations is crucial for subsequent quality control and defect analysis.

[0004] Although existing technologies are able to detect defects to a certain extent, they still have the following shortcomings:

[0005] 1. Lack of accuracy: Traditional image processing methods often lack accuracy when dealing with complex backgrounds or tiny defects, and are prone to misjudgment or omission.

[0006] 2. Difficulty in locating: Existing technologies are generally limited in their effectiveness in locating the specific location of defects, especially when the defects are small in size or irregular in shape.

[0007] 3. Slow processing speed: Some high-precision detection methods have slow processing speeds and are not suitable for the needs of fast production lines.

[0008] 4. Poor adaptability: For different types of rubber seals or different defect types, the existing technology has insufficient adaptability and flexibility.

[0009] In summary, the existing technology has obvious limitations in rubber seal defect detection and location, which prompted us to develop a new technology that is more efficient, accurate and adaptable to solve these problems. Summary of the invention

[0010] 1. Technical problems to be solved

[0011] In view of the problems existing in the prior art, the purpose of the present invention is to provide a method for classifying and locating multiple types of surface defects of rubber sealing rings. By combining advanced image processing technology, mathematical models and machine learning algorithms, a comprehensive and efficient solution is provided for classifying and locating multiple types of defects on the surface of rubber sealing rings.

[0012] 2. Technical solution

[0013] To solve the above problems, the present invention adopts the following technical solutions:

[0014] A method for classifying and locating multiple types of surface defects of a rubber sealing ring includes the following steps:

[0015] Step 1: Image Preprocessing

[0016] Perform image preprocessing to enhance the visual contrast between defective and normal areas, remove noise and protect image edges, providing clearer images for subsequent steps;

[0017] Step 2: Gaussian Differentiation Harness Detection

[0018] On the pre-processed image, the wiring harness area that may have defects is identified; the image features are enhanced through the Hessian matrix to facilitate the identification of subtle defects.

[0019] Step 3: Direction-Sensitive Filtering

[0020] For the image after wire harness inspection, the wire harness texture in a specific direction is enhanced, and the features in a specific direction in the image are further enhanced to provide more information for defect classification;

[0021] Step 4: Local feature extraction and multi-scale fusion

[0022] Based on the output of the above steps, local features are extracted and combined with multi-scale line bundle information to obtain rich feature data to provide input for subsequent classification models;

[0023] Step 5: SVM model training

[0024] Train the support vector machine model to improve the accuracy and robustness of the model by optimizing the loss functions of classification and localization;

[0025] Step 6: Category prediction and position regression

[0026] Use the trained SVM model to predict the defect category of the inspection image and give the specific area location; achieve accurate defect classification and positioning, and provide a basis for subsequent quality control and traceability.

[0027] The step 1 uses algorithm (1) to perform image preprocessing. The specific algorithm formula is as follows:

[0028]

[0029] Among them, F(x,y) is the pixel value of the processed image at position (x,y); f(i,j): is the pixel value of the original image at position (i,j); σ is the parameter that controls the smoothness of the Gaussian filter; β is the parameter that controls the edge preservation strength; Z(x,y) is the normalization factor to ensure that the processed pixel value is within a reasonable range; It is a Gaussian function, which is used to smooth the image and reduce the influence of noise; is the Sigmoid function, which is used to preserve edge information.

[0030] The specific process of step 1 is as follows:

[0031] Initialization: set the values ​​of σ and β;

[0032] Traverse the image: For each pixel (x, y) in the image, perform the following calculations;

[0033] Apply Gaussian filtering: Calculate the Gaussian weighted average centered at (x,y);

[0034] Edge preservation: Use the Sigmoid nonlinear function to adjust the contribution of each pixel to maintain the edge; Normalization: Use Z(x,y) to normalize the result;

[0035] Among them, the input data is the original image data, usually in digital image format, JPEG, PNG;

[0036] The image data comes from the production line or quality inspection station of the rubber seal;

[0037] Preprocessing steps: including basic image processing steps such as image format conversion and size adjustment.

[0038] Unique filter combination: Combining Gaussian filtering and nonlinear dynamics system, a novel image preprocessing method is provided.

[0039] Edge preservation capability: The algorithm places special emphasis on preserving image edges while removing noise, which is crucial for subsequent defect detection.

[0040] Algorithm (1) is particularly suitable for defect detection under complex backgrounds. It can effectively enhance the contrast between defects and backgrounds while maintaining the clarity of defect edges, providing ideal input for subsequent classification and positioning tasks. It provides a powerful image preprocessing tool for surface defect detection of rubber sealing rings. Through unique filtering technology and edge preservation strategy, it significantly improves the accuracy and efficiency of subsequent defect detection steps.

[0041] The step 2 adopts algorithm (2), and the specific algorithm formula is as follows:

[0042]

[0043] Among them, Δf is the Laplace operator, which is used to measure the curvature of the image at the point (x, y); f xx ,f yy ,f xy is the second-order partial derivative of the image at point (x, y), representing the curvature of the image in the x and y directions respectively; λ1, λ2 are adjustment parameters used to control the contribution of partial derivatives to the final result.

[0044] The step 2 comprises the following steps:

[0045] Input: the image processed in step 1;

[0046] Output: Image processed by the Hessian matrix, highlighting specific features;

[0047] The specific calculation process is as follows:

[0048] Calculate the second-order partial derivative: For each pixel (x, y) in the image, calculate f xx ,f yy ,f xy ;

[0049] Apply the Laplace operator: calculate Δf;

[0050] Construct Hessian matrix: construct the matrix according to the formula of algorithm (2);

[0051] Analyze features: Identify and enhance specific features in the image by analyzing the characteristics of the Hessian matrix.

[0052] Gaussian Differential Line Detection: This method is particularly useful for detecting subtle edges and textures in images, which are critical for defect detection.

[0053] Structural feature enhancement: Through the analysis of the Hessian matrix, the structural features in the image can be effectively enhanced and the accuracy of defect recognition can be improved.

[0054] Algorithm (2) is particularly suitable for defect detection in complex backgrounds. It can effectively identify and enhance the wire-like structures in images, providing key structural information for subsequent classification and positioning tasks.

[0055] The step 3 adopts the algorithm formula (3), and the specific algorithm formula is as follows:

[0056]

[0057] Among them, G(x,y): is the pixel value of the processed image at position (x,y); σ is a parameter that controls the smoothness of the Gaussian filter; k is the wave number, which is related to the frequency of the texture; θ is the direction angle, which determines the direction of the filter enhancement; is Planck's constant, which introduces the concept of quantum mechanics; m is the particle mass, which is used to adjust the quantum mechanical factor; ω is the angular frequency, which is related to the periodicity of the texture; is a Gaussian function, which is used to locally smooth the image and reduce the impact of noise; e i(kxcosθ+kysinθ) It is a complex exponential function representing the propagation of waves and is used to enhance the characteristics in a specific direction; is a factor in quantum mechanics that modulates the amplitude of a wave; is Planck's constant, m is the particle mass, and ω is the angular frequency.

[0058] The step 3 comprises the following steps:

[0059] Input: the image processed in step 2;

[0060] Output: Image processed by Gabor filtering, highlighting features in specific directions;

[0061] The specific calculation process is as follows:

[0062] Traverse the image: For each pixel (x, y) in the image, perform the following steps;

[0063] Apply Gaussian function: Calculate the Gaussian weighted average centered at (x,y);

[0064] Applying complex exponential function: enhancing features in specific directions in the image;

[0065] Apply quantum mechanical factors: modulate the amplitude of the wave to further enhance specific features.

[0066] Direction-sensitive feature enhancement: By combining the Gaussian function and the complex exponential function, features in specific directions in the image can be enhanced more accurately.

[0067] Application of quantum mechanical factors: The introduced quantum mechanical factors may provide a new way to modulate and enhance image features.

[0068] Algorithm formula (3) is particularly suitable for defect detection under complex backgrounds. It can effectively enhance the wire texture in a specific direction in the image, providing key visual information for subsequent classification and positioning tasks. Algorithm formula (3) provides a powerful direction-sensitive filtering tool for surface defect detection of rubber sealing rings. Through precise Gabor filtering and quantum mechanical factor modulation, it significantly improves the recognition ability of textures in specific directions. This step is closely linked to the results of the previous two steps, ensuring the efficiency and accuracy of the entire detection process.

[0069] The step 4 adopts the algorithm formula (4), and the specific algorithm formula is as follows:

[0070]

[0071] Among them, F multi (x, y) is the feature representation after multi-scale fusion; S, T is the number of scales and feature types; w s,t is a weight factor used to balance the contribution of different scales and feature types; γ, α, δ are adjustment parameters used to control the strength of nonlinear transformation; G s,t (x, y) is the Gabor filter response at scale s and feature type t; H s,t (x,y) is the Hessian matrix response at scale s and feature type t;

[0072] Input: pixel data of the image processed in step 3;

[0073] Output: multi-scale fusion feature representation; the specific process is as follows:

[0074] Initialization parameters: Set S, T, γ, α, δ and w s,t ;

[0075] Multi-scale feature extraction: For each scale s and feature type t, extract the Gabor filter and Hessian matrix response;

[0076] Feature fusion: features of different scales and types are fused through weighting and nonlinear transformation;

[0077] Generate feature representation: form the final multi-scale fusion feature representation F multi (x,y).

[0078] Innovative feature fusion method: Combining multi-scale analysis and complex network theory, it provides a novel way to process and fuse image features.

[0079] Nonlinear feature transformation: The expression ability and discrimination of features are enhanced through the application of sigmoid and log functions.

[0080] Algorithm formula (4) is particularly suitable for defect detection in complex backgrounds. It can effectively extract and fuse multi-scale features, providing rich and discriminative feature representations for subsequent classification and positioning tasks. Step 4 provides a powerful feature representation tool for rubber sealing ring surface defect detection through an innovative multi-scale feature extraction and fusion algorithm. This step is closely linked to the results of the previous three steps, ensuring the efficiency and accuracy of the entire detection process. Through this method, we can capture the key information in the image more comprehensively, thereby improving the accuracy of classification and positioning.

[0081] The step 5 adopts the algorithm formula (5), and the specific algorithm formula is as follows:

[0082]

[0083] in, is the cross entropy loss function, used for classification tasks; y o,c is the true category label, p o,c is the predicted probability; It is a smooth L1 loss function, used for positioning tasks; and are the predicted and true position vectors respectively; ω1, ω2 are weight factors used to balance the classification loss and positioning loss;

[0084] The input data is the multi-scale fusion features generated in step 4;

[0085] Data source: The image data comes from the production line or quality inspection station of rubber sealing rings;

[0086] Preprocessing steps: including image noise removal, edge protection, feature enhancement and multi-scale fusion; the specific process is as follows:

[0087] Initialize the model: set the parameters of the SVM model;

[0088] Prepare data: Use the multi-scale fusion features in step 4 as input data;

[0089] Define the loss function: Define the loss function according to the algorithm formula (5);

[0090] Model training: Use the loss function to train the SVM model;

[0091] Parameter adjustment: adjust ω1, ω2 and other model parameters through cross-validation and other methods;

[0092] Model evaluation: Evaluate the performance of the model on the training set and validation set.

[0093] The innovative loss function combines the optimization of classification accuracy and positioning accuracy, which is suitable for complex defect detection tasks; the application of multi-scale features, using multi-scale fusion features, improves the model's ability to identify defects of different sizes and shapes. This step improves the accuracy and robustness of the SVM model in the rubber seal surface defect detection task by optimizing the loss function; combined with multi-scale features, the model can more effectively identify and locate various types of defects.

[0094] The specific process of step 6 is as follows:

[0095] Load model: load the SVM model trained in step 5;

[0096] Data preparation: Prepare the feature data of the image to be detected. This data should be the same as the features used when training the model.

[0097] Category prediction: Use the SVM model to classify each image area to determine whether there is a defect and its category;

[0098] Position regression: For areas classified as defects, the SVM model is used for position regression to determine the specific location of the defect;

[0099] Result output: Output defect category and location information for subsequent analysis and decision-making;

[0100] The SVM model is expressed as:

[0101]

[0102] Where f(x) is the prediction function; α i is the coefficient of the support vector; y i is the label of the training sample; K(x i ,x) is the kernel function used to map data into a high-dimensional space, and b is the bias term.

[0103] The input data is the feature data of the image to be detected, which should be the same as the features used when training the model; the image data comes from the production line or quality inspection station of the rubber sealing ring.

[0104] The preprocessing steps include image noise removal, edge protection, feature enhancement, and multi-scale fusion, which have been completed in the previous steps. Use the same model parameters as in the training phase, including kernel function type, regularization parameters, etc.; ensure that the features in the test phase are consistent with those in the training phase; before actual application, the performance of the model on an independent test set should be evaluated, including classification accuracy and positioning accuracy.

[0105] This step uniquely combines classification and regression tasks to improve the comprehensiveness and accuracy of defect detection; through position regression, the model can accurately determine the specific location of the defect, which is crucial for subsequent quality control and traceability.

[0106] This step provides strong support for rubber seal surface defect detection through accurate category prediction and position regression. This not only improves the accuracy of defect detection, but also provides important information for subsequent quality control and traceability.

[0107] Step 6 is the key part of the rubber seal surface defect detection solution. It uses a well-trained SVM model to achieve accurate classification and location of defects. This step is closely linked to the previous steps to ensure the efficiency and accuracy of the entire detection process. With this method, we can achieve high-precision defect detection in complex industrial environments, providing reliable data support for quality control and traceability.

[0108] 3. Beneficial effects

[0109] Compared with the prior art, the advantages of the present invention are:

[0110] 1. Improve the accuracy and efficiency of rubber sealing ring defect detection. By using advanced image processing technology and mathematical models, the present invention can more effectively process and analyze image data; especially when processing rubber sealing ring images with complex backgrounds and subtle features, these algorithm formulas can significantly improve the accuracy of defect detection.

[0111] 2. Multi-scale feature fusion: By combining multi-scale analysis, the present invention can capture image information from coarse to fine, thereby improving the ability to recognize defects of different sizes and shapes.

[0112] 3. Accurate classification and positioning: Combining classification and regression tasks: The present invention can not only accurately classify defects in rubber seal ring images, but also accurately locate the specific location of defects, which is crucial for subsequent quality control and tracing.

[0113] 4. Optimized loss function: By using a specifically designed loss function, the present invention can effectively balance classification accuracy and positioning accuracy during the training process.

[0114] 5. High adaptability and flexibility. The algorithm formula provided by the present invention contains multiple adjustable parameters, so that the model can adapt to different data characteristics and requirements.

[0115] 6. Applicable to complex environments, improve efficiency, and reduce manual intervention: Due to its high adaptability, the present invention is particularly suitable for high-precision defect detection of rubber sealing rings in complex industrial environments; the present invention can quickly identify and locate defects in rubber sealing rings through automated image processing and analysis, thereby improving the efficiency of the production line, reducing dependence on manual inspection, reducing the possibility of human error, and improving the overall detection speed and reliability.

[0116] In summary, the present invention provides a comprehensive and efficient solution for multi-class defect detection on the surface of rubber sealing rings by combining advanced image processing technology, mathematical models and machine learning algorithms. This method not only improves the accuracy of detection, but also increases the processing speed, making it an important tool in industrial quality control. The method of the present invention can significantly improve production efficiency and product quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0117] Figure 1 It is a flow chart of the method for classifying and locating multiple types of surface defects of a rubber sealing ring of the present invention;

[0118] Figure 2 is a flow chart of step 1 of the present invention;

[0119] Figure 3 is a flow chart of step 2 of the present invention;

[0120] Figure 4 is a flow chart of step 3 of the present invention;

[0121] Figure 5 is a flow chart of step 4 of the present invention;

[0122] Figure 6 is a flow chart of step 5 of the present invention;

[0123] Figure 7 This is a flow chart of step 6 of the present invention. DETAILED DESCRIPTION

[0124] The following will combine the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all the embodiments. All other embodiments obtained by ordinary technicians in this field without creative work based on the embodiments of the present invention belong to the scope of protection of the present invention.

[0125] In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "top / bottom" indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0126] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "provided with", "mounted / connected", and "connected" should be understood in a broad sense. For example, "connected" means fixed connection, detachable connection, or integral connection; mechanical connection, electrical connection; direct connection, indirect connection through an intermediate medium, and internal communication between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention are understood according to specific circumstances.

[0127] Example 1

[0128] Please refer to Figure 1-7 , a classification and positioning method for multiple types of surface defects of rubber sealing rings, comprising the following steps:

[0129] Step 1: Image Preprocessing

[0130] Perform image preprocessing to enhance the visual contrast between defective and normal areas, remove noise and protect image edges, providing clearer images for subsequent steps;

[0131] Step 2: Gaussian Differentiation Harness Detection

[0132] On the preprocessed image in step 1, the wiring harness area that may have defects is identified; the image features are enhanced by the Hessian matrix to facilitate the identification of subtle defects;

[0133] Step 3: Direction-Sensitive Filtering

[0134] For the image after the wire harness inspection in step 2, the wire harness texture in a specific direction is enhanced, and the features in a specific direction in the image are further enhanced to provide more information for defect classification;

[0135] Step 4: Local feature extraction and multi-scale fusion

[0136] Based on the output of step 3 above, local features are extracted and combined with multi-scale line bundle information to obtain rich feature data to provide input for subsequent classification models;

[0137] Step 5: SVM model training

[0138] Train the support vector machine model to improve the accuracy and robustness of the model by optimizing the loss functions of classification and localization;

[0139] Step 6: Category prediction and position regression

[0140] Use the trained SVM model to predict the defect category of the inspection image and give the specific area location; achieve accurate defect classification and positioning, and provide a basis for subsequent quality control and traceability.

[0141] The step 1 uses algorithm (1) to perform image preprocessing. The specific algorithm formula is as follows:

[0142]

[0143] Among them, F(x,y) is the pixel value of the processed image at position (x,y); f(i,j): is the pixel value of the original image at position (i,j); σ is the parameter that controls the smoothness of the Gaussian filter; β is the parameter that controls the edge preservation strength; Z(x,y) is the normalization factor to ensure that the processed pixel value is within a reasonable range; It is a Gaussian function, which is used to smooth the image and reduce the influence of noise; is the Sigmoid function, which is used to preserve edge information.

[0144] Please refer to the attached Figure 2 , the specific process of step 1 is as follows:

[0145] Initialization: set the values ​​of σ and β;

[0146] Traverse the image: For each pixel (x, y) in the image, perform the following calculations;

[0147] Apply Gaussian filtering: Calculate the Gaussian weighted average centered at (x,y);

[0148] Edge preservation: Use the Sigmoid nonlinear function to adjust the contribution of each pixel to maintain the edge; Normalization: Use Z(x,y) to normalize the result;

[0149] The input data is original image data, usually in digital image format, such as JPEG, PNG, etc. The image data comes from the production line or quality inspection station of the rubber sealing ring;

[0150] Preprocessing steps: including basic image processing steps such as image format conversion and size adjustment.

[0151] Algorithm (1) combines Gaussian filtering and nonlinear dynamics systems to provide a novel image preprocessing method; it places special emphasis on maintaining image edges while removing noise, which is crucial for subsequent defect detection.

[0152] Algorithm (1) is particularly suitable for defect detection in complex backgrounds. It can effectively enhance the contrast between defects and backgrounds while maintaining the clarity of defect edges, providing ideal input for subsequent classification and positioning tasks. It provides a powerful image preprocessing tool for surface defect detection of rubber sealing rings. Through unique filtering technology and edge preservation strategy, it significantly improves the accuracy and efficiency of subsequent defect detection steps.

[0153] All parameters must be selected within a reasonable range to ensure the stability and effectiveness of the algorithm; the selection of γ, α, δ has a significant impact on the performance of the algorithm; w s,t The balance of is crucial to ensure effective fusion of different scales and feature types.

[0154] The step 2 adopts algorithm (2), and the specific algorithm formula is as follows:

[0155]

[0156] Among them, Δf is the Laplace operator, which is used to measure the curvature of the image at the point (x, y); f xx ,f yy ,f xy is the second-order partial derivative of the image at point (x, y), representing the curvature of the image in the x and y directions respectively; λ1, λ2 are adjustment parameters used to control the contribution of partial derivatives to the final result.

[0157] Please refer to the attached Figure 3 , the step 2 comprises the following steps:

[0158] Input: the image processed in step 1;

[0159] Output: Image processed by the Hessian matrix, highlighting specific features;

[0160] The specific calculation process is as follows:

[0161] Calculate the second-order partial derivative: For each pixel (x, y) in the image, calculate f xx ,f yy ,f xy ;

[0162] Apply the Laplace operator: calculate Δf;

[0163] Construct Hessian matrix: construct the matrix according to the formula of algorithm (2);

[0164] Analyze features: Identify and enhance specific features in the image by analyzing the characteristics of the Hessian matrix.

[0165] Gaussian Differential Line Detection: This method is particularly useful for detecting subtle edges and textures in images, which are critical for defect detection.

[0166] Structural feature enhancement: Through the analysis of the Hessian matrix, the structural features in the image can be effectively enhanced and the accuracy of defect recognition can be improved.

[0167] Algorithm (2) is particularly suitable for defect detection in complex backgrounds. It can effectively identify and enhance the wire-like structures in images, providing key structural information for subsequent classification and positioning tasks.

[0168] The step 3 adopts the algorithm formula (3), and the specific algorithm formula is as follows:

[0169]

[0170] Among them, G(x,y): is the pixel value of the processed image at position (x,y); σ is a parameter that controls the smoothness of the Gaussian filter; k is the wave number, which is related to the frequency of the texture; θ is the direction angle, which determines the direction of the filter enhancement; is Planck's constant, which introduces the concept of quantum mechanics; m is the particle mass, which is used to adjust the quantum mechanical factor; ω is the angular frequency, which is related to the periodicity of the texture; is a Gaussian function, which is used to locally smooth the image and reduce the impact of noise; e i(kxcosθ+kysinθ) It is a complex exponential function representing the propagation of waves and is used to enhance the characteristics in a specific direction; is a factor in quantum mechanics that modulates the amplitude of a wave; is Planck's constant, m is the particle mass, and ω is the angular frequency.

[0171] Please refer to the attached Figure 4 , the step 3 comprises the following steps:

[0172] Input: the image processed in step 2;

[0173] Output: Image processed by Gabor filtering, highlighting features in specific directions;

[0174] The specific calculation process is as follows:

[0175] Traverse the image: For each pixel (x, y) in the image, perform the following steps;

[0176] Apply Gaussian function: Calculate the Gaussian weighted average centered at (x,y);

[0177] Applying complex exponential function: enhancing features in specific directions in the image;

[0178] Apply quantum mechanical factors: modulate the amplitude of the wave to further enhance specific features.

[0179] Direction-sensitive feature enhancement: By combining the Gaussian function and the complex exponential function, features in specific directions in the image can be enhanced more accurately.

[0180] Application of quantum mechanical factors: The introduced quantum mechanical factors may provide a new way to modulate and enhance image features.

[0181] σ,k,θ, The selection of m and ω is crucial to the filtering effect. The selection of θ determines the direction of enhancement. Different direction settings are required for different image features.

[0182] Algorithm formula (3) is particularly suitable for defect detection under complex backgrounds. It can effectively enhance the wire texture in a specific direction in the image, providing key visual information for subsequent classification and positioning tasks. Algorithm formula (3) provides a powerful direction-sensitive filtering tool for surface defect detection of rubber sealing rings. Through precise Gabor filtering and quantum mechanical factor modulation, it significantly improves the recognition ability of textures in specific directions. This step is closely linked to the results of the previous two steps, ensuring the efficiency and accuracy of the entire detection process.

[0183] The step 4 adopts the algorithm formula (4), and the specific algorithm formula is as follows:

[0184]

[0185] Among them, F multi (x, y) is the feature representation after multi-scale fusion; S, T is the number of scales and feature types; w s,t is a weight factor used to balance the contribution of different scales and feature types; γ, α, δ are adjustment parameters used to control the strength of nonlinear transformation; G s,t (x, y) is the Gabor filter response at scale s and feature type t; H s,t (x,y) is the Hessian matrix response at scale s and feature type t;

[0186] Input: pixel data of the image processed in step 3;

[0187] Output: Multi-scale fusion feature representation; please refer to the attached Figure 5 , the specific process is as follows:

[0188] Initialization parameters: Set S, T, γ, α, δ and w s,t ;

[0189] Multi-scale feature extraction: For each scale s and feature type t, extract the Gabor filter and Hessian matrix response;

[0190] Algorithm formula (4) fuses features of different scales and types through weighting and nonlinear transformation to form the final multi-scale fusion feature representation F multi (x,y).

[0191] Innovative feature fusion method: Combining multi-scale analysis and complex network theory, it provides a novel way to process and fuse image features.

[0192] Nonlinear feature transformation: The expression ability and discrimination of features are enhanced through the application of sigmoid and log functions.

[0193] Algorithm formula (4) is particularly suitable for defect detection in complex backgrounds. It can effectively extract and fuse multi-scale features, providing rich and discriminative feature representations for subsequent classification and positioning tasks. Step 4 provides a powerful feature representation tool for rubber sealing ring surface defect detection through an innovative multi-scale feature extraction and fusion algorithm. This step is closely linked to the results of the previous three steps, ensuring the efficiency and accuracy of the entire detection process. Through this method, we can more comprehensively capture the key information from coarse to fine in the image, thereby improving the accuracy of classification and positioning tasks.

[0194] The step 5 adopts the algorithm formula (5), and the specific algorithm formula is as follows:

[0195]

[0196] in, is the cross entropy loss function, used for classification tasks; y o,c is the true category label, p o,c is the predicted probability; It is a smooth L1 loss function, used for positioning tasks; and are the predicted and true position vectors respectively; ω1, ω2 are weight factors used to balance the classification loss and positioning loss;

[0197] The input data is the multi-scale fusion features generated in step 4;

[0198] Data source: The image data comes from the production line or quality inspection station of rubber sealing rings;

[0199] Preprocessing steps: including image noise removal, edge protection, feature enhancement and multi-scale fusion; please refer to the attached Figure 6 , the specific process is as follows:

[0200] Initialize the model: set the parameters of the SVM model;

[0201] Prepare data: Use the multi-scale fusion features in step 4 as input data;

[0202] Define the loss function: Define the loss function according to the algorithm formula (5);

[0203] Model training: Use the loss function to train the SVM model;

[0204] Parameter adjustment: adjust ω1, ω2 and other model parameters through cross-validation and other methods;

[0205] Model evaluation: Evaluate the performance of the model on the training set and validation set.

[0206] The selection of ω1 and ω2 is crucial and needs to be adjusted according to the specific task to balance the importance of classification and positioning; when calculating the cross entropy, it is necessary to ensure numerical stability and avoid potential numerical problems in logarithmic operations; smooth L1 loss helps avoid the problem of gradient explosion, especially when the positioning error is large. By adjusting the weight factor, the importance of classification accuracy and positioning accuracy can be flexibly balanced; smooth L1 loss improves the robustness of the model to large positioning errors; the weight factor can be adjusted according to different application scenarios to make the model more suitable for specific tasks; the weight factors ω1 and ω2 must be non-negative, and usually their sum should be equal to 1; when implementing, it is necessary to ensure that the gradient calculation of the cross entropy and smooth L1 loss is stable to avoid numerical problems.

[0207] In summary, this algorithm formula (5) provides an effective and innovative solution in the training of machine learning models, especially in scenarios where classification and positioning tasks need to be considered simultaneously.

[0208] The innovative loss function combines the optimization of classification accuracy and positioning accuracy, which is suitable for complex defect detection tasks; the application of multi-scale features, using multi-scale fusion features, improves the model's ability to identify defects of different sizes and shapes. This step improves the accuracy and robustness of the SVM model in the rubber seal surface defect detection task by optimizing the loss function; combined with multi-scale features, the model can more effectively identify and locate various types of defects.

[0209] Please refer to the attached Figure 7 , the specific process of step 6 is as follows:

[0210] Load model: load the SVM model trained in step 5;

[0211] Data preparation: Prepare the feature data of the image to be detected. This data should be the same as the features used when training the model.

[0212] Category prediction: Use the SVM model to classify each image area to determine whether there is a defect and its category;

[0213] Position regression: For areas classified as defects, the SVM model is used for position regression to determine the specific location of the defect;

[0214] Result output: Output defect category and location information for subsequent analysis and decision-making.

[0215] The SVM model is expressed as:

[0216]

[0217] Where f(x) is the prediction function; α i is the coefficient of the support vector; y i is the label of the training sample; K(x i ,x) is the kernel function used to map data into a high-dimensional space, and b is the bias term.

[0218] Classification is to determine whether an image region contains a defect; regression is to accurately predict the location of the defect. Support vector machine is an effective machine learning algorithm for handling classification and regression tasks.

[0219] In classification problems, SVMs distinguish between different classes of data points by finding a hyperplane. In regression problems, SVMs try to find a function that is as close as possible to the training data points within a given error tolerance.

[0220] The input data is the feature data of the image to be tested, usually including color, texture, shape and other features. These data should be the same as the features used when training the model; the image data comes from the production line or quality inspection station of the rubber seal.

[0221] The preprocessing steps include image noise removal, edge protection, feature enhancement, and multi-scale fusion, which have been completed in the previous steps. Use the same model parameters as in the training phase, including kernel function type, regularization parameters, etc.; ensure that the features in the test phase are consistent with those in the training phase; before actual application, the performance of the model on an independent test set should be evaluated, including classification accuracy and positioning accuracy.

[0222] This step uniquely combines classification and regression tasks to improve the comprehensiveness and accuracy of defect detection; through position regression, the model can accurately determine the specific location of the defect, which is crucial for subsequent quality control and traceability.

[0223] This step provides strong support for rubber seal surface defect detection through accurate category prediction and position regression. This not only improves the accuracy of defect detection, but also provides important information for subsequent quality control and traceability.

[0224] Combination of classification and regression: The SVM model is used in step 6 to perform two tasks: classification (determining whether a defect exists) and regression (determining the specific location of the defect).

[0225] The Loss function in step 5 also combines these two aspects: classification loss (calculated by cross entropy loss) and localization loss (calculated by smooth L1 loss).

[0226] When training the SVM model, the loss function in step 5 is used to guide the model learning so that it can better classify and locate; by minimizing this loss function, the SVM model learns to distinguish data points of different categories and accurately predict the location of defects.

[0227] The loss function in step 5 contains weight parameters ω1, ω2, which need to be adjusted during training to balance classification accuracy and localization accuracy; this balance is crucial for defect detection tasks because we need to know not only whether defects exist, but also their exact locations.

[0228] In the training phase, the loss function is used to evaluate the performance of the SVM model and adjust the model parameters through back propagation and optimization algorithms. In the application phase (step 6), the trained SVM model is used for actual classification and positioning tasks. The relationship between the loss function in step 5 and the SVM model is close and direct. The loss function not only defines the goal of model training (i.e., minimizing classification and positioning errors), but also affects the final performance of the model; through a carefully designed loss function, we can ensure that the SVM model achieves high accuracy and efficiency in the rubber seal surface defect detection task.

[0229] Step 6 is the key part of the rubber seal surface defect detection solution. It uses a well-trained SVM model to achieve accurate classification and location of defects. This step is closely linked to the previous steps to ensure the efficiency and accuracy of the entire detection process. With this method, we can achieve high-precision defect detection in complex industrial environments, providing reliable data support for quality control and traceability.

[0230] The above description is only a preferred specific implementation manner of the present invention; however, the protection scope of the present invention is not limited thereto; any technician familiar with the technical field within the technical scope disclosed by the present invention; any replacement or change made by the technical solution and improved concept of the present invention shall be covered within the protection scope of the present invention.

Claims

1. A method for classifying and locating multiple types of surface defects of rubber sealing rings, characterized by: The following steps are involved: Step 1: Image Preprocessing Perform image preprocessing to enhance the visual contrast between defective and normal areas, remove noise and protect image edges to provide clearer images for subsequent steps; Step 2: Gaussian Differentiation Harness Detection On the pre-processed image, the wiring harness area that may have defects is identified; the image features are enhanced by the Hessian matrix to facilitate the identification of subtle defects; Step 3: Direction-Sensitive Filtering For the image after wire harness inspection, the wire harness texture in a specific direction is enhanced, and the features in a specific direction in the image are further enhanced to provide more information for defect classification; Step 4: Local feature extraction and multi-scale fusion Based on the output of the above steps, local features are extracted and combined with multi-scale line bundle information to obtain rich feature data to provide input for subsequent classification models; Step 5: SVM model training Train the support vector machine model to improve the accuracy and robustness of the model by optimizing the loss functions of classification and localization; Step 6: Category prediction and position regression Use the trained SVM model to predict the defect category of the inspection image and give the specific area location; Achieve accurate defect classification and location, providing a basis for subsequent quality control and traceability; The step 1 uses algorithm (1) to perform image preprocessing. The specific algorithm formula is as follows: Among them, F(x,y) is the pixel value of the processed image at position (x,y); f(i,j) is the pixel value of the original image at position (i,j); σ is the parameter that controls the smoothness of the Gaussian filter; β is the parameter that controls the strength of edge preservation; Z(x,y) is the normalization factor to ensure that the processed pixel value is within a reasonable range; It is a Gaussian function, which is used to smooth the image and reduce the influence of noise; is the Sigmoid function, used to maintain edge information; The step 2 adopts algorithm (2), and the specific algorithm formula is as follows: Among them, Δf is the Laplace operator, which is used to measure the curvature of the image at the point (x, y); f xx ,f yy ,f xy is the second-order partial derivative of the image at point (x, y), representing the curvature of the image in the x direction, y direction, and xy mixed direction respectively; λ1, λ2 are adjustment parameters used to control the contribution of partial derivatives to the final result; The step 3 adopts the algorithm formula (3), and the specific algorithm formula is as follows: Among them, G(x,y) is the pixel value of the processed image at position (x,y); σ is a parameter that controls the smoothness of the Gaussian filter; k is the wave number, which is related to the frequency of the texture; θ is the direction angle, which determines the direction of the filter enhancement; is Planck's constant, which introduces the concept of quantum mechanics; m is the particle mass, which is used to adjust the quantum mechanical factor; ω is the angular frequency, which is related to the periodicity of the texture; is a Gaussian function, which is used to locally smooth the image and reduce the impact of noise; e i(kxcosθ+kysinθ is a complex exponential function, representing the propagation of waves, used to enhance the characteristics of a specific direction, i represents the imaginary part of the complex number; is a factor in quantum mechanics that modulates the amplitude of a wave; The step 4 adopts the algorithm formula (4), and the specific algorithm formula is as follows: Among them, F multi x, y are the feature representations after multi-scale fusion; S, T are the number of scales and feature types; W s,t is a weight factor used to balance the contribution of different scales and feature types; γ, α, δ are adjustment parameters used to control the strength of nonlinear transformation; G s,t (x, y) is the Gabor filter response at scale s and feature type t; H s,t (x,y) is the Hessian matrix response at scale s and feature type t; Input: pixel data of the image processed in step 3; Output: multi-scale fusion feature representation; the specific process is as follows: Initialization parameters: Set S, T, γ, α, δ and w s,t ; Multi-scale feature extraction: For each scale s and feature type t, extract the Gabor filter and Hessian matrix response; Feature fusion: features of different scales and types are fused through weighting and nonlinear transformation; Generate feature representation: form the final multi-scale fusion feature representation F multi (x,y).

2. The method for classifying and locating multiple types of surface defects of a rubber sealing ring according to claim 1 is characterized in that: The specific process of step 1 is as follows: Initialization: set the values ​​of σ and β; Traverse the image: For each pixel (x, y) in the image, perform the following calculations; Apply Gaussian filtering: Calculate the Gaussian weighted average centered at (x,y); Edge preservation: Use the Sigmoid nonlinear function to adjust the contribution of each pixel to maintain the edge; Normalization: Use Z(x,y) to normalize the results; Among them, the input data is the original image data, usually in digital image format, JPEG, PNG; The image data comes from the production line or quality inspection station of the rubber seal; Preprocessing steps: including basic image processing steps such as image format conversion and size adjustment.

3. The method for classifying and locating multiple types of surface defects of a rubber sealing ring according to claim 1, characterized in that: The step 2 comprises the following steps: Input: the image processed in step 1; Output: Image processed by the Hessian matrix, highlighting specific features; The specific calculation process is as follows: Calculate the second-order partial derivative: For each pixel (x, y) in the image, calculate f xx ,f yy ,f xy ; Apply the Laplace operator: calculate Δf; Construct Hessian matrix: construct the matrix according to the formula of algorithm (2); Analyze features: Identify and enhance specific features in the image by analyzing the characteristics of the Hessian matrix.

4. The method for classifying and locating multiple types of surface defects of a rubber sealing ring according to claim 1, characterized in that: The step 3 comprises the following steps: Input: the image processed in step 2; Output: Image processed by Gabor filtering, highlighting features in specific directions; The specific calculation process is as follows: Traverse the image: For each pixel (x, y) in the image, perform the following steps; Apply Gaussian function: Calculate the Gaussian weighted average centered at (x,y); Applying complex exponential function: enhancing features in specific directions in the image; Apply quantum mechanical factors: modulate the amplitude of the wave to further enhance specific features.

5. The method for classifying and locating multiple types of surface defects of a rubber sealing ring according to claim 1, characterized in that: The step 5 adopts the algorithm formula (5), and the specific algorithm formula is as follows: in, is the cross entropy loss function, used for classification tasks; y o,c is the true category label, p o,c is the predicted probability; It is a smooth L1 loss function, used for positioning tasks; and are the predicted and true position vectors respectively; ω1, ω2 are weight factors used to balance the classification loss and positioning loss; The input data is the multi-scale fusion features generated in step 4; Data source: The image data comes from the production line or quality inspection station of rubber sealing rings; Preprocessing steps: including image noise removal, edge protection, feature enhancement and multi-scale fusion; the specific process is as follows: Initialize the model: set the parameters of the SVM model; Prepare data: Use the multi-scale fusion features in step 4 as input data; Define the loss function: Define the loss function according to the algorithm formula (5); Model training: Use the loss function to train the SVM model; Parameter adjustment: adjust ω1, ω2 and other model parameters through cross-validation and other methods; Model evaluation: Evaluate the performance of the model on the training set and validation set.

6. The method for classifying and locating multiple types of surface defects of a rubber sealing ring according to claim 1, characterized in that: The specific process of step 6 is as follows: Load model: load the SVM model trained in step 5; Data preparation: Prepare the feature data of the image to be detected. This data should be the same as the features used when training the model. Category prediction: Use the SVM model to classify each image area to determine whether there is a defect and its category; Position regression: For areas classified as defects, the SVM model is used for position regression to determine the specific location of the defect; Result output: Output defect category and location information for subsequent analysis and decision-making; The SVM model is expressed as: Where f(x) is the prediction function; α i is the coefficient of the support vector; y i is the label of the training sample; K(x i ),x) is the kernel function used to map data into a high-dimensional space, and b is the bias term.