[go: up one dir, main page]

CN117746000B - 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
CN117746000B
CN117746000B CN202311822151.0A CN202311822151A CN117746000B CN 117746000 B CN117746000 B CN 117746000B CN 202311822151 A CN202311822151 A CN 202311822151A CN 117746000 B CN117746000 B CN 117746000B
Authority
CN
China
Prior art keywords
image
specific
model
features
feature
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.)
Active
Application number
CN202311822151.0A
Other languages
Chinese (zh)
Other versions
CN117746000A (en
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 Ruiyong Sealing Products 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 Ruiyong Sealing Products Co ltd filed Critical Guangdong Ruiyong Sealing Products Co ltd
Priority to CN202311822151.0A priority Critical patent/CN117746000B/en
Publication of CN117746000A publication Critical patent/CN117746000A/en
Application granted granted Critical
Publication of CN117746000B publication Critical patent/CN117746000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

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

橡胶密封圈多类表面缺陷分类定位方法Classification and location method of multiple surface defects of rubber sealing rings

技术领域Technical Field

本发明涉及缺陷分类定位方法技术领域,更具体地说,涉及橡胶密封圈多类表面缺陷分类定位方法。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

橡胶密封圈是许多工业产品和机械设备中不可或缺的部件,它们在确保密封性和防止液体或气体泄漏方面发挥着关键作用。因此,确保橡胶密封圈的质量至关重要,其中缺陷检测和定位是保证产品质量的关键环节。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.

橡胶密封圈的缺陷可能包括裂纹、刮痕、凹陷、气泡等多种类型,这些缺陷往往微小且难以用肉眼识别。此外,橡胶材料的非均质性和生产过程中的复杂性增加了检测的难度。准确地检测这些缺陷并确定它们的具体位置对于后续的质量控制和缺陷分析至关重要。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.

尽管现有技术已经能够在一定程度上进行缺陷检测,但仍存在以下不足之处:Although existing technologies are able to detect defects to a certain extent, they still have the following shortcomings:

1.准确性不足:传统的图像处理方法在处理复杂背景或微小缺陷时往往准确性不足,容易产生误判或漏判。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.

2.定位困难:现有技术在定位缺陷的具体位置方面通常效果有限,尤其是在缺陷尺寸较小或形状不规则时。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.

3.处理速度慢:一些高精度的检测方法处理速度较慢,不适合快速生产线的需求。3. Slow processing speed: Some high-precision detection methods have slow processing speeds and are not suitable for the needs of fast production lines.

4.适应性差:对于不同类型的橡胶密封圈或不同的缺陷类型,现有技术的适应性和灵活性不足。4. Poor adaptability: For different types of rubber seals or different defect types, the existing technology has insufficient adaptability and flexibility.

综上所述,现有技术在橡胶密封圈缺陷检测和定位方面存在明显的局限性,这促使我们开发出一种更高效、更准确、更适应性强的新技术来解决这些问题。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

1.要解决的技术问题1. Technical problems to be solved

针对现有技术中存在的问题,本发明的目的在于提供橡胶密封圈多类表面缺陷分类定位方法,通过结合先进的图像处理技术、数学模型和机器学习算法,提供了一种全面且高效的解决方案,用于橡胶密封圈表面的多类缺陷分类定位。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.

2.技术方案2. Technical solution

为解决上述问题,本发明采用如下的技术方案:To solve the above problems, the present invention adopts the following technical solutions:

橡胶密封圈多类表面缺陷分类定位方法,包括以下步骤:A method for classifying and locating multiple types of surface defects of a rubber sealing ring includes the following steps:

步骤1:图像预处理Step 1: Image Preprocessing

对进行图像预处理,以增强缺陷区域和正常区域之间的视觉对比度,消除噪声并保护图像边缘,为后续步骤提供更清晰的图像;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;

步骤2:高斯微分线束检测Step 2: Gaussian Differentiation Harness Detection

在预处理后的图像上,以识别可能存在缺陷的线束区域;通过Hessian矩阵增强图像特征,便于识别细微缺陷。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.

步骤3:方向敏感滤波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;

步骤4:局部特征提取与多尺度融合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;

步骤5:SVM模型训练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;

步骤6:类别预测与位置回归Step 6: Category prediction and position regression

使用训练好的SVM模型对检测图像进行缺陷类别预测,并给出具体区域位置;实现精确的缺陷分类与定位,为后续的质量控制和追溯提供依据。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.

所述步骤1采用算法(1)进行图像预处理,具体算法公式如下:The step 1 uses algorithm (1) to perform image preprocessing. The specific algorithm formula is as follows:

其中,F(x,y)处理后的图像在位置(x,y)的像索值;f(i,j):为原始图像在位置(i,j)的像素值;σ为控制高斯滤波的平滑程度的参数;β为控制边缘保持强度的参数;Z(x,y)为归一化因子,确保处理后的像素值在合理范围内;为高斯函数,用于平滑图像,减少噪声影响;为Sigmoid函数,用于保持边缘信息。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 maintain edge information.

所述步骤1的具体过程如下:The specific process of step 1 is as follows:

初始化:设定σ和β的值;Initialization: set the values of σ and β;

遍历图像:对于图像中的每个像素点(x,y),执行以下计算;Traverse the image: For each pixel (x, y) in the image, perform the following calculations;

应用高斯滤波:计算以(x,y)为中心的高斯加权平均;Apply Gaussian filtering: Calculate the Gaussian weighted average centered at (x,y);

边缘保持:使用Sigmoid非线性函数调整每个像素的贡献,以保持边缘;归一化处理:使用Z(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 result;

其中,输入数据为原始的图像数据,通常为数字图像格式,JPEG、PNG;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.

独特的滤波组合:结合了高斯滤波和非线性动力学系统,提供了一种新颖的图像预处理方法。Unique filter combination: Combining Gaussian filtering and nonlinear dynamics system, a novel image preprocessing method is provided.

边缘保持能力:算法特别强调在噪声消除的同时保持图像边缘,这对于后续的缺陷检测至关重要。Edge preservation capability: The algorithm places special emphasis on preserving image edges while removing noise, which is crucial for subsequent defect detection.

算法(1)特别适用于在复杂背景下的缺陷检测,能够有效地增强缺陷与背景之间的对比度,同时保持缺陷边缘的清晰度,为后续的分类和定位任务提供了理想的输入。为橡胶密封圈表面缺陷检测提供了一个强大的图像预处理工具,通过独特的滤波技术和边缘保持策略,显著提高了后续缺陷检测步骤的准确性和效率。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.

所述步骤2采用算法(2),具体算法公式如下:The step 2 adopts algorithm (2), and the specific algorithm formula is as follows:

其中,Δf为拉普拉斯算子,用于测量图像在点(x,y)的弯曲程度;fxx,fyy,fxy为图像在点(x,y)的二阶偏导数,分别代表图像在x和y方向的曲率;λ12为调整参数,用于控制偏导数对最终结果的贡献。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 are the second-order partial derivatives of the image at the 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.

所述步骤2包括以下步骤:The step 2 comprises the following steps:

输入:经过步骤1处理的图像;Input: the image processed in step 1;

输出:经过Hessian矩阵处理的图像,突出了特定的特征;Output: Image processed by the Hessian matrix, highlighting specific features;

具体的计算过程如下:The specific calculation process is as follows:

计算二阶偏导数:对于图像中的每个像素点(x,y),计算fxx,fyy,fxyCalculate the second-order partial derivatives: For each pixel (x, y) in the image, calculate f xx , f yy , f xy ;

应用拉普拉斯算子:计算Δf;Apply the Laplace operator: calculate Δf;

构建Hessian矩阵:根据算法(2)的公式构建矩阵;Construct Hessian matrix: construct the matrix according to the formula of algorithm (2);

分析特征:通过分析Hessian矩阵的特性,来识别和增强图像中的特定特征。Analyze features: Identify and enhance specific features in the image by analyzing the characteristics of the Hessian matrix.

高斯微分线束检测:这种方法特别适用于检测图像中的细微边缘和纹理,这对于缺陷检测至关重要。Gaussian Differential Line Detection: This method is particularly useful for detecting subtle edges and textures in images, which are critical for defect detection.

结构特征增强:通过Hessian矩阵的分析,能够有效地增强图像中的结构特征,提高缺陷识别的准确性。Structural feature enhancement: Through the analysis of the Hessian matrix, the structural features in the image can be effectively enhanced to improve the accuracy of defect recognition.

算法(2)特别适用于在复杂背景下的缺陷检测,能够有效地识别和增强图像中的线束状结构,为后续的分类和定位任务提供了关键的结构信息。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.

所述步骤3采用算法公式(3),具体算法公式如下:The step 3 adopts algorithm formula (3), and the specific algorithm formula is as follows:

其中,G(x,y):为处理后的图像在位置(x,y)的像素值;σ为控制高斯滤波的平滑程度的参数;k为波数,与纹理的频率相关;θ为方向角,决定了滤波器增强的方向;为普朗克常数,引入量子力学概念;m为粒子质量,用于调节量子力学因子;ω为角频率,与纹理的周期性相关;为高斯函数,用于局部平滑图像,减少噪声影响;ei(kxcosθ+kysinθ)为复指数函数,代表波的传播,用于增强特定方向的特征;为量子力学中的因子,用于调制波的幅度;是普朗克常数,m是粒子质量,ω是角频率。Among them, G(x,y): is the pixel value of the processed image at position (x,y); σ is the 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 influence of noise; e i(kxcosθ+kysinθ) is a complex exponential function, which represents the propagation of waves and is used to enhance the features 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.

所述步骤3包括以下步骤:The step 3 comprises the following steps:

输入:经过步骤2处理的图像;Input: image processed in step 2;

输出:经过Gabor滤波处理的图像,突出了特定方向的特征;Output: Image processed by Gabor filtering, highlighting features in specific directions;

具体的计算过程如下:The specific calculation process is as follows:

遍历图像:对于图像中的每个像素点(x,y),执行以下步骤;Traverse the image: For each pixel (x, y) in the image, perform the following steps;

应用高斯函数:计算以(x,y)为中心的高斯加权平均;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.

方向敏感的特征增强:通过结合高斯函数和复指数函数,可以更精确地增强图像中特定方向的特征。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.

量子力学因子的应用:引入的量子力学因子可能提供了一种新的方式来调制和增强图像特征。Application of quantum mechanical factors: The introduced quantum mechanical factors may provide a new way to modulate and enhance image features.

算法公式(3)特别适用于在复杂背景下的缺陷检测,能够有效地增强图像中特定方向的线束纹理,为后续的分类和定位任务提供了关键的视觉信息。算法公式(3)为橡胶密封圈表面缺陷检测提供了一个强大的方向敏感滤波工具,通过精确的Gabor滤波和量子力学因子调制,显著提高了对特定方向纹理的识别能力,这一步骤与前两步的结果紧密衔接,确保了整个检测流程的高效性和准确性。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.

所述步骤4采用算法公式(4),具体算法公式如下:The step 4 adopts algorithm formula (4), and the specific algorithm formula is as follows:

其中,Fmulti(x,y)为多尺度融合后的特征表示;S,T为尺度和特征类型的数量;ws,t为权重因子,用于平衡不同尺度和特征类型的贡献;γ,α,δ为调节参数,用于控制非线性变换的强度;Gs,t(x,y)为在尺度s和特征类型t下的Gabor滤波响应;Hs,t(x,y)为在尺度s和特征类型t下的Hessian矩阵响应;Where, F multi (x, y) is the feature representation after multi-scale fusion; S, T are the number of scales and feature types; w s, t is the 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;

输入:经步骤3处理的图像的像素数据;Input: pixel data of the image processed in step 3;

输出:多尺度融合特征表示;具体过程如下:Output: multi-scale fusion feature representation; the specific process is as follows:

初始化参数:设定S,T,γ,α,δ和ws,tInitialization parameters: set S, T, γ, α, δ and w s, t ;

多尺度特征提取:对每个尺度s和特征类型t,提取Gabor滤波和Hessian矩阵响应;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;

生成特征表示:形成最终的多尺度融合特征表示Fmulti(x,y)。Generate feature representation: form the final multi-scale fusion feature representation F multi (x, y).

创新的特征融合方法:结合了多尺度分析和复杂网络理论,提供了一种新颖的方式来处理和融合图像特征。Innovative feature fusion method: Combining multi-scale analysis and complex network theory, it provides a novel way to process and fuse image features.

非线性特征变换:通过sigmoid和log函数的应用,增强了特征的表达能力和区分度。Nonlinear feature transformation: The expression ability and discrimination of features are enhanced through the application of sigmoid and log functions.

算法公式(4)特别适用于在复杂背景下的缺陷检测,能够有效地提取和融合多尺度特征,为后续的分类和定位任务提供了丰富且有区分力的特征表示;步骤4通过创新的多尺度特征提取与融合算法,为橡胶密封圈表面缺陷检测提供了一个强大的特征表示工具;这一步骤与前三步的结果紧密衔接,确保了整个检测流程的高效性和准确性;通过这种方法,我们能够更全面地捕获图像中的关键信息,从而提高分类和定位的准确率。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.

所述步骤5采用算法公式(5),具体算法公式如下:The step 5 adopts the algorithm formula (5), and the specific algorithm formula is as follows:

其中,为交叉熵损失函数,用于分类任务;yo,c是真实类别标签,po,c是预测概率;是平滑L1损失函数,用于定位任务;分别是预测和真实位置向量;ω12为权重因子,用于平衡分类损失和定位损失;in, is the cross entropy loss function, used for classification tasks; yo,c is the true category label, and p ,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; ω 12 are weight factors used to balance the classification loss and positioning loss;

输入数据为步骤4中生成的多尺度融合特征;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 the rubber sealing ring;

预处理步骤:包括图像的噪声消除、边缘保护、特征增强和多尺度融合;具体过程如下:Preprocessing steps: including image noise removal, edge protection, feature enhancement and multi-scale fusion; the specific process is as follows:

初始化模型:设置SVM模型的参数;Initialize the model: set the parameters of the SVM model;

准备数据:使用步骤4中的多尺度融合特征作为输入数据;Prepare data: Use the multi-scale fusion features in step 4 as input data;

定义损失函数:根据算法公式(5)定义损失函数;Define the loss function: Define the loss function according to the algorithm formula (5);

模型训练:使用损失函数训练SVM模型;Model training: Use the loss function to train the SVM model;

参数调整:通过交叉验证等方法调整ω12和其他模型参数;Parameter adjustment: adjust ω 1 , ω 2 and other model parameters through methods such as cross-validation;

模型评估:评估模型在训练集和验证集上的性能。Model evaluation: Evaluate the performance of the model on the training set and validation set.

创新的损失函数结合了分类准确性和定位精度的优化,适用于复杂的缺陷检测任务;多尺度特征的应用,利用多尺度融合特征,提高了模型对不同尺寸和形状缺陷的识别能力。此步骤通过优化损失函数,提高了SVM模型在橡胶密封圈表面缺陷检测任务中的准确性和鲁棒性;结合多尺度特征,模型能够更有效地识别和定位各种类型的缺陷。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.

所述步骤6具体过程如下:The specific process of step 6 is as follows:

加载模型:加载经过步骤5训练的SVM模型;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.

类别预测:使用SVM模型对每个图像区域进行分类,以确定是否存在缺陷及其类别;Category prediction: Use the SVM model to classify each image area to determine whether there is a defect and its category;

位置回归:对于分类为缺陷的区域,使用SVM模型进行位置回归,以确定缺陷的具体位置;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;

SVM模型表示为:The SVM model is expressed as:

其中,f(x)是预测函数;αi是支持向量的系数;yi是训练样本的标签;K(xi,x)是核函数,用于将数据映射到高维空间,b是偏置项。Among them, f(x) is the prediction function; α i is the coefficient of the support vector; yi is the label of the training sample; K( xi ,x) is the kernel function used to map data to a high-dimensional space, and b is the bias term.

输入数据为待检测图像的特征数据,这些数据应与训练模型时使用的特征相同;图像数据来源于橡胶密封圈的生产线或质量检测站。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.

预处理步骤包括图像的噪声消除、边缘保护、特征增强和多尺度融合,这些步骤已在前几步中完成。使用与训练阶段相同的模型参数,包括核函数类型、正则化参数等;确保测试阶段的特征与训练阶段的特征保持一致;在实际应用前,应评估模型在独立测试集上的性能,包括分类准确率和定位精度。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.

这一步骤独特地结合了分类和回归任务,提高了缺陷检测的全面性和准确性;通过位置回归,模型能够精确地确定缺陷的具体位置,这对于后续的质量控制和追溯至关重要。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.

此步骤通过精确的类别预测和位置回归,为橡胶密封圈表面缺陷检测提供了强大的支持。这不仅提高了缺陷检测的准确性,还为后续的质量控制和追溯提供了重要信息。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.

步骤6是橡胶密封圈表面缺陷检测方案的关键部分,它利用训练有素的SVM模型实现了缺陷的精确分类和定位;这一步骤与前面的步骤紧密衔接,确保了整个检测流程的高效性和准确性;通过这种方法,我们能够在复杂的工业环境中实现高精度的缺陷检测,为质量控制和追溯提供了可靠的数据支持。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.

3.有益效果3. Beneficial effects

相比于现有技术,本发明的优点在于:Compared with the prior art, the advantages of the present invention are:

1.提高橡胶密封圈缺陷检测的准确性和效率,通过使用高级图像处理技术和数学模型,本发明能够更有效地处理和分析图像数据;特别是在处理具有复杂背景和细微特征的橡胶密封圈图像时,这些算法公式能够显著提高缺陷检测的准确性。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.

2.多尺度特征融合:通过结合多尺度分析,本发明能够捕获从粗糙到细致的图像信息,从而提高对不同尺寸和形状缺陷的识别能力。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.

3.精确的分类与定位:结合分类和回归任务:本发明不仅能够准确地分类橡胶密封圈图像中的缺陷,还能够精确地定位缺陷的具体位置。这对于后续的质量控制和追溯至关重要。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 traceability.

4.优化的损失函数:通过使用特定设计的损失函数,本发明在训练过程中能够有效地平衡分类准确性和定位精度。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.

5.高度适应性和灵活性,本发明提供的算法公式中包含多个可调整的参数,使得模型能够适应不同的数据特征和需求。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.

6.适用于复杂环境,提高效率,减少人工干预:由于其高度的适应性,本发明特别适用于在复杂工业环境中进行高精度的橡胶密封圈的缺陷检测;本发明通过自动化的图像处理和分析,能够快速识别和定位橡胶密封圈的缺陷,从而提高生产线的效率减少对人工检查的依赖,降低了人为错误的可能性,同时提高了整体的检测速度和可靠性。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.

综上所述,本发明通过结合先进的图像处理技术、数学模型和机器学习算法,提供了一种全面且高效的解决方案,用于橡胶密封圈表面的多类缺陷检测。这种方法不仅提高了检测的准确性,还提高了处理速度,使其成为工业质量控制中的重要工具,本发明的方法能够显著提高生产效率和产品质量。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 improves 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

图1为本发明的橡胶密封圈多类表面缺陷分类定位方法的流程图;FIG1 is a flow chart of a method for classifying and locating multiple types of surface defects of a rubber sealing ring according to the present invention;

图2为本发明的步骤1的流程图;FIG2 is a flow chart of step 1 of the present invention;

图3为本发明的步骤2的流程图;FIG3 is a flow chart of step 2 of the present invention;

图4为本发明的步骤3的流程图;FIG4 is a flow chart of step 3 of the present invention;

图5为本发明的步骤4的流程图;FIG5 is a flow chart of step 4 of the present invention;

图6为本发明的步骤5的流程图;FIG6 is a flow chart of step 5 of the present invention;

图7为本发明的步骤6的流程图。FIG. 7 is a flow chart of step 6 of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图;对本发明实施例中的技术方案进行清楚、完整地描述;显然;所描述的实施例仅仅是本发明一部分实施例;而不是全部的实施例,基于本发明中的实施例;本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例;都属于本发明保护的范围。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.

在本发明的描述中,需要说明的是,术语“上”、“下”、“内”、“外”、“顶/底端”指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性。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.

在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“设置有”、“套设/接”、“连接”,应做广义理解,例如“连接”,是固定连接,也是可拆卸连接,或一体地连接;是机械连接,也是电连接;是直接相连,也通过中间媒介间接相连,是两个元件内部的连通。对于本领域的普通技术人员而言,具体情况理解上述术语在本发明中的具体含义。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.

实施例1Example 1

请参照图1-7,橡胶密封圈多类表面缺陷分类定位方法,包括以下步骤:Please refer to Figures 1-7 for a method for classifying and locating multiple types of surface defects of a rubber sealing ring, including the following steps:

步骤1:图像预处理Step 1: Image Preprocessing

对进行图像预处理,以增强缺陷区域和正常区域之间的视觉对比度,消除噪声并保护图像边缘,为后续步骤提供更清晰的图像;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;

步骤2:高斯微分线束检测Step 2: Gaussian Differentiation Harness Detection

在步骤1的预处理后的图像上,以识别可能存在缺陷的线束区域;通过Hessian矩阵增强图像特征,便于识别细微缺陷;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;

步骤3:方向敏感滤波Step 3: Direction-Sensitive Filtering

对步骤2的线束检测后的图像,增强特定方向的线束纹理,进一步增强图像中特定方向的特征,为缺陷分类提供更多信息;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;

步骤4:局部特征提取与多尺度融合Step 4: Local feature extraction and multi-scale fusion

基于上述步骤3的输出,提取局部特征,并结合多尺度线束信息,获取丰富的特征数据,为后续的分类模型提供输入;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;

步骤5:SVM模型训练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;

步骤6:类别预测与位置回归Step 6: Category prediction and position regression

使用训练好的SVM模型对检测图像进行缺陷类别预测,并给出具体区域位置;实现精确的缺陷分类与定位,为后续的质量控制和追溯提供依据。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.

所述步骤1采用算法(1)进行图像预处理,具体算法公式如下:The step 1 uses algorithm (1) to perform image preprocessing. The specific algorithm formula is as follows:

其中,F(x,y)处理后的图像在位置(x,y)的像索值;f(i,j):为原始图像在位置(i,j)的像素值;σ为控制高斯滤波的平滑程度的参数;β为控制边缘保持强度的参数;Z(x,y)为归一化因子,确保处理后的像素值在合理范围内;为高斯函数,用于平滑图像,减少噪声影响;为Sigmoid函数,用于保持边缘信息。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 maintain edge information.

请参照附图2,所述步骤1的具体过程如下:Please refer to Figure 2, the specific process of step 1 is as follows:

初始化:设定σ和β的值;Initialization: set the values of σ and β;

遍历图像:对于图像中的每个像素点(x,y),执行以下计算;Traverse the image: For each pixel (x, y) in the image, perform the following calculations;

应用高斯滤波:计算以(x,y)为中心的高斯加权平均;Apply Gaussian filtering: Calculate the Gaussian weighted average centered at (x,y);

边缘保持:使用Sigmoid非线性函数调整每个像素的贡献,以保持边缘;归一化处理:使用Z(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 result;

其中,输入数据为原始的图像数据,通常为数字图像格式,JPEG、PNG等;图像数据来源于橡胶密封圈的生产线或质量检测站;The input data is the 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;

预处理步骤:包括图像格式转换、尺寸调整基本图像处理步骤。Preprocessing steps: including basic image processing steps such as image format conversion and size adjustment.

算法(1)结合了高斯滤波和非线性动力学系统,提供了一种新颖的图像预处理方法;特别强调在噪声消除的同时保持图像边缘,这对于后续的缺陷检测至关重要。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.

算法(1)特别适用于在复杂背景下的缺陷检测,能够有效地增强缺陷与背景之间的对比度,同时保持缺陷边缘的清晰度,为后续的分类和定位任务提供了理想的输入;为橡胶密封圈表面缺陷检测提供了一个强大的图像预处理工具,通过独特的滤波技术和边缘保持策略,显著提高了后续缺陷检测步骤的准确性和效率。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 an 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.

所有参数必须在合理的范围内选择,以确保算法的稳定性和有效性;γ,α,δ的选择对算法性能有显著影响;ws,t的平衡对于确保不同尺度和特征类型的有效融合至关重要。All parameters must be selected within a reasonable range to ensure the stability and effectiveness of the algorithm; the choice of γ, α, δ has a significant impact on the performance of the algorithm; the balance of w s, t is crucial to ensure the effective fusion of different scales and feature types.

所述步骤2采用算法(2),具体算法公式如下:The step 2 adopts algorithm (2), and the specific algorithm formula is as follows:

其中,Δf为拉普拉斯算子,用于测量图像在点(x,y)的弯曲程度;fxx,fyy,fxy为图像在点(x,y)的二阶偏导数,分别代表图像在x和y方向的曲率;λ12为调整参数,用于控制偏导数对最终结果的贡献。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 are the second-order partial derivatives of the image at the 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.

请参照附图3,所述步骤2包括以下步骤:Please refer to Figure 3, step 2 includes the following steps:

输入:经过步骤1处理的图像;Input: the image processed in step 1;

输出:经过Hessian矩阵处理的图像,突出了特定的特征;Output: Image processed by the Hessian matrix, highlighting specific features;

具体的计算过程如下:The specific calculation process is as follows:

计算二阶偏导数:对于图像中的每个像素点(x,y),计算fxx,fyy,fxyCalculate the second-order partial derivatives: For each pixel (x, y) in the image, calculate f xx , f yy , f xy ;

应用拉普拉斯算子:计算Δf;Apply the Laplace operator: calculate Δf;

构建Hessian矩阵:根据算法(2)的公式构建矩阵;Construct Hessian matrix: construct the matrix according to the formula of algorithm (2);

分析特征:通过分析Hessian矩阵的特性,来识别和增强图像中的特定特征。Analyze features: Identify and enhance specific features in the image by analyzing the characteristics of the Hessian matrix.

高斯微分线束检测:这种方法特别适用于检测图像中的细微边缘和纹理,这对于缺陷检测至关重要。Gaussian Differential Line Detection: This method is particularly useful for detecting subtle edges and textures in images, which are critical for defect detection.

结构特征增强:通过Hessian矩阵的分析,能够有效地增强图像中的结构特征,提高缺陷识别的准确性。Structural feature enhancement: Through the analysis of the Hessian matrix, the structural features in the image can be effectively enhanced to improve the accuracy of defect recognition.

算法(2)特别适用于在复杂背景下的缺陷检测,能够有效地识别和增强图像中的线束状结构,为后续的分类和定位任务提供了关键的结构信息。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.

所述步骤3采用算法公式(3),具体算法公式如下:The step 3 adopts algorithm formula (3), and the specific algorithm formula is as follows:

其中,G(x,y):为处理后的图像在位置(x,y)的像素值;σ为控制高斯滤波的平滑程度的参数;k为波数,与纹理的频率相关;θ为方向角,决定了滤波器增强的方向;为普朗克常数,引入量子力学概念;m为粒子质量,用于调节量子力学因子;ω为角频率,与纹理的周期性相关;为高斯函数,用于局部平滑图像,减少噪声影响;ei(kxcosθ+kysinθ)为复指数函数,代表波的传播,用于增强特定方向的特征;为量子力学中的因子,用于调制波的幅度;是普朗克常数,m是粒子质量,ω是角频率。Among them, G(x,y): is the pixel value of the processed image at position (x,y); σ is the 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 influence of noise; e i(kxcosθ+kysinθ) is a complex exponential function, which represents the propagation of waves and is used to enhance the features 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.

请参照附图4,所述步骤3包括以下步骤:Please refer to Figure 4, step 3 includes the following steps:

输入:经过步骤2处理的图像;Input: image processed in step 2;

输出:经过Gabor滤波处理的图像,突出了特定方向的特征;Output: Image processed by Gabor filtering, highlighting features in specific directions;

具体的计算过程如下:The specific calculation process is as follows:

遍历图像:对于图像中的每个像素点(x,y),执行以下步骤;Traverse the image: For each pixel (x, y) in the image, perform the following steps;

应用高斯函数:计算以(x,y)为中心的高斯加权平均;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.

方向敏感的特征增强:通过结合高斯函数和复指数函数,可以更精确地增强图像中特定方向的特征。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.

量子力学因子的应用:引入的量子力学因子可能提供了一种新的方式来调制和增强图像特征。Application of quantum mechanical factors: The introduced quantum mechanical factors may provide a new way to modulate and enhance image features.

σ,k,θ,m,ω的选择对滤波效果至关重要,θ的选择决定了增强的方向,对于不同的图像特征,需要不同的方向设置。σ,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.

算法公式(3)特别适用于在复杂背景下的缺陷检测,能够有效地增强图像中特定方向的线束纹理,为后续的分类和定位任务提供了关键的视觉信息。算法公式(3)为橡胶密封圈表面缺陷检测提供了一个强大的方向敏感滤波工具,通过精确的Gabor滤波和量子力学因子调制,显著提高了对特定方向纹理的识别能力,这一步骤与前两步的结果紧密衔接,确保了整个检测流程的高效性和准确性。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.

所述步骤4采用算法公式(4),具体算法公式如下:The step 4 adopts algorithm formula (4), and the specific algorithm formula is as follows:

其中,Fmulti(x,y)为多尺度融合后的特征表示;S,T为尺度和特征类型的数量;ws,t为权重因子,用于平衡不同尺度和特征类型的贡献;γ,α,δ为调节参数,用于控制非线性变换的强度;Gs,t(x,y)为在尺度s和特征类型t下的Gabor滤波响应;Hs,t(x,y)为在尺度s和特征类型t下的Hessian矩阵响应;Where, F multi (x, y) is the feature representation after multi-scale fusion; S, T are the number of scales and feature types; w s, t is the 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;

输入:经步骤3处理的图像的像素数据;Input: pixel data of the image processed in step 3;

输出:多尺度融合特征表示;请参照附图5,具体过程如下:Output: multi-scale fusion feature representation; please refer to Figure 5, the specific process is as follows:

初始化参数:设定S,T,γ,α,δ和ws,tInitialization parameters: set S, T, γ, α, δ and w s, t ;

多尺度特征提取:对每个尺度s和特征类型t,提取Gabor滤波和Hessian矩阵响应;Multi-scale feature extraction: For each scale s and feature type t, extract the Gabor filter and Hessian matrix response;

算法公式(4)将不同尺度和类型的特征通过加权和非线性变换进行融合;形成最终的多尺度融合特征表示Fmulti(x,y)。Algorithm formula (4) fuses features of different scales and types through weighting and nonlinear transformation, forming the final multi-scale fusion feature representation F multi (x, y).

创新的特征融合方法:结合了多尺度分析和复杂网络理论,提供了一种新颖的方式来处理和融合图像特征。Innovative feature fusion method: Combining multi-scale analysis and complex network theory, it provides a novel way to process and fuse image features.

非线性特征变换:通过sigmoid和log函数的应用,增强了特征的表达能力和区分度。Nonlinear feature transformation: The expression ability and discrimination of features are enhanced through the application of sigmoid and log functions.

算法公式(4)特别适用于在复杂背景下的缺陷检测,能够有效地提取和融合多尺度特征,为后续的分类和定位任务提供了丰富且有区分力的特征表示;步骤4通过创新的多尺度特征提取与融合算法,为橡胶密封圈表面缺陷检测提供了一个强大的特征表示工具;这一步骤与前三步的结果紧密衔接,确保了整个检测流程的高效性和准确性;通过这种方法,我们能够更全面地捕获图像中粗糙到细致的关键信息,从而提高分类和定位任务的准确率。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.

所述步骤5采用算法公式(5),具体算法公式如下:The step 5 adopts the algorithm formula (5), and the specific algorithm formula is as follows:

其中,为交叉熵损失函数,用于分类任务;yo,c是真实类别标签,po,c是预测概率;是平滑L1损失函数,用于定位任务;分别是预测和真实位置向量;ω12为权重因子,用于平衡分类损失和定位损失;in, is the cross entropy loss function, used for classification tasks; yo,c is the true category label, and p ,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; ω 12 are weight factors used to balance the classification loss and positioning loss;

输入数据为步骤4中生成的多尺度融合特征;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 the rubber sealing ring;

预处理步骤:包括图像的噪声消除、边缘保护、特征增强和多尺度融合;请参照附图6,具体过程如下:Preprocessing steps: including image noise removal, edge protection, feature enhancement and multi-scale fusion; please refer to Figure 6, the specific process is as follows:

初始化模型:设置SVM模型的参数;Initialize the model: set the parameters of the SVM model;

准备数据:使用步骤4中的多尺度融合特征作为输入数据;Prepare data: Use the multi-scale fusion features in step 4 as input data;

定义损失函数:根据算法公式(5)定义损失函数;Define the loss function: Define the loss function according to the algorithm formula (5);

模型训练:使用损失函数训练SVM模型;Model training: Use the loss function to train the SVM model;

参数调整:通过交叉验证等方法调整ω12和其他模型参数;Parameter adjustment: adjust ω 1 , ω 2 and other model parameters through methods such as cross-validation;

模型评估:评估模型在训练集和验证集上的性能。Model evaluation: Evaluate the performance of the model on the training set and validation set.

ω1和ω2的选择至关重要,需要根据具体任务调整以平衡分类和定位的重要性;在计算交叉熵时,需要确保数值稳定性,避免对数运算中的潜在数值问题;平滑L1损失有助于避免梯度爆炸的问题,特别是在定位误差较大时。通过调整权重因子,可以灵活地平衡分类准确性和定位精度的重要性;平滑L1损失提高了模型对于大的定位误差的鲁棒性;可以根据不同的应用场景调整权重因子,使模型更适应特定任务;权重因子ω1和ω2必须是非负数,并且通常它们的和应该等于1;在实现时,需要确保交叉熵和平滑L1损失的梯度计算稳定,避免数值问题。The choice 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.

综上所述,这个算法公式(5)在机器学习模型的训练中,特别是在需要同时考虑分类和定位任务的场景中,提供了一种有效且创新的解决方案。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.

创新的损失函数结合了分类准确性和定位精度的优化,适用于复杂的缺陷检测任务;多尺度特征的应用,利用多尺度融合特征,提高了模型对不同尺寸和形状缺陷的识别能力。此步骤通过优化损失函数,提高了SVM模型在橡胶密封圈表面缺陷检测任务中的准确性和鲁棒性;结合多尺度特征,模型能够更有效地识别和定位各种类型的缺陷。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.

请参照附图7,所述步骤6具体过程如下:Please refer to FIG. 7 , the specific process of step 6 is as follows:

加载模型:加载经过步骤5训练的SVM模型;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.

类别预测:使用SVM模型对每个图像区域进行分类,以确定是否存在缺陷及其类别;Category prediction: Use the SVM model to classify each image area to determine whether there is a defect and its category;

位置回归:对于分类为缺陷的区域,使用SVM模型进行位置回归,以确定缺陷的具体位置;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.

SVM模型表示为:The SVM model is expressed as:

其中,f(x)是预测函数;αi是支持向量的系数;yi是训练样本的标签;K(xi,x)是核函数,用于将数据映射到高维空间,b是偏置项。Among them, f(x) is the prediction function; α i is the coefficient of the support vector; yi is the label of the training sample; K( xi ,x) is the kernel function used to map data to a high-dimensional space, and b is the bias term.

分类是为了确定图像区域是否包含缺陷;回归是为了精确预测缺陷的位置。支持向量机是一种有效的机器学习算法,用于处理分类和回归任务。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.

在分类问题中,SVM通过找到一个超平面来区分不同类别的数据点。在回归问题中,SVM则试图找到一个函数,该函数在给定的误差容忍度内尽可能地接近训练数据点。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.

输入数据为待检测图像的特征数据,通常包括颜色、纹理、形状等特征。这些数据应与训练模型时使用的特征相同;图像数据来源于橡胶密封圈的生产线或质量检测站。The input data is the feature data of the image to be detected, 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.

预处理步骤包括图像的噪声消除、边缘保护、特征增强和多尺度融合,这些步骤已在前几步中完成。使用与训练阶段相同的模型参数,包括核函数类型、正则化参数等;确保测试阶段的特征与训练阶段的特征保持一致;在实际应用前,应评估模型在独立测试集上的性能,包括分类准确率和定位精度。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.

这一步骤独特地结合了分类和回归任务,提高了缺陷检测的全面性和准确性;通过位置回归,模型能够精确地确定缺陷的具体位置,这对于后续的质量控制和追溯至关重要。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.

此步骤通过精确的类别预测和位置回归,为橡胶密封圈表面缺陷检测提供了强大的支持。这不仅提高了缺陷检测的准确性,还为后续的质量控制和追溯提供了重要信息。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.

分类与回归的结合:SVM模型在步骤6中用于执行两个任务:分类(确定是否存在缺陷)和回归(确定缺陷的具体位置)。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).

步骤5的Loss函数同样结合了这两个方面:分类损失(通过交叉熵损失计算)和定位损失(通过平滑L1损失计算)。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).

在训练SVM模型时,步骤5的损失函数用于指导模型学习,使其能够更好地进行分类和定位;通过最小化这个损失函数,SVM模型学习区分不同类别的数据点,并准确预测缺陷的位置。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.

步骤5中的损失函数包含权重参数ω12,这些参数在训练过程中需要调整,以平衡分类准确性和定位精度;这种平衡对于缺陷检测任务至关重要,因为我们不仅需要知道缺陷是否存在,还需要知道它们的确切位置。The loss function in step 5 contains weight parameters ω 12 , 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.

在训练阶段,损失函数用于评估SVM模型的性能,并通过反向传播和优化算法调整模型参数。在应用阶段(步骤6),训练好的SVM模型用于实际的分类和定位任务。步骤5中的损失函数与SVM模型的关系是密切且直接的。损失函数不仅定义了模型训练的目标(即最小化分类和定位的错误),还影响了模型的最终性能;通过精心设计的损失函数,我们可以确保SVM模型在橡胶密封圈表面缺陷检测任务中达到高准确性和高效率。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.

步骤6是橡胶密封圈表面缺陷检测方案的关键部分,它利用训练有素的SVM模型实现了缺陷的精确分类和定位;这一步骤与前面的步骤紧密衔接,确保了整个检测流程的高效性和准确性;通过这种方法,我们能够在复杂的工业环境中实现高精度的缺陷检测,为质量控制和追溯提供了可靠的数据支持。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.

以上所述;仅为本发明较佳的具体实施方式;但本发明的保护范围并不局限于此;任何熟悉本技术领域的技术人员在本发明揭露的技术范围内;根据本发明的技术方案及其改进构思加以同替换或改变;都应涵盖在本发明的保护范围内。The above is only a preferred specific implementation manner of the present invention, but 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, who makes substitutions or changes according to the technical solution and improved concepts of the present invention, shall be covered by the protection scope of the present invention.

Claims (6)

1.橡胶密封圈多类表面缺陷分类定位方法,其特征在于:包括以下步骤:1. A method for classifying and locating multiple types of surface defects of a rubber sealing ring, characterized in that it comprises the following steps: 步骤1:图像预处理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; 步骤2:高斯微分线束检测Step 2: Gaussian Differentiation Harness Detection 在预处理后的图像上,以识别可能存在缺陷的线束区域;通过Hessian矩阵增强图像特征,便于识别细微缺陷;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; 步骤3:方向敏感滤波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; 步骤4:局部特征提取与多尺度融合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; 步骤5:SVM模型训练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; 步骤6:类别预测与位置回归Step 6: Category prediction and position regression 使用训练好的SVM模型对检测图像进行缺陷类别预测,并给出具体区域位置;实现精确的缺陷分类与定位,为后续的质量控制和追溯提供依据;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; 所述步骤1采用算法(1)进行图像预处理,具体算法公式如下:The step 1 uses algorithm (1) to perform image preprocessing. The specific algorithm formula is as follows: 其中,F(x,y)为处理后的图像在位置(x,y)的像素值;f(i,j)为原始图像在位置(i,j)的像素值;σ为控制高斯滤波的平滑程度的参数;β为控制边缘保持强度的参数;Z(x,y)为归一化因子,确保处理后的像素值在合理范围内;为高斯函数,用于平滑图像,减少噪声影响;为Sigmoid函数,用于保持边缘信息;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; 所述步骤2采用算法(2),具体算法公式如下:The step 2 adopts algorithm (2), and the specific algorithm formula is as follows: 其中,Δf为拉普拉斯算子,用于测量图像在点(x,y)的弯曲程度;fxx,fyy,fxy为图像在点(x,y)的二阶偏导数,分别代表图像在x方向、y方向以及xy混合方向的曲率;λ12为调整参数,用于控制偏导数对最终结果的贡献;Wherein, Δ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 are the second-order partial derivatives of the image at the 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, which are used to control the contribution of partial derivatives to the final result; 所述步骤3采用算法公式(3),具体算法公式如下:The step 3 adopts algorithm formula (3), and the specific algorithm formula is as follows: 其中,G(x,y)为处理后的图像在位置(x,y)的像素值;σ为控制高斯滤波的平滑程度的参数;k为波数,与纹理的频率相关;θ为方向角,决定了滤波器增强的方向;为普朗克常数,引入量子力学概念;m为粒子质量,用于调节量子力学因子;ω为角频率,与纹理的周期性相关;为高斯函数,用于局部平滑图像,减少噪声影响;ei(kxcosθ+kysinθ为复指数函数,代表波的传播,用于增强特定方向的特征,i表示复数的虚部;为量子力学中的因子,用于调制波的幅度;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 influence of noise; e i(kxcosθ+kysinθ is a complex exponential function, which represents the propagation of waves and is used to enhance the features in 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; 所述步骤4采用算法公式(4),具体算法公式如下:The step 4 adopts algorithm formula (4), and the specific algorithm formula is as follows: 其中,Fmultix,y为多尺度融合后的特征表示;S,T为尺度和特征类型的数量;Ws,t为权重因子,用于平衡不同尺度和特征类型的贡献;γ,α,δ为调节参数,用于控制非线性变换的强度;Gs,t(x,y)为在尺度s和特征类型t下的Gabor滤波响应;Hs,t(x,y)为在尺度s和特征类型t下的Hessian矩阵响应;Where, 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 the 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; 输入:经步骤3处理的图像的像素数据;Input: pixel data of the image processed in step 3; 输出:多尺度融合特征表示;具体过程如下:Output: multi-scale fusion feature representation; the specific process is as follows: 初始化参数:设定S,T,γ,α,δ和ws,tInitialization parameters: set S, T, γ, α, δ and w s, t ; 多尺度特征提取:对每个尺度s和特征类型t,提取Gabor滤波和Hessian矩阵响应;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; 生成特征表示:形成最终的多尺度融合特征表示Fmulti(x,y)。Generate feature representation: form the final multi-scale fusion feature representation F multi (x, y). 2.根据权利要求1所述的橡胶密封圈多类表面缺陷分类定位方法,其特征在于:所述步骤1的具体过程如下: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 β; 遍历图像:对于图像中的每个像素点(x,y),执行以下计算;Traverse the image: For each pixel (x, y) in the image, perform the following calculations; 应用高斯滤波:计算以(x,y)为中心的高斯加权平均;Apply Gaussian filtering: Calculate the Gaussian weighted average centered at (x,y); 边缘保持:使用Sigmoid非线性函数调整每个像素的贡献,以保持边缘;Edge preservation: Use the Sigmoid nonlinear function to adjust the contribution of each pixel to maintain the edge; 归一化处理:使用Z(x,y)对结果进行归一化处理;Normalization: Use Z(x,y) to normalize the results; 其中,输入数据为原始的图像数据,通常为数字图像格式,JPEG、PNG;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.根据权利要求1所述的橡胶密封圈多类表面缺陷分类定位方法,其特征在于:所述步骤2包括以下步骤:3. The method for classifying and locating multiple types of surface defects of a rubber sealing ring according to claim 1, characterized in that: said step 2 comprises the following steps: 输入:经过步骤1处理的图像;Input: the image processed in step 1; 输出:经过Hessian矩阵处理的图像,突出了特定的特征;Output: Image processed by the Hessian matrix, highlighting specific features; 具体的计算过程如下:The specific calculation process is as follows: 计算二阶偏导数:对于图像中的每个像素点(x,y),计算fxx,fyy,fxyCalculate the second-order partial derivatives: For each pixel (x, y) in the image, calculate f xx , f yy , f xy ; 应用拉普拉斯算子:计算Δf;Apply the Laplace operator: calculate Δf; 构建Hessian矩阵:根据算法(2)的公式构建矩阵;Construct Hessian matrix: construct the matrix according to the formula of algorithm (2); 分析特征:通过分析Hessian矩阵的特性,来识别和增强图像中的特定特征。Analyze features: Identify and enhance specific features in the image by analyzing the characteristics of the Hessian matrix. 4.根据权利要求1所述的橡胶密封圈多类表面缺陷分类定位方法,其特征在于:所述步骤3包括以下步骤:4. The method for classifying and locating multiple types of surface defects of a rubber sealing ring according to claim 1, characterized in that: said step 3 comprises the following steps: 输入:经过步骤2处理的图像;Input: image processed in step 2; 输出:经过Gabor滤波处理的图像,突出了特定方向的特征;Output: Image processed by Gabor filtering, highlighting features in specific directions; 具体的计算过程如下:The specific calculation process is as follows: 遍历图像:对于图像中的每个像素点(x,y),执行以下步骤;Traverse the image: For each pixel (x, y) in the image, perform the following steps; 应用高斯函数:计算以(x,y)为中心的高斯加权平均;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.根据权利要求1所述的橡胶密封圈多类表面缺陷分类定位方法,其特征在于:所述步骤5采用算法公式(5),具体算法公式如下:5. 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 algorithm formula (5) is used in step 5, and the specific algorithm formula is as follows: 其中,为交叉熵损失函数,用于分类任务;yo,c是真实类别标签,po,c是预测概率;是平滑L1损失函数,用于定位任务;分别是预测和真实位置向量;ω12为权重因子,用于平衡分类损失和定位损失;in, is the cross entropy loss function, used for classification tasks; yo,c is the true category label, and p ,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; ω 12 are weight factors used to balance the classification loss and positioning loss; 输入数据为步骤4中生成的多尺度融合特征;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 the rubber sealing ring; 预处理步骤:包括图像的噪声消除、边缘保护、特征增强和多尺度融合;具体过程如下:Preprocessing steps: including image noise removal, edge protection, feature enhancement and multi-scale fusion; the specific process is as follows: 初始化模型:设置SVM模型的参数;Initialize the model: set the parameters of the SVM model; 准备数据:使用步骤4中的多尺度融合特征作为输入数据;Prepare data: Use the multi-scale fusion features in step 4 as input data; 定义损失函数:根据算法公式(5)定义损失函数;Define the loss function: Define the loss function according to the algorithm formula (5); 模型训练:使用损失函数训练SVM模型;Model training: Use the loss function to train the SVM model; 参数调整:通过交叉验证等方法调整ω12和其他模型参数;Parameter adjustment: adjust ω 1 , ω 2 and other model parameters through methods such as cross-validation; 模型评估:评估模型在训练集和验证集上的性能。Model evaluation: Evaluate the performance of the model on the training set and validation set. 6.根据权利要求1所述的橡胶密封圈多类表面缺陷分类定位方法,其特征在于:所述步骤6具体过程如下: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: 加载模型:加载经过步骤5训练的SVM模型;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. 类别预测:使用SVM模型对每个图像区域进行分类,以确定是否存在缺陷及其类别;Category prediction: Use the SVM model to classify each image area to determine whether there is a defect and its category; 位置回归:对于分类为缺陷的区域,使用SVM模型进行位置回归,以确定缺陷的具体位置;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; SVM模型表示为: The SVM model is expressed as: 其中,f(x)是预测函数;αi是支持向量的系数;yi是训练样本的标签;K(xi),x)是核函数,用于将数据映射到高维空间,b是偏置项。Among them, f(x) is the prediction function; α i is the coefficient of the support vector; yi is the label of the training sample; K( xi ), x) is the kernel function used to map data to a high-dimensional space, and b is the bias term.
CN202311822151.0A 2023-12-27 2023-12-27 Classifying and positioning method for multiple types of surface defects of rubber sealing ring Active CN117746000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311822151.0A CN117746000B (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 CN117746000B (en) 2023-12-27 2023-12-27 Classifying and positioning method for multiple types of surface defects of rubber sealing ring

Publications (2)

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

Family

ID=90279164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311822151.0A Active CN117746000B (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) CN117746000B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119086591B (en) * 2024-09-02 2025-07-01 惠州杜一特精密制品有限公司 Rubber whole mold appearance defect detection method and system based on machine vision

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111145165A (en) * 2019-12-30 2020-05-12 北京工业大学 Rubber seal ring surface defect detection method based on machine vision
CN116664540A (en) * 2023-06-15 2023-08-29 沈阳工业大学 Surface defect detection method of rubber sealing ring based on Gaussian line detection

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7039239B2 (en) * 2002-02-07 2006-05-02 Eastman Kodak Company Method for image region classification using unsupervised and supervised learning
JP2013020335A (en) * 2011-07-08 2013-01-31 Nikon Corp Image classification method
CN109523529B (en) * 2018-11-12 2021-07-13 西安交通大学 A Transmission Line Defect Identification Method Based on SURF Algorithm
CN110415222A (en) * 2019-07-16 2019-11-05 东华大学 A method for identifying side defects of silk cake based on texture features
CN110717896B (en) * 2019-09-24 2023-05-09 东北大学 Plate strip steel surface defect detection method based on significance tag information propagation model
CN111179260A (en) * 2019-12-31 2020-05-19 三峡大学 Ceramic tile surface crack detection method based on multi-scale Hessian matrix filtering
CN115797299B (en) * 2022-12-05 2023-09-01 常宝新材料(苏州)有限公司 Defect detection method of optical composite film
CN116934725A (en) * 2023-07-28 2023-10-24 河海大学 A method for detecting the sealing properties of aluminum foil seals based on unsupervised learning
CN117132560A (en) * 2023-08-17 2023-11-28 南京理工大学 Deep learning-based small-sample fine granularity defect detection method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111145165A (en) * 2019-12-30 2020-05-12 北京工业大学 Rubber seal ring surface defect detection method based on machine vision
CN116664540A (en) * 2023-06-15 2023-08-29 沈阳工业大学 Surface defect detection method of rubber sealing ring based on Gaussian line detection

Also Published As

Publication number Publication date
CN117746000A (en) 2024-03-22

Similar Documents

Publication Publication Date Title
CN111062915B (en) Real-time steel pipe defect detection method based on improved YOLOv3 model
CN108074231B (en) A method for surface defect detection of magnetic sheet based on convolutional neural network
CN108355981B (en) Battery connector quality detection method based on machine vision
WO2024002187A1 (en) Defect detection method, defect detection device, and storage medium
CN118537664B (en) Beef cattle carcass quality grading method based on image analysis and machine learning
Adem et al. Defect detection of seals in multilayer aseptic packages using deep learning
CN106875381A (en) A kind of phone housing defect inspection method based on deep learning
CN109726730B (en) Automatic optical inspection image classification method, system and computer readable medium
CN113989196B (en) Visual-sense-based method for detecting appearance defects of earphone silica gel gasket
CN118706336B (en) Soft package tightness detection equipment and method based on vibration and infrared image fusion
CN112862744A (en) Intelligent detection method for internal defects of capacitor based on ultrasonic image
CN117746000B (en) Classifying and positioning method for multiple types of surface defects of rubber sealing ring
CN115035092A (en) Image-based bottle detection method, device, equipment and storage medium
CN117132540A (en) A PCB circuit board defect post-processing method based on segmentation model
CN112017154A (en) Ray defect detection method based on Mask R-CNN model
CN117788384A (en) Diamond tool wear detection method and system integrating multi-scale abrasive grain characteristics
CN116664540A (en) Surface defect detection method of rubber sealing ring based on Gaussian line detection
Yang et al. Weld defect cascaded detection model based on bidirectional multi-scale feature fusion and shape pre-classification
Patil et al. Weld imperfection classification by texture features extraction and local binary pattern
CN113269234B (en) Connecting piece assembly detection method and system based on target detection
CN120031791A (en) A two-stage tool surface defect detection method and system
CN114863426A (en) A Tiny Object Detection Method Coupled with Object Feature Attention and Pyramid
Bhutta et al. Smart-inspect: micro scale localization and classification of smartphone glass defects for industrial automation
CN118037661A (en) Hub apparent defect detection method, device, equipment, storage medium and product
CN115393654B (en) Graphite ore grade detection method based on improved fast-RCNN

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240906

Address after: No. 2, Mowu Xinfeng West 2nd Road, Wanjiang Street, Dongguan City, Guangdong Province, 523000

Applicant after: Guangdong Ruiyong Sealing Products Co.,Ltd.

Country or region after: China

Address before: No. 2, Mowu Xinfeng West 2nd Road, Wanjiang Street, Dongguan City, Guangdong Province, 523000

Applicant before: Guangdong Ruifu Sealing Technology Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20250313

Address after: No. 2, Mowu Xinfeng West 2nd Road, Wanjiang Street, Dongguan City, Guangdong Province, 523000

Patentee after: Guangdong Ruifu Sealing Technology Co.,Ltd.

Country or region after: China

Address before: No. 2, Mowu Xinfeng West 2nd Road, Wanjiang Street, Dongguan City, Guangdong Province, 523000

Patentee before: Guangdong Ruiyong Sealing Products Co.,Ltd.

Country or region before: China