CN117746000A - Classifying and positioning method for multiple types of surface defects of rubber sealing ring - Google Patents

Classifying and positioning method for multiple types of surface defects of rubber sealing ring Download PDF

Info

Publication number
CN117746000A
CN117746000A CN202311822151.0A CN202311822151A CN117746000A CN 117746000 A CN117746000 A CN 117746000A CN 202311822151 A CN202311822151 A CN 202311822151A CN 117746000 A CN117746000 A CN 117746000A
Authority
CN
China
Prior art keywords
image
model
positioning
specific
rubber sealing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311822151.0A
Other languages
Chinese (zh)
Inventor
张瑞勇
帅德元
胡立平
王云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Ruifu Sealing Technology Co ltd
Original Assignee
Guangdong Ruifu Sealing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Ruifu Sealing Technology Co ltd filed Critical Guangdong Ruifu Sealing Technology Co ltd
Priority to CN202311822151.0A priority Critical patent/CN117746000A/en
Publication of CN117746000A publication Critical patent/CN117746000A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a multi-class surface defect classification positioning method for a rubber sealing ring, which comprises the following steps: step 1: preprocessing an image; step 2, gaussian differential harness detection is carried out on the preprocessed image so as to identify a harness area possibly with defects; the image characteristics are enhanced through the Hessian matrix, so that fine defects can be conveniently identified; step 3, direction sensitive filtering, namely enhancing the wire harness texture in a specific direction of the detected image of the wire harness, further enhancing the characteristic in the specific direction of the image and providing more information for defect classification; step 4, local feature extraction and multi-scale fusion, extracting local features based on the output of the steps, and acquiring abundant feature data by combining multi-scale harness information to provide input for a subsequent classification model; training an SVM model, training a support vector machine model, and improving the accuracy and the robustness of the model by optimizing a loss function of classification and positioning; and 6, category prediction and position regression.

Description

Classifying and positioning method for multiple types of surface defects of rubber sealing ring
Technical Field
The invention relates to the technical field of defect classification positioning methods, in particular to a multi-class surface defect classification positioning method for a rubber sealing ring.
Background
Rubber seals are an integral component of many industrial products and machinery that play a critical role in ensuring tightness and preventing leakage of liquids or gases. Therefore, ensuring the quality of the rubber sealing ring is important, wherein defect detection and positioning are key links for ensuring the quality of products.
Defects of the rubber seal may include various types of cracks, scratches, depressions, bubbles, etc., which tend to be tiny and difficult to identify with the naked eye. In addition, the heterogeneity of the rubber material and the complexity in the production process increase the difficulty of detection. Accurately detecting these defects and determining their specific locations is critical for subsequent quality control and defect analysis.
Although the prior art has been able to detect defects to some extent, the following disadvantages remain:
1. the accuracy is not enough: the traditional image processing method is often insufficient in accuracy when processing complex background or micro defects, and is easy to produce erroneous judgment or missed judgment.
2. Positioning is difficult: the prior art is generally limited in its effectiveness in locating the specific location of the defect, especially when the defect is small in size or irregularly shaped.
3. The treatment speed is slow: some high-precision detection methods have slower processing speed and are not suitable for the requirements of a rapid production line.
4. The adaptability is poor: the prior art has insufficient adaptability and flexibility for different types of rubber seals or different defect types.
In view of the above, the prior art has significant limitations in detecting and locating defects in rubber seals, which has prompted us to develop a new technique that is more efficient, accurate, and adaptable to address these problems.
Disclosure of Invention
1. Technical problem to be solved
Aiming at the problems existing in the prior art, the invention aims to provide a multi-class surface defect classification positioning method of a rubber sealing ring, which provides a comprehensive and efficient solution for multi-class defect classification positioning of the surface of the rubber sealing ring by combining an advanced image processing technology, a mathematical model and a machine learning algorithm.
2. Technical proposal
In order to solve the problems, the invention adopts the following technical scheme:
the classifying and positioning method for the multi-class surface defects of the rubber sealing ring comprises the following steps:
step 1: image preprocessing
Image preprocessing is carried out to enhance the visual contrast between the defect area and the normal area, eliminate noise and protect the image edge, and a clearer image is provided for the subsequent steps;
step 2, gaussian differential harness detection
On the preprocessed image, to identify a harness area where a defect may exist; the image features are enhanced by the Hessian matrix, so that fine defects can be conveniently identified.
Step 3, direction sensitive filtering
The detected image of the wire harness is enhanced to enhance the wire harness texture in a specific direction, further enhance the characteristics of 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 steps, extracting local features, and acquiring rich feature data by combining multi-scale wire harness information to provide input for a subsequent classification model;
step 5 SVM model training
Training a support vector machine model, and improving the accuracy and the robustness of the model by optimizing a loss function of classification and positioning;
step 6, category prediction and position regression
Performing defect type prediction on the detected image by using a trained SVM model, and giving out the position of a specific region; accurate defect classification and positioning are realized, and basis is provided for subsequent quality control and traceability.
The step 1 adopts the algorithm (1) to carry out image preprocessing, and the specific algorithm formula is as follows:
wherein, the image cable value of the image processed by F (x, y) at the position (x, y); f (i, j) is the pixel value of the original image at position (i, j); sigma is a parameter controlling the smoothness of the gaussian filter; beta is a parameter controlling edge holding strength; z (x, y) is a normalization factor, so that the pixel value after processing is ensured to be in a reasonable range;the Gaussian function is used for smoothing the image, so that noise influence is reduced; />Is a Sigmoid function used for maintaining edge information.
The specific process of the step 1 is as follows:
initializing: setting the values of sigma and beta;
traversing the image: for each pixel point (x, y) in the image, performing the following calculation;
gaussian filtering is applied: calculating a (x, y) -centered gaussian weighted average;
edge retention: adjusting the contribution of each pixel using a Sigmoid nonlinear function to preserve edges; normalization: normalizing the result using Z (x, y);
the input data is original image data, usually in a digital image format, JPEG (joint photographic experts group) and PNG (PNG);
the image data is from a production line or a quality detection station of the rubber sealing ring;
pretreatment: includes the steps of image format conversion and basic image processing for resizing.
Unique filter combination: a novel image preprocessing method is provided by combining Gaussian filtering and a nonlinear dynamics system.
Edge retention capability: the algorithm emphasizes in particular that the image edges are preserved while noise is eliminated, which is critical for subsequent defect detection.
The algorithm (1) is particularly suitable for defect detection under a complex background, can effectively enhance the contrast between the defect and the background, simultaneously keeps the definition of the edge of the defect, and provides ideal input for subsequent classification and positioning tasks. The method provides a powerful image preprocessing tool for detecting the surface defects of the rubber sealing ring, and remarkably improves the accuracy and efficiency of the subsequent defect detection step through a unique filtering technology and an edge maintaining strategy.
The step 2 adopts an algorithm (2), and the specific algorithm formula is as follows:
wherein Δf is a laplace operator for measuring the degree of curvature of an image at points (x, y); f (f) xx ,f yy ,f xy The second partial derivative of the image at points (x, y) represents the curvature of the image in the x and y directions, respectively; lambda (lambda) 12 To adjust the parameters, the contribution of the partial derivative to the final result is controlled.
The step 2 comprises the following steps:
input: the image processed by the step 1;
and (3) outputting: the image processed by the Hessian matrix highlights specific characteristics;
the specific calculation process is as follows:
calculating a second partial derivative: for each pixel point (x, y) in the image, calculate f xx ,f yy ,f xy
The laplace operator is applied: calculating Δf;
constructing a Hessian matrix: constructing a matrix according to the formula of the algorithm (2);
analysis characteristics: specific features in the image are identified and enhanced by analyzing the characteristics of the Hessian matrix.
Gaussian differential harness detection: this method is particularly suitable for detecting fine edges and textures in images, which is critical for defect detection.
Structural feature enhancement: through analysis of the Hessian matrix, structural features in the image can be effectively enhanced, and accuracy of defect identification is improved.
The algorithm (2) is particularly suitable for defect detection in a complex background, can effectively identify and enhance the wire harness-shaped structure in the image, and provides key structural information for subsequent classification and positioning tasks.
The step 3 adopts an algorithm formula (3), and the specific algorithm formula is as follows:
wherein G (x, y) is the pixel value of the processed image at the position (x, y); sigma is a parameter controlling the smoothness of the gaussian filter; k is the wave number, related to the frequency of the texture; θ is the direction angle, determining the direction of filter enhancement;for Planck constant, introducing quantum mechanics concept; m is the mass of the particles and is used for adjusting quantum mechanical factors; omega is the angular frequency, which is related to the periodicity of the texture; />The Gaussian function is used for locally smoothing the image, so that noise influence is reduced; e, e i(kxcosθ+kysinθ) A complex exponential function representing the propagation of waves for enhancing the characteristics of a particular direction; />Is a factor in quantum mechanics, used to modulate the amplitude of a wave; />Is the planck constant, m is the particle mass, ω is the angular frequency.
The step 3 comprises the following steps:
input: the image processed by the step 2;
and (3) outputting: the image subjected to Gabor filtering treatment highlights the characteristics of a specific direction;
the specific calculation process is as follows:
traversing the image: for each pixel point (x, y) in the image, performing the following steps;
applying a gaussian function: calculating a (x, y) -centered gaussian weighted average;
applying a complex exponential function: enhancing features in a particular direction in the image;
applying quantum mechanical factors: the amplitude of the modulated wave further enhances the specific characteristics.
Enhancement of direction sensitive features: by combining gaussian and complex exponential functions, features of a particular direction in an image can be more accurately enhanced.
Application of quantum mechanical factors: the introduced quantum mechanical factors may provide a new way to modulate and enhance image features.
The algorithm formula (3) is particularly suitable for defect detection under a complex background, can effectively enhance the line beam texture in a specific direction in an image, and provides key visual information for subsequent classification and positioning tasks. The algorithm formula (3) provides a powerful direction sensitive filtering tool for detecting the surface defects of the rubber sealing ring, the identification capability of textures in a specific direction is obviously improved through accurate Gabor filtering and quantum mechanical factor modulation, and the step is tightly connected with the results of the first two steps, so that the high efficiency and the accuracy of the whole detection flow are ensured.
The step 4 adopts an algorithm formula (4), and the specific algorithm formula is as follows:
wherein F is multi (x, y) is a multi-scale fused feature representation; s, T is the number of scale and feature types; w (w) s,t Is a weight factor for balancing the contributions of different scales and feature types; gamma, alpha, delta are adjusting parameters for controlling the intensity 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;
and (3) outputting: a multi-scale fusion feature representation; the specific process is as follows:
initializing parameters: setting S, T, gamma, alpha, delta and w s,t
Multi-scale feature extraction: extracting Gabor filtering and Hessian matrix response for each scale s and feature type t;
feature fusion: fusing the features of different scales and types through weighting and nonlinear transformation;
generating a feature representation: forming final multiscale fusion feature representation F multi (x,y)。
The innovative feature fusion method comprises the following steps: combining multi-scale analysis with complex network theory provides a novel way to process and fuse image features.
Nonlinear feature transformation: through application of sigmoid and log functions, the expression capacity and the distinguishing degree of the features are enhanced.
The algorithm formula (4) is particularly suitable for defect detection under a complex background, can effectively extract and fuse multi-scale features, and provides rich and distinguishing feature representation for subsequent classification and positioning tasks; step 4, providing a powerful feature representation tool for detecting the surface defects of the rubber sealing ring through an innovative multi-scale feature extraction and fusion algorithm; the step is tightly connected with the results of the previous three steps, so that the high efficiency and the accuracy of the whole detection flow are ensured; by the method, key information in the image can be more comprehensively captured, so that the accuracy of classification and positioning is improved.
The step 5 adopts an algorithm formula (5), and the specific algorithm formula is as follows:
wherein,is a cross entropy loss function and is used for classifying tasks; y is o,c Is a true class label, p o,c Is the prediction probability; />Is a smooth L1 loss function for locating tasks;and->Respectively a predicted and a true position vector; omega 12 Is a weight factor for balancing the classification loss and the positioning loss;
the input data is the multi-scale fusion characteristic generated in the step 4;
data sources: the image data is from a production line or a quality detection station of the rubber sealing ring;
pretreatment: noise elimination, edge protection, feature enhancement and multi-scale fusion of images; the specific process is as follows:
initializing a model: setting parameters of an SVM model;
preparing data: using the multi-scale fusion features in step 4 as input data;
defining a loss function: defining a loss function according to an algorithm formula (5);
model training: training an SVM model using the loss function;
parameter adjustment: omega adjustment by cross-validation or the like 12 And other model parameters;
model evaluation: the performance of the model on the training set and the validation set is evaluated.
The innovative loss function combines the optimization of classification accuracy and positioning accuracy, and is suitable for complex defect detection tasks; the application of the multi-scale features improves the recognition capability of the model to defects of different sizes and shapes by utilizing the multi-scale fusion features. The accuracy and the robustness of the SVM model in the surface defect detection task of the rubber sealing ring are improved by optimizing the loss function; in combination with the multi-scale features, the model is able to more effectively identify and locate various types of defects.
The specific process of the step 6 is as follows:
loading a model: loading the SVM model trained in the step 5;
data preparation: preparing characteristic data of an image to be detected, wherein the characteristic data are the same as the characteristics used in training a model;
category prediction: classifying each image region using an SVM model to determine whether defects and categories thereof exist;
position regression: for the regions classified as defects, carrying out position regression by using an SVM model to determine the specific positions of the defects;
and (3) outputting results: outputting defect type and position information for subsequent analysis and decision-making;
the SVM model is expressed as:
wherein f (x) is a prediction function; alpha i Is a coefficient of the support vector; y is i A tag that is a training sample; k (x) i X) is a kernel function for mapping data into a high-dimensional space, and b is a bias term.
The input data are characteristic data of the image to be detected, and the data are the same as the characteristics used in training the model; the image data originates from a production line or quality inspection station for the rubber seal rings.
The preprocessing steps include noise cancellation, edge protection, feature enhancement and multi-scale fusion of the image, which have been done in the previous steps. Using the same model parameters as the training phase, including kernel function type, regularization parameters, etc.; ensuring that the characteristics of the test stage are consistent with those of the training stage; before practical application, the performance of the model on the independent test set should be evaluated, including classification accuracy and positioning accuracy.
The step is uniquely combined with classification and regression tasks, so that the comprehensiveness and accuracy of defect detection are improved; by means of position regression, the model is able to accurately determine the specific location of the defect, which is crucial for subsequent quality control and traceability.
The method provides strong support for detecting the surface defects of the rubber sealing ring through accurate category prediction and position regression. The defect detection accuracy is improved, and important information is provided for subsequent quality control and traceability.
Step 6 is a key part of a surface defect detection scheme of the rubber sealing ring, and accurate classification and positioning of defects are realized by using a trained SVM model; the step is tightly connected with the previous step, so that the high efficiency and the accuracy of the whole detection flow are ensured; by the method, high-precision defect detection can be realized in a complex industrial environment, and reliable data support is provided for quality control and traceability.
3. Advantageous effects
Compared with the prior art, the invention has the advantages that:
1. the accuracy and the efficiency of the defect detection of the rubber sealing ring are improved, and the image data can be processed and analyzed more effectively by using an advanced image processing technology and a mathematical model; particularly, when processing rubber seal ring images with complex backgrounds and fine features, the algorithm formulas can remarkably improve the accuracy of defect detection.
2. Multi-scale feature fusion: by combining multi-scale analysis, the invention can capture coarse to fine image information, thereby improving the recognition capability of defects with different sizes and shapes.
3. Accurate classification and positioning: in combination with classification and regression tasks: the invention not only can accurately classify the defects in the rubber sealing ring image, but also can accurately position the specific positions of the defects. This is critical for subsequent quality control and traceability.
4. Optimized loss function: by using a specially designed loss function, the invention can effectively balance the classification accuracy and the positioning accuracy in the training process.
5. The algorithm formula provided by the invention contains a plurality of adjustable parameters, so that the model can adapt to different data characteristics and requirements.
6. The method is suitable for complex environments, improves efficiency, and reduces manual intervention: due to the high adaptability, the invention is particularly suitable for detecting the defects of the rubber sealing ring with high precision in a complex industrial environment; the invention can rapidly identify and position the defects of the rubber sealing ring through automatic image processing and analysis, thereby improving the efficiency of a production line, reducing the dependence on manual inspection, reducing the possibility of human errors and improving the overall detection speed and reliability.
In summary, the invention provides a comprehensive and efficient solution for detecting various defects on the surface of the rubber sealing ring by combining advanced image processing technology, mathematical model and machine learning algorithm. The method not only improves the detection accuracy, but also improves the processing speed, so that the method becomes an important tool in industrial quality control, and the production efficiency and the product quality can be obviously improved.
Drawings
FIG. 1 is a flow chart of a method for classifying and positioning multiple types of surface defects of a rubber seal ring;
FIG. 2 is a flow chart of step 1 of the present invention;
FIG. 3 is a flow chart of step 2 of the present invention;
FIG. 4 is a flow chart of step 3 of the present invention;
FIG. 5 is a flow chart of step 4 of the present invention;
FIG. 6 is a flow chart of step 5 of the present invention;
fig. 7 is a flow chart of step 6 of the present invention.
Detailed Description
The drawings in the embodiments of the present invention will be combined; the technical scheme in the embodiment of the invention is clearly and completely described; obviously; the described embodiments are only a few embodiments of the present invention; but not all embodiments, are based on embodiments in the present invention; all other embodiments obtained by those skilled in the art without undue burden; all falling within the scope of the present invention.
In the description of the present invention, it should be noted that the terms "upper," "lower," "inner," "outer," "top/bottom," and the like indicate an orientation or a positional relationship based on that shown in the drawings, and are merely for convenience of description and simplification of the description, and do not indicate or imply that the apparatus or element in question must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "provided," "engaged/connected," and "connected" are to be construed broadly, e.g., "connected," whether fixedly connected, detachably connected, or integrally connected; is a mechanical connection and also an electrical connection; is directly connected, also indirectly connected through an intermediate medium, and is the communication between the two components. The specific meaning of the above terms in the present invention is understood in detail by those of ordinary skill in the art.
Example 1
Referring to fig. 1-7, the method for classifying and positioning the surface defects of the rubber seal ring comprises the following steps:
step 1: image preprocessing
Image preprocessing is carried out to enhance the visual contrast between the defect area and the normal area, eliminate noise and protect the image edge, and a clearer image is provided for the subsequent steps;
step 2, gaussian differential harness detection
On the preprocessed image of step 1, to identify a harness area where a defect may exist; the image characteristics are enhanced through the Hessian matrix, so that fine defects can be conveniently identified;
step 3, direction sensitive filtering
The detected image of the wire harness in the step 2 is enhanced to enhance the wire harness texture in a specific direction, further enhance the characteristics 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 step 3, extracting local features, and acquiring rich feature data by combining multi-scale wire harness information to provide input for a subsequent classification model;
step 5 SVM model training
Training a support vector machine model, and improving the accuracy and the robustness of the model by optimizing a loss function of classification and positioning;
step 6, category prediction and position regression
Performing defect type prediction on the detected image by using a trained SVM model, and giving out the position of a specific region; accurate defect classification and positioning are realized, and basis is provided for subsequent quality control and traceability.
The step 1 adopts the algorithm (1) to carry out image preprocessing, and the specific algorithm formula is as follows:
wherein, the image cable value of the image processed by F (x, y) at the position (x, y); f (i, j) is the pixel value of the original image at position (i, j); sigma is a parameter controlling the smoothness of the gaussian filter; beta is a parameter controlling edge holding strength; z (x, y) is a normalization factor, so that the pixel value after processing is ensured to be in a reasonable range;the Gaussian function is used for smoothing the image, so that noise influence is reduced; />Is a Sigmoid function used for maintaining edge information.
Referring to fig. 2, the specific process of step 1 is as follows:
initializing: setting the values of sigma and beta;
traversing the image: for each pixel point (x, y) in the image, performing the following calculation;
gaussian filtering is applied: calculating a (x, y) -centered gaussian weighted average;
edge retention: adjusting the contribution of each pixel using a Sigmoid nonlinear function to preserve edges; normalization: normalizing the result using Z (x, y);
wherein, the input data is original image data, usually in digital image format, JPEG, PNG, etc.; the image data is from a production line or a quality detection station of the rubber sealing ring;
pretreatment: includes the steps of image format conversion and basic image processing for resizing.
The algorithm (1) combines Gaussian filtering and a nonlinear dynamics system, and provides a novel image preprocessing method; it is particularly emphasized that the image edges are maintained while noise is eliminated, which is critical for subsequent defect detection.
The algorithm (1) is particularly suitable for defect detection under a complex background, can effectively enhance the contrast between the defect and the background, simultaneously keeps the definition of the edge of the defect, and provides ideal input for subsequent classification and positioning tasks; the method provides a powerful image preprocessing tool for detecting the surface defects of the rubber sealing ring, and remarkably improves the accuracy and efficiency of the subsequent defect detection step through a unique filtering technology and an edge maintaining strategy.
All parameters must be chosen within reasonable limits to ensure the stability and effectiveness of the algorithm; the selection of gamma, alpha and delta has a significant effect on the algorithm performance; w (w) s,t Is critical to ensure efficient fusion of different scales and feature types.
The step 2 adopts an algorithm (2), and the specific algorithm formula is as follows:
wherein Δf is a laplace operator for measuring the degree of curvature of an image at points (x, y); f (f) xx ,f yy ,f xy The second partial derivative of the image at points (x, y) represents the curvature of the image in the x and y directions, respectively; lambda (lambda) 12 To adjust the parameters, the contribution of the partial derivative to the final result is controlled.
Referring to fig. 3, the step 2 includes the following steps:
input: the image processed by the step 1;
and (3) outputting: the image processed by the Hessian matrix highlights specific characteristics;
the specific calculation process is as follows:
calculating a second partial derivative: for each pixel point (x, y) in the image, calculate f xx ,f yy ,f xy
The laplace operator is applied: calculating Δf;
constructing a Hessian matrix: constructing a matrix according to the formula of the algorithm (2);
analysis characteristics: specific features in the image are identified and enhanced by analyzing the characteristics of the Hessian matrix.
Gaussian differential harness detection: this method is particularly suitable for detecting fine edges and textures in images, which is critical for defect detection.
Structural feature enhancement: through analysis of the Hessian matrix, structural features in the image can be effectively enhanced, and accuracy of defect identification is improved.
The algorithm (2) is particularly suitable for defect detection in a complex background, can effectively identify and enhance the wire harness-shaped structure in the image, and provides key structural information for subsequent classification and positioning tasks.
The step 3 adopts an algorithm formula (3), and the specific algorithm formula is as follows:
wherein G (x, y) is the pixel value of the processed image at the position (x, y); sigma is a parameter controlling the smoothness of the gaussian filter; k is the wave number, related to the frequency of the texture; θ is the direction angle, determining the direction of filter enhancement;for Planck constant, introducing quantum mechanics concept; m is the mass of the particles and is used for adjusting quantum mechanical factors; omega is the angular frequency, which is related to the periodicity of the texture; />The Gaussian function is used for locally smoothing the image, so that noise influence is reduced; e, e i(kxcosθ+kysinθ) A complex exponential function representing the propagation of waves for enhancing the characteristics of a particular direction; />Is a factor in quantum mechanics, used to modulate the amplitude of a wave; />Is the planck constant, m is the particle mass, ω is the angular frequency.
Referring to fig. 4, the step 3 includes the following steps:
input: the image processed by the step 2;
and (3) outputting: the image subjected to Gabor filtering treatment highlights the characteristics of a specific direction;
the specific calculation process is as follows:
traversing the image: for each pixel point (x, y) in the image, performing the following steps;
applying a gaussian function: calculating a (x, y) -centered gaussian weighted average;
applying a complex exponential function: enhancing features in a particular direction in the image;
applying quantum mechanical factors: the amplitude of the modulated wave further enhances the specific characteristics.
Enhancement of direction sensitive features: by combining gaussian and complex exponential functions, features of a particular direction in an image can be more accurately enhanced.
Application of quantum mechanical factors: the introduced quantum mechanical factors may provide a new way to modulate and enhance image features.
σ,k,θ,The choice of m, ω is critical to the filtering effect and the choice of θ determines the direction of enhancement, requiring different direction settings for different image features.
The algorithm formula (3) is particularly suitable for defect detection under a complex background, can effectively enhance the line beam texture in a specific direction in an image, and provides key visual information for subsequent classification and positioning tasks. The algorithm formula (3) provides a powerful direction sensitive filtering tool for detecting the surface defects of the rubber sealing ring, the identification capability of textures in a specific direction is obviously improved through accurate Gabor filtering and quantum mechanical factor modulation, and the step is tightly connected with the results of the first two steps, so that the high efficiency and the accuracy of the whole detection flow are ensured.
The step 4 adopts an algorithm formula (4), and the specific algorithm formula is as follows:
wherein F is multi (x, y) is a multi-scale fused feature representation; s, T is the number of scale and feature types; w (w) s,t Is a weight factor for balancing the contributions of different scales and feature types; gamma, alpha, delta are adjusting parameters for controlling the intensity 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;
and (3) outputting: a multi-scale fusion feature representation; referring to fig. 5, the specific process is as follows:
initializing parameters: setting S, T, gamma, alpha, delta and w s,t
Multi-scale feature extraction: extracting Gabor filtering and Hessian matrix response for each scale s and feature type t;
the algorithm formula (4) fuses the characteristics of different scales and types through weighting and nonlinear transformation; forming final multiscale fusion feature representation F multi (x,y)。
The innovative feature fusion method comprises the following steps: combining multi-scale analysis with complex network theory provides a novel way to process and fuse image features.
Nonlinear feature transformation: through application of sigmoid and log functions, the expression capacity and the distinguishing degree of the features are enhanced.
The algorithm formula (4) is particularly suitable for defect detection under a complex background, can effectively extract and fuse multi-scale features, and provides rich and distinguishing feature representation for subsequent classification and positioning tasks; step 4, providing a powerful feature representation tool for detecting the surface defects of the rubber sealing ring through an innovative multi-scale feature extraction and fusion algorithm; the step is tightly connected with the results of the previous three steps, so that the high efficiency and the accuracy of the whole detection flow are ensured; by the method, coarse to fine key information in the image can be more comprehensively captured, so that the accuracy of classification and positioning tasks is improved.
The step 5 adopts an algorithm formula (5), and the specific algorithm formula is as follows:
wherein,is a cross entropy loss function and is used for classifying tasks; y is o,c Is a true class label, p o,c Is the prediction probability; />Is a smooth L1 loss function for locating tasks;and->Respectively a predicted and a true position vector; omega 12 Is a weight factor for balancing the classification loss and the positioning loss;
the input data is the multi-scale fusion characteristic generated in the step 4;
data sources: the image data is from a production line or a quality detection station of the rubber sealing ring;
pretreatment: noise elimination, edge protection, feature enhancement and multi-scale fusion of images; referring to fig. 6, the specific process is as follows:
initializing a model: setting parameters of an SVM model;
preparing data: using the multi-scale fusion features in step 4 as input data;
defining a loss function: defining a loss function according to an algorithm formula (5);
model training: training an SVM model using the loss function;
parameter adjustment: omega adjustment by cross-validation or the like 12 And other model parameters;
model evaluation: the performance of the model on the training set and the validation set is evaluated.
ω 1 And omega 2 Is critical, and needs to be adjusted according to specific tasks to balance the importance of classification and positioning; when the cross entropy is calculated, the numerical stability needs to be ensured, and potential numerical problems in logarithmic operation are avoided; smoothing the L1 loss helps avoid the problem of gradient explosions, especially when positioning errors are large. The importance of classification accuracy and positioning accuracy can be flexibly balanced by adjusting the weight factors; the smooth L1 loss improves the robustness of the model to large positioning errors; the weight factors can be adjusted according to different application scenes to make the model more suitable for specific tasksThe method comprises the steps of carrying out a first treatment on the surface of the Weight factor omega 1 And omega 2 Must be non-negative and generally their sum should be equal to 1; in implementation, it is necessary to ensure stable gradient computation of cross entropy and smooth L1 loss, avoiding numerical problems.
In summary, this algorithmic formula (5) provides an effective and innovative solution in the training of machine learning models, particularly in scenarios where classification and localization tasks need to be considered simultaneously.
The innovative loss function combines the optimization of classification accuracy and positioning accuracy, and is suitable for complex defect detection tasks; the application of the multi-scale features improves the recognition capability of the model to defects of different sizes and shapes by utilizing the multi-scale fusion features. The accuracy and the robustness of the SVM model in the surface defect detection task of the rubber sealing ring are improved by optimizing the loss function; in combination with the multi-scale features, the model is able to more effectively identify and locate various types of defects.
Referring to fig. 7, the specific process of step 6 is as follows:
loading a model: loading the SVM model trained in the step 5;
data preparation: preparing characteristic data of an image to be detected, wherein the characteristic data are the same as the characteristics used in training a model;
category prediction: classifying each image region using an SVM model to determine whether defects and categories thereof exist;
position regression: for the regions classified as defects, carrying out position regression by using an SVM model to determine the specific positions of the defects;
and (3) outputting results: and outputting the defect type and the position information for subsequent analysis and decision making.
The SVM model is expressed as:
wherein f (x) is a prediction function; alpha i Is a coefficient of the support vector; y is i A tag that is a training sample; k (x) i X) isKernel function for mapping data to high dimensional space, b is a bias term.
Classification is to determine whether an image area contains a defect; regression is to accurately predict the location of defects. The support vector machine is an efficient machine learning algorithm for handling classification and regression tasks.
In the classification problem, the SVM distinguishes between different classes of data points by finding a hyperplane. In the regression problem, the SVM then attempts to find a function that is as close as possible to the training data point within a given tolerance of error.
The input data is characteristic data of the image to be detected, and generally comprises characteristics of color, texture, shape and the like. These data should be the same as the features used in training the model; the image data originates from a production line or quality inspection station for the rubber seal rings.
The preprocessing steps include noise cancellation, edge protection, feature enhancement and multi-scale fusion of the image, which have been done in the previous steps. Using the same model parameters as the training phase, including kernel function type, regularization parameters, etc.; ensuring that the characteristics of the test stage are consistent with those of the training stage; before practical application, the performance of the model on the independent test set should be evaluated, including classification accuracy and positioning accuracy.
The step is uniquely combined with classification and regression tasks, so that the comprehensiveness and accuracy of defect detection are improved; by means of position regression, the model is able to accurately determine the specific location of the defect, which is crucial for subsequent quality control and traceability.
The method provides strong support for detecting the surface defects of the rubber sealing ring through accurate category prediction and position regression. The defect detection accuracy is improved, and important information is provided for subsequent quality control and traceability.
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).
The Loss function of step 5 also combines these two aspects: classification loss (calculated by cross entropy loss) and positioning loss (calculated by smoothing L1 loss).
When training an SVM model, the loss function in the step 5 is used for guiding model learning, so that the SVM model can be better classified and positioned; by minimizing this loss function, the SVM model learns to distinguish between different classes of data points and accurately predicts the location of the defect.
The loss function in step 5 comprises a weight parameter ω 12 These parameters need to be adjusted during the training process to balance the classification accuracy and positioning accuracy; this balance is critical to the defect detection task, since we need to know not only whether defects are present, but also their exact location.
During the training phase, the loss function is used to evaluate the performance of the SVM model and adjust the model parameters via back-propagation and optimization algorithms. In the application phase (step 6), the trained SVM model is used for the actual classification and localization tasks. The loss function in step 5 is closely and directly related to the SVM model. The loss function not only defines the goal of model training (i.e., minimizes classification and localization errors), but also affects the final performance of the model; through the carefully designed loss function, the SVM model can be ensured to reach high accuracy and high efficiency in the surface defect detection task of the rubber sealing ring.
Step 6 is a key part of a surface defect detection scheme of the rubber sealing ring, and accurate classification and positioning of defects are realized by using a trained SVM model; the step is tightly connected with the previous step, so that the high efficiency and the accuracy of the whole detection flow are ensured; by the method, high-precision defect detection can be realized in a complex industrial environment, and reliable data support is provided for quality control and traceability.
The above; is only a preferred embodiment of the present invention; the scope of the invention is not limited in this respect; any person skilled in the art is within the technical scope of the present disclosure; the technical proposal and the improved conception according to the invention are replaced or changed with each other; are intended to be encompassed within the scope of the present invention.

Claims (10)

1. The classifying and positioning method for the surface defects of the rubber sealing rings is characterized by comprising the following steps of: the method comprises the following steps:
step 1: image preprocessing
Image preprocessing is carried out to enhance the visual contrast between the defect area and the normal area, eliminate noise and protect the image edge, and a clearer image is provided for the subsequent steps;
step 2, gaussian differential harness detection
On the preprocessed image, to identify a harness area where a defect may exist; the image characteristics are enhanced through the Hessian matrix, so that fine defects can be conveniently identified;
step 3, direction sensitive filtering
The detected image of the wire harness is enhanced to enhance the wire harness texture in a specific direction, further enhance the characteristics of 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 steps, extracting local features, and acquiring rich feature data by combining multi-scale wire harness information to provide input for a subsequent classification model;
step 5 SVM model training
Training a support vector machine model, and improving the accuracy and the robustness of the model by optimizing a loss function of classification and positioning;
step 6, category prediction and position regression
Performing defect type prediction on the detected image by using a trained SVM model, and giving out the position of a specific region; accurate defect classification and positioning are realized, and basis is provided for subsequent quality control and traceability.
2. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 1, wherein the step 1 is characterized in that an algorithm (1) is adopted for image preprocessing, and a specific algorithm formula is as follows:
wherein, the image cable value of the image processed by F (x, y) at the position (x, y); f (i, j) is the pixel value of the original image at position (i, j); sigma is a parameter controlling the smoothness of the gaussian filter; beta is a parameter controlling edge holding strength; z (x, y) is a normalization factor, so that the pixel value after processing is ensured to be in a reasonable range;the Gaussian function is used for smoothing the image, so that noise influence is reduced; />Is a Sigmoid function used for maintaining edge information.
3. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 2, which is characterized in that: the specific process of the step 1 is as follows:
initializing: setting values of v and beta;
traversing the image: for each pixel point (x, y) in the image, performing the following calculation;
gaussian filtering is applied: calculating a (x, y) -centered gaussian weighted average;
edge retention: adjusting the contribution of each pixel using a Sigmoid nonlinear function to preserve edges;
normalization: normalizing the result using Z (x, y);
the input data is original image data, usually in a digital image format, JPEG (joint photographic experts group) and PNG (PNG);
the image data is from a production line or a quality detection station of the rubber sealing ring;
pretreatment: includes the steps of image format conversion and basic image processing for resizing.
4. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 1, which is characterized in that: the step 2 adopts an algorithm (2), and the specific algorithm formula is as follows:
wherein Δf is a laplace operator for measuring the degree of curvature of an image at points (x, y); f (f) xx ,f yy ,f xy The second partial derivative of the image at points (x, y) represents the curvature of the image in the x and y directions, respectively; lambda (lambda) 12 To adjust the parameters, the contribution of the partial derivative to the final result is controlled.
5. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 4, which is characterized in that: the step 2 comprises the following steps:
input: the image processed by the step 1;
and (3) outputting: the image processed by the Hessian matrix highlights specific characteristics;
the specific calculation process is as follows:
calculating a second partial derivative: for each pixel point (x, y) in the image, calculate f xx ,f yy ,f xy
The laplace operator is applied: calculating Δf;
constructing a Hessian matrix: constructing a matrix according to the formula of the algorithm (2);
analysis characteristics: specific features in the image are identified and enhanced by analyzing the characteristics of the Hessian matrix.
6. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 1, which is characterized in that: the step 3 adopts an algorithm formula (3), and the specific algorithm formula is as follows:
wherein G (x, y) is the pixel value of the processed image at the position (x, y); sigma is a parameter controlling the smoothness of the gaussian filter; k is the wave number, related to the frequency of the texture; θ is the direction angle, determining the direction of filter enhancement;for Planck constant, introducing quantum mechanics concept; m is the mass of the particles and is used for adjusting quantum mechanical factors; omega is the angular frequency, which is related to the periodicity of the texture; />The Gaussian function is used for locally smoothing the image, so that noise influence is reduced; e, e i(kxcosθ+kysinθ) A complex exponential function representing the propagation of waves for enhancing the characteristics of a particular direction; />Is a factor in quantum mechanics, used to modulate the amplitude of a wave; />Is the planck constant, m is the particle mass, ω is the angular frequency.
7. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 6, which is characterized in that: the step 3 comprises the following steps:
input: the image processed by the step 2;
and (3) outputting: the image subjected to Gabor filtering treatment highlights the characteristics of a specific direction;
the specific calculation process is as follows:
traversing the image: for each pixel point (x, y) in the image, performing the following steps;
applying a gaussian function: calculating a (x, y) -centered gaussian weighted average;
applying a complex exponential function: enhancing features in a particular direction in the image;
applying quantum mechanical factors: the amplitude of the modulated wave further enhances the specific characteristics.
8. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 1, which is characterized in that: the step 4 adopts an algorithm formula (4), and the specific algorithm formula is as follows:
wherein F is multi (x, y) is a multi-scale fused feature representation; s, T is the number of scale and feature types; w (w) s,t Is a weight factor for balancing the contributions of different scales and feature types; gamma, alpha, delta are adjusting parameters for controlling the intensity 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;
and (3) outputting: a multi-scale fusion feature representation; the specific process is as follows:
initializing parameters: setting S, T, gamma, alpha, delta and w s,t
Multi-scale feature extraction: extracting Gabor filtering and Hessian matrix response for each scale s and feature type t;
feature fusion: fusing the features of different scales and types through weighting and nonlinear transformation;
generating a feature representation: forming final multiscale fusion feature representation F multi (x,y)。
9. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 1, which is characterized in that: the step 5 adopts an algorithm formula (5), and the specific algorithm formula is as follows:
wherein,is a cross entropy loss function and is used for classifying tasks; y is o,c Is a true class label, p o,c Is the prediction probability; />Is a smooth L1 loss function for locating tasks; />Andrespectively a predicted and a true position vector; omega 12 Is a weight factor for balancing the classification loss and the positioning loss;
the input data is the multi-scale fusion characteristic generated in the step 4;
data sources: the image data is from a production line or a quality detection station of the rubber sealing ring;
pretreatment: noise elimination, edge protection, feature enhancement and multi-scale fusion of images; the specific process is as follows:
initializing a model: setting parameters of an SVM model;
preparing data: using the multi-scale fusion features in step 4 as input data;
defining a loss function: defining a loss function according to an algorithm formula (5);
model training: training an SVM model using the loss function;
parameter adjustment: omega adjustment by cross-validation or the like 12 And other model parameters;
model evaluation: the performance of the model on the training set and the validation set is evaluated.
10. The method for classifying and positioning the surface defects of the rubber sealing rings according to claim 1, which is characterized in that: the specific process of the step 6 is as follows:
loading a model: loading the SVM model trained in the step 5;
data preparation: preparing characteristic data of an image to be detected, wherein the characteristic data are the same as the characteristics used in training a model;
category prediction: classifying each image region using an SVM model to determine whether defects and categories thereof exist;
position regression: for the regions classified as defects, carrying out position regression by using an SVM model to determine the specific positions of the defects;
and (3) outputting results: outputting defect type and position information for subsequent analysis and decision-making;
the SVM model is expressed as:
wherein f (x) is a prediction function; alpha i Is a coefficient of the support vector; y is i A tag that is a training sample; k (x) i X) is a kernel function for mapping data into a high-dimensional space, and b is a bias term.
CN202311822151.0A 2023-12-27 2023-12-27 Classifying and positioning method for multiple types of surface defects of rubber sealing ring Pending CN117746000A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311822151.0A CN117746000A (en) 2023-12-27 2023-12-27 Classifying and positioning method for multiple types of surface defects of rubber sealing ring

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311822151.0A CN117746000A (en) 2023-12-27 2023-12-27 Classifying and positioning method for multiple types of surface defects of rubber sealing ring

Publications (1)

Publication Number Publication Date
CN117746000A true CN117746000A (en) 2024-03-22

Family

ID=90279164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311822151.0A Pending CN117746000A (en) 2023-12-27 2023-12-27 Classifying and positioning method for multiple types of surface defects of rubber sealing ring

Country Status (1)

Country Link
CN (1) CN117746000A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030147558A1 (en) * 2002-02-07 2003-08-07 Loui Alexander C. Method for image region classification using unsupervised and supervised learning
CN103620647A (en) * 2011-07-08 2014-03-05 株式会社尼康 Image classification method
CN109523529A (en) * 2018-11-12 2019-03-26 西安交通大学 A kind of transmission line of electricity defect identification method based on SURF algorithm
CN111145165A (en) * 2019-12-30 2020-05-12 北京工业大学 Rubber seal ring surface defect detection method based on machine vision
CN111179260A (en) * 2019-12-31 2020-05-19 三峡大学 Ceramic tile surface crack detection method based on multi-scale Hessian matrix filtering
CN115797299A (en) * 2022-12-05 2023-03-14 常宝新材料(苏州)有限公司 Defect detection method of optical composite film
CN116664540A (en) * 2023-06-15 2023-08-29 沈阳工业大学 Rubber sealing ring surface defect detection method based on Gaussian line detection
CN116934725A (en) * 2023-07-28 2023-10-24 河海大学 Method for detecting sealing performance of aluminum foil seal based on unsupervised learning

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030147558A1 (en) * 2002-02-07 2003-08-07 Loui Alexander C. Method for image region classification using unsupervised and supervised learning
CN103620647A (en) * 2011-07-08 2014-03-05 株式会社尼康 Image classification method
CN109523529A (en) * 2018-11-12 2019-03-26 西安交通大学 A kind of transmission line of electricity defect identification method based on SURF algorithm
CN111145165A (en) * 2019-12-30 2020-05-12 北京工业大学 Rubber seal ring surface defect detection method based on machine vision
CN111179260A (en) * 2019-12-31 2020-05-19 三峡大学 Ceramic tile surface crack detection method based on multi-scale Hessian matrix filtering
CN115797299A (en) * 2022-12-05 2023-03-14 常宝新材料(苏州)有限公司 Defect detection method of optical composite film
CN116664540A (en) * 2023-06-15 2023-08-29 沈阳工业大学 Rubber sealing ring surface defect detection method based on Gaussian line detection
CN116934725A (en) * 2023-07-28 2023-10-24 河海大学 Method for detecting sealing performance of aluminum foil seal based on unsupervised learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨如民,许琳英,余成波: "基于Hessian矩阵和Gabor滤波的手指静脉特征提取", 《兵器装备工程学报》, vol. 40, no. 3, 31 March 2019 (2019-03-31), pages 103 - 107 *
蔡强;郝佳云;曹健;李海生;: "结合局部特征及全局特征的显著性检测", 光学精密工程, no. 03, 15 March 2017 (2017-03-15), pages 772 - 778 *

Similar Documents

Publication Publication Date Title
CN111062915B (en) Real-time steel pipe defect detection method based on improved YOLOv3 model
JP5546317B2 (en) Visual inspection device, visual inspection discriminator generation device, visual inspection discriminator generation method, and visual inspection discriminator generation computer program
CN110148130B (en) Method and device for detecting part defects
US10803573B2 (en) Method for automated detection of defects in cast wheel products
KR102166458B1 (en) Defect inspection method and apparatus using image segmentation based on artificial neural network
CN111815564B (en) Method and device for detecting silk ingots and silk ingot sorting system
CN112862770B (en) Defect analysis and diagnosis system, method and device based on artificial intelligence
CN113298757A (en) Metal surface defect detection method based on U-NET convolutional neural network
CN112330538B (en) Damage temperature reconstruction image splicing method based on feature point optimization extraction
CN114445366A (en) Intelligent long-distance pipeline radiographic image defect identification method based on self-attention network
Adem et al. Defect detection of seals in multilayer aseptic packages using deep learning
CN115775236A (en) Surface tiny defect visual detection method and system based on multi-scale feature fusion
CN111161237A (en) Fruit and vegetable surface quality detection method, storage medium and sorting device thereof
CN115830004A (en) Surface defect detection method, device, computer equipment and storage medium
CN112862744A (en) Intelligent detection method for internal defects of capacitor based on ultrasonic image
Tang et al. Anomaly detection of core failures in die casting X-ray inspection images using a convolutional autoencoder
CN117392042A (en) Defect detection method, defect detection apparatus, and storage medium
CN114719749A (en) Metal surface crack detection and real size measurement method and system based on machine vision
Ekambaram et al. Identification of defects in casting products by using a convolutional neural network
CN116777892B (en) Method and system for detecting dispensing quality based on visual detection
Kirthiga et al. A survey on crack detection in concrete surface using image processing and machine learning
CN117746000A (en) Classifying and positioning method for multiple types of surface defects of rubber sealing ring
Bhutta et al. Smart-inspect: micro scale localization and classification of smartphone glass defects for industrial automation
Palakal et al. Intelligent computational methods for corrosion damage assessment
CN115082416A (en) Lens flaw detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination